REST API¶
Note
You need token to access REST API. Receiving a token is described in tab with additional information.
Sign API¶
Provides management of compute node and instance signatures.
Managing instance signatures¶
Methods for managing signatures of specific instances available to Administrators only.
Get signature for an instance.
Request¶
Request parameters:¶
Name | In | Type | Description |
---|---|---|---|
server_id | path | string | Virtual machine ID. |
Request example:¶
curl -X GET -H "X-Auth-Token: $token" http://controller:9362/v1/sign/$server_id
Response¶
Response parameters:¶
Name | In | Type | Description |
---|---|---|---|
id | body | integer | Signature ID. |
instance_name | body | string | Instance name of signed virtual machine, assigned by libvirt. |
server_id | body | string | Virtual machine ID. |
node_id | body | integer | Host ID. |
is_valid | body | string | Signature status of a virtual machine. Possible values
- true ;
- false ;
- unknown . |
created_at | body | string | Date and time of object creation. |
updated_at | body | string | Date and time of object editing. |
Example response in JSON format:
{
"sign": {
"id": 115,
"instance_name": "instance-00000068",
"server_id": "bdfe7b89-4d44-4edb-af5a-de8733aa3eba",
"node_id": 2,
"is_valid": "true",
"created_at": "Mon, 03 Jun 2024 10:45:36 GMT",
"updated_at": null
}
}
Get a list of all signatures for signed instances.
Request¶
Request parameters:¶
Name | In | Type | Description |
---|---|---|---|
offset (Optional) | path | integer | Position number for getting data. |
limit (Optional) | path | integer | Limiting the amount of data received. |
Request example:¶
curl -X GET -H "X-Auth-Token: $token" http://controller:9362/sign?$offset=0&$limit=10
Response¶
Response parameters:¶
Name | In | Type | Description |
---|---|---|---|
id | body | integer | Signature ID. |
instance_name | body | string | Instance name of signed virtual machine, assigned by libvirt. |
server_id | body | string | Virtual machine ID. |
node_id | body | integer | Host ID. |
is_valid | body | string | Signature status of a virtual machine. Possible values
- true ;
- false ;
- unknown . |
created_at | body | string | Date and time of object creation. |
updated_at | body | string | Date and time of object editing. |
Example response in JSON format:
{
"signs": [
{
"created_at": "Mon, 03 Jun 2024 10:45:35 GMT",
"id": 114,
"instance_name": "instance-00000069",
"is_valid": "true",
"node_id": 2,
"server_id": "ee57ad11-5c74-4e49-bf2d-46858570b3a1",
"updated_at": null
},
{
"created_at": "Mon, 03 Jun 2024 10:45:36 GMT",
"id": 115,
"instance_name": "instance-00000068",
"is_valid": "true",
"node_id": 2,
"server_id": "bdfe7b89-4d44-4edb-af5a-de8733aa3eba",
"updated_at": null
}
]
}
Create a signature for the specified instance
Request¶
Request parameters:¶
Name | In | Type | Description |
---|---|---|---|
server_id | body | string | Virtual machine ID. |
Request example:¶
curl -X POST -H "X-Auth-Token: $token" -H "Content-Type: application/json" -d "{\"server_id\": \"$server_id\"}" http://controller:9362/v1/sign
Response¶
Response parameters:¶
Name | In | Type | Description |
---|---|---|---|
id | body | integer | Signature ID. |
instance_name | body | string | Instance name of signed virtual machine, assigned by libvirt. |
server_id | body | string | Virtual machine ID. |
node_id | body | integer | Host ID. |
is_valid | body | string | Signature status of a virtual machine. Possible values
- true ;
- false ;
- unknown . |
created_at | body | string | Date and time of object creation. |
updated_at | body | string | Date and time of object editing. |
Example response in JSON format:
{
"sign": {
"created_at": "Mon, 03 Jun 2024 10:45:35 GMT",
"id": 114,
"instance_name": "instance-00000069",
"is_valid": "true",
"node_id": 2,
"server_id": "ee57ad11-5c74-4e49-bf2d-46858570b3a1",
"updated_at": null
}
}
Update the signature for the specified instance.
Request¶
Request parameters:¶
- server_id: server_id|body|required
Request example:¶
curl -X PUT -H "X-Auth-Token: $token" -H "Content-Type: application/json" -d "{\"server_id\": \"$server_id\"}" http://controller:9362/v1/sign
Response¶
Response parameters:¶
Name | In | Type | Description |
---|---|---|---|
id | body | integer | Signature ID. |
instance_name | body | string | Instance name of signed virtual machine, assigned by libvirt. |
server_id | body | string | Virtual machine ID. |
node_id | body | integer | Host ID. |
is_valid | body | string | Signature status of a virtual machine. Possible values
- true ;
- false ;
- unknown . |
created_at | body | string | Date and time of object creation. |
updated_at | body | string | Date and time of object editing. |
Example response in JSON format:
{
"sign": {
"created_at": "Mon, 03 Jun 2024 10:45:35 GMT",
"id": 114,
"instance_name": "instance-00000069",
"is_valid": "true",
"node_id": 2,
"server_id": "ee57ad11-5c74-4e49-bf2d-46858570b3a1",
"updated_at": "Mon, 03 Jun 2024 13:53:12 GMT"
}
}
Managing node validation¶
Enable or disable validation on the specified compute node.
Request¶
Request parameters:¶
Name | In | Type | Description |
---|---|---|---|
node_id | path | integer | Host ID. |
action | body | string | Enabling/disabling validation on a node. Possible values
- activate ;
- deactivate . |
Request example:¶
curl -X GET -H "X-Auth-Token: $token" -H "Content-Type: application/json" -d "{\"action\": \"$action\"}" "http://controller:9362/v1/sign/node/$node_id/action"
Response¶
Response parameters:¶
Name | In | Type | Description |
---|---|---|---|
success | body | string | Signature request status for enabling/disabling validation on a node. |
task_id | body | string | Celery task ID. |
node_id | body | integer | Host ID. |
action | body | string | Enabling/disabling validation on a node. Possible values
- activate ;
- deactivate . |
Example response in JSON format:
{
"action": "activate",
"node_id": 1,
"success": true,
"task_id": "5e14e381-f98b-475e-8b19-7bd77bde8701"
}