CommandLogsData
stdoutThe requested part of the standard output stream, base64-encoded: from
the offset asked for, or from stdout_first when none was (the same
for stderr).
stderrThe requested part of the standard error stream, base64-encoded.
stdout_availableThe total number of bytes the standard output stream has produced so far,
released ones included: what is still available starts at stdout_first.
stderr_availableThe same for the standard error stream.
stdout_firstThe first byte of the standard output stream still available: everything before it was released. 0 unless something was; kept once the output is a file, and across a restart.
stderr_firstThe same for the standard error stream.
CommandLogsRange
offsetThe first byte of the stream to return. Omitted, the stream from where
it starts: byte 0, or what is still available once some was released.
Given, it may not be below what was released: that is a 416.
limitThe maximum number of bytes to return; omitted, the rest of the stream.
A stream comes whole up to what memory can hold, a little over 18 MiB;
one longer than that, which only a volume allows, is answered in pages of
that size, limit or not.
CommandLogsReleaseRequest
stdoutFree the standard output stream below this byte: the client has it and
will not ask for it again. A command held at its output ceiling
(capped) carries on once there is room. More than there is frees what
there is; no more than was released already does nothing, so a retry is
harmless. Released bytes are gone, from memory and from the log file
where some had spilled to it: a read's stdout_first says where what is
left starts, and an offset below it is a 416. Once the command has
exited and its log is a file, a release does nothing: the file is the
archive, and stdout_first stays where releases left it while it ran.
stderrThe same for the standard error stream.
CommandLogsRequest
The part of the standard output stream to return.
The part of the standard error stream to return.
CommandLogsResponse
statusThe status of the response.
The response data for this request.
op_time_usThe operation time in microseconds.
messageAn optional message providing additional information about the status.
A list of errors which may have occurred during the request.
CommandResizeRequest
colsThe new width, in columns.
rowsThe new height, in rows.
CommandSignalRequest
The signal to send, either as a number or as a name, with or without the
SIG prefix, e.g. 15, TERM or SIGTERM. 0 sends nothing and only
checks that the command can be signalled. Real-time signals go by number:
where SIGRTMIN sits is up to the program's libc (34 on glibc, 35 on
musl), so they have no names here.
CommandStdinRequest
dataThe bytes to feed into standard input, base64-encoded.
eofWhether to close standard input after injecting data.
CommandWaitRequest
timeout_sThe longest to wait, in seconds; decimals are accepted, 0 only asks.
At most 55, and 55 when absent: a proxy in front cuts a silent request
at about a minute, so a longer wait is a loop on 408.
CommandWaitTimeoutRequest
timeout_sThe maximum time to wait, in seconds, at most 55. Decimals are accepted.
EmptyResponse
statusThe status of the response.
dataThe response data for this request.
op_time_usThe operation time in microseconds.
messageAn optional message providing additional information about the status.
A list of errors which may have occurred during the request.
GetCommandData
uuidThe UUID of the command.
The command the command was started with, in the form it was supplied in: a shell command line, or an argument vector.
cwdThe current working directory, if supplied at startup, else null
Environment variables, if supplied at startup, else null
ptyWhether the command runs on a pseudo-terminal.
duration_msMilliseconds from start to exit, or to now while the command runs. null
for a command restored from a status file written before it was recorded.
exitcodeThe exit code of the command. It is null while the command is still
running.
cappedWhether the command is held at the output ceiling: the memory for output,
its own share of it (at most 16 MiB) or the sandbox's whole budget across
commands, is full of output nothing has released, so nothing more of it
is read and it blocks in its next write. Releasing some (see
POST .../logs/release) lets it carry on. With persistence, output at
the ceiling goes to the log file instead and the command carries on,
which is not capped: it is only once the volume's share for unread
output is used up or the volume will not take a spill. Either way true
means a release is the way on. false once it has finished.
GetCommandResponse
statusThe status of the response.
The response data for this request.
op_time_usThe operation time in microseconds.
messageAn optional message providing additional information about the status.
A list of errors which may have occurred during the request.
ListCommandsData
commandsThe UUIDs of all known commands, in the order they were started.
ListCommandsResponse
statusThe status of the response.
The response data for this request.
op_time_usThe operation time in microseconds.
messageAn optional message providing additional information about the status.
A list of errors which may have occurred during the request.
MkdirRequest
pathThe absolute path of the directory to create.
parentsWhether to create missing parent directories.
ReadFileData
contentsThe contents of the file, base64-encoded.
ReadFileRequest
pathThe absolute path of the file to read.
ReadFileResponse
statusThe status of the response.
The response data for this request.
op_time_usThe operation time in microseconds.
messageAn optional message providing additional information about the status.
A list of errors which may have occurred during the request.
ResponseError
statusThe HTTP status code of the error.
ResponseStatus
The response status of an API request.
RunCommandData
uuidThe UUID of the command.
The command the command was started with, in the form it was supplied in: a shell command line, or an argument vector.
cwdThe current working directory, if supplied at startup, else null
Environment variables, if supplied at startup, else null
ptyWhether the command runs on a pseudo-terminal.
duration_msMilliseconds from start to exit, or to now while the command runs. null
for a command restored from a status file written before it was recorded.
exitcodeThe exit code of the command. It is null while the command is still
running.
cappedWhether the command is held at the output ceiling: the memory for output,
its own share of it (at most 16 MiB) or the sandbox's whole budget across
commands, is full of output nothing has released, so nothing more of it
is read and it blocks in its next write. Releasing some (see
POST .../logs/release) lets it carry on. With persistence, output at
the ceiling goes to the log file instead and the command carries on,
which is not capped: it is only once the volume's share for unread
output is used up or the volume will not take a spill. Either way true
means a release is the way on. false once it has finished.
Only with req_timeout_s: the output, as GET .../logs returns it.
Absent if the logs were deleted while the request waited.
RunCommandRequest
The command to run: a command line interpreted by the shell, or an argument
vector executed directly. A bare program name in a vector is looked up in
the PATH of env, falling back to the sandbox's own PATH. 400 is
returned if the vector is empty, the program cannot be resolved or run,
cwd is not a directory, an environment variable name is empty or has a
= in it, or the request holds what exec will not take (NUL bytes, an
argument list past the kernel's limit).
cwd(OPTIONAL) Current working directory
(OPTIONAL) Environment variables: the command's whole environment,
unless the sandbox is configured with inherit_env, when they are laid
over the environment the sandbox itself was started with.
pty(OPTIONAL) Run the command on a pseudo-terminal instead of pipes. Its
output, stdout and stderr merged as a terminal shows them, is served as
stdout; input fed to it is echoed by the terminal; an eof on stdin
types the terminal's end-of-input character rather than closing anything;
and deleting the logs hangs the terminal up, which ends most commands.
TERM is set to xterm-256color unless env provides one.
cols(OPTIONAL) The terminal's width in columns. Needs pty; 80 by default.
rows(OPTIONAL) The terminal's height in rows. Needs pty; 24 by default.
stdin(OPTIONAL) Bytes to feed into standard input before anything else,
base64-encoded, exactly as a POST .../stdin right after the start would.
stdin_eof(OPTIONAL) Whether to close standard input after stdin (at once when
there is none). Defaults to true when req_timeout_s is given, since
nothing can be fed until the request answers, and to false otherwise.
req_timeout_s(OPTIONAL) Block until the command exits or this many seconds have
passed, then answer with the command's state and output (logs). More
than 0 and at most 55: a proxy in front cuts a silent request at about a
minute. A timeout is not an error: the answer has exitcode: null, the
output so far, and the command keeps running, addressable by UUID as any
other. Absent: answer as soon as the command has started.
logs_limit(OPTIONAL) With req_timeout_s: at most this many bytes of each stream in
the answer, the rest staying at GET .../logs. Whole streams by default.
forget(OPTIONAL) With req_timeout_s: forget the command once it has finished,
as DELETE .../{uuid} would, so that one request is the whole exchange.
Does nothing on a timeout, when the UUID is still needed, nor when the
answer had to leave output behind short of what was asked (no
logs_limit, or one past the bound): a persisted log that spilled past
the ceiling is answered up to what memory could have held (a little
over 18 MiB), and the command then stays for GET .../logs,
stdout_available/stderr_available past what the answer carries
showing it.
RunCommandResponse
statusThe status of the response.
The response data for this request.
op_time_usThe operation time in microseconds.
messageAn optional message providing additional information about the status.
A list of errors which may have occurred during the request.
UploadFileRequest
pathPath where to upload the file.
filenameName of uploaded file; will be used if path is a directory.
parentsWhether to create parent directories of path.
encodingThe encoding of data.
dataThe data to write, in the given encoding
WriteFileRequest
pathThe absolute path of the file to write. It is created if missing.
appendWhether to append to the file instead of truncating it.
encodingThe encoding of data.
dataThe data to write, in the given encoding.