API DocumentationComputer Actions
Initial a VM action
Perform an action on an existing VM. Set the type attribute to on of the supported action types:
| Action | Details |
|---|---|
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 : if VM shuts down before timeout, you get back a success response 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. |
Authorization
bearer_auth AuthorizationBearer <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
Path Parameters
vm_id*string
A unique identifier for a VM instance.
Format
uuidRequest Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
text/pain
application/json
application/json
application/json
curl -X POST "https://example.com/v1/vms/cc3ccab2-0ae2-11ef-9136-6a0922f6458b/actions" \ -H "Content-Type: application/json" \ -d '{ "type": "start" }'Empty
{ "errors": [ { "message": "'vcpus' field must be an integer", "field": "resource_id" } ]}"Access denied"{ "errors": [ { "message": "VM with ID 23 not found" } ]}{ "errors": [ { "message": "User not initialized (missing required fields in token), please init user by sending POST request to `/v1/init` then refresh your token\n" } ]}{ "errors": [ { "message": "VM with ID 23 not found" } ]}