k8s_client.views.groups¶
Module Contents¶
Functions¶
|
Get groups list |
Create a new group |
|
|
Delete a group |
|
updates a group |
- k8s_client.views.groups.get_groups(name=None)¶
Get groups list
Parameters¶
"name"string (optional)The name of the group of which showing the details.
Returns¶
[code: 200]JSON containing the full list of groups if_nameis None[code: 200]JSON containing the detail of the specified group ifnameis a <valid value>[code: 404]Error message ifnameis NOT a <valid value>
Notes¶
To each returned group will be added the context details
Examples¶
>>> [ { "contexts": [ { "cluster_id": 1, "cost": 0, "id": 1, "kubeuser_id": 1, "max_cores_for_single_job": 105, "name": "context.dev.k8s.master.dafni.hydra.org.uk", "namespace": "default" } ], "id": 1, "name": "umwrg" } ]
- k8s_client.views.groups.post_group()¶
Create a new group
Parameters¶
- Request Bodyjson
- JSON containing data for the group:
"name"stringThe name of the group to create
"contexts"list [dict]List of dictionaries of the contexts to attach to the group, eventually empty It can contain the name or the id of the contexts. The name has higher priority, meaning if it is defined, the id is ignored If the context is not found, the group will be inserted anyway without contexts
Returns¶
[code: 409]Error message ifnameis already inside the DB[code: 406]Error message ifINPUTis NOT a <valid json>[code: 200]Empty array ifINPUTis valid
Examples¶
>>> Body = { "name": "test5", "contexts": [{"id":1}] }
>>> Body = { "name": "test15", "contexts": [{"name":"context-test"}] }
- k8s_client.views.groups.delete_group(id=None)¶
Delete a group
Parameters¶
"id": intThe id of the group to delete
Returns¶
Error message with return code 409 if there is an integrity error
Error message with return code 404 if
idis NOT a <valid value>JSON containing the deleted group id with return code 200 if
INPUTis valid
- k8s_client.views.groups.update_group(id=None)¶
updates a group
Parameters¶
"id"intThe id of the group to update
- Request Bodyjson
- JSON containing data for the group:
"name": stringThe name of the group to update
"contexts"list [dict]List of dictionaries of the contexts to attach to the group, eventually empty It can contain the name or the id of the contexts. The name has higher priority, meaning if it is defined, the id is ignored If the context is not found, the group will be inserted anyway without contexts
Returns¶
[code: 404]Error message ifidis not inside the DB[code: 406]Error message ifINPUTis NOT a <valid json>[code: 409]Error message if there is an integrity error[code: 200]Empty array ifINPUTis valid
Examples¶
>>> Body = { "name": "test5", "contexts": [{"id":1}] }
>>> Body = { "name": "test15", "contexts": [{"name":"context-test"}] }