The client's SSH agent in the sandbox, for one SSH session (WebSocket)
What the SSH gateway asks for when a client forwards its agent (ssh -A): the guest makes a socket, /run/sbx/ssh-agent.<id>/agent, in a directory of its own that only user (and root) may enter, and the first message says where (AgentListening): the session's commands get it as SSH_AUTH_SOCK. Then the binary messages carry the connections programs make to it, each a type byte, the connection's number (four bytes, little endian) and bytes: from the server n (a program connected), o (what it sent), x (it closed); from the client d (the agent's answer) and x (the agent closed it). AgentReset says that every connection is gone: the sandbox went to sleep. The sandbox is woken for the socket to be made and is not kept awake by it: while it sleeps the WebSocket stays, and when it runs again the socket is the same one. Closing the WebSocket ends the socket; one whose sandbox is asleep then goes by itself a minute after the sandbox runs again. A second call with the same id takes the socket over from the first. Opened only with a session token of the forward scope, which the node's SSH gateway is given for each session (POST /internal/ssh/authorize), and a control plane for the sessions of a gateway in front of it: a project cannot have one (POST …/tokens gives forward to the operator alone).
Its messages are in Event streams and terminals.
Takes no key of a project, or a token of the sandbox with forward.
https://api.glac.ai/v1/sandboxes/{id}/agentالتفويض
معاملات المسار
معاملات الاستعلام
معاملات الترويسة
Returns
101
The connection is a WebSocket from here on.
400
The request is not one this call takes. unknown_parameter: the query has a parameter this call does not take; websocket_expected: the request is not a WebSocket upgrade; invalid_field: id or user is missing or not one; no_such_user: the sandbox has no such user.
- 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_forward: it is not a sandbox token (a project's key, the operator's); token_scope: the sandbox token does not carry forward, which only the SSH gateway's sessions' do. spend_limit_reached: the sandbox is frozen because a spend limit was reached; it sleeps, with its data, until the limit is raised.
- 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. sandbox_failed: the sandbox is failed; sandbox_too_old: the sandbox was made before the node could 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.
502
agent_failed: the guest could not make the socket; the message has its reason (16 agents are forwarded to the sandbox at most).
- 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.