Set a file's length, mode or time of modification
Sets what is given and leaves the rest as it is. size_bytes cuts a file to that length, or extends it with zeros; mode sets the permission bits of a file or a directory; modified_at its time of last modification. A symbolic link is followed. An empty body does nothing, and wakes nothing. Paths are absolute. The operation is done as the user commands run as, or as user: what that user may not do is refused with 403.
Takes files, or a token of the sandbox with files.
https://api.glac.ai/v1/sandboxes/{id}/filesAuthorization
Path parameters
Query parameters
Header parameters
Request bodyJSONoptional
Returns
204
Set.
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; missing_path: no path; invalid_path: a path that is not absolute, or one whose length cannot be set (a pipe, a device); name_too_long: a name in the path is longer than the file system takes (255 bytes); invalid_field: a field or query parameter has the wrong type or is out of range; unknown_parameter: the query has a parameter this call does not take; no_such_user: user is not a user of the sandbox.
- 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. token_scope: the sandbox token lacks the scope; permission_denied: the user the operation was done as may not: it is not that user's file.
- 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; file_not_found: nothing at the path.
- 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. is_a_directory: a directory has no length to set; not_a_directory: something on the way is not a directory; read_only: the file system is mounted read-only; symlink_loop: the symbolic links on the way lead in a circle; file_busy: a program is running from the file, whose length cannot be changed meanwhile; sandbox_too_old: the sandbox was made before the node could do this; sandbox_failed: the sandbox is failed.
- 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.
413
No room. disk_full: the length is more than the file system takes.
- 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.