Commit d6e845ba authored by Cédric Le Ninivin's avatar Cédric Le Ninivin Committed by Titouan Soulard

slapos_jio_api_style: allDocs for Instances and Installations include timestamp

parent 3dca7fde
......@@ -70,6 +70,11 @@
"type": "string",\n
"description": "URL of the software release used by the software instance"\n
},\n
"processing_timestamp": {\n
"title": "Processing Timestamp",\n
"type": "number",\n
"description": "Timestamp set by the master node to mark when it was last processed in the master node. If it has been processed on master, it needs reprocessing on the compute node."\n
},\n
"portal_type": {\n
"title": "Portal Type",\n
"const": "Software Instance",\n
......@@ -96,6 +101,11 @@
"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
"processing_timestamp": {\n
"title": "Processing Timestamp",\n
"type": "number",\n
"description": "Timestamp set by the master node to mark when it was last processed in the master node. If it has been processed on master, it needs reprocessing on the compute node."\n
},\n
"portal_type": {\n
"title": "Portal Type",\n
"const": "Shared Instance",\n
......
......@@ -58,6 +58,11 @@
"const": "Software Installation",\n
"type": "string"\n
},\n
"processing_timestamp": {\n
"title": "Processing Timestamp",\n
"type": "number",\n
"description": "Timestamp set by the master node to mark when it was last processed in the master node. If it has been processed on master, it needs reprocessing on the compute node."\n
},\n
"state": {\n
"title": "Requested State",\n
"type": "string",\n
......
......@@ -17,7 +17,7 @@ if portal_type == "Software Instance":
search_kw = {
"portal_type": "Software 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", "url_string", "slap_date")
}
if "title" in data_dict:
......@@ -38,13 +38,14 @@ if portal_type == "Software Instance":
"state": slap_state_dict.get(x.slap_state, ""),
"compute_partition_id": x.aggregate_reference,
"software_release_uri": x.url_string,
"processing_timestamp": int(x.slap_date),
} for x in portal.portal_catalog(**search_kw)]
elif portal_type == "Shared Instance":
search_kw = {
"portal_type": "Slave Instance",
"validation_state": "validated",
"select_list": ("title", "reference", "portal_type", "slap_state", "aggregate_reference")
"select_list": ("title", "reference", "portal_type", "slap_state", "aggregate_reference", "slap_date")
}
if "host_instance_reference" in data_dict:
host_instance_list = portal.portal_catalog(
......@@ -69,6 +70,7 @@ elif portal_type == "Shared Instance":
"portal_type": "Shared Instance",
"state": slap_state_dict.get(x.slap_state, ""),
"compute_partition_id": x.aggregate_reference,
"processing_timestamp": int(x.slap_date),
# 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)]
......
search_kw = {
"portal_type": "Software Installation",
"validation_state": "validated",
"select_list": ("aggregate_reference", "url_string", "slap_state", "portal_type"),
"select_list": ("aggregate_reference", "url_string", "slap_state", "portal_type", "slap_date"),
}
if "software_release_uri" in data_dict:
......@@ -14,6 +14,7 @@ result_list = [{
"compute_node_id": x.aggregate_reference,
"state": "available" if x.slap_state == "start_requested" else "destroyed",
"portal_type": x.portal_type,
"processing_timestamp": int(x.slap_date),
} for x in context.getPortalObject().portal_catalog(**search_kw)]
import json
......
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