api.vm.base
¶
/vm¶
-
api.vm.base.views.
vm_list
(*args, **kwargs)¶ List (
GET
) existing VMs.-
GET
/vm
¶ DC-bound?: Permissions: Asynchronous?: Parameters: - data.full (boolean) – Return list of objects with some VM details (default: false)
- data.extended (boolean) – Return list of objects with extended VM details (default: false)
- data.active (boolean) – Display currently active (on compute node) VM details (default: false)
- data.order_by (string) – Available fields for sorting:
hostname
(default:hostname
)
Status Codes: - 200 OK – SUCCESS
- 403 Forbidden – Forbidden
es get /vm
{ "url": "https://my.erigones.com/api/vm/", "status": 200, "method": "GET", "text": { "status": "SUCCESS", "result": [ "example2.cust.erigones.com", "example.cust.erigones.com" ], "task_id": "0-6f75849b-f2e0-4f1d-a891" } }
-
/vm/(hostname_or_uuid)¶
-
api.vm.base.views.
vm_manage
(*args, **kwargs)¶ Get (
GET
), create (deploy) (POST
), update (PUT
) or delete (DELETE
) a VM on a compute node. The VM must be defined.-
GET
/vm/
(hostname_or_uuid)¶ DC-bound?: Permissions: Asynchronous?: Parameters: - data.extended (boolean) – Display extended VM details (default: false)
- data.active (boolean) – Display currently active (on compute node) VM details (default: false)
Status Codes: - 200 OK – SUCCESS
- 403 Forbidden – Forbidden
- 404 Not Found – VM not found
-
POST
/vm/
(hostname_or_uuid)¶ DC-bound?: Permissions: Asynchronous?: Parameters: - hostname_or_uuid (string) – required - Server hostname or uuid
- data.recreate (boolean) – Delete and create the VM from scratch (default: false)
- data.force (boolean) – Must be true to force recreate (default: false)
Status Codes: - 200 OK – SUCCESS
- 201 Created – PENDING
- 400 Bad Request – FAILURE
- 403 Forbidden – Forbidden
- 404 Not Found – VM not found
- 409 Conflict – VM has pending tasks
- 417 Expectation Failed – Are you sure? (recreate=true, force=false)
- 423 Locked – Node is not operational / VM is already created / VM is not stopped (recreate=true) / VM is locked or has slave VMs (recreate=true)
- 424 Failed Dependency – Cannot import required image
- 428 – VM has no bootable disk / Could not find node with free resources / VM owner has no SSH keys available
-
PUT
/vm/
(hostname_or_uuid)¶ DC-bound?: Permissions: Asynchronous?: Parameters: - hostname_or_uuid (string) – required - Server hostname or uuid
- data.force (boolean) – If true, update VM definition according to current VM configuration on compute node
- data.node (string) – (EXPERIMENTAL feature) Name of the compute node on which VM is located - must be used used with force (requires SuperAdmin permission)
Status Codes: - 200 OK – SUCCESS
- 201 Created – PENDING
- 400 Bad Request – FAILURE
- 403 Forbidden – Forbidden
- 404 Not Found – VM not found
- 409 Conflict – VM has pending tasks
- 412 Precondition Failed – VM already has the requested node set in DB
- 417 Expectation Failed – VM has snapshots (disk size update)
- 423 Locked – Node is not operational / VM is not stopped or running / VM is locked or has slave VMs
- 424 Failed Dependency – Cannot import required image
- 428 – VM has to be stopped when updating disks or NICs
Warning
The node parameter should only be used in special cases, i.e. disaster recovery from backups, when the VM was restored manually on a different compute node. This action does not perform any resource checking on the target node in DB.
-
DELETE
/vm/
(hostname_or_uuid)¶ DC-bound?: Permissions: Asynchronous?: Parameters: - hostname_or_uuid (string) – required - Server hostname or uuid
Status Codes: - 200 OK – SUCCESS
- 201 Created – PENDING
- 400 Bad Request – FAILURE
- 403 Forbidden – Forbidden
- 404 Not Found – VM not found
- 409 Conflict – VM has pending tasks
- 423 Locked – Node is not operational / VM is not stopped / VM is locked or has slave VMs
es create /vm/example.cust.erigones.com
{ "url": "https://my.erigones.com/api/vm/example.cust.erigones.com/", "status": 200, "method": "POST", "text": { "status": "SUCCESS", "result": { "message": "Successfully created VM example.cust.erigones.com", "returncode": 0 }, "task_id": "0-e0b6801c-dad9-4481-9bb2" } }
-