Update a VM
Change the sleep policy of a VM, its wakes and its backups. A field that you do not send keeps its value.
PATCH /v1/tenants/{tenant}/vms/{name}
curl -X PATCH "https://api.shako.dev/v1/tenants/acme/vms/web1" \
-H "Authorization: Bearer $SHAKO_API_KEY" \
-H "Content-Type: application/json" \
-d '{"sleep":"never"}'200 (excerpt)
{
"name": "web1",
"tenant": "acme",
"state": "awake",
"ssh": "web1.acme.shako.dev",
"vcpus": 1,
"mem_mib": 2048,
"disk_gb": 10
}Authenticate with Authorization: Bearer <API key> on https://api.shako.dev. Role: contributor or owner.
Path parameters
tenantstringrequired- The tenant's name, from GET /v1/tenants.
namestringrequired- The VM's name.
Request body
sleepstring (auto, never)default: no change- When the VM sleeps. auto: when it is quiet. never: it stays on, and it restarts after a reboot or a crash. With both, the sleep and wake endpoints work at once.
idlestringdefault: no change- The quiet time before the VM sleeps, for example "15m" or "2h".
wake_on_cronbooleandefault: no change- true: after each sleep, the VM wakes 2 minutes before its next cron job.
wake_on_chatbooleandefault: no change- true: a chat message wakes the VM.
backupbooleandefault: no change- true: each night, Shako backs up the VM if its disk changed. false: no new backups, and the old backups go 7 days after they were taken.
after_deletestring (keep-7d, erase)default: no change- What happens to the VM's backups when the VM is deleted. keep-7d: they stay 7 days, then Shako erases them. erase: Shako erases them within a few minutes.
Response
200 with the VM object.
The errors. All the endpoints of VMs.