Commit 6410b52f authored by Cédric Le Ninivin's avatar Cédric Le Ninivin Committed by Romain Courteaud

slapos_jio_api_style: add from processing timestamp to instance search

parent 9f1b13b2
......@@ -161,6 +161,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
"from_processing_timestamp": {\n
"title": "From Processing Timestamp",\n
"type": "number",\n
"description": "Filter by processing timestamp. Returns the list of elements having a processing timestamp higher or equal to the one inputed. The Processing Timestamp is set by the master node to mark when the element was last processed. 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
......@@ -193,6 +198,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
"from_processing_timestamp": {\n
"title": "From Processing Timestamp",\n
"type": "number",\n
"description": "Filter by processing timestamp. Returns the list of elements having a processing timestamp higher or equal to the one inputed. The Processing Timestamp is set by the master node to mark when the element was last processed. 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
......
......@@ -30,6 +30,8 @@ if portal_type == "Software Instance":
search_kw["strict_specialise_title"] = data_dict["root_instance_title"]
if "state" in data_dict:
search_kw["slap_state"] = reverse_slap_state_dict.get(data_dict["state"], "")
if "from_processing_timestamp" in data_dict:
search_kw["slap_date"] = ">= %s" % DateTime(data_dict["from_processing_timestamp"])
result_list = [{
"title": x.title,
......@@ -64,6 +66,9 @@ elif portal_type == "Shared Instance":
search_kw["strict_specialise_title"] = data_dict["root_instance_title"]
if "state" in data_dict:
search_kw["slap_state"] = reverse_slap_state_dict.get(data_dict["state"], "")
if "from_processing_timestamp" in data_dict:
search_kw["slap_date"] = ">= %s" % DateTime(data_dict["from_processing_timestamp"])
result_list = [{
"title": x.title,
"reference": x.reference,
......
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