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
Titouan Soulard
slapos.core
Commits
196fc996
Commit
196fc996
authored
Jul 19, 2022
by
Cédric Le Ninivin
Committed by
Titouan Soulard
Sep 21, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
slapos_jio_api_style: search instance return more information
parent
477be03a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
2 deletions
+14
-2
master/bt5/slapos_jio_api_style/SkinTemplateItem/portal_skins/slapos_jio_api/jIOWebSection_searchInstance.py
...rtal_skins/slapos_jio_api/jIOWebSection_searchInstance.py
+14
-2
No files found.
master/bt5/slapos_jio_api_style/SkinTemplateItem/portal_skins/slapos_jio_api/jIOWebSection_searchInstance.py
View file @
196fc996
portal_type
=
data_dict
[
"portal_type"
]
portal_type
=
data_dict
[
"portal_type"
]
portal
=
context
.
getPortalObject
()
portal
=
context
.
getPortalObject
()
slap_state_dict
=
{
"stop_requested"
:
"started"
,
"start_requested"
:
"stopped"
,
"destroy_requested"
:
"destroyed"
,
}
if
portal_type
==
"Software Instance"
:
if
portal_type
==
"Software Instance"
:
search_kw
=
{
search_kw
=
{
"portal_type"
:
"Software Instance"
,
"portal_type"
:
"Software Instance"
,
"validation_state"
:
"validated"
,
"validation_state"
:
"validated"
,
"select_list"
:
(
"title"
,
"reference"
,
"portal_type"
)
"select_list"
:
(
"title"
,
"reference"
,
"portal_type"
,
"slap_state"
,
"aggregate_reference"
,
"url_string"
)
}
}
if
"title"
in
data_dict
:
if
"title"
in
data_dict
:
...
@@ -19,13 +25,16 @@ if portal_type == "Software Instance":
...
@@ -19,13 +25,16 @@ if portal_type == "Software Instance":
"title"
:
x
.
title
,
"title"
:
x
.
title
,
"reference"
:
x
.
reference
,
"reference"
:
x
.
reference
,
"portal_type"
:
x
.
portal_type
,
"portal_type"
:
x
.
portal_type
,
"state"
:
slap_state_dict
.
get
(
x
.
slap_state
,
""
),
"compute_partition_id"
:
x
.
aggregate_reference
,
"software_release_uri"
:
x
.
url_string
,
}
for
x
in
portal
.
portal_catalog
(
**
search_kw
)]
}
for
x
in
portal
.
portal_catalog
(
**
search_kw
)]
elif
portal_type
==
"Shared Instance"
:
elif
portal_type
==
"Shared Instance"
:
search_kw
=
{
search_kw
=
{
"portal_type"
:
"Slave Instance"
,
"portal_type"
:
"Slave Instance"
,
"validation_state"
:
"validated"
,
"validation_state"
:
"validated"
,
"select_list"
:
(
"title"
,
"reference"
,
"portal_type"
)
"select_list"
:
(
"title"
,
"reference"
,
"portal_type"
,
"slap_state"
,
"aggregate_reference"
,
"url_string"
)
}
}
if
"host_instance_reference"
in
data_dict
:
if
"host_instance_reference"
in
data_dict
:
host_instance_list
=
portal
.
portal_catalog
(
host_instance_list
=
portal
.
portal_catalog
(
...
@@ -47,6 +56,9 @@ elif portal_type == "Shared Instance":
...
@@ -47,6 +56,9 @@ elif portal_type == "Shared Instance":
"title"
:
x
.
title
,
"title"
:
x
.
title
,
"reference"
:
x
.
reference
,
"reference"
:
x
.
reference
,
"portal_type"
:
x
.
portal_type
,
"portal_type"
:
x
.
portal_type
,
"state"
:
x
.
slap_state
,
"compute_partition_id"
:
x
.
aggregate_reference
,
"software_release_uri"
:
x
.
url_string
,
}
for
x
in
portal
.
portal_catalog
(
**
search_kw
)]
}
for
x
in
portal
.
portal_catalog
(
**
search_kw
)]
else
:
else
:
...
...
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