Commit fca6b0bc authored by Romain Courteaud's avatar Romain Courteaud

WIP slapos_json_rpc_api: migrate slapos_jio_api_stype to JSON RPC

Migrate previous actions to the Web Service entry points.

Fixup JSON schema provided by the JSON Forms.

TODO:
- revision parameters
- authentication error handling
- json schema for errors
- performance
parent 4cdfd188
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ActionInformation" module="Products.CMFCore.ActionInformation"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>action</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>categories</string> </key>
<value>
<tuple>
<string>action_type/object_slapos_json_get</string>
</tuple>
</value>
</item>
<item>
<key> <string>category</string> </key>
<value> <string>object_slapos_json_get</string> </value>
</item>
<item>
<key> <string>condition</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>icon</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>slapos_jio_api_get_compute_node</string> </value>
</item>
<item>
<key> <string>permissions</string> </key>
<value>
<tuple>
<string>View</string>
</tuple>
</value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Action Information</string> </value>
</item>
<item>
<key> <string>priority</string> </key>
<value> <float>6.0</float> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Get Compute Node</string> </value>
</item>
<item>
<key> <string>visible</string> </key>
<value> <int>1</int> </value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="Expression" module="Products.CMFCore.Expression"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>text</string> </key>
<value> <string>string:${object_url}/ComputeNode_getFromJSON</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ActionInformation" module="Products.CMFCore.ActionInformation"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>action</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>categories</string> </key>
<value>
<tuple>
<string>action_type/object_slapos_json_put</string>
</tuple>
</value>
</item>
<item>
<key> <string>category</string> </key>
<value> <string>object_slapos_json_put</string> </value>
</item>
<item>
<key> <string>condition</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>icon</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>slapos_jio_api_put_compute_node</string> </value>
</item>
<item>
<key> <string>permissions</string> </key>
<value>
<tuple>
<string>View</string>
</tuple>
</value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Action Information</string> </value>
</item>
<item>
<key> <string>priority</string> </key>
<value> <float>1.5</float> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Update Compute Node</string> </value>
</item>
<item>
<key> <string>visible</string> </key>
<value> <int>1</int> </value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="Expression" module="Products.CMFCore.Expression"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>text</string> </key>
<value> <string>string:${object_url}/ComputeNode_updateFromJSON</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ActionInformation" module="Products.CMFCore.ActionInformation"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>action</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>categories</string> </key>
<value>
<tuple>
<string>action_type/object_slapos_json_get</string>
</tuple>
</value>
</item>
<item>
<key> <string>category</string> </key>
<value> <string>object_slapos_json_get</string> </value>
</item>
<item>
<key> <string>condition</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>icon</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>slapos_jio_api_get_software_instance</string> </value>
</item>
<item>
<key> <string>permissions</string> </key>
<value>
<tuple>
<string>View</string>
</tuple>
</value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Action Information</string> </value>
</item>
<item>
<key> <string>priority</string> </key>
<value> <float>7.0</float> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Get Software Instance</string> </value>
</item>
<item>
<key> <string>visible</string> </key>
<value> <int>1</int> </value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="Expression" module="Products.CMFCore.Expression"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>text</string> </key>
<value> <string>string:${object_url}/SoftwareInstance_getFromJSON</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ActionInformation" module="Products.CMFCore.ActionInformation"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>action</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>categories</string> </key>
<value>
<tuple>
<string>action_type/object_slapos_json_put</string>
</tuple>
</value>
</item>
<item>
<key> <string>category</string> </key>
<value> <string>object_slapos_json_put</string> </value>
</item>
<item>
<key> <string>condition</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>icon</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>slapos_jio_api_put_software_instance</string> </value>
</item>
<item>
<key> <string>permissions</string> </key>
<value>
<tuple>
<string>View</string>
</tuple>
</value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Action Information</string> </value>
</item>
<item>
<key> <string>priority</string> </key>
<value> <float>7.0</float> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Update Software Instance</string> </value>
</item>
<item>
<key> <string>visible</string> </key>
<value> <int>1</int> </value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="Expression" module="Products.CMFCore.Expression"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>text</string> </key>
<value> <string>string:${object_url}/SoftwareInstance_updateFromJSON</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ActionInformation" module="Products.CMFCore.ActionInformation"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>action</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>categories</string> </key>
<value>
<tuple>
<string>action_type/object_slapos_json_get</string>
</tuple>
</value>
</item>
<item>
<key> <string>category</string> </key>
<value> <string>object_slapos_json_get</string> </value>
</item>
<item>
<key> <string>condition</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>icon</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>slapos_jio_api_get_software_installation</string> </value>
</item>
<item>
<key> <string>permissions</string> </key>
<value>
<tuple>
<string>View</string>
</tuple>
</value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Action Information</string> </value>
</item>
<item>
<key> <string>priority</string> </key>
<value> <float>3.0</float> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Get Software Installation</string> </value>
</item>
<item>
<key> <string>visible</string> </key>
<value> <int>1</int> </value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="Expression" module="Products.CMFCore.Expression"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>text</string> </key>
<value> <string>string:${object_url}/SoftwareInstallation_getFromJSON</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ActionInformation" module="Products.CMFCore.ActionInformation"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>action</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>categories</string> </key>
<value>
<tuple>
<string>action_type/object_slapos_json_put</string>
</tuple>
</value>
</item>
<item>
<key> <string>category</string> </key>
<value> <string>object_slapos_json_put</string> </value>
</item>
<item>
<key> <string>condition</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>icon</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>slapos_jio_api_put_software_installation</string> </value>
</item>
<item>
<key> <string>permissions</string> </key>
<value>
<tuple>
<string>View</string>
</tuple>
</value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Action Information</string> </value>
</item>
<item>
<key> <string>priority</string> </key>
<value> <float>2.0</float> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Update Software Installation</string> </value>
</item>
<item>
<key> <string>visible</string> </key>
<value> <int>1</int> </value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="Expression" module="Products.CMFCore.Expression"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>text</string> </key>
<value> <string>string:${object_url}/SoftwareInstallation_updateFromJSON</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ActionInformation" module="Products.CMFCore.ActionInformation"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>action</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>categories</string> </key>
<value>
<tuple>
<string>action_type/object_slapos_json_get</string>
</tuple>
</value>
</item>
<item>
<key> <string>category</string> </key>
<value> <string>object_slapos_json_get</string> </value>
</item>
<item>
<key> <string>condition</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>icon</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>slapos_jio_api_get_software_instance_certificate</string> </value>
</item>
<item>
<key> <string>permissions</string> </key>
<value>
<tuple>
<string>View</string>
</tuple>
</value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Action Information</string> </value>
</item>
<item>
<key> <string>priority</string> </key>
<value> <float>1.0</float> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Get Software Instance Certificates</string> </value>
</item>
<item>
<key> <string>visible</string> </key>
<value> <int>1</int> </value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="Expression" module="Products.CMFCore.Expression"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>text</string> </key>
<value> <string>string:${object_url}/SoftwareInstanceCertificateRecord_getFromJSON</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ActionInformation" module="Products.CMFCore.ActionInformation"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>action</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>categories</string> </key>
<value>
<tuple>
<string>action_type/object_slapos_json_get</string>
</tuple>
</value>
</item>
<item>
<key> <string>category</string> </key>
<value> <string>object_slapos_json_get</string> </value>
</item>
<item>
<key> <string>condition</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>icon</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>slapos_jio_api_get_software_instance</string> </value>
</item>
<item>
<key> <string>permissions</string> </key>
<value>
<tuple>
<string>View</string>
</tuple>
</value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Action Information</string> </value>
</item>
<item>
<key> <string>priority</string> </key>
<value> <float>7.0</float> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Get Software Instance</string> </value>
</item>
<item>
<key> <string>visible</string> </key>
<value> <int>1</int> </value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="Expression" module="Products.CMFCore.Expression"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>text</string> </key>
<value> <string>string:${object_url}/SoftwareInstance_getFromJSON</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ActionInformation" module="Products.CMFCore.ActionInformation"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>action</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>categories</string> </key>
<value>
<tuple>
<string>action_type/object_slapos_json_put</string>
</tuple>
</value>
</item>
<item>
<key> <string>category</string> </key>
<value> <string>object_slapos_json_put</string> </value>
</item>
<item>
<key> <string>condition</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>icon</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>slapos_jio_api_put_software_instance</string> </value>
</item>
<item>
<key> <string>permissions</string> </key>
<value>
<tuple>
<string>View</string>
</tuple>
</value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Action Information</string> </value>
</item>
<item>
<key> <string>priority</string> </key>
<value> <float>7.0</float> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Update Software Instance</string> </value>
</item>
<item>
<key> <string>visible</string> </key>
<value> <int>1</int> </value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="Expression" module="Products.CMFCore.Expression"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>text</string> </key>
<value> <string>string:${object_url}/SoftwareInstance_updateFromJSON</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ActionInformation" module="Products.CMFCore.ActionInformation"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>action</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>categories</string> </key>
<value>
<tuple>
<string>action_type/object_slapos_json_post</string>
</tuple>
</value>
</item>
<item>
<key> <string>category</string> </key>
<value> <string>object_slapos_json_post</string> </value>
</item>
<item>
<key> <string>condition</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>icon</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>slapos_jio_api_create_compute_node</string> </value>
</item>
<item>
<key> <string>permissions</string> </key>
<value>
<tuple>
<string>View</string>
</tuple>
</value>
</item>
<item>
<key> <string>priority</string> </key>
<value> <float>10.0</float> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Create Compute Node</string> </value>
</item>
<item>
<key> <string>visible</string> </key>
<value> <int>1</int> </value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="Expression" module="Products.CMFCore.Expression"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>text</string> </key>
<value> <string>string:${object_url}/jIOWebSection_createComputeNodeFromJSON</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ActionInformation" module="Products.CMFCore.ActionInformation"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>action</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>categories</string> </key>
<value>
<tuple>
<string>action_type/object_slapos_json_post</string>
</tuple>
</value>
</item>
<item>
<key> <string>category</string> </key>
<value> <string>object_slapos_json_post</string> </value>
</item>
<item>
<key> <string>condition</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>icon</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>slapos_jio_api_create_software_installation</string> </value>
</item>
<item>
<key> <string>permissions</string> </key>
<value>
<tuple>
<string>View</string>
</tuple>
</value>
</item>
<item>
<key> <string>priority</string> </key>
<value> <float>8.0</float> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Supply Software</string> </value>
</item>
<item>
<key> <string>visible</string> </key>
<value> <int>1</int> </value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="Expression" module="Products.CMFCore.Expression"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>text</string> </key>
<value> <string>string:${object_url}/jIOWebSection_createSoftwareInstallationFromJSON</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ActionInformation" module="Products.CMFCore.ActionInformation"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>action</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>categories</string> </key>
<value>
<tuple>
<string>action_type/object_slapos_json_post</string>
</tuple>
</value>
</item>
<item>
<key> <string>category</string> </key>
<value> <string>object_slapos_json_post</string> </value>
</item>
<item>
<key> <string>condition</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>icon</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>slapos_jio_api_request_software_instance</string> </value>
</item>
<item>
<key> <string>permissions</string> </key>
<value>
<tuple>
<string>View</string>
</tuple>
</value>
</item>
<item>
<key> <string>priority</string> </key>
<value> <float>9.0</float> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Request Software Instance</string> </value>
</item>
<item>
<key> <string>visible</string> </key>
<value> <int>1</int> </value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="Expression" module="Products.CMFCore.Expression"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>text</string> </key>
<value> <string>string:${object_url}/jIOWebSection_requestSoftwareInstanceFromJSON</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ActionInformation" module="Products.CMFCore.ActionInformation"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>action</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>categories</string> </key>
<value>
<tuple>
<string>action_type/object_slapos_json_all_docs</string>
</tuple>
</value>
</item>
<item>
<key> <string>category</string> </key>
<value> <string>object_slapos_json_all_docs</string> </value>
</item>
<item>
<key> <string>condition</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>icon</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>slapos_jio_api_search_compute_node</string> </value>
</item>
<item>
<key> <string>permissions</string> </key>
<value>
<tuple>
<string>View</string>
</tuple>
</value>
</item>
<item>
<key> <string>priority</string> </key>
<value> <float>12.0</float> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Search Compute Node</string> </value>
</item>
<item>
<key> <string>visible</string> </key>
<value> <int>1</int> </value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="Expression" module="Products.CMFCore.Expression"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>text</string> </key>
<value> <string>string:${object_url}/jIOWebSection_searchComputeNodeFromJSON</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ActionInformation" module="Products.CMFCore.ActionInformation"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>action</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>categories</string> </key>
<value>
<tuple>
<string>action_type/object_slapos_json_all_docs</string>
</tuple>
</value>
</item>
<item>
<key> <string>category</string> </key>
<value> <string>object_slapos_json_all_docs</string> </value>
</item>
<item>
<key> <string>condition</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>icon</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>slapos_jio_api_search_instance</string> </value>
</item>
<item>
<key> <string>permissions</string> </key>
<value>
<tuple>
<string>View</string>
</tuple>
</value>
</item>
<item>
<key> <string>priority</string> </key>
<value> <float>8.0</float> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Search Instance</string> </value>
</item>
<item>
<key> <string>visible</string> </key>
<value> <int>1</int> </value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="Expression" module="Products.CMFCore.Expression"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>text</string> </key>
<value> <string>string:${object_url}/jIOWebSection_searchInstanceFromJSON</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ActionInformation" module="Products.CMFCore.ActionInformation"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>action</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>categories</string> </key>
<value>
<tuple>
<string>action_type/object_slapos_json_all_docs</string>
</tuple>
</value>
</item>
<item>
<key> <string>category</string> </key>
<value> <string>object_slapos_json_all_docs</string> </value>
</item>
<item>
<key> <string>condition</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>icon</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>slapos_jio_api_search_software_installation</string> </value>
</item>
<item>
<key> <string>permissions</string> </key>
<value>
<tuple>
<string>View</string>
</tuple>
</value>
</item>
<item>
<key> <string>priority</string> </key>
<value> <float>7.0</float> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Search Supplied Software</string> </value>
</item>
<item>
<key> <string>visible</string> </key>
<value> <int>1</int> </value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="Expression" module="Products.CMFCore.Expression"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>text</string> </key>
<value> <string>string:${object_url}/jIOWebSection_searchSoftwareInstallationFromJSON</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="JSON Form" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>after_method_id</string> </key>
<value> <string>Base_asJSONText</string> </value>
</item>
<item>
<key> <string>content_type</string> </key>
<value> <string>application/json</string> </value>
</item>
<item>
<key> <string>default_reference</string> </key>
<value> <string>SoftwareInstance_getFromJSON</string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>SoftwareInstance_getFromJSON</string> </value>
</item>
<item>
<key> <string>output_schema</string> </key>
<value> <string>{\n
"$ref: "%(base_url)s/portal_types/Software%20Instance/getTextContent"\n
}</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>JSON Form</string> </value>
</item>
<item>
<key> <string>text_content</string> </key>
<value> <string>{\n
"$schema": "http://json-schema.org/draft-07/schema#",\n
"title": "Get Compute Node",\n
"description": "Data necessary to get Compute Node",\n
"type": "object",\n
"oneOf": [\n
{\n
"properties": {\n
"reference": {\n
"title": "Software Instance Id/Reference",\n
"type": "string",\n
"description": "The unique reference of the Software Instance, example: SOFTINST-1234"\n
},\n
"portal_type": {\n
"title": "Portal Type",\n
"const": "Software Instance",\n
"type": "string"\n
}\n
},\n
"required": [\n
"reference",\n
"portal_type"\n
]\n
},\n
{\n
"properties": {\n
"compute_node_id": {\n
"title": "Compute Node Id",\n
"type": "string",\n
"description": "Id Of the Requesting Compute Node, used by Slap Client when an instance is requesting an instance"\n
},\n
"compute_partition_id": {\n
"title": "Compute Partition Id",\n
"type": "string",\n
"description": "Id Of the Requesting Compute Partition, used by Slap Client when an instance is requesting an instance"\n
},\n
"portal_type": {\n
"title": "Portal Type",\n
"const": "Software Instance",\n
"type": "string"\n
}\n
},\n
"required": [\n
"compute_node_id",\n
"compute_partition_id",\n
"portal_type"\n
]\n
}\n
]\n
}\n
</string> </value>
</item>
<item>
<key> <string>version</string> </key>
<value> <string>01</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<type_mixin>
<portal_type id="Compute Node">
<item>ComputeNodeJsonTypeMixin</item>
<item>JIOAPIRevisionMixin</item>
</portal_type>
<portal_type id="Slave Instance">
<item>JIOAPIRevisionMixin</item>
<item>SoftwareInstanceJsonTypeMixin</item>
</portal_type>
<portal_type id="Software Installation">
<item>JIOAPIRevisionMixin</item>
<item>SoftwareInstallationJsonTypeMixin</item>
</portal_type>
<portal_type id="Software Instance">
<item>JIOAPIRevisionMixin</item>
<item>SoftwareInstanceJsonTypeMixin</item>
</portal_type>
</type_mixin>
\ No newline at end of file
compute_node = context.getPortalObject().portal_catalog.getResultValue(
portal_type='Compute Node',
# XXX Hardcoded validation state
validation_state="validated",
reference=data_dict["compute_node_id"],
)
if not compute_node:
return context.ERP5Site_logApiErrorAndReturn(
error_code="404",
error_message="Compute Node not found",
error_name="COMPUTE-NODE-NOT-FOUND",
)
import urllib
compute_node.requestSoftwareRelease(
software_release_url=urllib.unquote(data_dict["software_release_uri"]),
state=data_dict.get("state", "available"),
)
import json
return json.dumps({
"$schema": "id-response-schema.json",
"id": context.REQUEST.get("software_installation_url")
}, indent=2)
import json
import urllib
compute_node_id = data_dict.get("compute_node_id", None)
compute_partition_id = data_dict.get("compute_partition_id", None)
class SoftwareInstanceNotReady(Exception):
pass
castToStr = context.Base_castDictToXMLString
def logError(e, error_name="", error_code=400, detail_list=None):
return portal.ERP5Site_logApiErrorAndReturn(
error_code=error_code,
error_message=e,
error_name=error_name,
detail_list=detail_list,
)
portal = context.getPortalObject()
# Loads partition parameter
partition_parameter = data_dict.get("parameters", None)
if partition_parameter:
try:
partition_parameter = json.loads(partition_parameter)
except ValueError, e:
return logError(
"Cannot Decode JSON Parameter. Error: %s" % e,
error_name="CANNOT-DECODE-COMPUTER-PARTITION-JSON-PARAMETER",
)
if not isinstance(partition_parameter, dict):
return logError(
"Parameters should be a key value object.",
error_name="INCORRECT-COMPUTER-PARTITION-JSON-PARAMETER",
)
else:
partition_parameter = {}
try:
# filter dict
filter_kw = data_dict.get("sla_parameters", {})
partition_reference = data_dict.get("title")
kw = dict(software_release=urllib.unquote(data_dict.get("software_release_uri")),
software_type=data_dict.get("software_type", "RootSoftwareInstance"),
software_title=partition_reference,
instance_xml=castToStr(partition_parameter),
shared=data_dict.get("shared", False),
sla_xml=castToStr(filter_kw),
state=data_dict.get("state", "started"),
project_reference=data_dict.get("project_reference", None))
if compute_node_id and compute_partition_id:
compute_partition = portal.portal_catalog.getComputePartitionObject(
compute_node_id,
compute_partition_id,
)
requester = compute_partition.getSoftwareInstance()
instance_tree = requester.getSpecialiseValue()
if instance_tree is not None:
kw["project_reference"] = instance_tree.getFollowUpReference()
if instance_tree.getSlapState() == "stop_requested":
kw['state'] = 'stopped'
key = '_'.join([instance_tree.getRelativeUrl(), partition_reference])
else:
# requested as root, so done by human
requester = portal.portal_membership.getAuthenticatedMember().getUserValue()
key = '_'.join([requester.getRelativeUrl(), partition_reference])
last_data = requester.getLastData(key)
requested_software_instance = None
value = dict(
hash='_'.join([requester.getRelativeUrl(), str(kw)]),
)
if last_data is not None and isinstance(last_data, type(value)):
requested_software_instance = portal.restrictedTraverse(
last_data.get('request_instance'), None)
if last_data is None or not isinstance(last_data, type(value)) or \
last_data.get('hash') != value['hash'] or \
requested_software_instance is None:
if compute_node_id and compute_partition_id:
requester.requestInstance(**kw)
else:
# requester is a person so we use another method
requester.requestSoftwareInstance(**kw)
requested_software_instance = context.REQUEST.get('request_instance')
if requested_software_instance is not None:
value['request_instance'] = requested_software_instance\
.getRelativeUrl()
requester.setLastData(value, key=key)
if requested_software_instance is not None:
return requested_software_instance.asJSONText()
raise SoftwareInstanceNotReady
except SoftwareInstanceNotReady:
return logError(
"Software Instance Not Ready",
error_name="SoftwareInstanceNotReady",
error_code=102
)
Compute Node | slapos_jio_api_get_compute_node
Compute Node | slapos_jio_api_put_compute_node
Slave Instance | slapos_jio_api_get_software_instance
Slave Instance | slapos_jio_api_put_software_instance
Software Installation | slapos_jio_api_get_software_installation
Software Installation | slapos_jio_api_put_software_installation
Software Instance Certificate Record | slapos_jio_api_get_software_instance_certificate
Software Instance | slapos_jio_api_get_software_instance
Software Instance | slapos_jio_api_put_software_instance
jIO Web Section | slapos_jio_api_create_compute_node
jIO Web Section | slapos_jio_api_create_software_installation
jIO Web Section | slapos_jio_api_request_software_instance
jIO Web Section | slapos_jio_api_search_compute_node
jIO Web Section | slapos_jio_api_search_instance
jIO Web Section | slapos_jio_api_search_software_installation
\ No newline at end of file
portal_alarms/slapos_jio_api_revision_check_consistency
portal_alarms/slapos_update_jio_api_revision_template
portal_callables/ComputeNode_getFromJSON
portal_callables/ComputeNode_updateFromJSON
portal_callables/SoftwareInstallation_getFromJSON
portal_callables/SoftwareInstallation_updateFromJSON
portal_callables/SoftwareInstanceCertificateRecord_getFromJSON
portal_callables/SoftwareInstance_getFromJSON
portal_callables/SoftwareInstance_updateFromJSON
portal_callables/jIOWebSection_createComputeNodeFromJSON
portal_callables/jIOWebSection_createSoftwareInstallationFromJSON
portal_callables/jIOWebSection_requestSoftwareInstanceFromJSON
portal_callables/jIOWebSection_searchComputeNodeFromJSON
portal_callables/jIOWebSection_searchInstanceFromJSON
portal_callables/jIOWebSection_searchSoftwareInstallationFromJSON
portal_categories/action_type/object_slapos_json_*
\ No newline at end of file
Compute Node | JIOAPIRevisionMixin
Compute Node | ComputeNodeJsonTypeMixin
Slave Instance | JIOAPIRevisionMixin
Software Installation | JIOAPIRevisionMixin
Software Installation | SoftwareInstallationJsonTypeMixin
Software Instance | JIOAPIRevisionMixin
\ No newline at end of file
Software Instance | SoftwareInstanceJsonTypeMixin
Slave Instance | SoftwareInstanceJsonTypeMixin
\ No newline at end of file
slapos_jio_api
slapos_jio_api_cache
\ No newline at end of file
test.erp5.testSlapOSJIOAPI
\ No newline at end of file
......@@ -28,7 +28,6 @@
from AccessControl import ClassSecurityInfo
from Products.ERP5Type import Permissions
import json
class SoftwareInstallationJsonTypeMixin:
......@@ -53,7 +52,7 @@ class SoftwareInstallationJsonTypeMixin:
# software instance has to define an xml parameter
status_dict = self.getAccessStatus()
result = {
"$schema": self.getJSONSchemaUrl(),
# "$schema": self.getJSONSchemaUrl(),
"software_release_uri": self.getUrlString(),
"compute_node_id": self.getAggregateReference(),
"state": state,
......@@ -70,7 +69,7 @@ class SoftwareInstallationJsonTypeMixin:
if revision:
result["api_revision"] = revision
return json.dumps(result, indent=2)
return result
def getSlapTimestamp(self):
return int(self.getModificationDate())
......
......@@ -25,13 +25,11 @@
#
##############################################################################
from App.Common import rfc1123_date
from AccessControl import ClassSecurityInfo
from Products.ERP5Type import Permissions
from Products.ERP5Type.UnrestrictedMethod import UnrestrictedMethod
from erp5.component.module.SlapOSCloud import _assertACI
import json
class SoftwareInstanceJsonTypeMixin:
......@@ -119,7 +117,7 @@ class SoftwareInstanceJsonTypeMixin:
raise ValueError("Unknown slap state : %s" % requested_state)
# software instance has to define an xml parameter
result = {
"$schema": self.getJSONSchemaUrl(),
#"$schema": self.getJSONSchemaUrl(),
"title": self.getTitle().decode("UTF-8"),
"reference": self.getReference().decode("UTF-8"),
"software_release_uri": self.getUrlString(),
......@@ -127,16 +125,16 @@ class SoftwareInstanceJsonTypeMixin:
"state": state,
"connection_parameters": self.getConnectionXmlAsDict(),
"parameters": self.getInstanceXmlAsDict(),
"shared": False,
"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"),
"shared": self.getPortalType() == "Slave Instance",
"root_instance_title": parameter_dict.get("root_instance_title", ""),
"ip_list": [list(x) for x in parameter_dict.get("ip_list", [])],
"full_ip_list": [list(x) for x in parameter_dict.get("full_ip_list", [])],
"sla_parameters": self.getSlaXmlAsDict(),
"compute_node_id": parameter_dict.get("slap_computer_id"),
"compute_partition_id": parameter_dict.get("slap_computer_partition_id"),
"compute_node_id": parameter_dict.get("slap_computer_id", ""),
"compute_partition_id": parameter_dict.get("slap_computer_partition_id", ""),
"processing_timestamp": self.getSlapTimestamp(),
"access_status_message": self.getTextAccessStatus(),
"portal_type": self.getPortalType(),
"portal_type": "Software Instance"#self.getPortalType(),
}
if self.useRevision():
web_section = self.getWebSectionValue()
......@@ -146,13 +144,7 @@ class SoftwareInstanceJsonTypeMixin:
if revision:
result["api_revision"] = revision
self.REQUEST.response.setHeader('Cache-Control',
'private, max-age=0, must-revalidate')
self.REQUEST.response.setHeader('Vary',
'REMOTE_USER')
self.REQUEST.response.setHeader('Last-Modified',
rfc1123_date(self.getModificationDate()))
return json.dumps(result, indent=2)
return result
security.declareProtected(Permissions.ModifyPortalContent, 'fromJSONText')
def fromJSONText(self, json_content):
......
......@@ -8,7 +8,7 @@
<dictionary>
<item>
<key> <string>after_method_id</string> </key>
<value> <string>Base_asJSONText</string> </value>
<value> <string>jIOWebSection_asJSONText</string> </value>
</item>
<item>
<key> <string>content_type</string> </key>
......@@ -30,9 +30,9 @@
</item>
<item>
<key> <string>output_schema</string> </key>
<value> <string>{\n
"title": "bar"\n
}</string> </value>
<value>
<none/>
</value>
</item>
<item>
<key> <string>portal_type</string> </key>
......@@ -45,6 +45,7 @@
"title": "Get Compute Node",\n
"description": "Data necessary to get Compute Node",\n
"type": "object",\n
"additionalProperties": false,\n
"properties": {\n
"compute_node_id": {\n
"title": "Compute Node ID",\n
......
......@@ -35,6 +35,7 @@
"title": "Software Installation Updated",\n
"description": "Response when the software installation is updated",\n
"type": "object",\n
"additionalProperties": false,\n
"properties": {\n
"compute_node_id": {\n
"title": "Compute Node ID",\n
......@@ -43,7 +44,7 @@
},\n
"portal_type": {\n
"title": "Portal Type",\n
"const": "Software Installation",\n
"const": "Compute Node",\n
"type": "string"\n
},\n
"date": {\n
......@@ -56,8 +57,9 @@
"title": "Success Message",\n
"type": "string",\n
"description": "Success Message"\n
},\n
}\n
},\n
"required": ["portal_type", "compute_node_id", "date", "success"]\n
}\n
</string> </value>
</item>
......@@ -72,6 +74,7 @@
"title": "Update Compute Node",\n
"description": "Update Compute Node Information. Send the list of partition and their ip addresses.",\n
"type": "object",\n
"additionalProperties": false,\n
"properties": {\n
"compute_partition_list": {\n
"title": "Compute Partition List",\n
......@@ -90,7 +93,7 @@
"ip_list": {\n
"title": "IP List",\n
"type": "array",\n
"descritpion": "List of IPs usable by the Software Instance on the partition. Used to configure firewall when necessary and allow only related instances to access it.",\n
"description": "List of IPs usable by the Software Instance on the partition. Used to configure firewall when necessary and allow only related instances to access it.",\n
"items": {\n
"type": "object",\n
"title": "Internet Protocol Address",\n
......
......@@ -8,7 +8,7 @@
<dictionary>
<item>
<key> <string>after_method_id</string> </key>
<value> <string>Base_asJSONText</string> </value>
<value> <string>jIOWebSection_asJSONText</string> </value>
</item>
<item>
<key> <string>content_type</string> </key>
......@@ -30,7 +30,54 @@
</item>
<item>
<key> <string>output_schema</string> </key>
<value> <string>{}</string> </value>
<value> <string>{\n
"$schema": "http://json-schema.org/draft-07/schema#",\n
"title": "Software Installation",\n
"description": "Software Installation\'s data",\n
"type": "object",\n
"additionalProperties": false,\n
"properties": {\n
"portal_type": {\n
"title": "Portal Type",\n
"const": "Software Installation",\n
"type": "string"\n
},\n
"compute_node_id": {\n
"title": "Compute Node Id",\n
"type": "string",\n
"description": "Id Of the Requesting Compute Node, used by Slap Client when an instance is requesting an instance"\n
},\n
"software_release_uri": {\n
"title": "Software Release URI",\n
"type": "string",\n
"description": "URL of the software release used by the software instance"\n
},\n
"state": {\n
"title": "Requested State",\n
"type": "string",\n
"enum": ["available", "stopped", "destroyed"],\n
"description": "State of the requested installation."\n
},\n
"reported_state": {\n
"title": "Reported State",\n
"type": "string",\n
"description": "Reported State of the installation."\n
},\n
"status_message": {\n
"title": "Status Message",\n
"type": "string"\n
}\n
},\n
"required": [\n
"portal_type",\n
"compute_node_id",\n
"reported_state",\n
"software_release_uri",\n
"state",\n
"status_message"\n
]\n
}\n
</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
......@@ -43,6 +90,7 @@
"title": "Software Installation",\n
"description": "Software Installation",\n
"type": "object",\n
"additionalProperties": false,\n
"properties": {\n
"software_release_uri": {\n
"title": "Software Release URI",\n
......
......@@ -35,6 +35,7 @@
"title": "Software Installation Updated",\n
"description": "Response when the software installation is updated",\n
"type": "object",\n
"additionalProperties": false,\n
"properties": {\n
"software_release_uri": {\n
"title": "Software Release URI",\n
......@@ -60,8 +61,14 @@
"title": "Success Message",\n
"type": "string",\n
"description": "Success Message"\n
},\n
}\n
},\n
"required": [\n
"software_release_uri",\n
"compute_node_id",\n
"portal_type",\n
"success"\n
]\n
}\n
</string> </value>
</item>
......@@ -76,8 +83,7 @@
"title": "Software Installation",\n
"description": "Software Installation",\n
"type": "object",\n
"oneOf": [\n
{\n
"additionalProperties": false,\n
"properties": {\n
"software_release_uri": {\n
"title": "Software Release URI",\n
......@@ -92,28 +98,7 @@
"title": "Portal Type",\n
"const": "Software Installation",\n
"type": "string"\n
}\n
},\n
"required": [\n
"software_release_uri",\n
"compute_node_id",\n
"portal_type"\n
]\n
},\n
{\n
"properties": {\n
"id": {\n
"title": "ID",\n
"type": "string",\n
"description": "Unique Id of the object. This ID is defined by KD Portal. It is not editable."\n
}\n
},\n
"required": [\n
"id"\n
]\n
}\n
],\n
"properties": {\n
"state": {\n
"title": "Requested State",\n
"type": "string",\n
......@@ -132,7 +117,12 @@
"description": "Used to inform master of an Error in the local processing of the Software Installation",\n
"type": "string"\n
}\n
}\n
},\n
"required": [\n
"software_release_uri",\n
"compute_node_id",\n
"portal_type"\n
]\n
}\n
</string> </value>
</item>
......
......@@ -35,6 +35,7 @@
"title": "X509 Certificates",\n
"description": "X509 Certificates used by the instance to authentify itself on master",\n
"type": "object",\n
"additionalProperties": false,\n
"properties": {\n
"reference": {\n
"title": "Software Instance Reference",\n
......@@ -57,7 +58,13 @@
"const": "Software Instance Certificate Record",\n
"type": "string"\n
}\n
}\n
},\n
"required": [\n
"reference",\n
"key",\n
"portal_type",\n
"certificate"\n
]\n
}</string> </value>
</item>
<item>
......@@ -71,6 +78,7 @@
"title": "Get Software Instance Certificate",\n
"description": "Data necessary to get Software Instance Certificates",\n
"type": "object",\n
"additionalProperties": false,\n
"properties": {\n
"reference": {\n
"title": "Software Instance Id/Reference",\n
......
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="JSON Form" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>after_method_id</string> </key>
<value> <string>jIOWebSection_asJSONText</string> </value>
</item>
<item>
<key> <string>content_type</string> </key>
<value> <string>application/json</string> </value>
</item>
<item>
<key> <string>default_reference</string> </key>
<value> <string>SoftwareInstance_getFromJSON</string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>SoftwareInstance_getFromJSON</string> </value>
</item>
<item>
<key> <string>output_schema</string> </key>
<value> <string>{\n
"$schema": "http://json-schema.org/draft-07/schema#",\n
"title": "Get Compute Node",\n
"description": "Data necessary to get Compute Node",\n
"type": "object",\n
"additionalProperties": false,\n
"properties": {\n
"compute_node_id": {\n
"title": "Compute Node Id",\n
"type": "string",\n
"description": "Id Of the Requesting Compute Node, used by Slap Client when an instance is requesting an instance"\n
},\n
"portal_type": {\n
"title": "Portal Type",\n
"oneOf": [\n
{"const": "Software Instance"},\n
{"const": "Slave Instance"}\n
],\n
"type": "string"\n
},\n
"reference": {\n
"title": "Software Instance Reference",\n
"description": "Unique identifier of the Software Instance",\n
"type": "string"\n
},\n
"root_instance_title": {\n
"title": "Title of the Roor Instance",\n
"type": "string"\n
},\n
"title": {\n
"title": "Unique Title of the Instance",\n
"type": "string"\n
},\n
"state": {\n
"title": "Requested State",\n
"type": "string",\n
"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
"compute_partition_id": {\n
"title": "Compute Partition Id",\n
"type": "string",\n
"description": "Id Of the Requesting Compute Partition, used by Slap Client when an instance is requesting an instance"\n
},\n
"software_release_uri": {\n
"title": "Software Release URI",\n
"type": "string",\n
"description": "URL of the software release used by the software instance"\n
},\n
"software_type": {\n
"title": "Software Type",\n
"type": "string"\n
},\n
"shared": {\n
"title": "Shared",\n
"type": "boolean",\n
"description": "Is it a shared instance"\n
},\n
"processing_timestamp": {\n
"title": "Processing Timestamp",\n
"type": "integer"\n
},\n
"access_status_message": {\n
"title": "Access Status Message",\n
"type": "string"\n
},\n
"parameters": {\n
"title": "Parameters",\n
"type": "object"\n
},\n
"sla_parameters": {\n
"title": "SLA Parameters",\n
"type": "object"\n
},\n
"connection_parameters": {\n
"title": "Connection Parameters",\n
"type": "object"\n
},\n
"ip_list": {\n
"title": "IP List",\n
"type": "array",\n
"description": "List of IPs usable by the Software Instance on the partition.",\n
"items": {\n
"type": "array",\n
"title": "Internet Protocol Address",\n
"description": "All elements to describe the interface",\n
"items": {\n
"type": "string"\n
}\n
}\n
},\n
"full_ip_list": {\n
"title": "Full IP List",\n
"type": "array",\n
"description": "List of IPs usable by the Software Instance on the partition.",\n
"items": {\n
"type": "array",\n
"title": "Internet Protocol Address",\n
"description": "All elements to describe the interface",\n
"items": {\n
"type": "string"\n
}\n
}\n
}\n
},\n
"required": [\n
"compute_node_id",\n
"portal_type",\n
"reference",\n
"root_instance_title",\n
"title",\n
"state",\n
"compute_partition_id",\n
"software_release_uri",\n
"software_type",\n
"shared",\n
"processing_timestamp",\n
"access_status_message",\n
"parameters",\n
"sla_parameters",\n
"connection_parameters",\n
"ip_list",\n
"full_ip_list"\n
]\n
}\n
</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>JSON Form</string> </value>
</item>
<item>
<key> <string>text_content</string> </key>
<value> <string>{\n
"$schema": "http://json-schema.org/draft-07/schema#",\n
"title": "Get Compute Node",\n
"description": "Data necessary to get Compute Node",\n
"type": "object",\n
"additionalProperties": false,\n
\n
"properties": {\n
"reference": {\n
"title": "Software Instance Id/Reference",\n
"type": "string",\n
"description": "The unique reference of the Software Instance, example: SOFTINST-1234"\n
},\n
\n
"compute_node_id": {\n
"title": "Compute Node Id",\n
"type": "string",\n
"description": "Id Of the Requesting Compute Node, used by Slap Client when an instance is requesting an instance"\n
},\n
"compute_partition_id": {\n
"title": "Compute Partition Id",\n
"type": "string",\n
"description": "Id Of the Requesting Compute Partition, used by Slap Client when an instance is requesting an instance"\n
},\n
\n
"portal_type": {\n
"title": "Portal Type",\n
"oneOf": [\n
{"const": "Slave Instance"},\n
{"const": "Software Instance"}\n
],\n
"type": "string"\n
}\n
},\n
"oneOf": [{\n
"required": [\n
"reference",\n
"portal_type"\n
]\n
},{\n
"required": [\n
"compute_node_id",\n
"compute_partition_id",\n
"portal_type"\n
]\n
}]\n
}\n
</string> </value>
</item>
<item>
<key> <string>version</string> </key>
<value> <string>01</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
......@@ -35,6 +35,7 @@
"title": "Software Instance Updated",\n
"description": "Response when the software instance is updated",\n
"type": "object",\n
"additionalProperties": false,\n
"properties": {\n
"reference": {\n
"title": "Software Instance Id/Reference",\n
......@@ -51,8 +52,19 @@
"description": "Date and Time of the operation",\n
"type": "string",\n
"format": "date-time"\n
},\n
"success": {\n
"title": "Sucess",\n
"const": "Done",\n
"type": "string"\n
}\n
}\n
},\n
"required": [\n
"reference",\n
"portal_type",\n
"date",\n
"success"\n
]\n
}\n
</string> </value>
</item>
......@@ -68,27 +80,15 @@
"title": "Software Instance",\n
"description": "Software Instance",\n
"type": "object",\n
"oneOf": [\n
{\n
"additionalProperties": false,\n
"properties": {\n
\n
"reference": {\n
"title": "Software Instance Id/Reference",\n
"type": "string",\n
"description": "The unique reference of the Software Instance, example: SOFTINST-1234"\n
},\n
"portal_type": {\n
"title": "Portal Type",\n
"const": "Software Instance",\n
"type": "string"\n
}\n
},\n
"required": [\n
"reference",\n
"portal_type"\n
]\n
},\n
{\n
"properties": {\n
\n
"compute_node_id": {\n
"title": "Compute Node Id",\n
"type": "string",\n
......@@ -99,20 +99,7 @@
"type": "string",\n
"description": "Id Of the Requesting Compute Partition, used by Slap Client when an instance is requesting an instance"\n
},\n
"portal_type": {\n
"title": "Portal Type",\n
"const": "Software Instance",\n
"type": "string"\n
}\n
},\n
"required": [\n
"compute_node_id",\n
"compute_partition_id",\n
"portal_type"\n
]\n
}\n
],\n
"properties": {\n
\n
"connection_parameters": {\n
"title": "Connections Parameters",\n
"type": "object",\n
......@@ -134,21 +121,20 @@
"const": "Software Instance",\n
"type": "string"\n
},\n
"requested_instance_list": {\n
"title": "Requested Instance List",\n
"type": "array",\n
"description": "List of the instances references requested by this instance. This is used to garbage collect instances that are no longer requested by this instance.",\n
"items": {\n
"type": "string"\n
}\n
},\n
"title": {\n
"title": "New Title",\n
"type": "string",\n
"description": "Use this to change the name of your instance. Very dangerous. DO NOT USE IF YOU DO NOT KNOW WHAT YOU ARE DOING",\n
"maxLength": 200\n
}\n
}\n
},\n
"required": [\n
"portal_type"\n
],\n
"oneOf": [\n
{"required": ["reference"]},\n
{"required": ["compute_node_id", "compute_partition_id"]}\n
]\n
}\n
</string> </value>
</item>
......
......@@ -34,6 +34,7 @@
"title": "Compute Node",\n
"description": "Compute Node",\n
"type": "object",\n
"additionalProperties": false,\n
"properties": {\n
"portal_type": {\n
"title": "Portal Type",\n
......@@ -46,7 +47,7 @@
"maxLength": 200\n
}\n
},\n
"required": ["portal_type"]\n
"required": ["portal_type", "title"]\n
}\n
</string> </value>
</item>
......
......@@ -33,6 +33,7 @@
"title": "Software Installation",\n
"description": "Software Installation",\n
"type": "object",\n
"additionalProperties": false,\n
"properties": {\n
"software_release_uri": {\n
"title": "Software Release URI",\n
......
......@@ -28,6 +28,155 @@
<key> <string>id</string> </key>
<value> <string>jIOWebSection_requestSoftwareInstanceFromJSON</string> </value>
</item>
<item>
<key> <string>output_schema</string> </key>
<value> <string>{\n
"$schema": "http://json-schema.org/draft-07/schema#",\n
"title": "Software Instance Requested",\n
"description": "Response when the software instance is requested",\n
"type": "object",\n
"additionalProperties": false,\n
"properties": {\n
\n
"message": {\n
"title": "Message",\n
"type": "string"\n
},\n
"name": {\n
"title": "Name",\n
"type": "string"\n
},\n
"status": {\n
"title": "Status",\n
"type": "integer"\n
},\n
\n
"compute_node_id": {\n
"title": "Compute Node Id",\n
"type": "string",\n
"description": "Id Of the Requesting Compute Node, used by Slap Client when an instance is requesting an instance"\n
},\n
"portal_type": {\n
"title": "Portal Type",\n
"const": "Software Instance",\n
"type": "string"\n
},\n
"reference": {\n
"title": "Software Instance Reference",\n
"description": "Unique identifier of the Software Instance",\n
"type": "string"\n
},\n
"root_instance_title": {\n
"title": "Title of the Roor Instance",\n
"type": "string"\n
},\n
"title": {\n
"title": "Unique Title of the Instance",\n
"type": "string"\n
},\n
"state": {\n
"title": "Requested State",\n
"type": "string",\n
"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
"compute_partition_id": {\n
"title": "Compute Partition Id",\n
"type": "string",\n
"description": "Id Of the Requesting Compute Partition, used by Slap Client when an instance is requesting an instance"\n
},\n
"software_release_uri": {\n
"title": "Software Release URI",\n
"type": "string",\n
"description": "URL of the software release used by the software instance"\n
},\n
"software_type": {\n
"title": "Software Type",\n
"type": "string"\n
},\n
"shared": {\n
"title": "Shared",\n
"type": "boolean",\n
"description": "Is it a shared instance"\n
},\n
"processing_timestamp": {\n
"title": "Processing Timestamp",\n
"type": "integer"\n
},\n
"access_status_message": {\n
"title": "Access Status Message",\n
"type": "string"\n
},\n
"parameters": {\n
"title": "Parameters",\n
"type": "object"\n
},\n
"sla_parameters": {\n
"title": "SLA Parameters",\n
"type": "object"\n
},\n
"connection_parameters": {\n
"title": "Connection Parameters",\n
"type": "object"\n
},\n
"ip_list": {\n
"title": "IP List",\n
"type": "array",\n
"description": "List of IPs usable by the Software Instance on the partition.",\n
"items": {\n
"type": "array",\n
"title": "Internet Protocol Address",\n
"description": "All elements to describe the interface",\n
"items": {\n
"type": "string"\n
}\n
}\n
},\n
"full_ip_list": {\n
"title": "Full IP List",\n
"type": "array",\n
"description": "List of IPs usable by the Software Instance on the partition.",\n
"items": {\n
"type": "array",\n
"title": "Internet Protocol Address",\n
"description": "All elements to describe the interface",\n
"items": {\n
"type": "string"\n
}\n
}\n
}\n
},\n
\n
"oneOf": [{\n
"required": [\n
"compute_node_id",\n
"portal_type",\n
"reference",\n
"root_instance_title",\n
"title",\n
"state",\n
"compute_partition_id",\n
"software_release_uri",\n
"software_type",\n
"shared",\n
"processing_timestamp",\n
"access_status_message",\n
"parameters",\n
"sla_parameters",\n
"connection_parameters",\n
"ip_list",\n
"full_ip_list"\n
]\n
},{\n
"required": [\n
"message",\n
"name",\n
"status"\n
]\n
}]\n
}\n
</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>JSON Form</string> </value>
......@@ -40,7 +189,12 @@
"title": "Software Instance",\n
"description": "Software Instance",\n
"type": "object",\n
"additionalProperties": false,\n
"properties": {\n
"project_reference": {\n
"title": "Project Reference",\n
"type": "string"\n
},\n
"title": {\n
"title": "Title",\n
"type": "string",\n
......@@ -123,7 +277,7 @@
"description": "Id Of the Requesting Compute Partition, used by Slap Client when an instance is requesting an instance"\n
}\n
},\n
"required": ["title", "software_release_uri", "portal_type"]\n
"required": ["title", "software_release_uri", "software_type", "portal_type"]\n
}\n
</string> </value>
</item>
......
......@@ -34,6 +34,8 @@
"$schema": "http://json-schema.org/draft-07/schema#",\n
"title": "allDocs: Response Payload",\n
"description": "Payload returned by allDocs method.",\n
"type": "object",\n
"additionalProperties": false,\n
"properties": {\n
"current_page_full": {\n
"title": "Current Page Full",\n
......@@ -51,6 +53,7 @@
"type": "array",\n
"items": {\n
"type": "object",\n
"additionalProperties": false,\n
"title": "Item",\n
"properties": {\n
"title": {\n
......@@ -77,6 +80,7 @@
"title": "Get Parameters",\n
"description": "Copy Paste the content of this object in order to get the object",\n
"type": "object",\n
"additionalProperties": false,\n
"properties": {\n
"compute_node_id": {\n
"title": "Compute Node ID",\n
......@@ -88,12 +92,27 @@
"const": "Compute Node",\n
"type": "string"\n
}\n
},\n
"required": [\n
"title",\n
"compute_node_id",\n
"portal_type"\n
]\n
}\n
},\n
"required": [\n
"title",\n
"compute_node_id",\n
"portal_type",\n
"get_parameters"\n
]\n
}\n
}\n
}\n
}\n
}\n
},\n
"required": [\n
"current_page_full",\n
"result_list"\n
]\n
}</string> </value>
</item>
<item>
......@@ -107,6 +126,7 @@
"title": "Search Compute Node",\n
"description": "JSON Schema to query/search for a Compute Node",\n
"type": "object",\n
"additionalProperties": false,\n
"properties": {\n
"title": {\n
"title": "Compute Node Title",\n
......
......@@ -34,6 +34,8 @@
"$schema": "http://json-schema.org/draft-07/schema#",\n
"title": "allDocs: Response Payload",\n
"description": "Payload returned by allDocs method.",\n
"type": "object",\n
"additionalProperties": false,\n
"properties": {\n
"current_page_full": {\n
"title": "Current Page Full",\n
......@@ -53,6 +55,7 @@
"anyOf": [\n
{\n
"type": "object",\n
"additionalProperties": false,\n
"title": "Software Instance",\n
"properties": {\n
"get_parameters": {\n
......@@ -111,6 +114,7 @@
},\n
{\n
"type": "object",\n
"additionalProperties": false,\n
"title": "Shared Instance",\n
"properties": {\n
"get_parameters": {\n
......@@ -128,7 +132,7 @@
"const": "Software Instance",\n
"type": "string"\n
}\n
},\n
}\n
},\n
"reference": {\n
"title": "Software Instance Reference",\n
......@@ -152,7 +156,7 @@
},\n
"portal_type": {\n
"title": "Portal Type",\n
"const": "Shared Instance",\n
"const": "Slave Instance",\n
"type": "string"\n
}\n
}\n
......@@ -160,7 +164,11 @@
]\n
}\n
}\n
}\n
},\n
"required": [\n
"current_page_full",\n
"result_list"\n
]\n
}</string> </value>
</item>
<item>
......@@ -175,62 +183,32 @@
"title": "Software Instance",\n
"description": "Software Instance Search",\n
"type": "object",\n
"oneOf": [\n
{\n
"additionalProperties": false,\n
\n
"properties": {\n
"title": {\n
"title": "Title",\n
"type": "string",\n
"description": "Unique Name of the Software Instance",\n
"maxLength": 200\n
},\n
"compute_node_id": {\n
"title": "Compute Node ID",\n
"type": "string",\n
"description": "The Id of the compute node hosting the instance, example: COMP-1234"\n
},\n
"compute_partition_id": {\n
"title": "Compute Partition Id",\n
"type": "string",\n
"description": "Id Of the Requesting Compute Partition, used by Slap Client when an instance is requesting an instance"\n
},\n
"root_instance_title": {\n
"title": "Root Instance Title",\n
"type": "string",\n
"description": "Title of the Instance at the root of the instance tree. This is the title of the instance that has been requested by the user."\n
},\n
"state": {\n
"title": "Requested State",\n
"host_instance_reference": {\n
"title": "Host Instance Reference",\n
"type": "string",\n
"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
"description": "Reference of the Instance where this is instance is hosted, usefull for shared instances"\n
},\n
\n
"from_api_revision": {\n
"title": "From API Revision",\n
"type": "string",\n
"description": "Filter by API Revision. Returns the list of elements having an api revision higher or equal to the one inputed. The API Revision is set by the master node to mark when the element was last processed. It is incremental. If revision has changed, critical data has been updated"\n
},\n
"portal_type": {\n
"title": "Portal Type",\n
"const": "Software Instance",\n
"type": "string"\n
}\n
},\n
"required": ["portal_type"]\n
},\n
{\n
"properties": {\n
\n
"title": {\n
"title": "Title",\n
"type": "string",\n
"description": "Unique Name of the Software Instance",\n
"maxLength": 200\n
},\n
"host_instance_reference": {\n
"title": "Host Instance Reference",\n
"type": "string",\n
"description": "Reference of the Instance where this is instance is hosted, usefull for shared instances"\n
},\n
"root_instance_title": {\n
"title": "Root Instance Title",\n
"type": "string",\n
......@@ -242,20 +220,30 @@
"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_api_revision": {\n
"title": "From API Revision",\n
\n
"compute_partition_id": {\n
"title": "Compute Partition Id",\n
"type": "string",\n
"description": "Filter by API Revision. Returns the list of elements having an api revision higher or equal to the one inputed. The API Revision is set by the master node to mark when the element was last processed. It is incremental. If revision has changed, critical data has been updated"\n
"description": "Id Of the Requesting Compute Partition, used by Slap Client when an instance is requesting an instance"\n
},\n
\n
"portal_type": {\n
"title": "Portal Type",\n
"const": "Shared Instance",\n
"oneOf": [\n
{"const": "Slave Instance"},\n
{"const": "Software Instance"}\n
],\n
"type": "string"\n
}\n
},\n
"required": ["portal_type"]\n
}\n
"required": [\n
"portal_type"\n
],\n
"oneOf": [\n
{"required": ["host_instance_reference"]},\n
{"required": ["compute_node_id"]}\n
]\n
\n
}\n
</string> </value>
</item>
......
......@@ -34,6 +34,8 @@
"$schema": "http://json-schema.org/draft-07/schema#",\n
"title": "allDocs: Response Payload",\n
"description": "Payload returned by allDocs method.",\n
"type": "object",\n
"additionalProperties": false,\n
"properties": {\n
"next_page_request": {\n
"title": "Next Page Request",\n
......@@ -98,10 +100,19 @@
"description": "State of the requested software",\n
"default": "available"\n
}\n
},\n
"required": [\n
"compute_node_id",\n
"portal_type",\n
"get_parameters"\n
]\n
}\n
}\n
}\n
}\n
},\n
"required": [\n
"current_page_full",\n
"result_list"\n
]\n
}</string> </value>
</item>
<item>
......@@ -116,6 +127,7 @@
"title": "Software Instance",\n
"description": "Software Instance",\n
"type": "object",\n
"additionalProperties": false,\n
"properties": {\n
"software_release_uri": {\n
"title": "Software Release URI",\n
......
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="JSON RPC Service" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_Access_contents_information_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Associate</string>
<string>Auditor</string>
<string>Authenticated</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Add_portal_content_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Associate</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Modify_portal_content_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Associate</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_View_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Associate</string>
<string>Auditor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>slapos_master_api</string> </value>
</item>
<item>
<key> <string>json_form</string> </key>
<value>
<tuple>
<string>slapos.put.slapos_jio_api_put_software_instance | SoftwareInstance_updateFromJSON</string>
<string>slapos.put.slapos_jio_api_put_software_installation | SoftwareInstallation_updateFromJSON</string>
<string>slapos.put.slapos_jio_api_put_compute_node | ComputeNode_updateFromJSON</string>
<string>slapos.get.slapos_jio_api_get_software_instance | SoftwareInstance_getFromJSON</string>
<string>slapos.get.slapos_jio_api_get_compute_node | ComputeNode_getFromJSON</string>
<string>slapos.get.slapos_jio_api_get_software_installation | SoftwareInstallation_getFromJSON</string>
<string>slapos.get.slapos_jio_api_get_software_instance_certificate | SoftwareInstanceCertificateRecord_getFromJSON</string>
<string>slapos.post.slapos_jio_api_create_compute_node | jIOWebSection_createComputeNodeFromJSON</string>
<string>slapos.post.slapos_jio_api_request_software_instance | jIOWebSection_requestSoftwareInstanceFromJSON</string>
<string>slapos.post.slapos_jio_api_create_software_installation | jIOWebSection_createSoftwareInstallationFromJSON</string>
<string>slapos.allDocs.slapos_jio_api_search_compute_node | jIOWebSection_searchComputeNodeFromJSON</string>
<string>slapos.allDocs.slapos_jio_api_search_instance | jIOWebSection_searchInstanceFromJSON</string>
<string>slapos.allDocs.slapos_jio_api_search_software_installation | jIOWebSection_searchSoftwareInstallationFromJSON</string>
</tuple>
</value>
</item>
<item>
<key> <string>workflow_history</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="PersistentMapping" module="Persistence.mapping"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>data</string> </key>
<value>
<dictionary>
<item>
<key> <string>edit_workflow</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value>
</item>
<item>
<key> <string>validation_workflow</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAQ=</string> </persistent>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="3" aka="AAAAAAAAAAM=">
<pickle>
<global name="WorkflowHistoryList" module="Products.ERP5Type.Workflow"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_log</string> </key>
<value>
<list>
<dictionary>
<item>
<key> <string>action</string> </key>
<value> <string>edit</string> </value>
</item>
<item>
<key> <string>actor</string> </key>
<value> <unicode>zope</unicode> </value>
</item>
<item>
<key> <string>comment</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>error_message</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>1021.19615.5761.15104</string> </value>
</item>
<item>
<key> <string>state</string> </key>
<value> <string>current</string> </value>
</item>
<item>
<key> <string>time</string> </key>
<value>
<object>
<klass>
<global name="_reconstructor" module="copy_reg"/>
</klass>
<tuple>
<global name="DateTime" module="DateTime.DateTime"/>
<global name="object" module="__builtin__"/>
<none/>
</tuple>
<state>
<tuple>
<float>1734001867.68</float>
<string>UTC</string>
</tuple>
</state>
</object>
</value>
</item>
</dictionary>
</list>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="4" aka="AAAAAAAAAAQ=">
<pickle>
<global name="WorkflowHistoryList" module="Products.ERP5Type.Workflow"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_log</string> </key>
<value>
<list>
<dictionary>
<item>
<key> <string>action</string> </key>
<value> <string>validate</string> </value>
</item>
<item>
<key> <string>actor</string> </key>
<value> <unicode>zope</unicode> </value>
</item>
<item>
<key> <string>comment</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>error_message</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>time</string> </key>
<value>
<object>
<klass>
<global name="_reconstructor" module="copy_reg"/>
</klass>
<tuple>
<global name="DateTime" module="DateTime.DateTime"/>
<global name="object" module="__builtin__"/>
<none/>
</tuple>
<state>
<tuple>
<float>1733393628.5</float>
<string>UTC</string>
</tuple>
</state>
</object>
</value>
</item>
<item>
<key> <string>validation_state</string> </key>
<value> <string>validated</string> </value>
</item>
</dictionary>
</list>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<type_mixin>
<portal_type id="Compute Node">
<item>ComputeNodeJsonTypeMixin</item>
</portal_type>
<portal_type id="Slave Instance">
<item>SoftwareInstanceJsonTypeMixin</item>
</portal_type>
<portal_type id="Software Installation">
<item>SoftwareInstallationJsonTypeMixin</item>
</portal_type>
<portal_type id="Software Instance">
<item>SoftwareInstanceJsonTypeMixin</item>
</portal_type>
</type_mixin>
\ No newline at end of file
compute_node = context.jIOWebSection_getObjectFromData(data_dict)
def compareAndUpdateAddressList(partition, partition_ip_list):
to_delete_ip_id_list = []
to_add_ip_dict_list = partition_ip_list[:]
......@@ -43,28 +45,28 @@ def compareAndUpdateAddressList(partition, partition_ip_list):
partition.deleteContent(to_delete_ip_id_list)
if "bang_status_message" in data_dict:
context.reportComputeNodeBang(comment=data_dict["bang_status_message"])
compute_node.reportComputeNodeBang(comment=data_dict["bang_status_message"])
# Getting existing partitions
existing_partition_dict = {}
for c in context.contentValues(portal_type="Compute Partition"):
for c in compute_node.contentValues(portal_type="Compute Partition"):
existing_partition_dict[c.getReference()] = c
# update compute_node data
edit_kw = {}
quantity = len(data_dict.get('compute_partition_list', []))
if context.getQuantity() != quantity:
if compute_node.getQuantity() != quantity:
edit_kw['quantity'] = quantity
if edit_kw:
context.edit(**edit_kw)
compute_node.edit(**edit_kw)
expected_partition_dict = {}
for send_partition in data_dict.get('compute_partition_list', []):
partition = existing_partition_dict.get(send_partition['partition_id'], None)
expected_partition_dict[send_partition['partition_id']] = True
if partition is None:
partition = context.newContent(portal_type='Compute Partition')
partition = compute_node.newContent(portal_type='Compute Partition')
partition.validate()
partition.markFree()
elif partition.getSlapState() == 'inactive':
......@@ -85,11 +87,10 @@ for key, value in existing_partition_dict.items():
if value.getValidationState() == "validated":
value.invalidate(comment="Desactivated by slapformat")
import json
return json.dumps({
"$schema": json_form.absolute_url().strip() + "/getOutputJSONSchema",
"compute_node_id": context.getReference(),
"date": str(DateTime()),
return {
#"$schema": json_form.absolute_url().strip() + "/getOutputJSONSchema",
"compute_node_id": compute_node.getReference(),
"date": DateTime().ISO8601(),
"portal_type": "Compute Node",
"success": "Done"
}, indent=2)
}
import json
from erp5.component.document.JsonRpcAPIService import JsonRpcAPIError
software_installation = context.jIOWebSection_getObjectFromData(data_dict)
class WrongStateError(JsonRpcAPIError):
type = "SOFTWARE-INSTALLATION-WRONG-STATE"
status = 403
class WrongReportedStateError(JsonRpcAPIError):
type = "SOFTWARE-INSTALLATION-WRONG-REPORTED-STATE"
status = 403
class DestroyNotRequestedError(JsonRpcAPIError):
type = "SOFTWARE-INSTALLATION-DESTROY-NOT-REQUESTED"
status = 403
software_installation = context
url = software_installation.getUrlString()
tag = "%s_%s_inProgress" % (software_installation.getAggregateUid(portal_type="Compute Node"),
software_installation.getUrlString())
logError = context.ERP5Site_logApiErrorAndReturn
if "state" in data_dict:
# Change desired state
state = data_dict["state"]
......@@ -15,10 +26,7 @@ if "state" in data_dict:
elif (state == "destroyed"):
software_installation.requestDestroy(activate_kw={'tag': tag})
else:
return logError(
error_name="SOFTWARE-INSTALLATION-WRONG-STATE",
error_message="State should be available or destroyed, but is %s" % state,
)
raise WrongStateError("State should be available or destroyed, but is %s" % state)
if "reported_state" in data_dict:
reported_state = data_dict["reported_state"]
......@@ -28,28 +36,23 @@ if "reported_state" in data_dict:
software_installation.setBuildingStatus('software release %s' % url, "building")
elif reported_state == "destroyed":
if software_installation.getSlapState() != 'destroy_requested':
return logError(
error_name="SOFTWARE-INSTALLATION-DESTROY-NOT-REQUESTED",
error_message="Reported state is destroyed but requested state is not destroyed",
)
raise DestroyNotRequestedError("Reported state is destroyed but requested state is not destroyed")
if context.getPortalObject().portal_workflow.isTransitionPossible(software_installation,
'invalidate'):
software_installation.invalidate(
comment="Software Release destroyed report.")
else:
return logError(
error_name="SOFTWARE-INSTALLATION-WRONG-REPORTED-STATE",
error_message="Reported state should be available, destroyed or building, but is %s" % state,
)
raise WrongReportedStateError("Reported state should be available, destroyed or building, but is %s" % state)
if "error_status" in data_dict:
software_installation.setErrorStatus('while installing %s' % url)
return json.dumps({
"$schema": json_form.absolute_url().strip() + "/getOutputJSONSchema",
return {
# "$schema": json_form.absolute_url().strip() + "/getOutputJSONSchema",
"software_release_uri": software_installation.getUrlString(),
"compute_node_id": software_installation.getAggregateReference(),
"date": str(DateTime()),
"date": DateTime().ISO8601(),
"portal_type": "Software Installation",
"success": "Done"
}, indent=2)
}
import json
software_instance = context.getParentValue()
return json.dumps({
"$schema": json_form.absolute_url().strip() + "/getOutputJSONSchema",
software_instance = context.jIOWebSection_getObjectFromData(data_dict)
# software_instance = context.getParentValue()
return {
#"$schema": json_form.absolute_url().strip() + "/getOutputJSONSchema",
"reference": software_instance.getReference(),
"key": software_instance.getSslKey(),
"certificate": software_instance.getSslCertificate(),
"portal_type": "Software Instance Certificate Record",
}, indent=2)
}
import json
from erp5.component.document.JsonRpcAPIService import JsonRpcAPIError
software_instance = context
class WrongReportedStateError(JsonRpcAPIError):
type = "SOFTWARE-INSTANCE-WRONG-REPORTED-STATE"
status = 403
logError = context.ERP5Site_logApiErrorAndReturn
software_instance = context.jIOWebSection_getObjectFromData(data_dict)
castToStr = context.Base_castDictToXMLString
if "connection_parameters" in data_dict:
......@@ -38,13 +40,7 @@ if "reported_state" in data_dict:
error_log = data_dict.get("status_message", "")
software_instance.setErrorStatus('while instanciating: %s' % error_log[-80:], reindex=1)
else:
return logError(
error_name="SOFTWARE-INSTANCE-WRONG-REPORTED-STATE",
error_message="Unexcepected Reported State: %s" % reported_state,
)
if "requested_instance_list" in data_dict:
software_instance.updateRequestedInstanceList(data_dict["requested_instance_list"])
raise WrongReportedStateError("Unexcepected Reported State: %s" % reported_state)
if "title" in data_dict and data_dict["title"] != software_instance.getTitle():
software_instance.rename(
......@@ -52,10 +48,10 @@ if "title" in data_dict and data_dict["title"] != software_instance.getTitle():
comment="Rename %s into %s" % (software_instance.getTitle(), data_dict["title"])
)
return json.dumps({
"$schema": json_form.absolute_url().strip() + "/getOutputJSONSchema",
return {
#"$schema": json_form.absolute_url().strip() + "/getOutputJSONSchema",
"reference": software_instance.getReference(),
"portal_type": "Software Instance",
"date": DateTime().HTML4(),
"date": DateTime().ISO8601(),
"success": "Done"
}, indent=2)
}
doc = context.jIOWebSection_getObjectFromData(data_dict)
return doc.asJSONText()
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="PythonScript" module="Products.PythonScripts.PythonScript"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_bind_names</string> </key>
<value>
<object>
<klass>
<global name="_reconstructor" module="copy_reg"/>
</klass>
<tuple>
<global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/>
<global name="object" module="__builtin__"/>
<none/>
</tuple>
<state>
<dictionary>
<item>
<key> <string>_asgns</string> </key>
<value>
<dictionary>
<item>
<key> <string>name_container</string> </key>
<value> <string>container</string> </value>
</item>
<item>
<key> <string>name_context</string> </key>
<value> <string>context</string> </value>
</item>
<item>
<key> <string>name_m_self</string> </key>
<value> <string>script</string> </value>
</item>
<item>
<key> <string>name_subpath</string> </key>
<value> <string>traverse_subpath</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>data_dict, form_reference</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>jIOWebSection_asJSONText</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
from erp5.component.document.JsonRpcAPIService import JsonRpcAPIError
class RequestFailsError(JsonRpcAPIError):
type = "SUPPLY-FAILED"
status = 403
compute_node = context.jIOWebSection_getObjectFromData({
'portal_type': 'Compute Node',
'compute_node_id': data_dict['compute_node_id']
})
compute_node.requestSoftwareRelease(
software_release_url=data_dict["software_release_uri"],
state=data_dict.get("state", "available"),
)
software_installation_url = context.REQUEST.get("software_installation_url")
if not software_installation_url:
raise RequestFailsError("Installation request for '%s' with state '%s' on '%s' failed" % (
data_dict["software_release_uri"],
data_dict.get("state", "available"),
data_dict["compute_node_id"]
))
return
from erp5.component.document.JsonRpcAPIService import JsonRpcAPIError
portal = context.getPortalObject()
class SoftwareInstanceNotFoundError(JsonRpcAPIError):
type = "SOFTWARE-INSTANCE-NOT-FOUND"
status = 403
class SoftwareInstallationNotFoundError(JsonRpcAPIError):
type = "SOFTWARE-INSTALLATION-NOT-FOUND"
status = 403
def getSoftwareInstance(reference, include_shared=False):
# No need to get all results if an error is raised when at least 2 objects
# are found
if include_shared:
portal_type = ("Software Instance", "Slave Instance")
else:
portal_type = "Software Instance"
# XXX TODO slap_tool use unrestrictedTraverse to script the security params for performance
software_instance_list = portal.portal_catalog(
limit=2,
portal_type=portal_type,
validation_state="validated",
reference=reference
)
if len(software_instance_list) != 1:
raise SoftwareInstanceNotFoundError("No instance found with reference: %s" % reference)
return software_instance_list[0].getObject()
portal_type = data_dict["portal_type"]
import urllib
portal = context.getPortalObject()
if portal_type == "Software Installation":
if "compute_node_id" in data_dict and "software_release_uri" in data_dict:
compute_node = portal.portal_catalog.getComputeNodeObject(
data_dict["compute_node_id"],
)
if compute_node:
return compute_node.getSoftwareInstallationFromUrl(urllib.unquote(data_dict["software_release_uri"]))
# XXX TODO slap_tool use unrestrictedTraverse to script the security params for performance
software_installation_list = portal.portal_catalog(
portal_type='Software Installation',
default_aggregate_uid=compute_node.getUid(),
validation_state='validated',
limit=2,
url_string={'query': data_dict["software_release_uri"], 'key': 'ExactMatch'},
)
if len(software_installation_list) != 1:
raise SoftwareInstallationNotFoundError("No installation found with url: %s" % data_dict["software_release_uri"])
return software_installation_list[0].getObject()
elif portal_type == "Compute Node":
class ComputeNodeNotFoundError(JsonRpcAPIError):
type = "COMPUTE-NODE-NOT-FOUND"
status = 403
if "compute_node_id" in data_dict:
compute_node_id = data_dict["compute_node_id"]
user = portal.portal_membership.getAuthenticatedMember().getUserName()
......@@ -21,34 +63,38 @@ elif portal_type == "Compute Node":
compute_node = portal.portal_catalog.getComputeNodeObject(compute_node_id)
if compute_node:
return compute_node
raise ComputeNodeNotFoundError("Compute Node '%s' not found" % data_dict["compute_node_id"])
elif portal_type == "Software Instance":
if "reference" in data_dict:
software_instance = portal.portal_catalog.getSoftwareInstanceObject(
return getSoftwareInstance(
data_dict["reference"],
include_shared=True
)
if software_instance:
return software_instance
elif "compute_node_id" and "compute_partition_id" in data_dict:
compute_partition = portal.portal_catalog.getComputePartitionObject(
data_dict["compute_node_id"],
data_dict["compute_partition_id"],
)
if compute_partition:
return compute_partition.getSoftwareInstance()
requester_list = portal.portal_catalog(limit=2, **{
'validation_state': 'validated',
'portal_type': 'Software Instance',
'aggregate__uid': compute_partition.getUid(),
})
if len(requester_list) != 1:
raise SoftwareInstanceNotFoundError("No instance found with compute_node_id: %s and compute_partition_id: %s" % (data_dict["compute_node_id"], data_dict["compute_partition_id"]))
return requester_list[0].getObject()
elif portal_type == "Software Instance Certificate Record":
if "reference" in data_dict:
software_instance = portal.portal_catalog.getSoftwareInstanceObject(
return getSoftwareInstance(
data_dict["reference"],
include_shared=True
)
if software_instance:
return software_instance.newContent(
temp_object=True,
portal_type="Software Instance Certificate Record",
)
return None
class ObjectNotFoundError(JsonRpcAPIError):
type = "OBJECT-NODE-NOT-FOUND"
status = 403
raise ObjectNotFoundError("Object not found")
compute_node_id = data_dict.get("compute_node_id", None)
compute_partition_id = data_dict.get("compute_partition_id", None)
castToStr = context.Base_castDictToXMLString
portal = context.getPortalObject()
# Loads partition parameter
partition_parameter = data_dict.get("parameters", {})
# filter dict
filter_kw = data_dict.get("sla_parameters", {})
partition_reference = data_dict.get("title")
kw = dict(software_release=data_dict.get("software_release_uri"),
software_type=data_dict.get("software_type"),
software_title=partition_reference,
instance_xml=castToStr(partition_parameter),
shared=data_dict.get("shared", False),
sla_xml=castToStr(filter_kw),
state=data_dict.get("state", "started"),
project_reference=data_dict.get("project_reference", None))
if compute_node_id and compute_partition_id:
requester = context.jIOWebSection_getObjectFromData(data_dict)
instance_tree = requester.getSpecialiseValue()
if instance_tree is not None:
kw["project_reference"] = instance_tree.getFollowUpReference()
if instance_tree.getSlapState() == "stop_requested":
kw['state'] = 'stopped'
key = '_'.join([instance_tree.getRelativeUrl(), partition_reference])
else:
# requested as root, so done by human
requester = portal.portal_membership.getAuthenticatedMember().getUserValue()
key = '_'.join([requester.getRelativeUrl(), partition_reference])
last_data = requester.getLastData(key)
requested_software_instance = None
value = dict(
hash='_'.join([requester.getRelativeUrl(), str(kw)]),
)
if last_data is not None and isinstance(last_data, type(value)):
requested_software_instance = portal.restrictedTraverse(
last_data.get('request_instance'), None)
if last_data is None or not isinstance(last_data, type(value)) or \
last_data.get('hash') != value['hash'] or \
requested_software_instance is None:
if compute_node_id and compute_partition_id:
requester.requestInstance(**kw)
else:
# requester is a person so we use another method
requester.requestSoftwareInstance(**kw)
requested_software_instance = context.REQUEST.get('request_instance')
if requested_software_instance is not None:
value['request_instance'] = requested_software_instance\
.getRelativeUrl()
requester.setLastData(value, key=key)
if requested_software_instance is not None:
return requested_software_instance.asJSONText()
return {
'message': 'Software Instance Not Ready',
'status': 102,
'name': 'SoftwareInstanceNotReady'
}
from erp5.component.document.JsonRpcAPIService import JsonRpcAPIError
portal_type = data_dict["portal_type"]
portal = context.getPortalObject()
# Hardcoded
limit = 1000
class HostInstanceNotFoundError(JsonRpcAPIError):
type = "HOST-INSTANCE-NOT-FOUND"
status = 403
web_section = context.getWebSectionValue()
web_section = web_section.getRelativeUrl() if web_section else context.REQUEST.get("web_section_relative_url", None)
......@@ -23,9 +29,11 @@ if portal_type == "Software Instance":
search_kw = {
"portal_type": "Software Instance",
"validation_state": "validated",
"jio_api_revision.web_section": web_section,
"select_list": ("title", "reference", "portal_type", "slap_state", "aggregate_reference", "url_string", "jio_api_revision.revision"),
"sort_on": ("jio_api_revision.revision", "ASC"),
#"jio_api_revision.web_section": web_section,
"select_list": ("title", "reference", "portal_type", "slap_state", "aggregate_reference", "url_string"),#, "jio_api_revision.revision"),
#"sort_on": ("jio_api_revision.revision", "ASC"),
# XXX Sorting is slow
"sort_on": [("reference", "ASC")],
"limit": limit
}
......@@ -48,20 +56,21 @@ if portal_type == "Software Instance":
"state": slap_state_dict.get(x.slap_state, ""),
"compute_partition_id": x.aggregate_reference,
"software_release_uri": x.url_string,
"api_revision": x.revision,
#"api_revision": x.revision,
"get_parameters": {
"portal_type": x.portal_type,
"reference": x.reference,
},
} for x in portal.portal_catalog(**search_kw)]
elif portal_type == "Shared Instance":
elif portal_type == "Slave Instance":
search_kw = {
"portal_type": "Slave Instance",
"validation_state": "validated",
"jio_api_revision.web_section": web_section,
"select_list": ("title", "reference", "portal_type", "slap_state", "aggregate_reference", "jio_api_revision.revision"),
"sort_on": ("jio_api_revision.revision", "ASC"),
# "jio_api_revision.web_section": web_section,
"select_list": ("title", "reference", "portal_type", "slap_state", "aggregate_reference"),#, "jio_api_revision.revision"),
# "sort_on": ("jio_api_revision.revision", "ASC"),
"sort_on": [("reference", "ASC")],
"limit": limit
}
if "host_instance_reference" in data_dict:
......@@ -71,12 +80,9 @@ elif portal_type == "Shared Instance":
validation_state="validated",
)
if len(host_instance_list) != 1:
return portal.ERP5Site_logApiErrorAndReturn(
error_name="HOST-INSTANCE-NOT-FOUND",
error_message="No matching instances with the provided reference has been found",
error_code=404
)
search_kw["strict_aggregate_uid"] = host_instance_list[0].getObject().getComputePartitionUid()
raise HostInstanceNotFoundError("No matching instances with the provided reference has been found")
search_kw["strict_aggregate_uid"] = host_instance_list[0].getObject().getAggregateUid()
if "root_instance_title" in data_dict:
search_kw["strict_specialise_title"] = data_dict["root_instance_title"]
if "state" in data_dict:
......@@ -90,7 +96,7 @@ elif portal_type == "Shared Instance":
"portal_type": "Software Instance",
"state": slap_state_dict.get(x.slap_state, ""),
"compute_partition_id": x.aggregate_reference,
"api_revision": x.revision,
#"api_revision": x.revision,
"get_parameters": {
"portal_type": "Software Instance",
"reference": x.reference,
......@@ -100,18 +106,15 @@ elif portal_type == "Shared Instance":
} for x in portal.portal_catalog(**search_kw)]
else:
return portal.ERP5Site_logApiErrorAndReturn(
error_name="UNREACHABLE",
error_message="You Reached code that was not recheable",
)
raise NotImplementedError('Unsupported portal type: %s' % portal_type)
if result_list:
data_dict["from_api_revision"] = result_list[-1]["api_revision"]
#if result_list:
# data_dict["from_api_revision"] = result_list[-1]["api_revision"]
import json
return json.dumps({
"$schema": json_form.absolute_url().strip() + "/getOutputJSONSchema",
return {
# "$schema": json_form.absolute_url().strip() + "/getOutputJSONSchema",
"result_list": result_list,
"next_page_request": data_dict,
"current_page_full": len(result_list) == limit,
}, indent=2)
}
import urllib
# Hardcoded
limit = 1000
web_section = context.getWebSectionValue()
......@@ -8,14 +6,15 @@ web_section = web_section.getRelativeUrl() if web_section else context.REQUEST.g
search_kw = {
"portal_type": "Software Installation",
"validation_state": "validated",
"jio_api_revision.web_section": web_section,
"select_list": ("aggregate_reference", "url_string", "slap_state", "portal_type", "jio_api_revision.revision"),
"sort_on": ("jio_api_revision.revision", "ASC"),
# "jio_api_revision.web_section": web_section,
"select_list": ("aggregate_reference", "url_string", "slap_state", "portal_type"),#, "jio_api_revision.revision"),
# "sort_on": ("jio_api_revision.revision", "ASC"),
'sort_on': [('reference', 'ASC')],
"limit": limit,
}
if "software_release_uri" in data_dict:
search_kw["url_string"] = urllib.unquote(data_dict["software_release_uri"])
search_kw["url_string"] = data_dict["software_release_uri"]
if "compute_node_id" in data_dict:
search_kw["strict_aggregate_reference"] = data_dict["compute_node_id"]
if "from_api_revision" in data_dict:
......@@ -23,23 +22,22 @@ if "from_api_revision" in data_dict:
result_list = [{
"get_parameters": {
"software_release_uri": urllib.quote(x.url_string),
"software_release_uri": x.url_string,
"compute_node_id": x.aggregate_reference,
"portal_type": x.portal_type,
},
"software_release_uri": x.url_string,
"compute_node_id": x.aggregate_reference,
"state": "available" if x.slap_state == "start_requested" else "destroyed",
"api_revision": x.revision,
# "api_revision": x.revision,
"portal_type": x.portal_type,
} for x in context.getPortalObject().portal_catalog(**search_kw)]
if result_list:
data_dict["from_api_revision"] = result_list[-1]["api_revision"]
import json
return json.dumps({
"$schema": json_form.absolute_url().strip() + "/getOutputJSONSchema",
# if result_list:
# data_dict["from_api_revision"] = result_list[-1]["api_revision"]
return {
# "$schema": json_form.absolute_url().strip() + "/getOutputJSONSchema",
"result_list": result_list,
"next_page_request": data_dict,
"current_page_full": len(result_list) == limit,
}, indent=2)
}
......@@ -8,7 +8,7 @@
<dictionary>
<item>
<key> <string>default_reference</string> </key>
<value> <string>testSlapOSJIOAPI</string> </value>
<value> <string>testSlapOSJsonRpc</string> </value>
</item>
<item>
<key> <string>default_source_reference</string> </key>
......@@ -24,7 +24,7 @@
</item>
<item>
<key> <string>id</string> </key>
<value> <string>test.erp5.testSlapOSJIOAPI</string> </value>
<value> <string>test.erp5.testSlapOSJsonRpc</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
......
slapos_cloud
erp5_json_rpc_api
\ No newline at end of file
portal_web_services/slapos_master_api
\ No newline at end of file
portal_web_services/slapos_master_api
\ No newline at end of file
portal_callables/ComputeNode_getFromJSON
portal_callables/ComputeNode_updateFromJSON
portal_callables/SoftwareInstallation_getFromJSON
portal_callables/SoftwareInstallation_updateFromJSON
portal_callables/SoftwareInstanceCertificateRecord_getFromJSON
portal_callables/SoftwareInstance_getFromJSON
portal_callables/SoftwareInstance_updateFromJSON
portal_callables/jIOWebSection_createComputeNodeFromJSON
portal_callables/jIOWebSection_createSoftwareInstallationFromJSON
portal_callables/jIOWebSection_requestSoftwareInstanceFromJSON
portal_callables/jIOWebSection_searchComputeNodeFromJSON
portal_callables/jIOWebSection_searchInstanceFromJSON
portal_callables/jIOWebSection_searchSoftwareInstallationFromJSON
portal_web_services/slapos_master_api
\ No newline at end of file
Compute Node | ComputeNodeJsonTypeMixin
Slave Instance | SoftwareInstanceJsonTypeMixin
Software Installation | SoftwareInstallationJsonTypeMixin
Software Instance | SoftwareInstanceJsonTypeMixin
\ No newline at end of file
slapos_jio_api
\ No newline at end of file
test.erp5.testSlapOSJsonRpc
\ No newline at end of file
slapos_json_rpc_api
\ No newline at end of file
0.1
\ No newline at end of file
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