diff --git a/master/bt5/slapos_jio_api_style/ActionTemplateItem/portal_types/Software%20Instance%20Certificate%20Record/slapos_jio_api_get_software_instance_certificate.xml b/master/bt5/slapos_jio_api_style/ActionTemplateItem/portal_types/Software%20Instance%20Certificate%20Record/slapos_jio_api_get_software_instance_certificate.xml new file mode 100644 index 0000000000000000000000000000000000000000..6359b94940b0aa2f6743b491d5bc512b136f55ba --- /dev/null +++ b/master/bt5/slapos_jio_api_style/ActionTemplateItem/portal_types/Software%20Instance%20Certificate%20Record/slapos_jio_api_get_software_instance_certificate.xml @@ -0,0 +1,85 @@ +<?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> diff --git a/master/bt5/slapos_jio_api_style/PathTemplateItem/portal_callables/SoftwareInstanceCertificateRecord_getFromJSON.xml b/master/bt5/slapos_jio_api_style/PathTemplateItem/portal_callables/SoftwareInstanceCertificateRecord_getFromJSON.xml new file mode 100644 index 0000000000000000000000000000000000000000..619f60e50565035e688e7714636ec94fc3c6a24f --- /dev/null +++ b/master/bt5/slapos_jio_api_style/PathTemplateItem/portal_callables/SoftwareInstanceCertificateRecord_getFromJSON.xml @@ -0,0 +1,100 @@ +<?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>SoftwareInstanceCertificateRecord_getSoftwareInstanceCertificatesAsJSON</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>SoftwareInstanceCertificateRecord_getFromJSON</string> </value> + </item> + <item> + <key> <string>description</string> </key> + <value> + <none/> + </value> + </item> + <item> + <key> <string>id</string> </key> + <value> <string>SoftwareInstanceCertificateRecord_getFromJSON</string> </value> + </item> + <item> + <key> <string>output_schema</string> </key> + <value> <string>{\n + "$schema": "http://json-schema.org/draft-07/schema#",\n + "title": "X509 Certificates",\n + "description": "X509 Certificates used by the instance to authentify itself on master",\n + "type": "object",\n + "properties": {\n + "reference": {\n + "title": "Software Instance Reference",\n + "description": "Unique identifier of the Software Instance",\n + "type": "string",\n + "maxLength": 50\n + },\n + "key": {\n + "title": "X509 Key",\n + "type": "string",\n + "descritpion": "X509 Key used by the instance to authentify itself on master"\n + },\n + "certificate": {\n + "title": "X509 Certificate",\n + "type": "string",\n + "descritpion": "X509 Certificate used by the instance to authentify itself on master"\n + },\n + "portal_type": {\n + "title": "Portal Type",\n + "const": "Software Instance Certificate Record",\n + "type": "string"\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 Software Instance Certificate",\n + "description": "Data necessary to get Software Instance Certificates",\n + "type": "object",\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 Certificate Record",\n + "type": "string"\n + }\n + },\n + "required": [\n + "reference",\n + "portal_type"\n + ]\n +}\n +</string> </value> + </item> + <item> + <key> <string>version</string> </key> + <value> <string>01</string> </value> + </item> + </dictionary> + </pickle> + </record> +</ZopeData> diff --git a/master/bt5/slapos_jio_api_style/PortalTypeAllowedContentTypeTemplateItem/allowed_content_types.xml b/master/bt5/slapos_jio_api_style/PortalTypeAllowedContentTypeTemplateItem/allowed_content_types.xml new file mode 100644 index 0000000000000000000000000000000000000000..eca56af150a820a2d99a1aaba6df7c1007738dd2 --- /dev/null +++ b/master/bt5/slapos_jio_api_style/PortalTypeAllowedContentTypeTemplateItem/allowed_content_types.xml @@ -0,0 +1,5 @@ +<allowed_content_type_list> + <portal_type id="Software Instance"> + <item>Software Instance Certificate Record</item> + </portal_type> +</allowed_content_type_list> \ No newline at end of file diff --git a/master/bt5/slapos_jio_api_style/PortalTypePropertySheetTemplateItem/property_sheet_list.xml b/master/bt5/slapos_jio_api_style/PortalTypePropertySheetTemplateItem/property_sheet_list.xml new file mode 100644 index 0000000000000000000000000000000000000000..e49628753a9bcac6f3909cefca804a1e7fb151b6 --- /dev/null +++ b/master/bt5/slapos_jio_api_style/PortalTypePropertySheetTemplateItem/property_sheet_list.xml @@ -0,0 +1,5 @@ +<property_sheet_list> + <portal_type id="Software Instance Certificate Record"> + <item>JSONTypeConstraint</item> + </portal_type> +</property_sheet_list> \ No newline at end of file diff --git a/master/bt5/slapos_jio_api_style/PortalTypeTemplateItem/portal_types/Software%20Instance%20Certificate%20Record.xml b/master/bt5/slapos_jio_api_style/PortalTypeTemplateItem/portal_types/Software%20Instance%20Certificate%20Record.xml new file mode 100644 index 0000000000000000000000000000000000000000..27dcbc6c6d1a2639ae57f6309cd3555fca5d29d7 --- /dev/null +++ b/master/bt5/slapos_jio_api_style/PortalTypeTemplateItem/portal_types/Software%20Instance%20Certificate%20Record.xml @@ -0,0 +1,64 @@ +<?xml version="1.0"?> +<ZopeData> + <record id="1" aka="AAAAAAAAAAE="> + <pickle> + <global name="JSON Type" module="erp5.portal_type"/> + </pickle> + <pickle> + <dictionary> + <item> + <key> <string>acquire_local_roles</string> </key> + <value> <int>1</int> </value> + </item> + <item> + <key> <string>content_icon</string> </key> + <value> + <none/> + </value> + </item> + <item> + <key> <string>description</string> </key> + <value> + <none/> + </value> + </item> + <item> + <key> <string>id</string> </key> + <value> <string>Software Instance Certificate Record</string> </value> + </item> + <item> + <key> <string>init_script</string> </key> + <value> + <none/> + </value> + </item> + <item> + <key> <string>permission</string> </key> + <value> + <none/> + </value> + </item> + <item> + <key> <string>portal_type</string> </key> + <value> <string>JSON Type</string> </value> + </item> + <item> + <key> <string>type_class</string> </key> + <value> <string>JSONType</string> </value> + </item> + <item> + <key> <string>type_interface</string> </key> + <value> + <tuple/> + </value> + </item> + <item> + <key> <string>type_mixin</string> </key> + <value> + <tuple/> + </value> + </item> + </dictionary> + </pickle> + </record> +</ZopeData> diff --git a/master/bt5/slapos_jio_api_style/PortalTypeWorkflowChainTemplateItem/workflow_chain_type.xml b/master/bt5/slapos_jio_api_style/PortalTypeWorkflowChainTemplateItem/workflow_chain_type.xml new file mode 100644 index 0000000000000000000000000000000000000000..a22d7de83f53b5d1717e41cc5838d748369a943b --- /dev/null +++ b/master/bt5/slapos_jio_api_style/PortalTypeWorkflowChainTemplateItem/workflow_chain_type.xml @@ -0,0 +1,6 @@ +<workflow_chain> + <chain> + <type>Software Instance Certificate Record</type> + <workflow>edit_workflow, validation_workflow</workflow> + </chain> +</workflow_chain> \ No newline at end of file diff --git a/master/bt5/slapos_jio_api_style/SkinTemplateItem/portal_skins/slapos_jio_api/SoftwareInstanceCertificateRecord_getSoftwareInstanceCertificatesAsJSON.py b/master/bt5/slapos_jio_api_style/SkinTemplateItem/portal_skins/slapos_jio_api/SoftwareInstanceCertificateRecord_getSoftwareInstanceCertificatesAsJSON.py new file mode 100644 index 0000000000000000000000000000000000000000..5c0510399ca4eed84031ba2b8be9955bd38256bb --- /dev/null +++ b/master/bt5/slapos_jio_api_style/SkinTemplateItem/portal_skins/slapos_jio_api/SoftwareInstanceCertificateRecord_getSoftwareInstanceCertificatesAsJSON.py @@ -0,0 +1,9 @@ +import json +software_instance = context.getParentValue() +return json.dumps({ + "$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) diff --git a/master/bt5/slapos_jio_api_style/SkinTemplateItem/portal_skins/slapos_jio_api/SoftwareInstanceCertificateRecord_getSoftwareInstanceCertificatesAsJSON.xml b/master/bt5/slapos_jio_api_style/SkinTemplateItem/portal_skins/slapos_jio_api/SoftwareInstanceCertificateRecord_getSoftwareInstanceCertificatesAsJSON.xml new file mode 100644 index 0000000000000000000000000000000000000000..2768b79efeabfe1e45135a6557eb8e034b9b4aec --- /dev/null +++ b/master/bt5/slapos_jio_api_style/SkinTemplateItem/portal_skins/slapos_jio_api/SoftwareInstanceCertificateRecord_getSoftwareInstanceCertificatesAsJSON.xml @@ -0,0 +1,62 @@ +<?xml version="1.0"?> +<ZopeData> + <record id="1" aka="AAAAAAAAAAE="> + <pickle> + <global name="PythonScript" module="Products.PythonScripts.PythonScript"/> + </pickle> + <pickle> + <dictionary> + <item> + <key> <string>Script_magic</string> </key> + <value> <int>3</int> </value> + </item> + <item> + <key> <string>_bind_names</string> </key> + <value> + <object> + <klass> + <global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/> + </klass> + <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, json_form</string> </value> + </item> + <item> + <key> <string>id</string> </key> + <value> <string>SoftwareInstanceCertificateRecord_getSoftwareInstanceCertificatesAsJSON</string> </value> + </item> + </dictionary> + </pickle> + </record> +</ZopeData> diff --git a/master/bt5/slapos_jio_api_style/SkinTemplateItem/portal_skins/slapos_jio_api/jIOWebSection_getObjectFromData.py b/master/bt5/slapos_jio_api_style/SkinTemplateItem/portal_skins/slapos_jio_api/jIOWebSection_getObjectFromData.py index 99b60e957c1877eee33e79d395be969208997199..851bfa29e3ee4f70a0c6cb8bba8b00161160fb1f 100644 --- a/master/bt5/slapos_jio_api_style/SkinTemplateItem/portal_skins/slapos_jio_api/jIOWebSection_getObjectFromData.py +++ b/master/bt5/slapos_jio_api_style/SkinTemplateItem/portal_skins/slapos_jio_api/jIOWebSection_getObjectFromData.py @@ -30,4 +30,17 @@ elif portal_type == "Software Instance": if software_instance: return software_instance +elif portal_type == "Software Instance Certificate Record": + if "reference" in data_dict: + software_instance = portal.portal_catalog.getSoftwareInstanceObject( + data_dict["reference"], + include_shared=True + ) + if software_instance: + return software_instance.newContent( + temp_object=True, + portal_type="Software Instance Certificate Record", + ) + + return None diff --git a/master/bt5/slapos_jio_api_style/bt/template_action_path_list b/master/bt5/slapos_jio_api_style/bt/template_action_path_list index fb112310a68593bbf2f3e98c22c7b6a6c5bdfe62..e9ee865f07789eaa7004c9095841bdfd63bd0fd2 100644 --- a/master/bt5/slapos_jio_api_style/bt/template_action_path_list +++ b/master/bt5/slapos_jio_api_style/bt/template_action_path_list @@ -3,6 +3,7 @@ Compute Node | slapos_jio_api_put_compute_node Slave Instance | slapos_jio_api_get_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 diff --git a/master/bt5/slapos_jio_api_style/bt/template_path_list b/master/bt5/slapos_jio_api_style/bt/template_path_list index 23181270cb735db34929851bef0ee6ee06841cd8..17bcebb87c7488ede69bf4da6446004b75cc811e 100644 --- a/master/bt5/slapos_jio_api_style/bt/template_path_list +++ b/master/bt5/slapos_jio_api_style/bt/template_path_list @@ -2,6 +2,7 @@ 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 diff --git a/master/bt5/slapos_jio_api_style/bt/template_portal_type_allowed_content_type_list b/master/bt5/slapos_jio_api_style/bt/template_portal_type_allowed_content_type_list new file mode 100644 index 0000000000000000000000000000000000000000..be31aae5a153de376bd1ab4f62da4cad34c3c8c8 --- /dev/null +++ b/master/bt5/slapos_jio_api_style/bt/template_portal_type_allowed_content_type_list @@ -0,0 +1 @@ +Software Instance | Software Instance Certificate Record \ No newline at end of file diff --git a/master/bt5/slapos_jio_api_style/bt/template_portal_type_id_list b/master/bt5/slapos_jio_api_style/bt/template_portal_type_id_list new file mode 100644 index 0000000000000000000000000000000000000000..9cb80051af3d7b90b45c6282440c19f21a721a00 --- /dev/null +++ b/master/bt5/slapos_jio_api_style/bt/template_portal_type_id_list @@ -0,0 +1 @@ +Software Instance Certificate Record \ No newline at end of file diff --git a/master/bt5/slapos_jio_api_style/bt/template_portal_type_property_sheet_list b/master/bt5/slapos_jio_api_style/bt/template_portal_type_property_sheet_list new file mode 100644 index 0000000000000000000000000000000000000000..f9fbb62f149dcc9da0b3fd2d284fecdb25962d08 --- /dev/null +++ b/master/bt5/slapos_jio_api_style/bt/template_portal_type_property_sheet_list @@ -0,0 +1 @@ +Software Instance Certificate Record | JSONTypeConstraint \ No newline at end of file diff --git a/master/bt5/slapos_jio_api_style/bt/template_portal_type_workflow_chain_list b/master/bt5/slapos_jio_api_style/bt/template_portal_type_workflow_chain_list new file mode 100644 index 0000000000000000000000000000000000000000..522d320cb6a79853656b9f2082d099513d8528a6 --- /dev/null +++ b/master/bt5/slapos_jio_api_style/bt/template_portal_type_workflow_chain_list @@ -0,0 +1,2 @@ +Software Instance Certificate Record | edit_workflow +Software Instance Certificate Record | validation_workflow \ No newline at end of file