def get(self, request): """Get a list of the Pods for a project. The returned result is an object with property 'items' and each item under this is a Pod. """ bays = magnum.bay_list(request) baymodels = magnum.baymodel_list(request) result = [] baymodel = {} for model in baymodels: baymodel[model.uuid] = model for bay in bays: if bay.status == "CREATE_COMPLETE" and (baymodel[bay.baymodel_id].coe == "kubernetes"): result += magnum.pod_list(request, bay.name) pods = [] for p in result: pods.append(magnum.pod_show(request, p.uuid, p.bay_uuid)) return {"items": [change_to_id(p.to_dict()) for p in pods]}
def get(self, request): """Get a list of the Pods for a project. The returned result is an object with property 'items' and each item under this is a Pod. """ bays = magnum.bay_list(request) baymodels = magnum.baymodel_list(request) result = [] baymodel = {} for model in baymodels: baymodel[model.uuid] = model for bay in bays: if bay.status == 'CREATE_COMPLETE' and ( baymodel[bay.baymodel_id].coe == "kubernetes"): result += magnum.pod_list(request, bay.name) pods = [] for p in result: pods.append(magnum.pod_show(request, p.uuid, p.bay_uuid)) return {'items': [change_to_id(p.to_dict()) for p in pods]}
def get(self, request, bay_uuid, pod_uuid): """Get a specific pod """ return magnum.pod_show(request, pod_uuid, bay_uuid).to_dict()