create_sandbox
Create sandbox
Create a cloud sandbox (an Ubuntu microVM with root, Docker, git, Node and Python) and wait until it is ready. Returns its id and URL; later calls use it by default. Start from a named snapshot with from (a name, or a versioned name for its newest version) or fromLabels (the newest snapshot with all those labels).
輸入參數envfromnametypenoEnvlabelsfromLabelsttlSecondsidleStopMinutes
list_sandboxes
List sandboxes
List your sandboxes with their state, URL and labels.
輸入參數statelabels
Show one sandbox: state, URL, when it stops automatically, labels and stored bytes.
輸入參數sandboxId
Run a shell command (bash -c) in the sandbox. By default it waits and returns stdout, stderr and the exit code (timeoutSeconds, default 120, max 600). With detached: true it starts the command in the background and returns its processId at once: read its output and exit code with command_status, stop it with kill_command. Use detached for anything long (builds, test suites, servers).
輸入參數cwdenvcommand必填detachedsandboxIdtimeoutSeconds
command_status
Command status
Status of a detached command: running or its exit code, and its output. Pass the stdoutOffset/stderrOffset from the previous call to get only new output.
輸入參數processId必填sandboxIdstderrOffsetstdoutOffset
Stop a detached command.
輸入參數processId必填sandboxId
Read a file from the sandbox (up to 5 MiB).
輸入參數path必填encodingsandboxId
Create or overwrite a file in the sandbox (up to 5 MiB). Parent directories are created.
輸入參數path必填content必填encodingsandboxId
Serve a port of the sandbox on a stable public HTTPS URL. The URL carries an access token unless public is true. Start the service first, listening on 0.0.0.0 (or set localhost).
輸入參數port必填titlepubliclocalhostsandboxId
Snapshot the sandbox (memory included) and stop billing. Files, installed packages and running processes are kept; resume_sandbox brings it back.
輸入參數sandboxId
resume_sandbox
Resume sandbox
Resume a stopped sandbox from its snapshot and wait until it is ready. Its memory (running processes) is restored when a machine of its CPU type is free within 2 minutes; otherwise it boots from disk (files intact) and the result says so. requireMemory: true waits up to 30 minutes for its memory instead and fails rather than boot from disk.
輸入參數sandboxIdrequireMemory
extend_sandbox
Extend sandbox
Set when the sandbox stops: ttlSeconds from now (0 never), and/or idleStopMinutes (pause after that long without activity, waking on use; 0 never).
輸入參數sandboxIdttlSecondsidleStopMinutes
rename_sandbox
Rename sandbox
Change the sandbox's display name.
輸入參數name必填sandboxId
label_sandbox
Label sandbox
Replace the sandbox's labels ({} clears them).
輸入參數labels必填sandboxId
delete_sandbox
Delete sandbox
Delete a sandbox permanently: its disk, memory and automatic snapshots go (named snapshots saved from it stay). sandboxId is required: there is no default and no wildcard.
輸入參數sandboxId必填
save_snapshot
Save snapshot
Save the sandbox as a named snapshot to create new sandboxes from, and wait until it is saved. With versioned: true each save is a new version (<name>-v<N>); ifLatest saves only if the newest version is still that number (safe concurrent saves); keep deletes all but the newest N versions.
輸入參數keepname必填labelsifLatestsandboxIdversioned
list_snapshots
List snapshots
List your named snapshots: name, version, labels, created time, stored bytes (what counts toward your storage) and disk size (logical).
輸入參數namelabels
delete_snapshot
Delete snapshot
Delete one named snapshot (one version, e.g. ci-base-v3). name is required: there is no wildcard.
輸入參數name必填