Create a sandbox
Returns when the sandbox can run commands, with status running. For an image the node has not built yet it returns at once with status starting; calls that need the sandbox wait for it, and if the image cannot be pulled the sandbox becomes failed.
Takes write.
https://api.glac.ai/v1/sandboxes인증
헤더 파라미터
요청 본문JSON선택
- startoptionalboolean
true: start the image's own start command (ENTRYPOINT and CMD) when the machine boots;false: start nothing, whatever the image's labels ask for. Given (as any ofstart,start_commandandready), it is all that counts: the image's labelssbx.startandsbx.readyare not read. The sandbox is made from a template built with these settings andenv(two settings of one image are two templates; the first sandbox of a setting is returnedstartingwhile it is built), which only its owner's sandboxes are made from. Not for a sandbox made from asnapshotor atemplate(400invalid_start). - start_commandoptional
The start command, run as the image's user, its output kept by the sandbox's agent as that of the command
exe-start(the last 16 MiB of it, read like any command's withGET …/exec/exe-startand…/exec/exe-start/output; for an app's instance it is also what the app's log has of the instance): a string is run by/bin/sh -cand may hold several lines; a list is run as it is, without a shell (for an image that has none). At most 1000 arguments and 64 KiB, no NUL bytes, the first argument not empty. Withstart: false, 400invalid_start. - readyoptional
When the machine of the sandbox's template counts as up: the node saves the template, which every sandbox of these settings is cloned from, only once this check passes, so that the service is running in each of them from the start. One of three.
tcpandhttpare tried by the node from the host, at the address the preview URLs reach the sandbox by: nothing runs in the sandbox for them, so an image without a shell can be checked, and the service has to listen on all addresses, not on 127.0.0.1 alone.commandruns in the sandbox as the image's user, bysh, like the labelsbx.ready. Tried every 0.2 s for at most 120 s; a start command that ends with a failure meanwhile ends the wait at once. Either way the sandbox fails withfailure_codeboot_failed, andfailuresays what the check last got and what the start command printed last. Needsstart: trueorstart_command(400invalid_start). Not given: the template is saved without waiting. - guest_mitigationsoptionalboolean
Whether the guest kernel keeps its mitigations against speculative execution. They guard the guest's kernel against processes in the same sandbox: turn them on when a sandbox runs code of several users who do not trust each other. Sandboxes are kept apart from each other by the host either way. Default: the node's setting (off). The setting is fixed when the kernel boots: the first sandbox with a setting other than its image template's starts like a new image (returned
starting), and a sandbox made from a snapshot keeps the snapshot's (asking for the other is 400). - tmpoptionaldisk또는memory
Where the sandbox's /tmp is.
disk: on its disk, as the rest.memory: a tmpfs of at most half of its memory, mounted before its first command (in a sandbox made from a template or an image, over what the template's guest had put there; by the guest's init where it starts from its disk): what is written there is the guest's memory, billed as memory, kept when it sleeps, and gone when it starts again from its disk. A sandbox made from a snapshot whose sandbox had it in memory has it so whatever this says.default: "disk" - runtimeoptional
Runtime settings of its machine and its commands, as a Compose file's
ulimits,sysctls,tmpfs,dnsandshm_sizeask for them (Runtime). For a sandbox made from an image: they make a template of the caller's own, built with them (with nothing said of the start, the image is started as its labels ask). Refused for one made from a snapshot or a template (400invalid_start), which goes on with what its machine has. - initoptional
What the sandbox's PID 1 is. Not given, or null: the platform's init, which starts the image's start command where there is one (
start,start_command, the image's labels).systemd: a whole system. The image's own systemd is PID 1 and the node's agent is one of its services: the user installs packages, starts services withsystemctl, uses cron and the journal and logs in by SSH, as on a machine. Nothing a create names is started (start,start_commandandreadyare refused with 400invalid_start), and the template is saved once systemd says the machine has booted. Withoutimage: the node's image of a whole system (--systemd-image; Ubuntu 24.04 with systemd and OpenSSH, sandboxd/images/ubuntu), refused with 400invalid_starton a node that has none. An image without systemd (/usr/lib/systemd/systemd) fails its build, withfailure_codeinvalid_image. Its template is anybody's who asks for the same image so, unless something of the caller's is in it (runtime,image_pull_secret). Refused for one made from a snapshot or a template (400invalid_start), which goes on as its machine was. Everything else a sandbox does works as for any sandbox: commands, files, terminals, the SSH gateway, sleep and wake, snapshots and forks, moves, egress rules (sandboxd/README.md, 「整个系统:systemd 当 PID 1」). - project_networkoptionalboolean
true: the sandbox is on its project's private network from before it runs anything, at the first of the addresses the node was left to spare for the project (setProjectNetwork): the answer says which (project_address). The project is the call's owner, so this is for a call the control plane makes for a project; on a node that stands alone a sandbox is nobody's, and is put on a network by being named in it. A sandbox is on no project's network unless it asks: defaultfalse. A copy made by a fork is on none, whatever its original is on. - imageoptionalstring
An OCI image reference (
python:3.12,ghcr.io/org/app@sha256:…), in a registry on the internet: one that gives the image to anybody, or one that wants a login, withimage_pull_secret. The first sandbox of an image is returnedstartingwhile the node pulls the image and builds a template; later ones start from the template. Default: the node's base image.maxLength: 512 - image_pull_secretoptionalstring
The name of a secret (
PUT /v1/secrets/{name}) that holds the credentials of the image's registry, for an image that is not public:username:passwordin printable ASCII, the user name ending at the first colon. A registry that takes a token alone documents the user name that goes with it (AWSfor ECR,oauth2accesstokenfor Google's, any name for GHCR). The node hands the credentials to the tool that pulls the image and to nothing else: nothing of them is in the sandbox, in its template or in the node's log, and what a registry says when it refuses them comes back without them (failure_coderegistry_auth_failed). The sandbox is made from a template of its owner's alone, which a create that names credentials finds and no other: the same image named without them is asked of its registry without a login, whether or not the node has the template. The secret has to exist (404secret_not_found), to be one that may go to the image's registry (itsallowed_hostscover the registry's host as the reference writes it, without its port,docker.iowhere it names none; 403secret_host_not_allowedotherwise) and to hold such a pair (400invalid_field), and it goes withimage(400invalid_fieldfor a sandbox made from none).maxLength: 128 - limitsoptionalobject
The shape a create asks for. Each part that is not given (or is null) is the node's base template's, which is what a sandbox that asks for none gets. Up to the most this node gives a sandbox,
max_vcpusandmax_memory_bytesofGET /internal/node(by default the host's CPUs, up to 32, and its memory; never less than the base template's shape); more is 400invalid_field. Each shape of an image is a template of its own: the first sandbox of a shape the node has not built that image in is returnedstartingwhile the node builds it, from the same image, and later ones are cloned from it. Withoutimage, another shape than the base template's is built from the node's base image. A sandbox made from asnapshotor atemplatehas that one's shape: asking for it is fine, for another 400invalid_field(paramlimits). The disk's size is the node's:disk_bytesis 400invalid_field. - nameoptionalstring
A name given by the caller to a sandbox, a snapshot, a volume or an SSH key: 1 to 63 lower-case letters, digits and hyphens, not starting or ending with a hyphen, and not starting with an id prefix (
sbx-,exe-,snap-,vol-,evt-,req-; an SSH key's not withsshkey-either). A DNS label that cannot be taken for an id. Unique among sandboxes, among snapshots, among volumes and among SSH keys.pattern: ^[a-z0-9]([a-z0-9\-]{0,61}[a-z0-9])?$ - secret_envoptional맵string
More environment variables, whose values are secrets: every command started in the sandbox gets them with
env, and so does its start command (written for it whereenvis, and nowhere else: no value of them is in a template's key or record). No answer shows a value: the sandbox shows their names (Sandbox.secret_env). At most 64 variables and 64 KiB, names asenvtakes them, none of them inenvtoo (400invalid_field,paramsecret_env.<name>); taken when the sandbox is made and not changed afterwards (a PATCH that givesenvone of these names is refused the same way,paramenv.<name>). Not in a snapshot: a sandbox made from one has the ones its own create gives. - metadataoptional맵string
Free key-value pairs for the caller's own use; lists of sandboxes filter by them. At most 64 keys of 1 to 64 characters, values of up to 1024. Not a place for secrets: metadata are stored in clear, and every set of them a sandbox has had while it used something is kept with its usage for thirteen months, also after the sandbox is deleted (
GET /v1/usagegroups and filters by them). - volumesoptional배열object
Volumes to mount before the call returns. At most two that are not shared. A sandbox made from a template that holds its start command back (
TemplateBuildRequest.start_after_volumes) has its start command started once they are mounted, and the call returns when the command is up as the template'sreadysays; so does every boot of it from its disk (a restart, a host that went down), which mounts them first. - public_ports_exceptoptionalarray | null
Every port but these is public as well: its short preview URL opens it for anybody, as a port in
public_ports(how E2B makes a sandbox's ports; the control plane's E2B compatibility gives[49983], envd's port, which a sandbox token opens).[]: every port. Null (the default): onlypublic_ports. Ports are taken once each, in order. - awake_portsoptionalarray | null
Ports on which a connection upgraded through the preview URL (a WebSocket: a browser's DevTools client on 9222, the viewer of a screen on 6080) keeps the sandbox awake for as long as it is open, and is billed for. While this names a port, the sandbox is idle by those connections and by the requests and calls it is given, and by nothing its guest does: its CPU, its timers, its connections to anywhere and their traffic do not keep it awake, and it is not woken for a timer (what came due meanwhile fires when the next connection wakes it). It goes to sleep
sleep_after_secondsafter the last of them ended, without its guest being asked. Such a connection has TCP's keepalive on its client's side, so that a client that went away without closing it is found out within about a minute. Null or[](the default): idle as any sandbox is. Kept in order, without duplicates. Not for a one-shot run (POST /v1/run). A session of Browsers (reports/browsers/README.md) is made with[9222]. - connection_idle_secondsoptionalinteger | null
A connection on one of
awake_portsthat has carried nothing in either direction for this long is closed by the node (and the sandbox, if nothing else holds it, sleepssleep_after_secondsafter that). Null (the default): never for that. Holds for the connections that open after it is set.maximum: 86400 · minimum: 1 - on_expiryoptionaldelete또는sleep또는hold또는null
What
expires_atdoes when it comes:deletethe sandbox (null or absent: this);sleep, put it to sleep whatever goes on in it, and keep it (itsexpires_atis null from then on, and a request wakes it as ever);hold, the same, held asleep (held_asleepis set then: a request does not wake it). How E2B pauses a sandbox when its time is up (the control plane's E2B compatibility). Another word is 400invalid_field.default: "delete" - held_asleepoptionalboolean | null
True: while it sleeps, a request to one of its ports does not wake it: the preview listener answers 502
sandbox_pausedin its place, as E2B's proxy answers for a paused sandbox (x-preview-ingress), and only a call of the API (or its own timer) wakes it. It is not put to sleep by this:POST /v1/sandboxes/{id}/sleepdoes that. False or null: as any sandbox. (E2B'spausewithout itsautoResume, which the control plane's E2B compatibility sets, and takes away at itsconnect.)default: false - sleep_notice_msoptionalinteger | null
How long before the idle rule puts the sandbox to sleep (or pauses it) every program connected to its guest's
/run/sbx/awakeis sent the linesleep N, in milliseconds; the sleep comes that long after, unless a hold raised meanwhile puts it off (sleep_hold_max_ms). Where nobody is connected, the sleep is not put off. A sleep somebody asks for (POST /v1/sandboxes/{id}/sleep, a freeze, a move, the node stopping) is told nothing. 0, null or absent: not told.maximum: 60000 · minimum: 0 - sleep_hold_max_msoptionalinteger | null
How long the holds a program in its guest raises (
+on/run/sbx/awake) keep the sandbox up at the most, in milliseconds, counted from the moment it was first found held while nothing else kept it up; then it sleeps whatever holds it (the programs connected are toldsleep N capfirst, wheresleep_notice_msasks for a notice), and the count begins again at its next quiet. Held, it runs and is metered as running. 0: holds are not heeded. Null or absent: the node's (--sleep-hold-max-seconds, 30 s unless set).maximum: 900000 · minimum: 0 - suspend_after_msoptionalinteger | null
How long the pause tier (
pause_tierofGET /internal/node) holds the sandbox paused, once the idle rule has stopped it, before its memory is saved and it sleeps for real, in milliseconds. Paused, it answers in a millisecond or two and is metered for the memory it holds; asleep, for what it keeps on disk. The node's--pause-max-seconds(600 unless set) is also the longest it is held paused whatever this says: a paused machine holds the host's memory. The host's memory below the floor, a slot another machine needs and a sleep somebody asks for put it to sleep sooner. Null or absent: the node's. Of no effect where the node has no pause tier.maximum: 86400000 · minimum: 1000 - wake_daily_atoptionalstring | null
A time of day in UTC,
HH:MM, at which the node wakes the sandbox every day while it sleeps or stands paused, for work of its own that waits for a wake and keeps no time (a database's maintenance, say). The wake is no activity: what runs then is, and once that is done the idle rule puts it to sleep again. Not for a sandbox that is idle by its connections (awake_ports). A stateful service's instance (its start command held back for its volumes) is woken besides for the next run of its PostgreSQL server'spg_cronjobs, which the node asks its agent for before it rests; while a job runs, or is due within 5 s, the idle rule does not rest it. Null or absent: none.pattern: ^([01][0-9]|2[0-3]):[0-5][0-9]$ - hostnameoptionalstring | null
The name the sandbox's machine has, for good, in place of its id: what
hostnamesays in it, from its first boot and after every restart. Lower-case letters, digits and hyphens, in labels between dots; otherwise 400invalid_field. The control plane gives a service's instance the service's name (or the service'shostname). Not given: the sandbox's id.maxLength: 63 · pattern: ^[a-z0-9]([a-z0-9-]*[a-z0-9])?(\.[a-z0-9]([a-z0-9-]*[a-z0-9])?)*$ - stopoptionalobject | null
How the sandbox's start command is stopped before its machine is ended for good: before a restart (
POST /v1/sandboxes/{id}/restart) and a delete. The signal goes to the start command, which is then givengrace_msto end; what has not ended then goes with the machine. A machine that sleeps or is paused is not stopped: it goes on from where it was. Not given: the start command goes with its machine, as it always has. Unknown keys: 400unknown_field; a signal that is none of these, or a grace beyond ten minutes: 400invalid_field. - logoptionalobject | null
The app's log the sandbox's lines go to, as the lines of the app's instances do (
readAppLog): what its start command prints, a line for each request through its ports and what the node does to it (made, stopped, deleted). For a sandbox made from the app's version's template (template, the key the log knows the version by), of its owner's: the control plane gives it for an app's keyed instance and for a stateful service's. Nothing of the app's group holds for it otherwise: it is no instance the app's requests are given to, and sleeps and is deleted as a sandbox. Withouttemplate: 400invalid_field. - checkpointoptional
Checkpoints while the sandbox runs: every
every_secondsits memory and its disk as they are at one instant go to the node's object store (the node pauses its machine for a few milliseconds for it; what it wrote since the last one is what goes), so that when the node's host is lost the sandbox is taken over elsewhere with its processes, from its newest checkpoint, losing at most what it did since. A checkpoint is begun only once the one before is in the store: a sandbox that writes more than the node's link for them takes falls behind (checkpoint.behind_seconds) rather than filling it. Asleep, its sleep's image is what it is taken over from. Null (the default): none. Any sandbox may have it, given when it is made or by aPATCH(the control plane also gives it to the keyed instances of an app whosecheckpointsays so); what the store keeps of its newest checkpoint is billed as a sleeping sandbox's state while it runs (checkpoint.stored_bytes). A node that does not copy disks to an object store (--upload), or whose memory is not in layers, refuses it (409checkpoints_unavailable,paramcheckpoint), and a control plane makes a sandbox with it only on a node that takes checkpoints. Its Drives are pinned with its own disk at the same instant, and a takeover from it brings them back as they were then, with its memory; none is taken while a volume that is not a Drive is attached (such a volume has no copy in the store), or while a read of its guest is held up on a drive of its machine. A checkpoint does not reset the guest's vsock connections (the agent's calls go on), and the first one after a wake from a sleep whose image the store has sends only what the guest wrote since. - regionoptionalna또는eu또는ap또는null
The region to make it in, read by the API and not passed on. Null or left out: the region the API itself runs in. Where no machine of that region can take it, the next region does; what has to go to one machine (made from a snapshot or with volumes, or sent again with the same
Idempotency-Key) goes there, whatever the region. A volume made from a backup is made in the backup's region: another is 400invalid_field. Not a region: 400unknown_region. The answer'sregionsays where it was made.
Returns
201
The sandbox.
- start_commandrequired
How its start command runs, how often it was started again in its machine after it ended, and how its last run ended, as its guest said last (once a second while its machine runs: src/restarts.rs). The node has the guest start it again in the same machine, with its disk and volumes as they are, for an instance that is its owner's state (a key's, a stateful service's: a database's), once its command is up; an instance of an app's group is retired instead, and another takes its place; any other sandbox's start command is left as it ended. Null where its guest has said nothing of it: it has none, it has not begun (a stateful service's waits for its volumes), or its machine has not run since the node knew to ask.
- devtoolsobject | nullrequired
Of a sandbox of a browser's image (one with the label
sbx.devtools, the port of its browser's DevTools protocol): the browser's own address, as the node asked it (/json/version) when it built the image's template. The browser is the template's, the same in every sandbox made from it, and this goes with the sandbox wherever it goes. A client that takes nothing but a WebSocket's address connects topathat the signed link ofport. Null for any other sandbox. - image_digeststring | nullrequired
The image its disk was made of, by the digest of its manifest (or list of manifests) as its registry named it when its template was built (
Template.image_digest): what a tag named then. A tag that is moved since makes another image of the sandboxes made after it (a newer template), and this one's stays. While its template is being built (starting): the image the build is of, where the create knew it (a tag found to name a newer image than the template there holds, built by that digest), else null; and null where the template does not say (one built from a disk file, or before templates said so).pattern: ^[A-Za-z0-9]+:[0-9A-Fa-f]{32,}$ - appstring | nullrequired
For an instance of an app, one of those the node makes and deletes by the app's requests (
PUT /internal/apps/{key}): the app, by the key of its template, as the node's inventory says it. Null for any other sandbox, a keyed instance of an app among them (itsmetadatasay its app and its key). A control plane shown an instance first in the answer to a call keeps it out of its edges' table by this, as it keeps one its node's inventory lists. - ipv6string | nullrequired
Its own public IPv6 address, for its whole life: what it sends over IPv6 leaves from it, untranslated, and what comes to it is let in as
inboundsays. Given when it is made, on a node with a pool of addresses; kept through sleep, snapshot and move; a fork, or a sandbox made from a snapshot, has one of its own. Null: IPv4 alone (its node has no pool, or its template's agent is from before addresses of their own). - statusstringrequired
Information: a caller need not look at it before a call.
starting: its image is being pulled and built, and calls that need it wait.sleeping: memory saved, nothing running (also shown for a sandbox that has only its disk left, and for one that is paused in the node's memory:sleep_tiersays which); the next call that needs it wakes it.failed: it could not be built or woken, or its record on the node could not be read after the node's host went down, and calls that need it answer 409sandbox_failed. The answer of a call that changes it (create, sleep, restart, restore) shows the status that call left. - sleep_tierrequired
How a
sleepingsandbox sleeps; null for every other status.paused: its machine stands still in the node's memory, with its processes and connections (a node with the pause tier on pauses an idle sandbox instead of saving it), and a call resumes it in about a millisecond; the memory its machine holds is metered as a running sandbox's is (usage.memory_bytes,memory_gib_seconds), and its CPU is not.saved: its memory and the state of its devices are saved on the node, and nothing runs; a call wakes it from them in a few milliseconds.disk: only its disk is left (its machine ended by itself, the node's daemon ended without putting it to sleep, or its memory could not be kept); the next call that needs it boots it from the disk, and what ran is gone.POST /v1/sandboxes/{id}/sleepsaves a sandbox, paused or running. - failure_coderequired
Why the sandbox is
failed, for programs; null otherwise.image_not_found: the image is not in its registry, or is not public (a registry that wants a login says no more than that to a create that names no credentials).image_pull_failed: the registry could not be reached or did not hand the image out, or the tool that fetches was stopped at a limit of the node's (failuresays which).registry_auth_failed: the registry refused the credentials the create named (image_pull_secret);failurehas what the registry said.image_unpack_failed: the image does not fit the disk, is larger than the node takes (failurehas the numbers), or cannot be unpacked.invalid_image: the registry is at an address on the node or in a private network, or the image cannot be started as asked (no ENTRYPOINT or CMD forstart: true, labels that ask for what cannot be done).boot_failed: the machine made from the image did not start, or its start command did not come up (thenfailuresays what its ready check got and what it printed last).no_capacity: the node had no room.memory_full: the host's memory had no room for the machine its template is built in, or for its own.drive_full: the node's data drive filled while the image's template was being built.record_lost: the sandbox's record cannot be read; its files are kept on the node, but it cannot be started, only deleted.recovery_failed: the sandbox's startup recovery could not finish; its files and recovery intent are kept on the node, and it cannot be started, only deleted.start_failed: anything else; the node's log has it. - snapshotstring | nullrequired
The id of the snapshot whose state the sandbox last took: the one it was created from or restored to. Null for a sandbox made from an image. Not cleared when that snapshot is deleted, and for a fork it names the fork's own temporary snapshot, which is gone by the time the call returns.
pattern: ^snap-[0-9a-hjkmnp-tv-z]{16}$ - metadata맵stringrequired
Free key-value pairs for the caller's own use; lists of sandboxes filter by them. At most 64 keys of 1 to 64 characters, values of up to 1024. Not a place for secrets: metadata are stored in clear, and every set of them a sandbox has had while it used something is kept with its usage for thirteen months, also after the sandbox is deleted (
GET /v1/usagegroups and filters by them). - egressobjectrequired
A sandbox's egress rules, as they are stored: what it may reach, what it may ask of a host, and which of its requests get a secret added. Always there; a sandbox without rules has
defaultallowand four empty lists, and its traffic takes the path it would take without rules. A connection or a packet thatdenyspeaks of is refused; one thatallowspeaks of passes; anything else getsdefault. A host ininjectcounts as allowed, and so does a host inhttp, for the requests its entry allows. Whatever the rules say, a sandbox reaches neither the node, nor other sandboxes, nor private ranges, nor the metadata addresses of clouds.A host name is matched against the server name of a TLS handshake and the Host header of an HTTP request, on any port, and against the sandbox's DNS questions, which the node answers itself for a sandbox whose rules can refuse a name (for a refused name the answer is
REFUSED). A connection that names an allowed host goes to an address the node has for that name, whatever address the sandbox was connecting to. A TCP connection that is neither TLS nor HTTP passes to an address the rules list, or to one the node gave the sandbox as that of an allowed name. UDP and every other protocol go by address only. Underdefault: allowadenylist is not a wall: anything allowed that relays traffic gets around it. - on_expirydelete또는sleep또는holdrequired
What
expires_atdoes when it comes:delete, the sandbox is deleted (the default);sleep, it is put to sleep whatever goes on in it and kept, itsexpires_atnull from then on;hold, the same, held asleep (held_asleepset). The control plane's E2B compatibility givessleeporholdto a sandbox whose time being up pauses it. - held_asleepbooleanrequired
Asleep and not woken by requests (E2B's paused sandbox, which the control plane's E2B compatibility holds so between its
pauseand itsconnect): while it sleeps, a request to one of its ports does not wake it, and the preview listener answers 502sandbox_pausedin its place (x-preview-ingress). A call of the API wakes it as ever, and so does its own timer; a request that comes while it is awake goes on to it. - delete_after_idle_msinteger | nullrequired
After how long asleep the node deletes the sandbox, in milliseconds, counted from
idle_since: a sandbox that is woken counts again from its next sleep. Null: never for that (the default); the sandbox stays until it is deleted, or until itsexpires_at. A sandbox that does not sleep by itself (sleep_after_secondsnull) counts the sleeps it is put to (POST /v1/sandboxes/{id}/sleep, a restart of its node). Not while it is frozen (its owner's spend limit): a freeze keeps it with its data, and once let go of, the sleep it is in counts from then.format: int64 · minimum: 1000 - idle_sincestring | nullrequired
When its current sleep began, while
statusissleeping: when its machine was paused or put to sleep, or found to have ended. One that was running when its node stopped sleeps from the moment its node was started again; one that was frozen, from the moment it was let go of. Null while it is not asleep.format: date-time - last_active_atstring | nullrequired
The last activity the node saw: a call, a packet on its link, its guest computing (more than 2% of a core over
sleep_after_seconds, by the guest's own count where the host saw more than that; by the host's count for a template from before guests said what they computed), noted when the node looks.format: date-time - awake_becausestring | nullrequired
Why a running sandbox has not been put to sleep, in a few words of prose. Null unless
statusisrunning. An instance of an app says what the node gave it: a request in its hand, a call in flight, a request that ended less than itssleep_after_secondsago, or that its app's floor keeps it awake. One that a packet on its project's network woke, and that nothing else has kept awake since, says so and which packet it was:woken by a packet: TCP from 10.64.0.7:41594 to port 5432 [S] …. Connections inside its project keep no sandbox awake: what comes over them while it sleeps is the node's hold's (Node.hold). - host_failurerequired
What the sandbox last lost to the host it is on, and why (
cause): its memory when the host went down hard (power, a kernel that gave up), as the node found it when it came back; or its memory when the node was started again with another Firecracker than had saved it, and the sandbox was then used. Null for a sandbox that lost nothing: one that never went through either, and one that was asleep with everything it needs on the host's disk, which wakes as it always does on a node that is what it was. It stays as it is until the next such loss. - project_addressstring | nullrequired
Its address on its project's private network: where the project's other sandboxes on that network reach it, and what they see it as, whichever slot of the node it runs in. Null for a sandbox that is on no project's network. Given by whoever tells the node of the network (
setProjectNetwork), or taken by a create that saidproject_network: true.pattern: ^10\.(6[4-9]|[7-9][0-9]|1[01][0-9]|12[0-7])(\.(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9]?[0-9])){2}$ - usable_atstring | nullrequired
Where its disk came back from the object store (a restore, a move to this node, or a sandbox made here from a snapshot taken on another node, whose disk is in the store), the moment it could answer: its node had it and, for a disk filled as it is read, something listened for the blocks not here yet. Null for a sandbox whose disk was made on its node. Each such arrival starts the four fields over.
format: date-time - hydrated_bytesinteger | nullrequired
How many bytes of its disk are on its node, of
total_bytes, while it fills after it came back from the object store (a block brought ahead of the guest's first read counts);total_bytesonce it is all there. Bytes, not files: what a few large files that come last hold shows as what is left. Null astotal_bytesis.format: int64 · minimum: 0 - total_bytesinteger | nullrequired
How many bytes its disk brings from the object store: its own, and its image's where its node did not have the image and it comes block by block too. Null for a sandbox whose disk was made on its node, and in the moment before its node has counted them.
format: int64 · minimum: 0 - disk_writesrequired
What its disk has written today (UTC), against the day's share at full speed: past the share its disk takes writes slowly until the day ends, and no write fails. Null on a node that does not copy its disks to an object store, which counts nothing and slows nothing, and for a static instance (
SandboxInternals.static), whose disk is not copied. - initoptional
What its PID 1 is (
initat creation):systemd, its image's own systemd (a whole system), or null, the platform's init. One made from a snapshot, or a fork, has the snapshot's sandbox's. A whole system has a machine ID of its own (/etc/machine-id, and D-Bus's copy, /var/lib/dbus/machine-id), given when its machine is made (a clone of a template or a snapshot, a fork, a boot from a snapshot's disk) and kept from then on, through sleeps, wakes, moves and boots from its disk; its journal is filed under it (/var/log/journal/). - url_patternoptionalstring | null
The preview URL of a port, with
{port}and{signature}to fill in: the signature is the first 12 characters of base32(HMAC-SHA256(key =url_secret, message = the port in decimal)), in the alphabet0123456789abcdefghjkmnpqrstvwxyz. For a public port (public_ports, or onepublic_ports_exceptdoes not name where it is given), drop-{signature}. Null when the node has no preview domain; absent when the caller is a sandbox token.
400
The request is not one this call takes. invalid_json: the body is not a JSON object; unknown_field: the body has a field this call does not take; unknown_parameter: the query has a parameter this call does not take; invalid_field: a field or query parameter has the wrong type or is out of range; invalid_name: name is not a valid name; invalid_env: env has a name or a value an environment cannot hold; invalid_metadata: metadata is over its limits; expires_in_the_past: expires_at is not in the future; invalid_egress: egress is not a set of rules: param names the part that is wrong; invalid_start: start, start_command and ready do not go together as given (ready without a start command, start: false with start_command), or one of them is given with init: "systemd", whose systemd starts what its units say, or init: "systemd" names no image on a node that has no image of a whole system (--systemd-image), or the sandbox is made from a snapshot or a template: param names the field; ambiguous_source: more than one of image, snapshot and template; invalid_image: image is not a reference to an image in a registry on the internet; invalid_path: a volume's path is not absolute or is /; invalid_idempotency_key: Idempotency-Key is empty or over 255 characters.
- exec_idoptionalstring
With
sandbox_movedofPOST …/run: the id of the command the call started and waited for, which goes on where the sandbox went: wait for it there through the control plane withGET …/exec/{exec_id}?wait_seconds=once the move is over. The same call made again starts the command a second time, unless it comes with the same Idempotency-Key.
401
missing_api_key, invalid_api_key, expired_api_key, invalid_token.
403
The credential may not do this. needs_api_key: a sandbox token cannot do this. secret_host_not_allowed: a secret would be sent to a host it may not go to: by egress.inject (the rules given, or a snapshot's), or as image_pull_secret to the image's registry (param says which; allowed_hosts beside error says where it may go). account_share_reached: its account holds as much of this node's data drive as one account may (drive.accounts of GET /internal/node), and has not the room for the sandbox's memory and a gigabyte to write; the message says what it holds there and what it may. Nothing was made.
- exec_idoptionalstring
With
sandbox_movedofPOST …/run: the id of the command the call started and waited for, which goes on where the sandbox went: wait for it there through the control plane withGET …/exec/{exec_id}?wait_seconds=once the move is over. The same call made again starts the command a second time, unless it comes with the same Idempotency-Key.
404
Something the request names does not exist. snapshot_not_found: no such snapshot; template_not_found: no such template; volume_not_found: a volume named in volumes does not exist; secret_not_found: a secret named in egress.inject, or the one image_pull_secret names, does not exist.
- exec_idoptionalstring
With
sandbox_movedofPOST …/run: the id of the command the call started and waited for, which goes on where the sandbox went: wait for it there through the control plane withGET …/exec/{exec_id}?wait_seconds=once the move is over. The same call made again starts the command a second time, unless it comes with the same Idempotency-Key.
409
The state of something stands in the way. name_taken: the name is taken; volume_in_use: a volume in volumes that is not shared is another sandbox's; duplicate_volume: a volume is listed twice in volumes; mount_path_taken: two volumes in volumes have one path; too_many_volumes: volumes has more that are not shared than the sandbox's machine has spare drives (eight; two for one made from a template or a snapshot of before there were eight); snapshot_lost: the snapshot's status is lost; no_project_address: project_network was asked for, and the node has no network of the project, or no address of it left to spare, or another sandbox took the one project_address names meanwhile; sandbox_failed: the sandbox's template holds its start command back (TemplateBuildRequest.start_after_volumes) and the command did not come up once the volumes were mounted: the message says what it printed last, and nothing is kept; idempotency_key_reused: the key was used with another body; idempotency_in_progress: the first request with the key is still running. volume_restoring: a volume it names is being made from a backup, or could not be. checkpoints_unavailable (param checkpoint): checkpoint is on, and this node takes no checkpoints (it does not copy its disks to an object store, or its memory is not in layers).
- exec_idoptionalstring
With
sandbox_movedofPOST …/run: the id of the command the call started and waited for, which goes on where the sandbox went: wait for it there through the control plane withGET …/exec/{exec_id}?wait_seconds=once the move is over. The same call made again starts the command a second time, unless it comes with the same Idempotency-Key.
503
Not available. not_served_here: egress rules were given, and this node cannot put rules in force (it has no nft); or project_network was asked for, and this node puts no sandbox on a project's network; or the sandbox is to be made from an image the node has no template of, and this node fetches no images (image_pulls of GET /internal/node says why; param is image); or key_missing: this node is keyed (src/seal.rs) and does not hold the key of the project whose it is, or the platform's (the message says which): the control plane gives it, and the same call is made again (Retry-After); or unavailable: a volume in volumes could not be attached in time, and the same call is made again (Retry-After): the guest's mount of it did not finish within 60 s (a Drive whose blocks do not come: its object store away, or its fetcher out of reach), or it is still being taken off the machine after such an attach, or it is a Drive that comes block by block and nothing answers for its blocks yet.
- exec_idoptionalstring
With
sandbox_movedofPOST …/run: the id of the command the call started and waited for, which goes on where the sandbox went: wait for it there through the control plane withGET …/exec/{exec_id}?wait_seconds=once the move is over. The same call made again starts the command a second time, unless it comes with the same Idempotency-Key.
default
Any other failure, in the same shape. internal (500): the node failed; the message says no more, and the node's log has the reason under the request's id. unavailable (503, retryable): no_capacity, every network slot of the node is in use; memory_full, a machine the call has to start (made, woken, booted from its disk, resumed, rolled back, built) does not fit in the host's memory beside what the machines that run on it are promised, and nothing paused or idle could be put to sleep to make room for it (memory of the node); drive_full, the call would have a template built and the node's data drive has no room for one (drive of the node); unavailable, the node is shutting down, the sandbox was still starting after 10 minutes, or it did not answer, or it is being moved to this node (with Retry-After: 1); fenced, the node's lease fences the sandbox (Node.lease). moved (409): the sandbox was moved to another node, which to names.
- exec_idoptionalstring
With
sandbox_movedofPOST …/run: the id of the command the call started and waited for, which goes on where the sandbox went: wait for it there through the control plane withGET …/exec/{exec_id}?wait_seconds=once the move is over. The same call made again starts the command a second time, unless it comes with the same Idempotency-Key.