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

slapos_jio_api_style: Add update connection parameter to update instance

parent 59e7e654
......@@ -74,6 +74,11 @@
"type": "string",\n
"description": "The unique reference of the Software Instance, example: SOFTINST-1234"\n
},\n
"connection_parameters": {\n
"title": "Connections Parameters",\n
"type": "object",\n
"description": "List of parameters provided by the instance to access it."\n
},\n
"reported_state": {\n
"title": "Reported State",\n
"type": "string",\n
......
......@@ -4,6 +4,14 @@ software_instance = context
logError = context.ERP5Site_logApiErrorAndReturn
castToStr = context.Base_castDictToXMLString
if "connection_parameters" in data_dict:
connection_xml = castToStr(data_dict["connection_parameters"])
if not software_instance.isLastData(value=connection_xml):
software_instance.updateConnection(
connection_xml=connection_xml,
)
if "reported_state" in data_dict:
# Change desired state
reported_state = data_dict["reported_state"]
......
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