w.sandbox: Sandbox.v1¶
- class databricks.sdk.service.sandbox.SandboxAPI¶
Create, manage, and control the lifecycle of sandboxes – isolated, pre-configured, low-latency Serverless compute environments for running code.
- delete_sandbox(name: str)¶
Deletes a Sandbox.
- Parameters:
name – str
- execute_command_sync(name: str, cmd: str [, args: Optional[List[str]], envs: Optional[Dict[str, str]], execution_timeout: Optional[Duration]]) ExecuteCommandSyncResponse¶
Runs a command in the sandbox and blocks until it exits, returning the captured stdout, stderr and exit code in a single response.
- Parameters:
name – str Resource name of the sandbox to run the command in, in the form
sandboxes/{sandbox_id}. Bound from the URL path.cmd – str Executable or command to run (e.g.
/bin/echo,python3).args – List[str] (optional) Arguments passed to
cmd.envs – Dict[str,str] (optional) Extra environment variables for the command’s process, merged over the sandbox’s default environment.
execution_timeout – Duration (optional) Maximum time to wait for the command to finish. When it elapses the command is terminated and the response carries status
TIMED_OUT. The server applies a default when unset and clamps to an upper bound; negative or otherwise invalid durations are rejected withINVALID_ARGUMENT.
- Returns:
- list_sandboxes([, page_size: Optional[int], page_token: Optional[str]]) Iterator[Sandbox]¶
Lists all Sandboxes.
- Parameters:
page_size – int (optional)
page_token – str (optional)
- Returns:
Iterator over
Sandbox
- start_sandbox(name: str) Sandbox¶
Starts a previously stopped Sandbox under the same sandbox name. Returns NOT_FOUND if there is no stopped sandbox to start for the given name.
- Parameters:
name – str Resource name of the sandbox to start, in the form
sandboxes/{sandbox_id}.- Returns:
- stop_sandbox(name: str) Sandbox¶
Stops a running Sandbox, preserving it so it can later be restarted with a Start request.
- Parameters:
name – str Resource name of the sandbox to stop, in the form
sandboxes/{sandbox_id}.- Returns:
- update_sandbox(name: str, sandbox: Sandbox, update_mask: FieldMask) Sandbox¶
Updates mutable fields on an existing Sandbox. Allowlisted update_mask paths today: display_name, spec.compute.inactivity_timeout. Returns INVALID_PARAMETER_VALUE for empty masks or unknown paths; NOT_FOUND if the sandbox does not exist.
- Parameters:
name – str Resource name of the sandbox to update, in the form
sandboxes/{sandbox_id}.sandbox –
SandboxThe Sandbox resource carrying new field values. Only fields named inupdate_maskare read; unmasked fields are ignored.update_mask –
FieldMask Field paths to update. Must be a non-empty subset of:
display_name
spec.compute.inactivity_timeout Any other path returns INVALID_PARAMETER_VALUE.
- Returns: