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

Starting a VM

{
  "action" : "start"
}

Stopping a VM

{
  "action" : "stop"
}

Suspending a VM

{
  "action" : "suspend"
}

Refreshing a VM

{
  "action" : "refresh"
}

Resetting a VM

{
  "action" : "reset"
}

Rebooting guest in VM

{
  "action" : "reboot_guest"
}

Shuts down guest in VM

{
  "action" : "shutdown_guest"
}

Scanning a VM

{
  "action" : "scan"
}

Setting Owner of a VM

{
  "action" : "set_owner",
  "resource" : {
    "owner" : "admin"
  }
}

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.

Adding a Lifecycle Event to a VM

{
  "action" : "add_lifecycle_event",
  "resource" : {
    "event" : "...",
    "status" : "...",
    "message" : "...",
    "created_by" : "..."
  }
}

Deleting a VM

{
  "action" : "delete"
}

Or simply doing the following:

DELETE /api/vms/:id

Additional VM Management examples can be found on the main REST API Examples section.