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
71e6b40c
Commit
71e6b40c
authored
1 year ago
by
Titouan Soulard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
slapos_jio_api_style: update API to use project_reference
parent
42c494e2
Changes
2
Show 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 @
71e6b40c
...
...
@@ -48,7 +48,8 @@ try:
instance_xml
=
castToStr
(
partition_parameter
),
shared
=
data_dict
.
get
(
"shared"
,
False
),
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
:
compute_partition
=
portal
.
portal_catalog
.
getComputePartitionObject
(
...
...
This diff is collapsed.
Click to expand it.
master/bt5/slapos_jio_api_style/TestTemplateItem/portal_components/test.erp5.testSlapOSJIOAPI.py
View file @
71e6b40c
...
...
@@ -975,11 +975,13 @@ class TestSlapOSSlapToolInstanceAccess(TestSlapOSJIOAPIMixin):
try
:
requestInstance
=
instance
.
__class__
.
requestInstance
project_reference
=
self
.
project
.
getReference
()
instance
.
__class__
.
requestInstance
=
calledRequestInstance
partition_id
=
instance
.
getAggregateValue
(
portal_type
=
'Compute Partition'
).
getReference
()
self
.
login
(
instance
.
getUserId
())
response_dict
=
self
.
postToApi
({
"portal_type"
:
"Software Instance"
,
"project_reference"
:
project_reference
,
"software_release_uri"
:
"req_release"
,
"software_type"
:
"req_type"
,
"title"
:
"req_reference"
,
...
...
@@ -994,6 +996,7 @@ class TestSlapOSSlapToolInstanceAccess(TestSlapOSJIOAPIMixin):
response
.
headers
.
get
(
'content-type'
))
self
.
assertEqual
(
self
.
called_instance_request
,
{
'instance_xml'
:
"<?xml version='1.0' encoding='utf-8'?>
\
n
<instance/>
\
n
"
,
"project_reference"
:
project_reference
,
'software_title'
:
'req_reference'
,
'software_release'
:
'req_release'
,
'state'
:
'started'
,
...
...
@@ -1021,11 +1024,13 @@ class TestSlapOSSlapToolInstanceAccess(TestSlapOSJIOAPIMixin):
try
:
requestInstance
=
instance
.
__class__
.
requestInstance
project_reference
=
self
.
project
.
getReference
()
instance
.
__class__
.
requestInstance
=
calledRequestInstance
partition_id
=
instance
.
getAggregateValue
(
portal_type
=
'Compute Partition'
).
getReference
()
self
.
login
(
instance
.
getUserId
())
response_dict
=
self
.
postToApi
({
"portal_type"
:
"Software Instance"
,
"project_reference"
:
project_reference
,
"software_release_uri"
:
"req_release"
,
"software_type"
:
"req_type"
,
"title"
:
"req_reference"
,
...
...
@@ -1039,6 +1044,7 @@ class TestSlapOSSlapToolInstanceAccess(TestSlapOSJIOAPIMixin):
response
.
headers
.
get
(
'content-type'
))
self
.
assertEqual
(
self
.
called_instance_request
,
{
'instance_xml'
:
"<?xml version='1.0' encoding='utf-8'?>
\
n
<instance/>
\
n
"
,
"project_reference"
:
project_reference
,
'software_title'
:
'req_reference'
,
'software_release'
:
'req_release'
,
'shared'
:
False
,
...
...
@@ -1066,11 +1072,13 @@ class TestSlapOSSlapToolInstanceAccess(TestSlapOSJIOAPIMixin):
try
:
requestInstance
=
instance
.
__class__
.
requestInstance
project_reference
=
self
.
project
.
getReference
()
instance
.
__class__
.
requestInstance
=
calledRequestInstance
partition_id
=
instance
.
getAggregateValue
(
portal_type
=
'Compute Partition'
).
getReference
()
self
.
login
(
instance
.
getUserId
())
response_dict
=
self
.
postToApi
({
"portal_type"
:
"Software Instance"
,
"project_reference"
:
project_reference
,
"software_release_uri"
:
"req_release"
,
"software_type"
:
"req_type"
,
"title"
:
"req_reference"
,
...
...
@@ -1085,6 +1093,7 @@ class TestSlapOSSlapToolInstanceAccess(TestSlapOSJIOAPIMixin):
response
.
headers
.
get
(
'content-type'
))
self
.
assertEqual
(
self
.
called_instance_request
,
{
'instance_xml'
:
"<?xml version='1.0' encoding='utf-8'?>
\
n
<instance/>
\
n
"
,
"project_reference"
:
project_reference
,
'software_title'
:
'req_reference'
,
'software_release'
:
'req_release'
,
'shared'
:
False
,
...
...
@@ -1409,10 +1418,12 @@ class TestSlapOSSlapToolPersonAccess(TestSlapOSJIOAPIMixin):
try
:
requestSoftwareInstance
=
self
.
person
.
__class__
.
requestSoftwareInstance
project_reference
=
self
.
project
.
getReference
()
self
.
person
.
__class__
.
requestSoftwareInstance
=
calledRequestInstance
self
.
login
(
self
.
person_user_id
)
response_dict
=
self
.
postToApi
({
"portal_type"
:
"Software Instance"
,
"project_reference"
:
project_reference
,
"software_release_uri"
:
"req_release"
,
"software_type"
:
"req_type"
,
"title"
:
"req_reference"
,
...
...
@@ -1425,6 +1436,7 @@ class TestSlapOSSlapToolPersonAccess(TestSlapOSJIOAPIMixin):
response
.
headers
.
get
(
'content-type'
))
self
.
assertEqual
(
self
.
called_instance_request
,
{
'instance_xml'
:
"<?xml version='1.0' encoding='utf-8'?>
\
n
<instance/>
\
n
"
,
'project_reference'
:
project_reference
,
'software_title'
:
'req_reference'
,
'software_release'
:
'req_release'
,
'state'
:
'started'
,
...
...
@@ -1449,6 +1461,7 @@ class TestSlapOSSlapToolPersonAccess(TestSlapOSJIOAPIMixin):
try
:
requestSoftwareInstance
=
self
.
person
.
__class__
.
requestSoftwareInstance
project_reference
=
self
.
project
.
getReference
()
self
.
person
.
__class__
.
requestSoftwareInstance
=
calledRequestInstance
self
.
login
(
self
.
person_user_id
)
response_dict
=
self
.
postToApi
({
...
...
@@ -1456,6 +1469,7 @@ class TestSlapOSSlapToolPersonAccess(TestSlapOSJIOAPIMixin):
"software_release_uri"
:
"req_release"
,
"software_type"
:
"req_type"
,
"title"
:
"req_reference"
,
"project_reference"
:
project_reference
})
response
=
self
.
portal
.
REQUEST
.
RESPONSE
if
400
!=
response
.
getStatus
():
...
...
@@ -1464,6 +1478,7 @@ class TestSlapOSSlapToolPersonAccess(TestSlapOSJIOAPIMixin):
response
.
headers
.
get
(
'content-type'
))
self
.
assertEqual
(
self
.
called_instance_request
,
{
'instance_xml'
:
"<?xml version='1.0' encoding='utf-8'?>
\
n
<instance/>
\
n
"
,
'project_reference'
:
project_reference
,
'software_title'
:
'req_reference'
,
'software_release'
:
'req_release'
,
'state'
:
'started'
,
...
...
@@ -1498,6 +1513,7 @@ class TestSlapOSSlapToolPersonAccess(TestSlapOSJIOAPIMixin):
"software_release_uri"
:
instance
.
getUrlString
(),
"software_type"
:
instance
.
getSourceReference
(),
"title"
:
instance
.
getTitle
(),
"project_reference"
:
self
.
project
.
getReference
()
})
response
=
self
.
portal
.
REQUEST
.
RESPONSE
...
...
This diff is collapsed.
Click to expand it.
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