Expand description
Exec wire types: the bodies, queries, and SSE event payloads of /v1/exec/*.
Every type here derives both halves of serde. The daemon needs only one half of
each and a client needs the other, and a type that carries one half is a type the
other side has to hand-write — which is the drift this crate exists to prevent.
The published docs/schema.json is generated from these same attributes under
both contracts, so a shape change is a schema diff rather than a surprise.
Structs§
- Error
Body - The JSON error body every failing control route returns.
- Exit
Event - The terminal
exitSSE event. Emitted before the stream ends, so a client that sees the body close without one knows the connection failed rather than the command finishing. - GapEvent
- One
gapSSE event: the byte range a lagging or late subscriber lost. - Kill
Response POST /v1/exec/{id}/killresponse.- Outcome
- Captured output and exit status of a finished exec.
- Output
Event - One
outputSSE event. - Poll
Response - Proc
Group - One entry of
GET /v1/procs: an exec’s process group as the daemon sees it. - Procs
Response GET /v1/procsresponse.- Start
Request - A start request.
commandis either an argv array or, withshellset, a single script string. - Start
Response - Stdin
Request POST /v1/exec/{id}/stdinbody.- Stdin
Response POST /v1/exec/{id}/stdinresponse.- Stream
Query GET /v1/exec/{id}/streamquery.
Enums§
- Name
OrId - A user or group as a start request names it: a numeric id, or a name the daemon
resolves against the guest’s
/etc/passwdor/etc/group. - Phase
- Where an exec sits in its lifecycle. Mirrors
ExecPhasein the model crate. - Shell
- How a start request’s
commandis run:false(an argv),true(/bin/sh -c), or the name of a shell the daemon resolves and runs as<shell> -c. - Stream
Kind - Which pipe a streamed chunk came from. Both share one offset space, so a client holds one cursor rather than two that can disagree about ordering.
Constants§
- ERROR_
ALREADY_ ACKED - An earlier ack already released the output.
- ERROR_
MALFORMED_ REQUEST - The body is not a valid request for this route. Always 400, never 404.
- ERROR_
POWEROFF_ UNAVAILABLE - The requested shutdown is unavailable with the daemon’s current privileges.
- ERROR_
SPAWN_ FAILED - The child could not be spawned. 500, deliberately not 404.
- ERROR_
STDIN_ CLOSED - stdin was closed by an earlier eof, or the child stopped reading. 410: a retry will never succeed.
- ERROR_
STDIN_ NOT_ REQUESTED - The exec was started without
stdin: true. Fixable at start time, hence 409. - ERROR_
STDIN_ WRITE_ FAILED - The write to the pipe failed for a reason other than a broken pipe.
- ERROR_
STDIN_ WRITE_ TIMEOUT - The child did not read within the configured window. Retryable, and some bytes may already have been written.
- ERROR_
STDIN_ WRITE_ TOO_ LARGE - The decoded write exceeds the configured per-write cap.
- ERROR_
STILL_ RUNNING - The exec has not exited, so acking would drop output still being written.
- ERROR_
UNKNOWN_ EXEC - No exec is registered under this id, or its entry was collected after an ack.
- ERROR_
UNKNOWN_ GROUP - A start request named a group the guest’s
/etc/groupdoes not contain. 400, and nothing was spawned;detailnames the group. - ERROR_
UNKNOWN_ SHELL - A start request named a shell that no searched directory holds as an executable
file. 400, and nothing was spawned;
detailnames the shell and where it looked. - ERROR_
UNKNOWN_ USER - A start request named a user the guest’s
/etc/passwddoes not contain. 400, and nothing was spawned;detailnames the user. - EVENT_
EXIT - EVENT_
GAP - EVENT_
OUTPUT - The
event:names onGET /v1/exec/{id}/stream.