Terminal
Preview

Ask for a terminal in a pod

Checks everything a terminal needs and returns a session waiting for its WebSocket, with a ticket that opens it once, within 30 seconds, for the same person. A person who may manage the deployment may open one, unless its environment allows named people only (403 `exec.named_only`); so may anyone wh

POST
/deployments/{deploymentId}/pods/{clusterId}/{pod}/exec-sessions
cookiebetter-auth.session_token<token>

Better Auth session cookie. Production uses the __Secure- prefixed name.

deploymentId*string
Formatuuid
clusterId*string
Formatuuid
pod*string
Lengthlength <= 253
Idempotency-Key?string

Makes retries safe. A repeated key with the same request returns the first result and sets Idempotent-Replayed: true. The same key with a different request answers 409 idempotency.key_reused, and while the first request is still running 409 idempotency.in_progress. Results are kept for 24 hours. Server errors and refusals for lack of sign-in or permission are not kept, so a retry runs again.

Match^[A-Za-z0-9_.:-]+$
Length1 <= length <= 255
application/json
  1. body
container?string

Empty means the pod's default container.

Lengthlength <= 63
command?array<>

The program and its arguments. Absent runs /bin/sh with a TTY.

Itemsitems <= 64
tty?boolean
Defaultfalse
reason?string

Why. Required, 10 characters or more, on a production-tier cluster; recorded in Activity.

Lengthlength <= 500

Response Body

The session, waiting for its WebSocket, and its single-use ticket. The ticket is shown once.

application/json
  1. response
session*
ticket*string

Opens the session once. Send it as the subprotocol ticket.<ticket>.

expiresAt*string
Formatdate-time
streamPath*string

The WebSocket's path, under the API's base URL.

subprotocols*array<string>

The subprotocols to offer, in order, ticket included.

Example Request
curl -X POST 'https://wardn.example.com/api/v1/deployments/497f6eca-6276-4993-bfeb-53cbbbba6f08/pods/497f6eca-6276-4993-bfeb-53cbbbba6f08/string/exec-sessions' \  -H 'Content-Type: application/json' \  -d '{}'
Example Response
{  "session": {    "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",    "deploymentId": "a73c85a1-d857-491e-a6b2-51dce05de7a2",    "deploymentName": "string",    "clusterId": "a3d24843-7014-4490-bdd3-b7cb39b400c8",    "userId": "string",    "namespace": "string",    "pod": "string",    "container": "string",    "command": [      "string"    ],    "tty": true,    "reason": "string",    "production": true,    "recorded": true,    "state": "pending",    "idleTimeoutSeconds": 0,    "maxDurationSeconds": 0,    "createdAt": "2019-08-24T14:15:22Z",    "startedAt": "2019-08-24T14:15:22Z",    "endedAt": "2019-08-24T14:15:22Z",    "endReason": "exited",    "exitCode": 0,    "terminatedBy": "string",    "recordingBytes": 0  },  "ticket": "string",  "expiresAt": "2019-08-24T14:15:22Z",  "streamPath": "string",  "subprotocols": [    "string"  ]}