- Method:
POST
- Path:
/v1/orgs/{org}/compute/vms/{vm_id}/scheduled-actions
- Operation ID:
scheduleVmRestart
- Tag: Compute
Send Authorization: Bearer <credential>. The credential is either an API key (vsk_…) created for an organization, or an OIDC access token obtained by signing in to VirtScale.
| Name |
Type |
Required |
Description |
vm_id |
string (uuid) |
Yes |
VirtScale instance id |
org |
string (uuid) |
Yes |
The organization’s id. |
Content type application/json, schema ScheduleRestartRequest, required.
| Field |
Type |
Required |
Enum |
Description |
action |
string |
No |
reboot |
|
day_of_month |
integer, nullable |
No |
|
kind=monthly: 1 to 28, so that it happens in every month. |
day_of_week |
integer, nullable |
No |
|
kind=weekly: 0 = Monday .. 6 = Sunday. |
kind |
string |
Yes |
once, weekly, monthly |
|
run_at |
string (date-time), nullable |
No |
|
kind=once: an instant, with its offset. |
time_of_day |
string (time), nullable |
No |
|
weekly and monthly: a wall-clock time such as 03:00. |
timezone |
string |
No |
|
The IANA timezone the wall-clock time is kept in. |
| Field |
Type |
Required |
Enum |
Description |
action |
string |
Yes |
|
reboot. |
created_at |
string (date-time) |
Yes |
|
|
day_of_month |
integer, nullable |
Yes |
|
kind=monthly: 1 to 28. |
day_of_week |
integer, nullable |
Yes |
|
kind=weekly: 0 = Monday .. 6 = Sunday. |
id |
string (uuid) |
Yes |
|
|
kind |
string |
Yes |
|
once | weekly | monthly. |
last_operation_id |
string (uuid), nullable |
Yes |
|
The restart operation the last run queued, when it queued one. |
last_outcome |
string, nullable |
Yes |
|
queued | refused | missed – what happened the last time it came due. missed means it was reached too late and was skipped rather than run late. |
last_outcome_detail |
string, nullable |
Yes |
|
Why, for refused and missed, as a sentence. |
last_run_at |
string (date-time), nullable |
Yes |
|
When it last came due, if it has. |
next_run_at |
string (date-time), nullable |
Yes |
|
The next run as an instant; null once the schedule has completed or been cancelled. |
run_at |
string (date-time), nullable |
Yes |
|
kind=once: when it runs. |
state |
string |
Yes |
|
scheduled | completed | cancelled. |
time_of_day |
string (time), nullable |
Yes |
|
weekly and monthly: the wall-clock time, in timezone. |
timezone |
string |
Yes |
|
The IANA timezone the schedule keeps its time in. |
updated_at |
string (date-time) |
Yes |
|
|
vm_id |
string (uuid) |
Yes |
|
|
Every error response is application/problem+json (schema Problem).
| Status |
Meaning |
| 400 |
The request is malformed or failed validation. |
| 401 |
The credential is missing or invalid. |
| 403 |
The credential does not have permission to perform this operation. |
| 404 |
The resource does not exist. |
| default |
Any other status is possible; the code field identifies the error. |
curl -X POST "https://api.virtscale.nl/v1/orgs/$ORG_ID/compute/vms/$VM_ID/scheduled-actions" \
-H "Authorization: Bearer $VIRTSCALE_API_KEY" \
-H "Content-Type: application/json" \
--data @body.json