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
e172af11
Commit
e172af11
authored
Jan 02, 2025
by
Romain Courteaud
🐙
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
slapos_json_rpc_api: drop requested_instance_list api
parent
56fa38cd
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
0 additions
and
113 deletions
+0
-113
master/bt5/slapos_json_rpc_api/PathTemplateItem/portal_callables/SoftwareInstance_updateFromJSON.xml
...Item/portal_callables/SoftwareInstance_updateFromJSON.xml
+0
-8
master/bt5/slapos_json_rpc_api/SkinTemplateItem/portal_skins/slapos_jio_api/SoftwareInstance_updateFromDict.py
...l_skins/slapos_jio_api/SoftwareInstance_updateFromDict.py
+0
-3
master/bt5/slapos_json_rpc_api/TestTemplateItem/portal_components/test.erp5.testSlapOSJsonRpc.py
...lateItem/portal_components/test.erp5.testSlapOSJsonRpc.py
+0
-102
No files found.
master/bt5/slapos_json_rpc_api/PathTemplateItem/portal_callables/SoftwareInstance_updateFromJSON.xml
View file @
e172af11
...
@@ -121,14 +121,6 @@
...
@@ -121,14 +121,6 @@
"const": "Software Instance",\n
"const": "Software Instance",\n
"type": "string"\n
"type": "string"\n
},\n
},\n
"requested_instance_list": {\n
"title": "Requested Instance List",\n
"type": "array",\n
"description": "List of the instances references requested by this instance. This is used to garbage collect instances that are no longer requested by this instance.",\n
"items": {\n
"type": "string"\n
}\n
},\n
"title": {\n
"title": {\n
"title": "New Title",\n
"title": "New Title",\n
"type": "string",\n
"type": "string",\n
...
...
master/bt5/slapos_json_rpc_api/SkinTemplateItem/portal_skins/slapos_jio_api/SoftwareInstance_updateFromDict.py
View file @
e172af11
...
@@ -42,9 +42,6 @@ if "reported_state" in data_dict:
...
@@ -42,9 +42,6 @@ if "reported_state" in data_dict:
else
:
else
:
raise
WrongReportedStateError
(
"Unexcepected Reported State: %s"
%
reported_state
)
raise
WrongReportedStateError
(
"Unexcepected Reported State: %s"
%
reported_state
)
if
"requested_instance_list"
in
data_dict
:
software_instance
.
updateRequestedInstanceList
(
data_dict
[
"requested_instance_list"
])
if
"title"
in
data_dict
and
data_dict
[
"title"
]
!=
software_instance
.
getTitle
():
if
"title"
in
data_dict
and
data_dict
[
"title"
]
!=
software_instance
.
getTitle
():
software_instance
.
rename
(
software_instance
.
rename
(
new_name
=
data_dict
[
"title"
],
new_name
=
data_dict
[
"title"
],
...
...
master/bt5/slapos_json_rpc_api/TestTemplateItem/portal_components/test.erp5.testSlapOSJsonRpc.py
View file @
e172af11
...
@@ -1296,108 +1296,6 @@ class TestSlapOSSlapToolInstanceAccess(TestSlapOSJsonRpcMixin):
...
@@ -1296,108 +1296,6 @@ class TestSlapOSSlapToolInstanceAccess(TestSlapOSJsonRpcMixin):
finally
:
finally
:
instance
.
__class__
.
requestInstance
=
requestInstance
instance
.
__class__
.
requestInstance
=
requestInstance
def
test_InstanceAccess_23_updateInstanceSuccessorList
(
self
):
self
.
_makeComplexComputeNode
(
self
.
project
)
self
.
login
(
self
.
start_requested_software_instance
.
getUserId
())
# Atach two software instances
instance_kw
=
dict
(
software_release
=
'http://a.release'
,
software_type
=
'type'
,
instance_xml
=
self
.
generateSafeXml
(),
sla_xml
=
self
.
generateSafeXml
(),
shared
=
False
,
software_title
=
'Instance0'
,
state
=
'started'
)
self
.
start_requested_software_instance
.
requestInstance
(
**
instance_kw
)
instance_kw
[
'software_title'
]
=
'Instance1'
self
.
start_requested_software_instance
.
requestInstance
(
**
instance_kw
)
self
.
tic
()
self
.
assertEqual
(
len
(
self
.
start_requested_software_instance
.
getSuccessorList
()),
2
)
self
.
assertSameSet
([
'Instance0'
,
'Instance1'
],
self
.
start_requested_software_instance
.
getSuccessorTitleList
())
# Update with no changes
self
.
callInstancePutToApiAndCheck
({
"portal_type"
:
"Software Instance"
,
"reference"
:
self
.
start_requested_software_instance
.
getReference
(),
"requested_instance_list"
:
[
"Instance0"
,
"Instance1"
],
})
self
.
tic
()
self
.
assertSameSet
([
'Instance0'
,
'Instance1'
],
self
.
start_requested_software_instance
.
getSuccessorTitleList
())
# Update Instance0 was not requested
self
.
callInstancePutToApiAndCheck
({
"portal_type"
:
"Software Instance"
,
"reference"
:
self
.
start_requested_software_instance
.
getReference
(),
"requested_instance_list"
:
[
"Instance1"
],
})
self
.
tic
()
self
.
assertSameSet
([
'Instance1'
],
self
.
start_requested_software_instance
.
getSuccessorTitleList
())
def
test_InstanceAccess_24_updateInstanceSuccessorList_one_child
(
self
):
self
.
_makeComplexComputeNode
(
self
.
project
)
self
.
login
(
self
.
start_requested_software_instance
.
getUserId
())
# Atach one software instance
instance_kw
=
dict
(
software_release
=
'http://a.release'
,
software_type
=
'type'
,
instance_xml
=
self
.
generateSafeXml
(),
sla_xml
=
self
.
generateSafeXml
(),
shared
=
False
,
software_title
=
'Instance0'
,
state
=
'started'
)
self
.
start_requested_software_instance
.
requestInstance
(
**
instance_kw
)
self
.
tic
()
self
.
assertEqual
(
len
(
self
.
start_requested_software_instance
.
getSuccessorList
()),
1
)
self
.
assertSameSet
([
'Instance0'
],
self
.
start_requested_software_instance
.
getSuccessorTitleList
())
self
.
callInstancePutToApiAndCheck
({
"portal_type"
:
"Software Instance"
,
"reference"
:
self
.
start_requested_software_instance
.
getReference
(),
"requested_instance_list"
:
[],
})
self
.
tic
()
self
.
assertEqual
([],
self
.
start_requested_software_instance
.
getSuccessorTitleList
())
def
test_InstanceAccess_25_updateInstanceSuccessorList_no_child
(
self
):
self
.
_makeComplexComputeNode
(
self
.
project
)
self
.
login
(
self
.
start_requested_software_instance
.
getUserId
())
self
.
assertEqual
([],
self
.
start_requested_software_instance
.
getSuccessorTitleList
())
self
.
callInstancePutToApiAndCheck
({
"portal_type"
:
"Software Instance"
,
"reference"
:
self
.
start_requested_software_instance
.
getReference
(),
"requested_instance_list"
:
[],
})
self
.
tic
()
self
.
assertEqual
([],
self
.
start_requested_software_instance
.
getSuccessorTitleList
())
# Try with something that doesn't exist
self
.
callInstancePutToApiAndCheck
({
"portal_type"
:
"Software Instance"
,
"reference"
:
self
.
start_requested_software_instance
.
getReference
(),
"requested_instance_list"
:
[
"instance0"
],
})
self
.
tic
()
self
.
assertEqual
([],
self
.
start_requested_software_instance
.
getSuccessorTitleList
())
def
test_InstanceAccess_26_stoppedComputePartition
(
self
):
def
test_InstanceAccess_26_stoppedComputePartition
(
self
):
with
PinnedDateTime
(
self
,
DateTime
(
'2020/05/19'
)):
with
PinnedDateTime
(
self
,
DateTime
(
'2020/05/19'
)):
# XXX Should reported_state added to Instance returned json?
# XXX Should reported_state added to Instance returned json?
...
...
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