Roll a sandbox back to a snapshot
In place: same id, name and links, the memory, processes and disk of the snapshot. Any snapshot will do, not only one of this sandbox. What the sandbox was just before is kept as a new snapshot, returned in before. The commands that ran in it are gone; the snapshot's are there instead. Wakes the sandbox.
On a node that copies its disks to an object store, the disk as it is after the call goes there whole, as a fork's does (POST /v1/sandboxes/{id}/fork says how long that takes). Until it is there the sandbox's writes to its disk wait, from 0.9 s after the first one, and a host that is lost brings the sandbox back with the disk it had before the call.
Takes write.
https://api.glac.ai/v1/sandboxes/{id}/restoreỦy quyền
Tham số đường dẫn
Tham số header
Thân yêu cầuJSONbắt buộc
Returns
200
The sandbox as it is now, and the snapshot of what it was.
400
The request is not one this call takes. invalid_json: the body is not a JSON object; unknown_field: the body has a field this call does not take; unknown_parameter: the query has a parameter this call does not take; invalid_field: a field or query parameter has the wrong type or is out of range; missing_field: snapshot is missing; invalid_idempotency_key: Idempotency-Key is empty or over 255 characters.
- exec_idoptionalstring
With
sandbox_movedofPOST …/run: the id of the command the call started and waited for, which goes on where the sandbox went: wait for it there through the control plane withGET …/exec/{exec_id}?wait_seconds=once the move is over. The same call made again starts the command a second time, unless it comes with the same Idempotency-Key.
401
missing_api_key, invalid_api_key, expired_api_key, invalid_token.
403
The credential may not do this. needs_api_key: a sandbox token cannot do this. spend_limit_reached: the sandbox is frozen because a spend limit was reached; it sleeps, with its data, until the limit is raised. account_share_reached: its account has not the room on this node's data drive for the snapshot a roll-back first takes of what the sandbox is (drive.accounts of GET /internal/node). The sandbox is as it was.
- exec_idoptionalstring
With
sandbox_movedofPOST …/run: the id of the command the call started and waited for, which goes on where the sandbox went: wait for it there through the control plane withGET …/exec/{exec_id}?wait_seconds=once the move is over. The same call made again starts the command a second time, unless it comes with the same Idempotency-Key.
404
Something the request names does not exist. sandbox_not_found: no such sandbox; snapshot_not_found: no such snapshot.
- exec_idoptionalstring
With
sandbox_movedofPOST …/run: the id of the command the call started and waited for, which goes on where the sandbox went: wait for it there through the control plane withGET …/exec/{exec_id}?wait_seconds=once the move is over. The same call made again starts the command a second time, unless it comes with the same Idempotency-Key.
409
The state of something stands in the way. exclusive_volume_attached: the sandbox has a volume that is not shared; snapshot_lost: the snapshot's status is lost; sandbox_failed: the sandbox is failed; idempotency_key_reused: the key was used with another body; idempotency_in_progress: the first request with the key is still running; busy: a volume is still behind one of the sandbox's spare drives after an attach that did not get through (its guest's reads of it are held up, a Drive whose blocks do not come), and is taken off it once they end; or the sandbox's guest has a read held up on a Drive it has (its blocks do not come: the message names the Drive and says for how long), until that read ends: the same call is made again in a moment. static_instance: the sandbox is the instance the node keeps of a static spec (GET /internal/static).
- exec_idoptionalstring
With
sandbox_movedofPOST …/run: the id of the command the call started and waited for, which goes on where the sandbox went: wait for it there through the control plane withGET …/exec/{exec_id}?wait_seconds=once the move is over. The same call made again starts the command a second time, unless it comes with the same Idempotency-Key.
default
Any other failure, in the same shape. internal (500): the node failed; the message says no more, and the node's log has the reason under the request's id. unavailable (503, retryable): no_capacity, every network slot of the node is in use; memory_full, a machine the call has to start (made, woken, booted from its disk, resumed, rolled back, built) does not fit in the host's memory beside what the machines that run on it are promised, and nothing paused or idle could be put to sleep to make room for it (memory of the node); drive_full, the call would have a template built and the node's data drive has no room for one (drive of the node); unavailable, the node is shutting down, the sandbox was still starting after 10 minutes, or it did not answer, or it is being moved to this node (with Retry-After: 1); fenced, the node's lease fences the sandbox (Node.lease). moved (409): the sandbox was moved to another node, which to names.
- exec_idoptionalstring
With
sandbox_movedofPOST …/run: the id of the command the call started and waited for, which goes on where the sandbox went: wait for it there through the control plane withGET …/exec/{exec_id}?wait_seconds=once the move is over. The same call made again starts the command a second time, unless it comes with the same Idempotency-Key.