Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
slapos.core
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Paul Graydon
slapos.core
Commits
7bf7785f
Commit
7bf7785f
authored
Jun 22, 2022
by
Cédric Le Ninivin
Committed by
Cédric Le Ninivin
Mar 09, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
slapos_jio_api_style: Add search functions for software installation and instance
parent
530ff9c7
Changes
10
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
564 additions
and
2 deletions
+564
-2
master/bt5/slapos_jio_api_style/ActionTemplateItem/portal_types/jIO%20Web%20Section/slapos_jio_api_search_instance.xml
...es/jIO%20Web%20Section/slapos_jio_api_search_instance.xml
+81
-0
master/bt5/slapos_jio_api_style/ActionTemplateItem/portal_types/jIO%20Web%20Section/slapos_jio_api_search_software_installation.xml
...20Section/slapos_jio_api_search_software_installation.xml
+81
-0
master/bt5/slapos_jio_api_style/PathTemplateItem/portal_callables/jIOWebSection_searchInstanceFromJSON.xml
...portal_callables/jIOWebSection_searchInstanceFromJSON.xml
+112
-0
master/bt5/slapos_jio_api_style/PathTemplateItem/portal_callables/jIOWebSection_searchSoftwareInstallationFromJSON.xml
...bles/jIOWebSection_searchSoftwareInstallationFromJSON.xml
+114
-0
master/bt5/slapos_jio_api_style/SkinTemplateItem/portal_skins/slapos_jio_api/jIOWebSection_searchInstance.py
...rtal_skins/slapos_jio_api/jIOWebSection_searchInstance.py
+23
-0
master/bt5/slapos_jio_api_style/SkinTemplateItem/portal_skins/slapos_jio_api/jIOWebSection_searchInstance.xml
...tal_skins/slapos_jio_api/jIOWebSection_searchInstance.xml
+62
-0
master/bt5/slapos_jio_api_style/SkinTemplateItem/portal_skins/slapos_jio_api/jIOWebSection_searchSoftwareInstallation.py
...lapos_jio_api/jIOWebSection_searchSoftwareInstallation.py
+23
-0
master/bt5/slapos_jio_api_style/SkinTemplateItem/portal_skins/slapos_jio_api/jIOWebSection_searchSoftwareInstallation.xml
...apos_jio_api/jIOWebSection_searchSoftwareInstallation.xml
+62
-0
master/bt5/slapos_jio_api_style/bt/template_action_path_list
master/bt5/slapos_jio_api_style/bt/template_action_path_list
+3
-1
master/bt5/slapos_jio_api_style/bt/template_path_list
master/bt5/slapos_jio_api_style/bt/template_path_list
+3
-1
No files found.
master/bt5/slapos_jio_api_style/ActionTemplateItem/portal_types/jIO%20Web%20Section/slapos_jio_api_search_instance.xml
0 → 100644
View file @
7bf7785f
<?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>
master/bt5/slapos_jio_api_style/ActionTemplateItem/portal_types/jIO%20Web%20Section/slapos_jio_api_search_software_installation.xml
0 → 100644
View file @
7bf7785f
<?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>
master/bt5/slapos_jio_api_style/PathTemplateItem/portal_callables/jIOWebSection_searchInstanceFromJSON.xml
0 → 100644
View file @
7bf7785f
<?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_searchInstance
</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>
jIOWebSection_searchInstanceFromJSON
</string>
</value>
</item>
<item>
<key>
<string>
description
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
jIOWebSection_searchInstanceFromJSON
</string>
</value>
</item>
<item>
<key>
<string>
output_schema
</string>
</key>
<value>
<string>
{\n
"$schema": "http://json-schema.org/draft-07/schema#",\n
"title": "allDocs: Response Payload",\n
"description": "Payload returned by allDocs method.",\n
"properties": {\n
"result_list": {\n
"title": "Result List",\n
"description": "Contains a representation of the items",\n
"type": "array",\n
"items": {\n
"type": "object",\n
"title": "Item",\n
"properties": {\n
"reference": {\n
"title": "Software Instance Reference",\n
"description": "Unique identifier of the Software Instance",\n
"type": "string"\n
},\n
"title": {\n
"title": "Unique Title of the Instance",\n
"type": "string"\n
},\n
"portal_type": {\n
"title": "Portal Type",\n
"const": "Software Instance",\n
"type": "string"\n
}\n
}\n
}\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
"$id": "software-instance-base-schema.json",\n
"title": "Software Instance",\n
"description": "Software Instance",\n
"type": "object",\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
"root_instante_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
"portal_type": {\n
"title": "Portal Type",\n
"const": "Software Instance",\n
"type": "string"\n
}\n
},\n
"required": ["portal_type"]\n
}\n
</string>
</value>
</item>
<item>
<key>
<string>
version
</string>
</key>
<value>
<string>
001
</string>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
master/bt5/slapos_jio_api_style/PathTemplateItem/portal_callables/jIOWebSection_searchSoftwareInstallationFromJSON.xml
0 → 100644
View file @
7bf7785f
<?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_searchSoftwareInstallation
</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>
jIOWebSection_searchSoftwareInstallationFromJSON
</string>
</value>
</item>
<item>
<key>
<string>
description
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
jIOWebSection_searchSoftwareInstallationFromJSON
</string>
</value>
</item>
<item>
<key>
<string>
output_schema
</string>
</key>
<value>
<string>
{\n
"$schema": "http://json-schema.org/draft-07/schema#",\n
"title": "allDocs: Response Payload",\n
"description": "Payload returned by allDocs method.",\n
"properties": {\n
"result_list": {\n
"title": "Result List",\n
"description": "Contains a representation of the items",\n
"type": "array",\n
"items": {\n
"type": "object",\n
"title": "Item",\n
"properties": {\n
"software_release_uri": {\n
"title": "Software Release URI",\n
"type": "string",\n
"format": "uri-reference"\n
},\n
"compute_node_id": {\n
"title": "Compute Node ID",\n
"type": "string",\n
"description": "The Id of the compute node, example: COMP-1234"\n
},\n
"portal_type": {\n
"title": "Portal Type",\n
"const": "Software Installation",\n
"type": "string"\n
},\n
"state": {\n
"title": "Requested State",\n
"type": "string",\n
"enum": ["available", "destroyed"],\n
"description": "State of the requested software",\n
"default": "available"\n
}\n
}\n
}\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
"$id": "software-instance-base-schema.json",\n
"title": "Software Instance",\n
"description": "Software Instance",\n
"type": "object",\n
"properties": {\n
"software_release_uri": {\n
"title": "Software Release URI",\n
"type": "string",\n
"format": "uri-reference"\n
},\n
"compute_node_id": {\n
"title": "Compute Node ID",\n
"type": "string",\n
"description": "The Id of the compute node, example: COMP-1234"\n
},\n
"portal_type": {\n
"title": "Portal Type",\n
"const": "Software Installation",\n
"type": "string"\n
}\n
},\n
"required": ["portal_type"]\n
}\n
</string>
</value>
</item>
<item>
<key>
<string>
version
</string>
</key>
<value>
<string>
001
</string>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
master/bt5/slapos_jio_api_style/SkinTemplateItem/portal_skins/slapos_jio_api/jIOWebSection_searchInstance.py
0 → 100644
View file @
7bf7785f
search_kw
=
{
"portal_type"
:
"Software Instance"
,
"validation_state"
:
"validated"
,
"select_list"
:
(
"title"
,
"reference"
,
"portal_type"
)
}
if
"title"
in
data_dict
:
search_kw
[
"title"
]
=
data_dict
[
"title"
]
if
"compute_node_id"
in
data_dict
:
search_kw
[
"aggregate_parent_reference"
]
=
data_dict
[
"compute_node_id"
]
if
"root_instante_title"
in
data_dict
:
search_kw
[
"strict_specialise_title"
]
=
data_dict
[
"root_instante_title"
]
result_list
=
[{
"title"
:
x
.
title
,
"reference"
:
x
.
reference
,
"portal_type"
:
x
.
portal_type
,
}
for
x
in
context
.
getPortalObject
().
portal_catalog
(
**
search_kw
)]
import
json
return
json
.
dumps
({
"$schema"
:
json_form
.
absolute_url
().
strip
()
+
"/getOutputJSONSchema"
,
"result_list"
:
result_list
},
indent
=
2
)
master/bt5/slapos_jio_api_style/SkinTemplateItem/portal_skins/slapos_jio_api/jIOWebSection_searchInstance.xml
0 → 100644
View file @
7bf7785f
<?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>
jIOWebSection_searchInstance
</string>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
master/bt5/slapos_jio_api_style/SkinTemplateItem/portal_skins/slapos_jio_api/jIOWebSection_searchSoftwareInstallation.py
0 → 100644
View file @
7bf7785f
search_kw
=
{
"portal_type"
:
"Software Installation"
,
"validation_state"
:
"validated"
,
"select_list"
:
(
"aggregate_reference"
,
"url_string"
,
"slap_state"
,
"portal_type"
),
}
if
"software_release_uri"
in
data_dict
:
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"
]
result_list
=
[{
"software_release_uri"
:
x
.
url_string
,
"compute_node_id"
:
x
.
aggregate_reference
,
"state"
:
x
.
slap_state
,
"portal_type"
:
x
.
portal_type
,
}
for
x
in
context
.
getPortalObject
().
portal_catalog
(
**
search_kw
)]
import
json
return
json
.
dumps
({
"$schema"
:
json_form
.
absolute_url
().
strip
()
+
"/getOutputJSONSchema"
,
"result_list"
:
result_list
},
indent
=
2
)
master/bt5/slapos_jio_api_style/SkinTemplateItem/portal_skins/slapos_jio_api/jIOWebSection_searchSoftwareInstallation.xml
0 → 100644
View file @
7bf7785f
<?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>
jIOWebSection_searchSoftwareInstallation
</string>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
master/bt5/slapos_jio_api_style/bt/template_action_path_list
View file @
7bf7785f
...
@@ -2,4 +2,6 @@ Software Installation | slapos_jio_api_put_software_installation
...
@@ -2,4 +2,6 @@ Software Installation | slapos_jio_api_put_software_installation
Software Instance | slapos_jio_api_get_software_instance
Software Instance | slapos_jio_api_get_software_instance
jIO Web Section | slapos_jio_api_create_compute_node
jIO Web Section | slapos_jio_api_create_compute_node
jIO Web Section | slapos_jio_api_create_software_installation
jIO Web Section | slapos_jio_api_create_software_installation
jIO Web Section | slapos_jio_api_request_software_instance
jIO Web Section | slapos_jio_api_request_software_instance
\ No newline at end of file
jIO Web Section | slapos_jio_api_search_instance
jIO Web Section | slapos_jio_api_search_software_installation
\ No newline at end of file
master/bt5/slapos_jio_api_style/bt/template_path_list
View file @
7bf7785f
...
@@ -2,4 +2,6 @@ portal_callables/SoftwareInstallation_updateFromJSON
...
@@ -2,4 +2,6 @@ portal_callables/SoftwareInstallation_updateFromJSON
portal_callables/SoftwareInstance_getFromJSON
portal_callables/SoftwareInstance_getFromJSON
portal_callables/jIOWebSection_createComputeNodeFromJSON
portal_callables/jIOWebSection_createComputeNodeFromJSON
portal_callables/jIOWebSection_createSoftwareInstallationFromJSON
portal_callables/jIOWebSection_createSoftwareInstallationFromJSON
portal_callables/jIOWebSection_requestComputerPartitionFromJSON
portal_callables/jIOWebSection_requestComputerPartitionFromJSON
\ No newline at end of file
portal_callables/jIOWebSection_searchInstanceFromJSON
portal_callables/jIOWebSection_searchSoftwareInstallationFromJSON
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment