def instance_list(self, inst_ids): istore = InstanceStore(self.instances_dir) if inst_ids == None: insts = istore.get_instances() else: insts = [istore.get_instance(inst_id) for inst_id in inst_ids] # TODO: Return JSON return insts
def instance_list(self, inst_ids): istore = InstanceStore(self.instances_dir) (valid, invalid) = istore.get_instances(inst_ids) instances_jsons = [] for inst in valid: instances_jsons.append(inst.topology.to_json_string()) instances_json = "[" + ",".join(instances_jsons) + "]" # TODO: Return invalid instances as "warnings", once we # add that extra return value to the API. return API.STATUS_SUCCESS, "Success", instances_json