Vm Management
Management of Virtual Machines adds support of the following actions:
Action | Description |
---|---|
start |
Starts a VM |
stop |
Stops a VM |
suspend |
Suspends a VM |
refresh |
Refreshes a VM |
reset |
Resets a VM |
reboot_guest |
Reboots guest in VM |
shutdown_guest |
Shuts down guest in VM |
scan |
Scans a VM (Perform SmartState Analysis) |
set_owner |
Sets the owner of a VM |
add_event |
Adding an Event to a VM |
add_lifecycle_event |
Add a Lifecycle Event to a VM |
delete |
Deletes a VM in the Appliance |
Targeting VMs
These actions can be triggered on individual vm resources:
/api/vms/:id
As simply as POSTing the following action to a VM.
{
"action" : "start"
}
Requests can also be made on multiple vms by targetting the primary collection:
/api/vms
{
"action" : "start",
"resources" : [
{ "href" : "http://localhost:3000/api/vms/11" },
{ "href" : "http://localhost:3000/api/vms/12" },
...
]
}
Querying VMs
Virtual Machines are queried via the primary collection URL:
/api/vms
Filtering, sorting and paging as mentioned on the Querying page.
When querying vms, expanding the resources themselves as well as the following subcollections:
accounts |
software |
For example:
GET /api/vms?expand=resources,accounts,software
Or querying and individual vm
GET /api/vms/:id?expand=accounts,software
Adding an Event to a VM
{
"action" : "add_event",
"resource" : {
"event_type" : "...",
"event_message" : "...",
"event_time" : "UTC Time"
}
}
event_time above is optional. If skipped, current time will be used. |