Xeonr Developer Docs
API SpecificationConsole Sessions

Create Console Session

POST
/containers.api.v1.ConsoleService/CreateConsoleSession

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
AuthorizationBearer <token>

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

Connect-Protocol-Version?number

Define the version of the Connect protocol

Connect-Timeout-Ms?number

Define the timeout, in ms

Request Body

application/json

sandboxId?string
Length1 <= length <= 64
name?string

optional; unique per sandbox when set

Lengthlength <= 191
argv?argv

Empty => the image's best interactive shell. argv, env, cwd and name together must fit the in-pod daemon's 64 KiB request ceiling.

Itemsitems <= 1000
env?
Propertiesproperties <= 1000
cwd?string
Lengthlength <= 4096
cols?integer

0 => 80

Rangevalue <= 65535
rows?integer

0 => 24

Rangevalue <= 65535
idleTtlSec?integer

validate:skip any duration is honoured; 0 = never

attachIfExists?boolean

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

[key: string]?never

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": {}
    }
  ]
}