...
Code Block |
---|
language | py |
---|
theme | DJango |
---|
title | Response Body |
---|
collapse | true |
---|
|
{
"data": {
"_links": {
"request": "https://vss-api.eis.utoronto.ca:8001/v2/request/change/7",
"task": "https://vss-api.eis.utoronto.ca:8001/v2/request/task/4ecfa88d-1d1a-44fa-bb9b-d0ab04c17691"
},
"message": "VM Change Request has been accepted for processing",
"name": "Accepted",
"state": "Submitted",
"status": 202
},
"meta": {
"time": "0.03387s",
"user": "jm"
}
} |
Delete
To delete a disk you must submit a DELETE request to /vm/<vm_uuid>/disk/<disk_number> with no request body as follows:
...
Code Block |
---|
language | py |
---|
theme | DJango |
---|
title | Response Body |
---|
collapse | true |
---|
|
{
"data": {
"_links": {
"request": "https://vss-api.eis.utoronto.ca:8001/v2/request/change/4",
"task": "https://vss-api.eis.utoronto.ca:8001/v2/request/task/e1f77e2d-7323-4f6c-a454-ce2450d7b635"
},
"message": "VM Change Request has been accepted for processing",
"name": "Accepted",
"state": "Submitted",
"status": 202
},
"meta": {
"time": "0.07853s",
"user": "jm"
}
} |
Virtual Machine Boot
Boot optionsThe time when you power on the virtual machine, shows up the BIOS and launches the guest operating system software can be unnoticeable, because by default VMware sets up 0ms as boot delay. However, you can edit boot delay options to change that amount of time or to force the virtual machine to enter the BIOS setup screen after power on. This is done using the Boot resource in the RESTful API /vm/<vm_uuid>/boot.
Resource | URI | Description | GET | POST | PUT | DELETE | OPTIONS* |
---|
Virtual Machine Boot Options | /vm/<vm_uuid>/boot | Virtual Machine Boot resource. Get and update boot configuration options. | | | | | |
Boot info
Showing what's currently configured as boot options is done by making a GET request to /vm/<vm_uuid>/boot as follows:
Code Block |
---|
|
http -a $TK GET "https://vss-api.eis.utoronto.ca:8001/v2/vm/50125d11-a8d6-2af7-c01e-dc6f6be0e607/boot"
curl -u $TK -X GET "https://vss-api.eis.utoronto.ca:8001/v2/vm/50125d11-a8d6-2af7-c01e-dc6f6be0e607/boot" |
The response from the API would look something like:
Code Block |
---|
|
HTTP/1.0 200 OK
Allow: PUT, HEAD, OPTIONS, GET
Content-Length: 366
Content-Type: application/json
Date: Wed, 27 Apr 2016 19:07:54 GMT
Server: Werkzeug/0.11.3 Python/2.7.10
X-RateLimit-Limit: 7200
X-RateLimit-Remaining: 7199
X-RateLimit-Reset: 1461787200 |
Code Block |
---|
language | py |
---|
theme | DJango |
---|
title | Response Body |
---|
collapse | true |
---|
|
{
"_links": {
"self": "https://vss-api.eis.utoronto.ca:8001/v2/vm/50125d11-a8d6-2af7-c01e-dc6f6be0e607/boot",
"vm": "https://vss-api.eis.utoronto.ca:8001/v2/vm/50125d11-a8d6-2af7-c01e-dc6f6be0e607/"
},
"data": {
"bootDelayMs": 5000,
"bootRetryDelayMs": 10000,
"enterBIOSSetup": false
},
"meta": {
"count": 3,
"time": "0.07022s",
"user": "jm"
}
} |
Boot Changes
Submitting a HTTP request using PUT to /vm/<vm_uuid>/boot is used to update two boot options: bootdelay, to change that amount of time from powering on to boot into the main device in milliseconds and bootbios, which will force to boot directly to the BIOS setup, boolean. The request body expected is a JSON object as follows:
Code Block |
---|
|
# boot delay data
{"attribute": "bootdelay",
"value": 10000}
# boot to bios data
{"attribute": "bootbios",
"value": true} |
Updating VMs boot delay can be done as shown below:
Code Block |
---|
|
http -a $TK PUT "https://vss-api.eis.utoronto.ca:8001/v2/vm/50125d11-a8d6-2af7-c01e-dc6f6be0e607/boot" attribute=bootdelay value=10000
curl -u $TK -X PUT "https://vss-api.eis.utoronto.ca:8001/v2/vm/50125d11-a8d6-2af7-c01e-dc6f6be0e607/boot" -d '{"attribute": "bootdelay", "value": 10000}' |
The response from the API would look something like:
Code Block |
---|
|
HTTP/1.0 202 ACCEPTED
Allow: PUT, HEAD, OPTIONS, GET
Content-Length: 397
Content-Type: application/json
Date: Wed, 27 Apr 2016 19:33:47 GMT
Location: https://vss-api.eis.utoronto.ca:8001/v2/request/task/f5de4b0d-6f00-44ae-870a-e2858134b6d0
X-RateLimit-Limit: 7200
X-RateLimit-Remaining: 7197
X-RateLimit-Reset: 1461787200 |
Code Block |
---|
language | py |
---|
theme | DJango |
---|
title | Response Body |
---|
collapse | true |
---|
|
{
"data": {
"_links": {
"request": "https://vss-api.eis.utoronto.ca:8001/v2/request/change/9",
"task": "https://vss-api.eis.utoronto.ca:8001/v2/request/task/f5de4b0d-6f00-44ae-870a-e2858134b6d0"
},
"message": "VM Change Request has been accepted for processing",
"name": "Accepted",
"state": "Submitted",
"status": 202
},
"meta": {
"time": "0.04164s",
"user": "jm"
}
} |
Virtual Machine Folder
Folder options
Resource | URI | Description | GET | POST | PUT | DELETE | OPTIONS* |
---|
Virtual Machine Folder | /vm/<vm_uuid>/folder | Virtual Machine containing Folder resource. Get and update containing folder. | | | | | |