Change a volume's rule for its backups
backups: every day or not, how many daily backups are kept, for how many days one taken by a call is kept (VolumeBackupRule). Kept by the node with the volume, on its disk before the answer; a control plane takes the backups by it.
Takes write.
https://api.glac.ai/v1/volumes/{id}Authorization
Path parameters
Header parameters
Request bodyJSONoptional
Returns
200
The volume.
- kinddriveorplainorsharedrequired
Decided at creation.
drive: a disk one sandbox has at a time, kept on the node as a layer over zeros (the blocks written to it, in a sparse file, and a bitmap of them), which a machine's Firecracker keeps as it keeps a root disk in layers; a snapshot of a sandbox carries a copy of each Drive it has, and a sandbox made from the snapshot (or a fork) has a Drive of its own made of it. What a volume that is not shared is made as on a node whose machines keep Drives (drivesof the node).plain: a disk one sandbox has at a time, a file system in a file of its own; what such a volume is made as on a node whose machines keep no Drives, and wherekindasks for it.shared:sharedis true. - used_bytesintegerrequired
What it holds now, in bytes: what its file takes on the node, which is the blocks its file system uses, a few hundred kB for an empty one of 256 MiB and 5 MB for one of 64 GiB. It grows as files are written, and falls again when they are removed: the blocks they took go back to the node when the node next counts what its volumes keep (once a minute), and before that when the sandbox that has the volume sleeps, is started again from its disk or gives the volume up. What stays is the file system's own: its tables, and its journal as far as that has been written (512 MiB at the most on a volume of 64 GiB). A volume that is not shared gives nothing back on a node whose
volume_discardis false, nor while it is with a sandbox that was made from a template or a snapshot of before volumes did this. A node counts a volume as keeping this, moment by moment, for as long as it is there, whether or not a sandbox has it.format: int64 · minimum: 0 - host_failurerequired
What the last hard stop of the node's host left uncertain about the volume's disk. Null for a volume that was whole on the host's disk: one that no sandbox had, one whose sandbox was asleep with everything on the disk, and every shared volume (the node holds its file system itself, and what a sandbox was told is written there is on the disk).
- restore_attemptinteger | nullrequired
Of a volume made from a backup, which attempt to make it this is: 1 where it was placed; 2 where that failed and its control plane made it again from the same backup on another node of the backup's region (under the same id: the second and last attempt,
failedfor good where it fails too). Null for a volume made empty.maximum: 2 · minimum: 1 - placement_refusalsarray | nullrequired
Of a volume made from a backup: the nodes of the backup's region that refused to make it before it was made anywhere (each refused before it made anything: its drive was full, the account had no room left there, it could not be reached), in the order they were asked, as its control plane said them; the node that made it was the next. Null where the first node asked made it.
- backupsobjectrequired
How a volume's backups are taken, by the control plane it belongs to (control/README.md, 「卷的备份」): every day or not (
daily), how many of those daily backups are kept (keep), and for how many days a backup taken by a call or before a version of a stateful service is kept (expires_in_days). Kept by the node with the volume, and gone with it; a node of no control plane keeps the rule and takes no backup by it. - durabilityoptional
How a Drive is kept, decided at creation (
VolumeCreate.durability).standard: a guest's fsync returns at once, and a host that is lost loses at most the last second of writes.strict: a guest's fsync, and every flush of its file system, returns once the object store holds every write before it, at the cost of a request to the store for each. Of a plain volume:strictwhere the node made it for a static instance (mounted in its guest with barriers, so that a guest's fsync returns once the host's disk holds what it wrote), null otherwise; null of a shared one.
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 has the wrong type or is out of range. invalid_name: name is no name a volume can have.
- 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.
- 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. volume_not_found: no such volume.
- 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 name is taken. name_taken: another volume of the owner's has it. static_instance: the volume is the one a static spec of the node's names, which holds what its instance keeps.
- 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.