Skip to main content

Crate dvm_api

Crate dvm_api 

Source
Expand description

dvm.run’s REST API types and checked request drafts.

Structs§

ApiError
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.
ByteChunk
Raw bytes serialized as base64 in JSON payloads.
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.
CollectCliLogin
What a terminal asks for its key with: POST /api/cli-logins/key.
CreatedApiKey
A key just made, and the key itself: shown this once.
DecodedArgument
DvmStop
EnvironmentVariable
FileName
Non-UTF-8 file name or symlink target bytes carried as lowercase hex.
FileStatus
FileTime
Frame
A header and its bytes, and where the frame lies in its stream.
FrameDecoder
Splits a stream, given as it comes, into frames. A header that isn’t one is an error for its frame alone; one too long to hold ends the stream, which can’t be split past it.
ImageReference
A Docker image reference, as docker run takes it: alpine, alpine:3.20, ghcr.io/owner/name:tag, name@sha256:<hex>.
InspectionWatches
InvalidImageReference
Why a text isn’t an image reference.
InvalidRunAction
Me
The user signed in: GET /api/me.
NewApiKey
A key to make: POST /api/keys.
NewCliLogin
A login to start from a terminal: POST /api/cli-logins, with no session or key.
OutputAfter
PathDirectoryEntry
Run
RunId
RunOutput
Sandbox
SandboxAnswer
SandboxDraft
SandboxExited
SandboxId
SandboxInput
SandboxInputState
SandboxRead
SandboxRequest
SandboxRun
SandboxSpec
SandboxStarted
SandboxStdin
SandboxWrite
SandboxesPage
SeekSandbox
SpecError
StartedCliLogin
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.
StepPoint
SyscallName
Timestamp
A point in time: milliseconds since the Unix epoch, UTC.
UserLimits
What a user who isn’t an admin may use.
WatchPoints

Enums§

DecodedValue
FileType
FrameError
OutputStream
RunAction
RunState
SandboxAnswerKind
SandboxNetwork
As JSON: {"mode": "public"}, {"mode": "none"}, or {"mode": "allowlist", "allow": ["pypi.org", "*.github.com", "8.8.8.0/24"]}.
SandboxProgram
SandboxRequestAction
SeekTarget
SpecField
StopEvent
WatchPoint

Constants§

MAX_HEADER
The longest header, its newline excluded.
MAX_PAYLOAD
The most bytes one frame carries: a decoder holds a whole frame.

Functions§

decode_frame
bytes, whole, as one frame.
encode_frame
The frame of header, a struct or map, and payload.