Skip to main content

deployments

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

Overview

Namedeployments
TypeResource
Iddatabricks_workspace.bundledeployments.deployments

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
namestringResource name of the deployment. Format: deployments/{deployment_id}
last_successful_version_idstringThe version_id of the most recent version that completed successfully. Unset until a version has completed successfully. Unlike last_version_id, it is not advanced when a version fails, so it always points at the last known-good deployment state (or is unset if there has never been one).
last_version_idstringThe version_id of the most recent deployment version.
display_namestringHuman-readable name for the deployment, up to 256 characters. Output only: clients update it by setting ``display_name`` when creating a version.
target_namestringThe bundle target name associated with this deployment. Output only: it is denormalized from the latest version, not set directly on the deployment.
create_timestring (date-time)When the deployment was created.
created_bystringThe user who created the deployment (email or principal name).
deployment_modestringBundle target deployment mode (development or production), derived from the most recent version's mode. (DEPLOYMENT_MODE_DEVELOPMENT, DEPLOYMENT_MODE_PRODUCTION)
destroy_timestring (date-time)When deletion was recorded. Unset if deletion has not been recorded. This response metadata does not determine the deployment's lifecycle status.
destroyed_bystringThe user who destroyed the deployment (email or principal name). Unset if the deployment has not been destroyed.
git_infoobjectGit provenance of the deployment's source, derived from the latest version.
initial_parent_pathstringThe workspace path of the existing folder where the deployment is initially created. Must be absolute and canonical, with single separators, no ``.`` or ``..`` segments, and no trailing slash unless the path is ``/``. It may contain at most 24 path segments, excluding an optional leading ``/Workspace`` segment. The complete path may contain up to 1,024 characters, and each segment may contain up to 511 characters. This field is input only and is not returned in create, get, or list responses.
statusstringCurrent status of the deployment. (DEPLOYMENT_STATUS_ACTIVE, DEPLOYMENT_STATUS_DELETED, DEPLOYMENT_STATUS_FAILED, DEPLOYMENT_STATUS_IN_PROGRESS)
update_timestring (date-time)When the deployment was last updated.
updated_bystringThe user who most recently updated the deployment (email or principal name).
workspace_infoobjectWorkspace location of the deployment, derived from the latest version.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
listselectdeployment_namefilter, page_size, page_tokenLists deployments in the workspace.
createinsertdeployment_name, deploymentCreates a new deployment in the workspace.
deletedeletename, deployment_nameDeletes a deployment.
heartbeatexecname, deployment_nameSends a heartbeat to renew the lock held by a version.

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 (default: dbc-abcd0123-a1bc)
namestringThe version whose lock to renew. Format: deployments/{deployment_id}/versions/{version_id}
filterstringA filter expression restricting which deployments are returned, in the style of AIP-160 (https://google.aip.dev/160). The expression is a conjunction of one or more field operator value terms joined by AND (case-insensitive); a deployment is returned only when it matches every term. Whitespace around terms is ignored, and a value containing spaces must be wrapped in double quotes. An unset or empty filter returns all deployments. Filtering applies only to live deployments; deleted deployments are never returned regardless of the filter. Supported terms: - status = <STATUS>: exact match on the deployment status. The value is a DeploymentStatus enum value, with or without the DEPLOYMENT_STATUS_ prefix and case-insensitive (e.g. status = ACTIVE). - deployment_mode = <MODE>: exact match on the deployment mode. The value is a DeploymentMode enum value, with or without the DEPLOYMENT_MODE_ prefix and case-insensitive (e.g. deployment_mode = DEVELOPMENT). - display_name = "<name>": exact match on the display name. - display_name : "<substring>": case-insensitive substring match on the display name. For example: status = ACTIVE AND display_name : "etl".
page_sizeintegerThe maximum number of deployments to return. The service may return fewer than this value. If unspecified, at most 20 deployments will be returned. The maximum value is 100; values above 100 will be coerced to 100.
page_tokenstringA page token, received from a previous ListDeployments call. Provide this to retrieve the subsequent page.

SELECT examples

Lists deployments in the workspace.

SELECT
name,
last_successful_version_id,
last_version_id,
display_name,
target_name,
create_time,
created_by,
deployment_mode,
destroy_time,
destroyed_by,
git_info,
initial_parent_path,
status,
update_time,
updated_by,
workspace_info
FROM databricks_workspace.bundledeployments.deployments
WHERE deployment_name = '{{ deployment_name }}' -- required
AND filter = '{{ filter }}'
AND page_size = '{{ page_size }}'
AND page_token = '{{ page_token }}'
;

INSERT examples

Creates a new deployment in the workspace.

INSERT INTO databricks_workspace.bundledeployments.deployments (
deployment,
deployment_name
)
SELECT
'{{ deployment }}' /* required */,
'{{ deployment_name }}'
RETURNING
name,
last_successful_version_id,
last_version_id,
display_name,
target_name,
create_time,
created_by,
deployment_mode,
destroy_time,
destroyed_by,
git_info,
initial_parent_path,
status,
update_time,
updated_by,
workspace_info
;

DELETE examples

Deletes a deployment.

DELETE FROM databricks_workspace.bundledeployments.deployments
WHERE name = '{{ name }}' --required
AND deployment_name = '{{ deployment_name }}' --required
;

Lifecycle Methods

Sends a heartbeat to renew the lock held by a version.

EXEC databricks_workspace.bundledeployments.deployments.heartbeat
@name='{{ name }}' --required,
@deployment_name='{{ deployment_name }}' --required
;