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

slapos_cloud: JIO API Revision depend on web section

parent 29a9dee8
...@@ -66,15 +66,18 @@ class SoftwareInstallation(Item, JSONType): ...@@ -66,15 +66,18 @@ class SoftwareInstallation(Item, JSONType):
status_dict = self.getAccessStatus() status_dict = self.getAccessStatus()
result = { result = {
"$schema": self.getJSONSchemaUrl(), "$schema": self.getJSONSchemaUrl(),
"reference": self.getReference().decode("UTF-8"), "reference": self.getReference().decode("UTF-8") if self.getReference() else "",
"software_release_uri": self.getUrlString(), "software_release_uri": self.getUrlString(),
"compute_node_id": self.getAggregateReference(), "compute_node_id": self.getAggregateReference(),
"state": state, "state": state,
"reported_state": status_dict.get("state"), "reported_state": status_dict.get("state"),
"status_message": status_dict.get("text"), "status_message": status_dict.get("text"),
"processing_timestamp": self.getSlapTimestamp(), "processing_timestamp": self.getSlapTimestamp(),
"api_revision": self.getJIOAPIRevision(),
} }
web_section = self.getWebSectionValue()
web_section = web_section.getRelativeUrl() if web_section else self.REQUEST.get("web_section_relative_url", None)
if web_section:
result["api_revision"] = self.getJIOAPIRevision(web_section)
result.update() result.update()
return json.dumps(result, indent=2) return json.dumps(result, indent=2)
......
...@@ -388,9 +388,13 @@ class SoftwareInstance(Item, JSONType): ...@@ -388,9 +388,13 @@ class SoftwareInstance(Item, JSONType):
"compute_partition_id": parameter_dict.get("slap_computer_partition_id"), "compute_partition_id": parameter_dict.get("slap_computer_partition_id"),
"processing_timestamp": self.getSlapTimestamp(), "processing_timestamp": self.getSlapTimestamp(),
"access_status_message": self.getTextAccessStatus(), "access_status_message": self.getTextAccessStatus(),
"api_revision": self.getJIOAPIRevision(),
"portal_type": self.getPortalType(), "portal_type": self.getPortalType(),
} }
web_section = self.getWebSectionValue()
web_section = web_section.getRelativeUrl() if web_section else self.REQUEST.get("web_section_relative_url", None)
if web_section:
result["api_revision"] = self.getJIOAPIRevision(web_section)
self.REQUEST.response.setHeader('Cache-Control', self.REQUEST.response.setHeader('Cache-Control',
'private, max-age=0, must-revalidate') 'private, max-age=0, must-revalidate')
self.REQUEST.response.setHeader('Vary', self.REQUEST.response.setHeader('Vary',
......
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