Revoke every token of a sandbox, or one
With no body (or {}): every token signed for this sandbox before this call (those of POST /v1/sandboxes/{id}/tokens, in a preview's cookie or link, held by an SSH session) is refused from now on (401 invalid_token); tokens signed after it work. Tokens carry the generation of the sandbox's tokens they were signed at, and this moves the generation on by one; it is in the sandbox's record before the call answers, and stays after a restart of the daemon, a sleep and a move to another node.
With token (the token itself, which has to be one of this sandbox's) or token_id (its id, as POST /v1/sandboxes/{id}/tokens answered it): that token alone is refused from now on, and every other token of the sandbox works as before; the generation does not move. Nothing is kept of the tokens that are signed: the node keeps the id of each token revoked so until the token runs out (expires_at; named by its id alone, for as long as a token may live, 30 days), in the sandbox's record before the call answers, after a restart, a sleep and a move too. A sandbox keeps 1,000 such at the most that have not run out: one more is refused 409 too_many_revoked_tokens, and a revoke of every token does it.
A sandbox token cannot do this. Wakes nothing. While the sandbox is being moved to another node the call is refused 503 unavailable (call again: it then reaches the node it went to); a node whose lease does not cover a keyed or stateful sandbox refuses it 503 fenced.
Takes write.
https://api.glac.ai/v1/sandboxes/{id}/tokens/revokeالتفويض
معاملات المسار
معاملات الترويسة
متن الطلبJSONاختياري
Returns
200
The revocation: of every token, the generation tokens are signed at from now on; of one, its id and until when its revoke is kept.
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: token is not a token of this sandbox, token_id is not a token's id, or both are given; 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.
- 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.
- 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. moved: this node released the sandbox to another node, which has it now and revokes its tokens there (to, epoch); too_many_revoked_tokens: the sandbox keeps as many tokens revoked one by one as it may (1,000 that have not run out): revoke every token instead; idempotency_key_reused: the key was used with another body; idempotency_in_progress: the first request with the key is still running.
- 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.