Virtual Machine: Signal

The signal endpoint can be used to send signals to the machine (e.g., shutdown or key presses).

Signal requests can only be made against a powered-on virtual machine.

Endpoint

Relative to https://uk0.bigv.io

POST /accounts/{account-id}/groups/{group-id}/virtual_machines/{vm-id}/signal

Attributes

  • signal – this can be:
    • powerdown
    • reset
    • sendkey
  • data – only valid if the signal is sendkey. A dash-separated list of keys to press, e.g., a-b-c-ctrl-alt-delete

The valid keys can be found using the GET /definitions call (see the definitions page).

reset and powerdown are the ACPI signals of the same name.

powerdown is the same as pressing the soft power button on an ATX computer. This is operating system dependant, but would generally signal to the operating system to do a shut down and then turn off. Note that if the autoreboot_on attribute is set to true, the machine will be powered back up again immediately.

reset is similar to pressing the reset button on a real machine — it will instantly reboot the machine. It’s worth noting that the system restarts in the same process on the host machine, so any changes to the spec of a virtual machine which require a restart will not be applied using this. See the power section below for how to stop, start and reboot the machine.

Examples

Powerdown

Request
POST /accounts/myaccountname/groups/default/virtual_machines/45/signal?signal=powerdown
Curl
curl -H "Content-type: application/json" \
     -H "Authorization: Bearer {session-id}" \
     -X POST \
     -d '{"signal":"powerdown"}' \
     https://uk0.bigv.io/accounts/myaccountname/groups/default/virtual_machines/45/signal
Response (success: 200)
{
  "signal": "powerdown"
}

Send Keys

Request
POST /accounts/myaccountname/groups/default/virtual_machines/45/signal
Curl:
curl -H "Content-type: application/json" \
     -H "Authorization: Bearer {session-id}" \
     -X POST \
     -d '{"signal":"sendkey","data":"ctrl-alt-delete"}' \
     https://uk0.bigv.io/accounts/myaccountname/groups/default/virtual_machines/45/signal
Response (success: 200)
{
  "signal": "sendkey",
  "data": "ctrl-alt-delete"
}
Updated on May 22, 2019

Was this article helpful?

Related Articles

Have you tried Kubernetes?
Kubernetes (K8s) is helping enterprises to ship faster & scale their business. Sounds good? Let us build a K8s solution for your needs.
Register your interest