Expand description
dvm.run’s REST API: what it takes and returns. dvm.run’s controller serves it, and the SDKs and its panel call it; the controller, the panel and the Rust SDK check a sandbox’s spec with the same code.
A type that holds an invariant (a checked spec, an image reference) keeps its fields private; a plain record of what the controller answers has them public.
Structs§
- ApiError
- What the controller answers instead, when it refuses a request: the body of every response that isn’t a success.
- ApiKey
- One of a user’s API keys, as they list them: never the key itself, of
which the controller keeps only the SHA-256. A request that bears it
(
Authorization: Bearer <key>) acts as its user. - Byte
Chunk - Bytes as a program wrote them: base64 in JSON, since they needn’t be UTF-8.
- Capacity
- CPUs and memory: what a runner hands out, and what a run takes of it
(
SandboxSpec::footprint). - CliLogin
- A login from a terminal, as its page shows it to the user who may approve it.
- Collect
CliLogin - What a terminal asks for its key with:
POST /api/cli-logins/key. - Created
ApiKey - A key just made, and the key itself: shown this once.
- Environment
Variable - An environment variable the program is given.
- Execution
- A sandbox’s execution,
GET /api/executions/{id}: what it ran, one log from its start to its end, under its sandbox’s id. Its spec, its seed among it; its run, how and when it ended, and its log’s size; and its replays. - Image
Reference - A Docker image reference, as
docker runtakes it:alpine,alpine:3.20,ghcr.io/owner/name:tag,name@sha256:<hex>. - Invalid
Image Reference - Why a text isn’t an image reference.
- Invalid
RunAction - An action the run’s state doesn’t allow.
- Me
- The user signed in:
GET /api/me. - NewApi
Key - A key to make:
POST /api/keys. - NewCli
Login - A login to start from a terminal:
POST /api/cli-logins, with no session or key. - Output
After - Output after the stdout cursor
offsetand optionalstderr_offset. - Run
- A sandbox’s run, of its spec, recorded; or a replay of its recording.
- RunId
- A run’s id, the controller’s.
- RunOutput
- What a run’s program has written so far, as bytes.
- Sandbox
- A sandbox: one run of its spec, recorded, started as it’s made, and the replays of its recording. Its id is its run’s.
- Sandbox
Answer - Sandbox
Draft - A sandbox’s spec as a person writes it, unchecked: what the panel’s form
holds, and what the controller takes to create a sandbox. Each field but
the image may be left out, for
dvm run’s defaults. - Sandbox
Exited - Sandbox
Id - A sandbox’s id: its run’s, as its runner and its output know it.
- Sandbox
Input - Appends bytes to
POST /api/sandboxes/{id}/input. - Sandbox
Input State - The input accepted into the runner connection, which may still be in flight.
- Sandbox
Read - Sandbox
Request - Sandbox
Run - Sandbox
Spec - What a sandbox runs, checked: each value is one
dvm runmay be given as it is. Only aSandboxDraftthat passes becomes one, deserialized too. - Sandbox
Started - Sandbox
Stdin - Sandbox
Write - Sandboxes
Page - A page of the sandboxes a user sees,
GET /api/sandboxes?before=: the newest before the sandboxbefore, if given, newest first. - Spec
Error - Why a draft isn’t a spec: the first field that’s wrong, and how.
- Started
CliLogin - A login started: the panel’s page that approves it, the code that page shows, and the token the terminal collects its key with, which only the terminal holds.
- Timestamp
- A point in time: milliseconds since the Unix epoch, UTC.
- User
Limits - What a user who isn’t an admin may use.
Enums§
- Output
Stream - One of a program’s output streams.
- Replay
Verdict - Whether a replay was the run it replayed, as far as can be seen from outside: its exit code, and its output, byte for byte.
- RunAction
- What an owner may do to a sandbox’s run, besides starting it, as it’s
made: the last segment of its path,
POST /api/sandboxes/{id}/{action}; a replay may be stopped,POST /api/replays/{id}/stop. - RunState
- Where a run is:
- Sandbox
Answer Kind - Sandbox
Program - Sandbox
Request Action - Spec
Field - A field of a
SandboxDraft.