Run a program in a Kiste with its exact output and exit status, and follow durable command records.
Run a program in a Kiste with its exact output and exit status, and follow durable command records.
Run a command
POST /v1/instances/{name}/exec
Runs argv in the Kiste without a shell and streams newline-delimited JSON: one started event, output events with base64 stdout or stderr bytes in order, then exactly one completed event with the exit code, signal, duration and byte counts, or failed when the command could not finish. Standard input is not forwarded. Pass your own id (a UUID) to cancel the command later or find its record. A slow reader slows the command down instead of losing output.
Path parameters:
| Name | Type | Required | Description |
|---|---|---|---|
name | string | yes | The Kiste's name. |
Request body: ExecRequest
| Field | Type | Required | Description |
|---|---|---|---|
argv | array of string | yes | The program and its arguments, passed exactly, without a shell. |
cwd | string or null | no | Working directory inside the Kiste. |
env | map of string | no | Environment variables for the command. |
id | string (uuid) or null | no | Your own UUID for the command, to cancel it or find its record. |
timeout_ms | integer (int64) | no | Longest run time in milliseconds. |
Responses:
200One JSON event per line. Body: ExecEvent (application/x-ndjson)
Errors use the error envelope.
Cancel a running command
DELETE /v1/instances/{name}/exec/{id}
Cancels a command started with your own id on this Kiste.
Path parameters:
| Name | Type | Required | Description |
|---|---|---|---|
name | string | yes | The Kiste's name. |
id | string | yes | The object's ID. |
Responses:
200OK. Body: MessageResponse
Errors use the error envelope.
List a Kiste's commands
GET /v1/instances/{name}/commands
Durable records of the commands run in one Kiste: state, exit code, timing and byte counts. Output itself is not stored.
Path parameters:
| Name | Type | Required | Description |
|---|---|---|---|
name | string | yes | The Kiste's name. |
Responses:
200OK. Body: list of CommandResponse
Errors use the error envelope.
Get a command
GET /v1/commands/{id}
The durable record of one command, running or finished.
Path parameters:
| Name | Type | Required | Description |
|---|---|---|---|
id | string | yes | The object's ID. |
Responses:
200OK. Body: CommandResponse
Errors use the error envelope.
Interrupt a command
POST /v1/commands/{id}/interrupt
Asks a running command to stop, with an optional reason for the record. The command receives an interrupt and can finish cleanly; its record shows when the interrupt was requested.
Path parameters:
| Name | Type | Required | Description |
|---|---|---|---|
id | string | yes | The object's ID. |
Request body: InterruptCommandRequest
| Field | Type | Required | Description |
|---|---|---|---|
reason | string or null | no |
Responses:
200OK. Body: InterruptCommandResponse
Errors use the error envelope.