Skip to main content

workspace_base_environments

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

Overview​

Nameworkspace_base_environments
TypeResource
Iddatabricks_workspace.environments.workspace_base_environments

Fields​

The following fields are returned by SELECT queries:

NameDatatypeDescription
namestringThe resource name of the workspace base environment. Format: workspace-base-environments/{workspace-base-environment}
creator_user_idstringUser ID of the creator.
last_updated_user_idstringUser ID of the last user who updated the environment.
display_namestringHuman-readable display name for the workspace base environment.
base_environment_typestringThe type of base environment (CPU or GPU). (CPU, GPU)
create_timestring (date-time)Timestamp when the environment was created.
filepathstringThe WSFS or UC Volumes path to the environment YAML file.
is_defaultbooleanWhether this is the default environment for the workspace.
messagestringStatus message providing additional details about the environment status.
â–¶specobjectThe environment specification containing version and dependencies.
statusstringThe status of the materialized workspace base environment. (CREATED, EXPIRED, FAILED, INVALID, PENDING, REFRESHING)
update_timestring (date-time)Timestamp when the environment was last updated.

Methods​

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectworkspace_base_environment, deployment_name, workspace_domainRetrieves a WorkspaceBaseEnvironment by its name.
listselectdeployment_name, workspace_domainpage_size, page_tokenLists all WorkspaceBaseEnvironments in the workspace.
createinsertdeployment_name, workspace_domain, display_namerequest_id, workspace_base_environment_idCreates a new WorkspaceBaseEnvironment. This is a long-running operation. The operation will
updateupdateworkspace_base_environment, deployment_name, workspace_domainUpdates an existing WorkspaceBaseEnvironment. This is a long-running operation. The operation will
deletedeleteworkspace_base_environment, deployment_name, workspace_domainDeletes a WorkspaceBaseEnvironment. Deleting a base environment may impact linked notebooks and jobs.
refreshexecworkspace_base_environment, deployment_name, workspace_domainRefreshes the materialized environment for a WorkspaceBaseEnvironment. This is a long-running

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)
workspace_base_environmentstringThe workspace_base_environment segment of the name resource name (workspace-base-environments/{workspace_base_environment}). Required. The resource name of the workspace base environment to delete. Format: workspace-base-environments/{workspace_base_environment}
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_sizeintegerThe maximum number of environments to return per page. Default is 1000.
page_tokenstringPage token for pagination. Received from a previous ListWorkspaceBaseEnvironments call.
request_idstringA unique identifier for this request. A random UUID is recommended. This request is only idempotent if a request_id is provided.
workspace_base_environment_idstringThe ID to use for the workspace base environment, which will become the final component of the resource name. This value should be 4-63 characters, and valid characters are /[a-z][0-9]-/.

SELECT examples​

Retrieves a WorkspaceBaseEnvironment by its name.

SELECT
name,
creator_user_id,
last_updated_user_id,
display_name,
base_environment_type,
create_time,
filepath,
is_default,
message,
spec,
status,
update_time
FROM databricks_workspace.environments.workspace_base_environments
WHERE workspace_base_environment = '{{ workspace_base_environment }}' -- required
AND deployment_name = '{{ deployment_name }}' -- required
AND workspace_domain = '{{ workspace_domain }}' -- required
;

INSERT examples​

Creates a new WorkspaceBaseEnvironment. This is a long-running operation. The operation will

INSERT INTO databricks_workspace.environments.workspace_base_environments (
display_name,
base_environment_type,
create_time,
creator_user_id,
filepath,
is_default,
last_updated_user_id,
message,
name,
spec,
status,
update_time,
deployment_name,
workspace_domain,
request_id,
workspace_base_environment_id
)
SELECT
'{{ display_name }}' /* required */,
'{{ base_environment_type }}',
'{{ create_time }}',
'{{ creator_user_id }}',
'{{ filepath }}',
{{ is_default }},
'{{ last_updated_user_id }}',
'{{ message }}',
'{{ name }}',
'{{ spec }}',
'{{ status }}',
'{{ update_time }}',
'{{ deployment_name }}',
'{{ workspace_domain }}',
'{{ request_id }}',
'{{ workspace_base_environment_id }}'
;

UPDATE examples​

Updates an existing WorkspaceBaseEnvironment. This is a long-running operation. The operation will

UPDATE databricks_workspace.environments.workspace_base_environments
SET
-- No updatable properties
WHERE
workspace_base_environment = '{{ workspace_base_environment }}' --required
AND deployment_name = '{{ deployment_name }}' --required
AND workspace_domain = '{{ workspace_domain }}' --required;

DELETE examples​

Deletes a WorkspaceBaseEnvironment. Deleting a base environment may impact linked notebooks and jobs.

DELETE FROM databricks_workspace.environments.workspace_base_environments
WHERE workspace_base_environment = '{{ workspace_base_environment }}' --required
AND deployment_name = '{{ deployment_name }}' --required
AND workspace_domain = '{{ workspace_domain }}' --required
;

Lifecycle Methods​

Refreshes the materialized environment for a WorkspaceBaseEnvironment. This is a long-running

EXEC databricks_workspace.environments.workspace_base_environments.refresh
@workspace_base_environment='{{ workspace_base_environment }}' --required,
@deployment_name='{{ deployment_name }}' --required,
@workspace_domain='{{ workspace_domain }}' --required
;