def get_tensorboards(namespace): tensorboards = api.list_custom_rsrc("tensorboard.kubeflow.org", "v1alpha1", "tensorboards", namespace) content = [ utils.parse_tensorboard(tensorboard) for tensorboard in tensorboards["items"] ] return api.success_response("tensorboards", content)
def get_pvcs(namespace): # Get the active viewers for each pvc as a dictionary # with Key:PVC name and Value:Status of Viewer viewers_lst = api.list_custom_rsrc(*utils.PVCVIEWER, namespace) viewers = {} for v in viewers_lst["items"]: pvc_name = v["spec"]["pvc"] viewers[pvc_name] = status.viewer_status(v) # Return the list of PVCs and the corresponding Viewer's state pvcs = api.list_pvcs(namespace) content = [utils.parse_pvc(pvc, viewers) for pvc in pvcs.items] return api.success_response("pvcs", content)
def get_inference_services(namespace): gvk = versions.inference_service_gvk() inference_services = api.list_custom_rsrc(**gvk, namespace=namespace) return api.success_response("inferenceServices", inference_services["items"])