Commit 3c389f8c authored by Cédric Le Ninivin's avatar Cédric Le Ninivin

slapos_jio_api_style: Fix Search Shared Instance

parent f4f633ff
......@@ -40,40 +40,70 @@
"description": "Contains a representation of the items",\n
"type": "array",\n
"items": {\n
"type": "object",\n
"title": "Item",\n
"properties": {\n
"reference": {\n
"title": "Software Instance Reference",\n
"description": "Unique identifier of the Software Instance",\n
"type": "string"\n
"anyOf": [\n
{\n
"type": "object",\n
"title": "Software Instance",\n
"properties": {\n
"reference": {\n
"title": "Software Instance Reference",\n
"description": "Unique identifier of the Software Instance",\n
"type": "string"\n
},\n
"title": {\n
"title": "Unique Title of the Instance",\n
"type": "string"\n
},\n
"state": {\n
"title": "Requested State",\n
"type": "string",\n
"enum": ["started", "stopped", "destroyed"],\n
"description": "State of the requested instance. It is functionnal when started. In stopped state, all services are stopped. If destroyed, it will remove the instance."\n
},\n
"compute_partition_id": {\n
"title": "Compute Partition Id",\n
"type": "string",\n
"description": "Id Of the Requesting Compute Partition, used by Slap Client when an instance is requesting an instance"\n
},\n
"software_release_uri": {\n
"title": "Software Release URI",\n
"type": "string",\n
"description": "URL of the software release used by the software instance"\n
},\n
"portal_type": {\n
"title": "Portal Type",\n
"const": "Software Instance",\n
"type": "string"\n
}\n
}\n
},\n
"title": {\n
"title": "Unique Title of the Instance",\n
"type": "string"\n
},\n
"state": {\n
"title": "Requested State",\n
"type": "string",\n
"enum": ["started", "stopped", "destroyed"],\n
"description": "State of the requested instance. It is functionnal when started. In stopped state, all services are stopped. If destroyed, it will remove the instance."\n
},\n
"compute_partition_id": {\n
"title": "Compute Partition Id",\n
"type": "string",\n
"description": "Id Of the Requesting Compute Partition, used by Slap Client when an instance is requesting an instance"\n
},\n
"software_release_uri": {\n
"title": "Software Release URI",\n
"type": "string",\n
"description": "URL of the software release used by the software instance"\n
},\n
"portal_type": {\n
"title": "Portal Type",\n
"const": "Software Instance",\n
"type": "string"\n
{\n
"type": "object",\n
"title": "Shared Instance",\n
"properties": {\n
"reference": {\n
"title": "Software Instance Reference",\n
"description": "Unique identifier of the Software Instance",\n
"type": "string"\n
},\n
"title": {\n
"title": "Unique Title of the Instance",\n
"type": "string"\n
},\n
"state": {\n
"title": "Requested State",\n
"type": "string",\n
"enum": ["started", "stopped", "destroyed"],\n
"description": "State of the requested instance. It is functionnal when started. In stopped state, all services are stopped. If destroyed, it will remove the instance."\n
},\n
"portal_type": {\n
"title": "Portal Type",\n
"const": "Shared Instance",\n
"type": "string"\n
}\n
}\n
}\n
}\n
]\n
}\n
}\n
}\n
......
......@@ -44,7 +44,7 @@ elif portal_type == "Shared Instance":
search_kw = {
"portal_type": "Slave Instance",
"validation_state": "validated",
"select_list": ("title", "reference", "portal_type", "slap_state", "aggregate_reference", "url_string")
"select_list": ("title", "reference", "portal_type", "slap_state", "aggregate_reference")
}
if "host_instance_reference" in data_dict:
host_instance_list = portal.portal_catalog(
......@@ -66,10 +66,11 @@ elif portal_type == "Shared Instance":
result_list = [{
"title": x.title,
"reference": x.reference,
"portal_type": x.portal_type,
"state": x.slap_state,
"portal_type": "Shared Instance",
"state": slap_state_dict.get(x.slap_state, ""),
"compute_partition_id": x.aggregate_reference,
"software_release_uri": x.url_string,
# Slave Instance don't have url_string cataloged. Selecting it return 0 result each time
#"software_release_uri": x.url_string,
} for x in portal.portal_catalog(**search_kw)]
else:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment