Console Sessions
Persistent terminal sessions that outlive the client attached to them, addressed by byte offset.
postAttach Console
Bidirectional interactive attach. The first client message must be the AttachSpec (InvalidArgument otherwise); later messages are stdin bytes or resize events. The server streams output from from_offset (replay with 0 starts at the oldest retained byte; otherwise 0 starts at the live tail), marks truncated when bytes were evicted, and ends with an exit event when the process exits. Hanging up leaves the session running. Browsers reach this through the /ws/console bridge. **Access:** namespace OPERATOR or above (write)
postClose Console Session
Ends a session: signals its process group with TERM and escalates to KILL after a grace window (force kills at once), then drops its index entry. Closing a LOST session just removes the record. **Access:** namespace OPERATOR or above (write)
postCreate Console Session
Opens a persistent terminal in a RUNNING sandbox (FailedPrecondition otherwise), starting the in-pod console daemon on first use. Empty argv runs the image's interactive shell; cols/rows default to 80x24. With attach_if_exists and a name, returns the running session of that name instead of starting another (reattached=true). ResourceExhausted when the sandbox already has its maximum of running sessions (8 by default); InvalidArgument when the argv or shell is not in the image. Unimplemented without cluster access. **Access:** namespace OPERATOR or above (write)
postGet Console Session
Returns one session's live state, or its record in state LOST when its sandbox's pod is gone. **Access:** namespace VIEWER or above (read)
postList Console Sessions
Lists a sandbox's terminal sessions with their live state. Sessions the pod no longer has (suspended, restarted or evicted) are reported LOST; exited sessions are omitted unless include_exited is set. **Access:** namespace VIEWER or above (read)
postRead Console
Reads output from from_offset, optionally long-polling up to wait_ms (capped at 25 s) for new bytes. max_bytes is capped at 1 MiB (0 means 1 MiB). truncated is set when the requested offset was already evicted. Returns the next offset, session state and exit code. **Access:** namespace VIEWER or above (read)
postResize Console
Sets the session's PTY window size; cols and rows must both be non-zero (InvalidArgument otherwise). **Access:** namespace OPERATOR or above (write)
postWrite Console
Sends stdin to a session without holding a stream and returns the ring's tail offset after the write, so the caller can read back only this input's output. The in-pod daemon reads at most 1 MiB per write. FailedPrecondition for an exited or lost session. **Access:** namespace OPERATOR or above (write)
Update Cluster POST
Updates the fields named in `update_mask` and nothing else; an empty mask is InvalidArgument. The owner team's admins may change `display_name`, `labels`, `grants` and switch `visibility` between PRIVATE and SHARED. Setting `visibility` to GLOBAL, `default`, `allow_runc` and the everyone-grant (a grant with an empty `team`) are platform-admin-only; naming them in the mask otherwise is PermissionDenied. At most one cluster is `default`, and it must be GLOBAL. `archive_interval_sec` (how often mounted volumes are archived; 0 disables, unset in the mask restores the 6-hour default) is the owner team's on its own cluster and platform-admin-only on a GLOBAL one. **Access:** admin of the owner team, or a platform admin. Other callers get NotFound.
Attach Console POST
Bidirectional interactive attach. The first client message must be the AttachSpec (InvalidArgument otherwise); later messages are stdin bytes or resize events. The server streams output from from_offset (replay with 0 starts at the oldest retained byte; otherwise 0 starts at the live tail), marks truncated when bytes were evicted, and ends with an exit event when the process exits. Hanging up leaves the session running. Browsers reach this through the /ws/console bridge. **Access:** namespace OPERATOR or above (write)