Sandbox¶
These dataclasses are used in the SDK to represent API requests and responses for services in the databricks.sdk.service.sandbox module.
- class databricks.sdk.service.sandbox.ComputeSpec(inactivity_timeout: 'Optional[Duration]' = None)¶
- inactivity_timeout: Duration | None = None¶
Idle duration after which the sandbox is automatically terminated.
- as_dict() dict¶
Serializes the ComputeSpec into a dictionary suitable for use as a JSON request body.
- as_shallow_dict() dict¶
Serializes the ComputeSpec into a shallow dictionary of its immediate attributes.
- classmethod from_dict(d: Dict[str, Any]) ComputeSpec¶
Deserializes the ComputeSpec from a dictionary.
- class databricks.sdk.service.sandbox.ExecuteCommandStatus¶
Terminal status of a unary command execution.
- EXECUTE_COMMAND_STATUS_COMPLETED = "EXECUTE_COMMAND_STATUS_COMPLETED"¶
- EXECUTE_COMMAND_STATUS_FAILED = "EXECUTE_COMMAND_STATUS_FAILED"¶
- EXECUTE_COMMAND_STATUS_TIMED_OUT = "EXECUTE_COMMAND_STATUS_TIMED_OUT"¶
- class databricks.sdk.service.sandbox.ExecuteCommandSyncResponse(command_id: str | None = None, exit_code: int | None = None, status: ExecuteCommandStatus | None = None, stderr: str | None = None, stdout: str | None = None, truncated: bool | None = None)¶
Result of a completed unary command execution: captured output, exit code, and terminal status.
- command_id: str | None = None¶
Daemon-generated identifier for this command execution, for correlation (for example in
ListCommands).
- exit_code: int | None = None¶
Process exit code. Unset when the process was terminated by a signal (e.g. on
TIMED_OUT) or never started (FAILED) rather than exiting normally.
- status: ExecuteCommandStatus | None = None¶
Terminal status of the command execution. Always set on a successful response; never
EXECUTE_COMMAND_STATUS_UNSPECIFIED.
- stderr: str | None = None¶
Captured standard error, with the same UTF-8 semantics as
stdout.
- stdout: str | None = None¶
Captured standard output as UTF-8 text. Invalid UTF-8 bytes are replaced with the Unicode replacement character (U+FFFD).
- truncated: bool | None = None¶
True when
stdout/stderrwere truncated because the captured output exceeded the server’s per-response size cap. The dropped output is not included in this response and is not recoverable through this unary API.
- as_dict() dict¶
Serializes the ExecuteCommandSyncResponse into a dictionary suitable for use as a JSON request body.
- as_shallow_dict() dict¶
Serializes the ExecuteCommandSyncResponse into a shallow dictionary of its immediate attributes.
- classmethod from_dict(d: Dict[str, Any]) ExecuteCommandSyncResponse¶
Deserializes the ExecuteCommandSyncResponse from a dictionary.
- class databricks.sdk.service.sandbox.ListSandboxesResponse(next_page_token: str | None = None, sandboxes: List[Sandbox] | None = None)¶
A list of Sandboxes.
- next_page_token: str | None = None¶
- as_dict() dict¶
Serializes the ListSandboxesResponse into a dictionary suitable for use as a JSON request body.
- as_shallow_dict() dict¶
Serializes the ListSandboxesResponse into a shallow dictionary of its immediate attributes.
- classmethod from_dict(d: Dict[str, Any]) ListSandboxesResponse¶
Deserializes the ListSandboxesResponse from a dictionary.
- class databricks.sdk.service.sandbox.Sandbox(create_time: Timestamp | None = None, display_name: str | None = None, name: str | None = None, spec: SandboxSpec | None = None, status: SandboxStatus | None = None, update_time: Timestamp | None = None)¶
A Sandbox resource representing an execution environment.
- create_time: Timestamp | None = None¶
Output only. The creation time of the sandbox.
- display_name: str | None = None¶
Human-readable display label for the sandbox. At most 256 characters.
- name: str | None = None¶
The sandbox resource name, in the form
sandboxes/{sandbox_id}. Derived fromsandbox_id; any value supplied in a create or update request body is ignored.
- spec: SandboxSpec | None = None¶
The desired configuration of the sandbox, supplied by the caller at creation time.
- status: SandboxStatus | None = None¶
The observed runtime state of the sandbox, populated by the server.
- update_time: Timestamp | None = None¶
Output only. The last update time of the sandbox metadata and spec.
- as_dict() dict¶
Serializes the Sandbox into a dictionary suitable for use as a JSON request body.
- as_shallow_dict() dict¶
Serializes the Sandbox into a shallow dictionary of its immediate attributes.
- class databricks.sdk.service.sandbox.SandboxSpec(compute: 'Optional[ComputeSpec]' = None)¶
- compute: ComputeSpec | None = None¶
Compute configuration (size, inactivity timeout) requested for the sandbox.
- as_dict() dict¶
Serializes the SandboxSpec into a dictionary suitable for use as a JSON request body.
- as_shallow_dict() dict¶
Serializes the SandboxSpec into a shallow dictionary of its immediate attributes.
- classmethod from_dict(d: Dict[str, Any]) SandboxSpec¶
Deserializes the SandboxSpec from a dictionary.
- class databricks.sdk.service.sandbox.SandboxState¶
Lifecycle state of a Sandbox resource. STOPPING is the transient state while the sandbox is being stopped – by a Stop request or inactivity auto-termination – and settles to STOPPED once the operation completes.
- SANDBOX_STATE_PENDING = "SANDBOX_STATE_PENDING"¶
- SANDBOX_STATE_RUNNING = "SANDBOX_STATE_RUNNING"¶
- SANDBOX_STATE_STOPPED = "SANDBOX_STATE_STOPPED"¶
- SANDBOX_STATE_STOPPING = "SANDBOX_STATE_STOPPING"¶
- class databricks.sdk.service.sandbox.SandboxStatus(state: 'Optional[SandboxState]' = None)¶
- state: SandboxState | None = None¶
Lifecycle state of the sandbox.
- as_dict() dict¶
Serializes the SandboxStatus into a dictionary suitable for use as a JSON request body.
- as_shallow_dict() dict¶
Serializes the SandboxStatus into a shallow dictionary of its immediate attributes.
- classmethod from_dict(d: Dict[str, Any]) SandboxStatus¶
Deserializes the SandboxStatus from a dictionary.