Skip to main content
A sandbox created with a command runs one more process, its main command, which is not an exec. Its stdin, its exit, and its logs have their own routes on the data plane.

Attach

GET /sandbox/{id}/attach is a WebSocket to the main command’s stdin. Stdin goes in over it as stdin messages, as on an exec’s attach. The socket carries no output, so it is silent until its first heartbeat at 30 seconds. Its final message carries the exit code, and is sent again to a later attach. Output is read through the logs.

Stdin

POST /sandbox/{id}/stdin/close sends end-of-file to the main command’s stdin. /attach and /stdin/close are refused with 409 no_command on a sandbox without a main command.

Logs

GET /sandbox/{id}/logs returns the main command’s output as lines, oldest first, 20 per page and at most 100.
Output
page[after] continues from a position. A sandbox without a main command has no log lines. stream is null on every line, and ?stream= is refused with 400, because the main command’s output does not tell stdout and stderr apart.

Follow

?follow=true streams new lines as server-sent events. Each line is an event: log whose id is its position. A Last-Event-ID header resumes after that position. On a line that follow=true replays, ts is the time of the read. A comment is sent every 30 seconds, and an event: end marks the end of the logs once the sandbox has terminated.
API
Output
The host keeps 64 MiB of logs per sandbox. A line longer than 256 KiB is split.