Logo
OpenScaler
API Documentation/Computer Actions

Initial a VM action

Perform an action on an existing VM. Set the type attribute to on of the supported action types:

ActionDetails
start Start a VM that isn't running
shutdown Attempt to gracefully shutdown a running VM. Normal shutdown may take some time because it simply sends a shutdown signal to the OS of the VM a few times and checks if the VM state has changed, the OS of the VM might ignore this call depending on its state (for example if its booting), there's 2 possibilities :
  1. if VM shuts down before timeout, you get back a success response
  2. if request timed out, the call will return 500 status even if the VM was actually in the process of shutting down
Either way, if error is due to timeout, a 408 timeout response is returned.
power_off Force stop a running VM. This will stop the VM immediately similar to cutting power on a server. This may lead to undesirable results like data loss.
reboot Attempts to reboot a VM that is currently running. Note that this will not force the reboot by default, but merely send a signal to the VM's operating system to reboot, this signal might be ignored by the OS (for instance if VM is not fully booted).
reset Reset a running VM. Similar to pressing the reset button on a machine. This may have undesirable results like data loss.
POST
/v1/vms/{vm_id}/actions

Authorization

AuthorizationRequiredBearer <token>

OAuth Authentication

OpenScaler API uses OAuth, a standard for secure authorization. To access the API, obtain a token via the OpenScaler Platform.

Use the access_token in the Authorization header for requests:

Authorization: Bearer <token>

Always keep your token secure and do not share it with anyone.

In: header

Request Body

application/jsonOptional
bodyobject | object & object

Path Parameters

vm_idRequiredstring

A unique identifier for a VM instance.

curl -X POST "https://api.alpha.openscaler.net/v1/vms/23/actions" \
  -H "Authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d '{
    "type": "start"
  }'

If action was performed successfully, an empty success response is returned.