Optional
options: ExecOptions & { mode?: "text" }Open a file in the Sandbox filesystem.
Path to the file to open
File open mode (r, w, a, r+, w+, a+)
Promise that resolves to a SandboxFile
Check if the Sandbox has finished running.
Returns null
if the Sandbox is still running, else returns the exit code.
Set tags (key-value pairs) on the Sandbox. Tags can be used to filter results in Sandbox.list
.
Snapshot the filesystem of the Sandbox.
Returns an Image
object which can be used to spawn a new Sandbox with the same filesystem.
Timeout for the snapshot operation in milliseconds
Promise that resolves to an Image
Get Tunnel metadata for the Sandbox.
Raises SandboxTimeoutError
if the tunnels are not available after the timeout.
A dictionary of Tunnel objects which are keyed by the container port.
Static
fromReturns a running Sandbox object from an ID.
Sandbox with ID
Static
fromGet a running Sandbox by name from a deployed App.
Raises a NotFoundError if no running Sandbox is found with the given name.
A Sandbox's name is the name
argument passed to App.createSandbox
.
Name of the deployed App
Name of the Sandbox
Optional
environment: stringOptional override for the environment
Promise that resolves to a Sandbox
Static
listList all Sandboxes for the current Environment or App ID (if specified). If tags are specified, only Sandboxes that have at least those tags are returned.
Sandboxes are secure, isolated containers in Modal that boot in seconds.