Commit c9df3d1d authored by Cédric Le Ninivin's avatar Cédric Le Ninivin Committed by Cédric Le Ninivin

slapos_cloud: Software Instance clean asJSON Text add full_ip_list and remove relative_url

parent 6bab24b1
...@@ -331,26 +331,28 @@ class SoftwareInstance(Item, JSONType): ...@@ -331,26 +331,28 @@ class SoftwareInstance(Item, JSONType):
result = { result = {
"$schema": self.getPortalObject().portal_types.restrictedTraverse(self.getPortalType()).absolute_url() "$schema": self.getPortalObject().portal_types.restrictedTraverse(self.getPortalType()).absolute_url()
+ "/getTextContent", + "/getTextContent",
"reference": self.getReference().decode("UTF-8"),
"title": self.getTitle().decode("UTF-8"), "title": self.getTitle().decode("UTF-8"),
"connection_parameters": self.getConnectionXmlAsDict(), "reference": self.getReference().decode("UTF-8"),
"parameters": self.getInstanceXmlAsDict(),
"node": self.getSlaXmlAsDict(),
"state": state,
"id": self.getRelativeUrl(),
"software_release_uri": self.getUrlString(), "software_release_uri": self.getUrlString(),
"software_type": self.getSourceReference().decode("UTF-8"), "software_type": self.getSourceReference().decode("UTF-8"),
"compute_node_id": parameter_dict.get("slap_computer_id"), "state": state,
"compute_partition_id": parameter_dict.get("slap_computer_partition_id"), "connection_parameters": self.getConnectionXmlAsDict(),
"sla_parameters": self.getSlaXmlAsDict(), "parameters": self.getInstanceXmlAsDict(),
"access_status_message": self.getTextAccessStatus(), "shared": False,
"processing_timestamp": parameter_dict.get("timestamp"), "root_instance_title": parameter_dict.get("root_instance_title"),
"ip_list": parameter_dict.get("ip_list"),
"full_ip_list": parameter_dict.get("full_ip_list"),
"X509": { "X509": {
"key": self.getSslKey(), "key": self.getSslKey(),
"certificate": self.getSslCertificate(), "certificate": self.getSslCertificate(),
}, },
"sla_parameters": self.getSlaXmlAsDict(),
"compute_node_id": parameter_dict.get("slap_computer_id"),
"compute_partition_id": parameter_dict.get("slap_computer_partition_id"),
"processing_timestamp": parameter_dict.get("timestamp"),
"access_status_message": self.getTextAccessStatus(),
"portal_type": self.getPortalType(),
} }
result.update(parameter_dict)
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',
......
...@@ -132,6 +132,17 @@ ...@@ -132,6 +132,17 @@
}\n }\n
}\n }\n
},\n },\n
"full_ip_list": {\n
"title": "Full IP List",\n
"type": "array",\n
"descritpion": "XXXX List of IPs usable by the Software Instance on the partition",\n
"items": {\n
"type": "array",\n
"items": {\n
"type": "string"\n
}\n
}\n
},\n
"X509": {\n "X509": {\n
"title": "X509 Certificates",\n "title": "X509 Certificates",\n
"description": "X509 Certificates used by the instance to authentify itself on master",\n "description": "X509 Certificates used by the instance to authentify itself on master",\n
...@@ -206,11 +217,6 @@ ...@@ -206,11 +217,6 @@
"title": "Portal Type",\n "title": "Portal Type",\n
"const": "Software Instance",\n "const": "Software Instance",\n
"type": "string"\n "type": "string"\n
},\n
"id": {\n
"title": "ID",\n
"type": "string",\n
"description": "Unique Id of the object. It is not editable."\n
}\n }\n
}\n }\n
}\n }\n
......
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