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
1
Merge Requests
1
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
Romain Courteaud
slapos.core
Commits
ab996469
Commit
ab996469
authored
Sep 28, 2023
by
Titouan Soulard
Committed by
Romain Courteaud
Nov 27, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
slapos_jio_api_style: update API to use project_reference
parent
2dbf4008
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
1 deletion
+18
-1
master/bt5/slapos_jio_api_style/SkinTemplateItem/portal_skins/slapos_jio_api/jIOWebSection_requestSoftwareInstance.py
...s/slapos_jio_api/jIOWebSection_requestSoftwareInstance.py
+2
-1
master/bt5/slapos_jio_api_style/TestTemplateItem/portal_components/test.erp5.testSlapOSJIOAPI.py
...plateItem/portal_components/test.erp5.testSlapOSJIOAPI.py
+16
-0
No files found.
master/bt5/slapos_jio_api_style/SkinTemplateItem/portal_skins/slapos_jio_api/jIOWebSection_requestSoftwareInstance.py
View file @
ab996469
...
@@ -48,7 +48,8 @@ try:
...
@@ -48,7 +48,8 @@ try:
instance_xml
=
castToStr
(
partition_parameter
),
instance_xml
=
castToStr
(
partition_parameter
),
shared
=
data_dict
.
get
(
"shared"
,
False
),
shared
=
data_dict
.
get
(
"shared"
,
False
),
sla_xml
=
castToStr
(
filter_kw
),
sla_xml
=
castToStr
(
filter_kw
),
state
=
data_dict
.
get
(
"state"
,
"started"
))
state
=
data_dict
.
get
(
"state"
,
"started"
),
project_reference
=
data_dict
.
get
(
"project_reference"
))
if
compute_node_id
and
compute_partition_id
:
if
compute_node_id
and
compute_partition_id
:
compute_partition
=
portal
.
portal_catalog
.
getComputePartitionObject
(
compute_partition
=
portal
.
portal_catalog
.
getComputePartitionObject
(
...
...
master/bt5/slapos_jio_api_style/TestTemplateItem/portal_components/test.erp5.testSlapOSJIOAPI.py
View file @
ab996469
...
@@ -975,11 +975,13 @@ class TestSlapOSSlapToolInstanceAccess(TestSlapOSJIOAPIMixin):
...
@@ -975,11 +975,13 @@ class TestSlapOSSlapToolInstanceAccess(TestSlapOSJIOAPIMixin):
try
:
try
:
requestInstance
=
instance
.
__class__
.
requestInstance
requestInstance
=
instance
.
__class__
.
requestInstance
project_reference
=
self
.
project
.
getReference
()
instance
.
__class__
.
requestInstance
=
calledRequestInstance
instance
.
__class__
.
requestInstance
=
calledRequestInstance
partition_id
=
instance
.
getAggregateValue
(
portal_type
=
'Compute Partition'
).
getReference
()
partition_id
=
instance
.
getAggregateValue
(
portal_type
=
'Compute Partition'
).
getReference
()
self
.
login
(
instance
.
getUserId
())
self
.
login
(
instance
.
getUserId
())
response_dict
=
self
.
postToApi
({
response_dict
=
self
.
postToApi
({
"portal_type"
:
"Software Instance"
,
"portal_type"
:
"Software Instance"
,
"project_reference"
:
project_reference
,
"software_release_uri"
:
"req_release"
,
"software_release_uri"
:
"req_release"
,
"software_type"
:
"req_type"
,
"software_type"
:
"req_type"
,
"title"
:
"req_reference"
,
"title"
:
"req_reference"
,
...
@@ -994,6 +996,7 @@ class TestSlapOSSlapToolInstanceAccess(TestSlapOSJIOAPIMixin):
...
@@ -994,6 +996,7 @@ class TestSlapOSSlapToolInstanceAccess(TestSlapOSJIOAPIMixin):
response
.
headers
.
get
(
'content-type'
))
response
.
headers
.
get
(
'content-type'
))
self
.
assertEqual
(
self
.
called_instance_request
,
{
self
.
assertEqual
(
self
.
called_instance_request
,
{
'instance_xml'
:
"<?xml version='1.0' encoding='utf-8'?>
\
n
<instance/>
\
n
"
,
'instance_xml'
:
"<?xml version='1.0' encoding='utf-8'?>
\
n
<instance/>
\
n
"
,
"project_reference"
:
project_reference
,
'software_title'
:
'req_reference'
,
'software_title'
:
'req_reference'
,
'software_release'
:
'req_release'
,
'software_release'
:
'req_release'
,
'state'
:
'started'
,
'state'
:
'started'
,
...
@@ -1021,11 +1024,13 @@ class TestSlapOSSlapToolInstanceAccess(TestSlapOSJIOAPIMixin):
...
@@ -1021,11 +1024,13 @@ class TestSlapOSSlapToolInstanceAccess(TestSlapOSJIOAPIMixin):
try
:
try
:
requestInstance
=
instance
.
__class__
.
requestInstance
requestInstance
=
instance
.
__class__
.
requestInstance
project_reference
=
self
.
project
.
getReference
()
instance
.
__class__
.
requestInstance
=
calledRequestInstance
instance
.
__class__
.
requestInstance
=
calledRequestInstance
partition_id
=
instance
.
getAggregateValue
(
portal_type
=
'Compute Partition'
).
getReference
()
partition_id
=
instance
.
getAggregateValue
(
portal_type
=
'Compute Partition'
).
getReference
()
self
.
login
(
instance
.
getUserId
())
self
.
login
(
instance
.
getUserId
())
response_dict
=
self
.
postToApi
({
response_dict
=
self
.
postToApi
({
"portal_type"
:
"Software Instance"
,
"portal_type"
:
"Software Instance"
,
"project_reference"
:
project_reference
,
"software_release_uri"
:
"req_release"
,
"software_release_uri"
:
"req_release"
,
"software_type"
:
"req_type"
,
"software_type"
:
"req_type"
,
"title"
:
"req_reference"
,
"title"
:
"req_reference"
,
...
@@ -1039,6 +1044,7 @@ class TestSlapOSSlapToolInstanceAccess(TestSlapOSJIOAPIMixin):
...
@@ -1039,6 +1044,7 @@ class TestSlapOSSlapToolInstanceAccess(TestSlapOSJIOAPIMixin):
response
.
headers
.
get
(
'content-type'
))
response
.
headers
.
get
(
'content-type'
))
self
.
assertEqual
(
self
.
called_instance_request
,
{
self
.
assertEqual
(
self
.
called_instance_request
,
{
'instance_xml'
:
"<?xml version='1.0' encoding='utf-8'?>
\
n
<instance/>
\
n
"
,
'instance_xml'
:
"<?xml version='1.0' encoding='utf-8'?>
\
n
<instance/>
\
n
"
,
"project_reference"
:
project_reference
,
'software_title'
:
'req_reference'
,
'software_title'
:
'req_reference'
,
'software_release'
:
'req_release'
,
'software_release'
:
'req_release'
,
'shared'
:
False
,
'shared'
:
False
,
...
@@ -1066,11 +1072,13 @@ class TestSlapOSSlapToolInstanceAccess(TestSlapOSJIOAPIMixin):
...
@@ -1066,11 +1072,13 @@ class TestSlapOSSlapToolInstanceAccess(TestSlapOSJIOAPIMixin):
try
:
try
:
requestInstance
=
instance
.
__class__
.
requestInstance
requestInstance
=
instance
.
__class__
.
requestInstance
project_reference
=
self
.
project
.
getReference
()
instance
.
__class__
.
requestInstance
=
calledRequestInstance
instance
.
__class__
.
requestInstance
=
calledRequestInstance
partition_id
=
instance
.
getAggregateValue
(
portal_type
=
'Compute Partition'
).
getReference
()
partition_id
=
instance
.
getAggregateValue
(
portal_type
=
'Compute Partition'
).
getReference
()
self
.
login
(
instance
.
getUserId
())
self
.
login
(
instance
.
getUserId
())
response_dict
=
self
.
postToApi
({
response_dict
=
self
.
postToApi
({
"portal_type"
:
"Software Instance"
,
"portal_type"
:
"Software Instance"
,
"project_reference"
:
project_reference
,
"software_release_uri"
:
"req_release"
,
"software_release_uri"
:
"req_release"
,
"software_type"
:
"req_type"
,
"software_type"
:
"req_type"
,
"title"
:
"req_reference"
,
"title"
:
"req_reference"
,
...
@@ -1085,6 +1093,7 @@ class TestSlapOSSlapToolInstanceAccess(TestSlapOSJIOAPIMixin):
...
@@ -1085,6 +1093,7 @@ class TestSlapOSSlapToolInstanceAccess(TestSlapOSJIOAPIMixin):
response
.
headers
.
get
(
'content-type'
))
response
.
headers
.
get
(
'content-type'
))
self
.
assertEqual
(
self
.
called_instance_request
,
{
self
.
assertEqual
(
self
.
called_instance_request
,
{
'instance_xml'
:
"<?xml version='1.0' encoding='utf-8'?>
\
n
<instance/>
\
n
"
,
'instance_xml'
:
"<?xml version='1.0' encoding='utf-8'?>
\
n
<instance/>
\
n
"
,
"project_reference"
:
project_reference
,
'software_title'
:
'req_reference'
,
'software_title'
:
'req_reference'
,
'software_release'
:
'req_release'
,
'software_release'
:
'req_release'
,
'shared'
:
False
,
'shared'
:
False
,
...
@@ -1409,10 +1418,12 @@ class TestSlapOSSlapToolPersonAccess(TestSlapOSJIOAPIMixin):
...
@@ -1409,10 +1418,12 @@ class TestSlapOSSlapToolPersonAccess(TestSlapOSJIOAPIMixin):
try
:
try
:
requestSoftwareInstance
=
self
.
person
.
__class__
.
requestSoftwareInstance
requestSoftwareInstance
=
self
.
person
.
__class__
.
requestSoftwareInstance
project_reference
=
self
.
project
.
getReference
()
self
.
person
.
__class__
.
requestSoftwareInstance
=
calledRequestInstance
self
.
person
.
__class__
.
requestSoftwareInstance
=
calledRequestInstance
self
.
login
(
self
.
person_user_id
)
self
.
login
(
self
.
person_user_id
)
response_dict
=
self
.
postToApi
({
response_dict
=
self
.
postToApi
({
"portal_type"
:
"Software Instance"
,
"portal_type"
:
"Software Instance"
,
"project_reference"
:
project_reference
,
"software_release_uri"
:
"req_release"
,
"software_release_uri"
:
"req_release"
,
"software_type"
:
"req_type"
,
"software_type"
:
"req_type"
,
"title"
:
"req_reference"
,
"title"
:
"req_reference"
,
...
@@ -1425,6 +1436,7 @@ class TestSlapOSSlapToolPersonAccess(TestSlapOSJIOAPIMixin):
...
@@ -1425,6 +1436,7 @@ class TestSlapOSSlapToolPersonAccess(TestSlapOSJIOAPIMixin):
response
.
headers
.
get
(
'content-type'
))
response
.
headers
.
get
(
'content-type'
))
self
.
assertEqual
(
self
.
called_instance_request
,
{
self
.
assertEqual
(
self
.
called_instance_request
,
{
'instance_xml'
:
"<?xml version='1.0' encoding='utf-8'?>
\
n
<instance/>
\
n
"
,
'instance_xml'
:
"<?xml version='1.0' encoding='utf-8'?>
\
n
<instance/>
\
n
"
,
'project_reference'
:
project_reference
,
'software_title'
:
'req_reference'
,
'software_title'
:
'req_reference'
,
'software_release'
:
'req_release'
,
'software_release'
:
'req_release'
,
'state'
:
'started'
,
'state'
:
'started'
,
...
@@ -1449,6 +1461,7 @@ class TestSlapOSSlapToolPersonAccess(TestSlapOSJIOAPIMixin):
...
@@ -1449,6 +1461,7 @@ class TestSlapOSSlapToolPersonAccess(TestSlapOSJIOAPIMixin):
try
:
try
:
requestSoftwareInstance
=
self
.
person
.
__class__
.
requestSoftwareInstance
requestSoftwareInstance
=
self
.
person
.
__class__
.
requestSoftwareInstance
project_reference
=
self
.
project
.
getReference
()
self
.
person
.
__class__
.
requestSoftwareInstance
=
calledRequestInstance
self
.
person
.
__class__
.
requestSoftwareInstance
=
calledRequestInstance
self
.
login
(
self
.
person_user_id
)
self
.
login
(
self
.
person_user_id
)
response_dict
=
self
.
postToApi
({
response_dict
=
self
.
postToApi
({
...
@@ -1456,6 +1469,7 @@ class TestSlapOSSlapToolPersonAccess(TestSlapOSJIOAPIMixin):
...
@@ -1456,6 +1469,7 @@ class TestSlapOSSlapToolPersonAccess(TestSlapOSJIOAPIMixin):
"software_release_uri"
:
"req_release"
,
"software_release_uri"
:
"req_release"
,
"software_type"
:
"req_type"
,
"software_type"
:
"req_type"
,
"title"
:
"req_reference"
,
"title"
:
"req_reference"
,
"project_reference"
:
project_reference
})
})
response
=
self
.
portal
.
REQUEST
.
RESPONSE
response
=
self
.
portal
.
REQUEST
.
RESPONSE
if
400
!=
response
.
getStatus
():
if
400
!=
response
.
getStatus
():
...
@@ -1464,6 +1478,7 @@ class TestSlapOSSlapToolPersonAccess(TestSlapOSJIOAPIMixin):
...
@@ -1464,6 +1478,7 @@ class TestSlapOSSlapToolPersonAccess(TestSlapOSJIOAPIMixin):
response
.
headers
.
get
(
'content-type'
))
response
.
headers
.
get
(
'content-type'
))
self
.
assertEqual
(
self
.
called_instance_request
,
{
self
.
assertEqual
(
self
.
called_instance_request
,
{
'instance_xml'
:
"<?xml version='1.0' encoding='utf-8'?>
\
n
<instance/>
\
n
"
,
'instance_xml'
:
"<?xml version='1.0' encoding='utf-8'?>
\
n
<instance/>
\
n
"
,
'project_reference'
:
project_reference
,
'software_title'
:
'req_reference'
,
'software_title'
:
'req_reference'
,
'software_release'
:
'req_release'
,
'software_release'
:
'req_release'
,
'state'
:
'started'
,
'state'
:
'started'
,
...
@@ -1498,6 +1513,7 @@ class TestSlapOSSlapToolPersonAccess(TestSlapOSJIOAPIMixin):
...
@@ -1498,6 +1513,7 @@ class TestSlapOSSlapToolPersonAccess(TestSlapOSJIOAPIMixin):
"software_release_uri"
:
instance
.
getUrlString
(),
"software_release_uri"
:
instance
.
getUrlString
(),
"software_type"
:
instance
.
getSourceReference
(),
"software_type"
:
instance
.
getSourceReference
(),
"title"
:
instance
.
getTitle
(),
"title"
:
instance
.
getTitle
(),
"project_reference"
:
self
.
project
.
getReference
()
})
})
response
=
self
.
portal
.
REQUEST
.
RESPONSE
response
=
self
.
portal
.
REQUEST
.
RESPONSE
...
...
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