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

slapos_cloud: JIO API Revision depend on web section

parent 8408d2b3
......@@ -66,15 +66,18 @@ class SoftwareInstallation(Item, JSONType):
status_dict = self.getAccessStatus()
result = {
"$schema": self.getJSONSchemaUrl(),
"reference": self.getReference().decode("UTF-8"),
"reference": self.getReference().decode("UTF-8") if self.getReference() else "",
"software_release_uri": self.getUrlString(),
"compute_node_id": self.getAggregateReference(),
"state": state,
"reported_state": status_dict.get("state"),
"status_message": status_dict.get("text"),
"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()
return json.dumps(result, indent=2)
......
......@@ -387,9 +387,13 @@ class SoftwareInstance(Item, JSONType):
"compute_partition_id": parameter_dict.get("slap_computer_partition_id"),
"processing_timestamp": self.getSlapTimestamp(),
"access_status_message": self.getTextAccessStatus(),
"api_revision": self.getJIOAPIRevision(),
"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',
'private, max-age=0, must-revalidate')
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