Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ycai
simbricks
Commits
71762cda
Unverified
Commit
71762cda
authored
Jan 14, 2025
by
Jakob Görgen
Browse files
symphony/client: added call to update resource group
parent
413c0570
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
0 deletions
+21
-0
symphony/client/simbricks/client/client.py
symphony/client/simbricks/client/client.py
+21
-0
No files found.
symphony/client/simbricks/client/client.py
View file @
71762cda
...
@@ -378,6 +378,27 @@ class ResourceGroupClient:
...
@@ -378,6 +378,27 @@ class ResourceGroupClient:
async
with
self
.
_ns_client
.
post
(
url
=
"/resource_group"
,
json
=
obj
)
as
resp
:
async
with
self
.
_ns_client
.
post
(
url
=
"/resource_group"
,
json
=
obj
)
as
resp
:
return
await
resp
.
json
()
return
await
resp
.
json
()
async
def
update_rg
(
self
,
rg_id
:
int
,
label
:
str
|
None
=
None
,
available_cores
:
int
|
None
=
None
,
available_memory
:
int
|
None
=
None
,
cores_left
:
int
|
None
=
None
,
memory_left
:
int
|
None
=
None
,
)
->
dict
:
obj
=
{
"id"
:
rg_id
,
"label"
:
label
,
"available_cores"
:
available_cores
,
"available_memory"
:
available_memory
,
"cores_left"
:
cores_left
,
"memory_left"
:
memory_left
,
}
obj
=
utils_base
.
filter_None_dict
(
to_filter
=
obj
)
async
with
self
.
_ns_client
.
put
(
url
=
f
"/resource_group/
{
rg_id
}
"
,
json
=
obj
)
as
resp
:
return
await
resp
.
json
()
async
def
get_rg
(
self
,
rg_id
:
int
)
->
dict
:
async
def
get_rg
(
self
,
rg_id
:
int
)
->
dict
:
async
with
self
.
_ns_client
.
get
(
url
=
f
"/resource_group/
{
rg_id
}
"
)
as
resp
:
async
with
self
.
_ns_client
.
get
(
url
=
f
"/resource_group/
{
rg_id
}
"
)
as
resp
:
return
await
resp
.
json
()
return
await
resp
.
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