Create 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)
Authorization
BearerAuth A namespace-scoped API key (cpk_…) for machines, or a Xeonr Auth OIDC
token for humans. The key's namespace and role are pinned server-side.
In: header
Header Parameters
Define the version of the Connect protocol
Define the timeout, in ms
Request Body
application/json
1 <= length <= 64optional; unique per sandbox when set
length <= 191Empty => the image's best interactive shell. argv, env, cwd and name together must fit the in-pod daemon's 64 KiB request ceiling.
items <= 1000properties <= 1000length <= 40960 => 80
value <= 655350 => 24
value <= 65535validate:skip any duration is honoured; 0 = never
Return the existing session with this name instead of failing when one is
already open. The console's terminal slots reconnect this way: "give me the
session called main, making it if it isn't there" is one round trip and is
safe to repeat on every page load. validate:skip a bool has no bounds
Response Body
application/json
application/json
curl -X POST "https://containers.xeonr.io/containers.api.v1.ConsoleService/CreateConsoleSession" \ -H "Connect-Protocol-Version: 1" \ -H "Connect-Timeout-Ms: 1000" \ -H "Content-Type: application/json" \ -d '{}'{
"session": {
"sessionId": "string",
"sandboxId": "string",
"namespace": "string",
"name": "string",
"argv": [
"string"
],
"env": {
"property1": "string",
"property2": "string"
},
"cwd": "string",
"cols": 0,
"rows": 0,
"state": "CONSOLE_SESSION_STATE_UNSPECIFIED",
"exitCode": 0,
"createdAtUnix": "string",
"lastActivityUnix": "string",
"headOffset": "string",
"tailOffset": "string",
"attached": 0,
"idleTtlSec": 0,
"createdBy": "string"
},
"reattached": true
}{
"code": "not_found",
"message": "string",
"details": [
{
"type": "string",
"value": "string",
"debug": {}
}
]
}Close Console Session POST
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)
Get Console Session POST
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)