Skip to main content

sandboxes

Creates, updates, deletes, gets or lists a sandboxes resource.

Overview​

Namesandboxes
TypeResource
Iddatabricks_workspace.sandbox.sandboxes

Fields​

The following fields are returned by SELECT queries:

NameDatatypeDescription
namestringThe sandbox resource name, in the form ``sandboxes/{sandbox_id}``. Derived from ``sandbox_id``; any value supplied in a create or update request body is ignored.
display_namestringHuman-readable display label for the sandbox. At most 256 characters.
create_timestring (date-time)Output only. The creation time of the sandbox.
â–¶metadataobjectMetadata associated with the sandbox.
â–¶specobjectThe desired configuration of the sandbox, supplied by the caller at creation time.
â–¶statusobjectThe observed runtime state of the sandbox, populated by the server.
update_timestring (date-time)Output only. The last update time of the sandbox metadata and spec.

Methods​

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectsandbox_id, deployment_name, workspace_domainRetrieves a Sandbox by name.
listselectdeployment_name, workspace_domainpage_size, page_tokenLists all Sandboxes.
createinsertsandbox_id, deployment_name, workspace_domainCreates a new Sandbox.
updateupdatesandbox_id, update_mask, deployment_name, workspace_domainUpdates mutable fields on an existing Sandbox. Allowlisted update_mask paths today: display_name,
deletedeletesandbox_id, deployment_name, workspace_domainDeletes a Sandbox.
startexecsandbox_id, deployment_name, workspace_domainStarts a previously stopped Sandbox under the same sandbox name. Returns NOT_FOUND if there is no
stopexecsandbox_id, deployment_name, workspace_domainStops a running Sandbox, preserving it so it can later be restarted with a Start request.

Parameters​

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
deployment_namestringThe Databricks workspace deployment name: the host prefix of the workspace URL (dbc-abcd0123-a1bc on AWS, adb-1234567890123456.7 on Azure, 1234567890123456.7 on GCP). Set DATABRICKS_DEPLOYMENT_NAME to default it for the session. (default: dbc-abcd0123-a1bc, x-stackQL-envVar: DATABRICKS_DEPLOYMENT_NAME)
sandbox_idstringThe sandbox_id segment of the name resource name (sandboxes/{sandbox_id}). Resource name of the sandbox to stop, in the form sandboxes/{sandbox_id}.
update_maskobjectField paths to update. Must be a non-empty subset of: - display_name - spec.compute.inactivity_timeout Any other path returns INVALID_PARAMETER_VALUE.
workspace_domainstringThe Databricks workspace domain suffix for the cloud. Selected by DATABRICKS_CLOUD (aws, azure or gcp; default aws). (default: cloud.databricks.com, x-stackQL-envVarSelector: {"envVar":"DATABRICKS_CLOUD","default":"aws","values":{"aws":"cloud.databricks.com","azure":"azuredatabricks.net","gcp":"gcp.databricks.com"}})
page_sizeinteger
page_tokenstring

SELECT examples​

Retrieves a Sandbox by name.

SELECT
name,
display_name,
create_time,
metadata,
spec,
status,
update_time
FROM databricks_workspace.sandbox.sandboxes
WHERE sandbox_id = '{{ sandbox_id }}' -- required
AND deployment_name = '{{ deployment_name }}' -- required
AND workspace_domain = '{{ workspace_domain }}' -- required
;

INSERT examples​

Creates a new Sandbox.

INSERT INTO databricks_workspace.sandbox.sandboxes (
create_time,
display_name,
metadata,
name,
spec,
status,
update_time,
sandbox_id,
deployment_name,
workspace_domain
)
SELECT
'{{ create_time }}',
'{{ display_name }}',
'{{ metadata }}',
'{{ name }}',
'{{ spec }}',
'{{ status }}',
'{{ update_time }}',
'{{ sandbox_id }}',
'{{ deployment_name }}',
'{{ workspace_domain }}'
RETURNING
name,
display_name,
create_time,
metadata,
spec,
status,
update_time
;

UPDATE examples​

Updates mutable fields on an existing Sandbox. Allowlisted update_mask paths today: display_name,

UPDATE databricks_workspace.sandbox.sandboxes
SET
create_time = '{{ create_time }}',
display_name = '{{ display_name }}',
metadata = '{{ metadata }}',
name = '{{ name }}',
spec = '{{ spec }}',
status = '{{ status }}',
update_time = '{{ update_time }}'
WHERE
sandbox_id = '{{ sandbox_id }}' --required
AND update_mask = '{{ update_mask }}' --required
AND deployment_name = '{{ deployment_name }}' --required
AND workspace_domain = '{{ workspace_domain }}' --required
RETURNING
name,
display_name,
create_time,
metadata,
spec,
status,
update_time;

DELETE examples​

Deletes a Sandbox.

DELETE FROM databricks_workspace.sandbox.sandboxes
WHERE sandbox_id = '{{ sandbox_id }}' --required
AND deployment_name = '{{ deployment_name }}' --required
AND workspace_domain = '{{ workspace_domain }}' --required
;

Lifecycle Methods​

Starts a previously stopped Sandbox under the same sandbox name. Returns NOT_FOUND if there is no

EXEC databricks_workspace.sandbox.sandboxes.start
@sandbox_id='{{ sandbox_id }}' --required,
@deployment_name='{{ deployment_name }}' --required,
@workspace_domain='{{ workspace_domain }}' --required
;