deployments
Creates, updates, deletes, gets or lists a deployments resource.
Overview
| Name | deployments |
| Type | Resource |
| Id | databricks_workspace.bundledeployments.deployments |
Fields
The following fields are returned by SELECT queries:
- list
| Name | Datatype | Description |
|---|---|---|
name | string | Resource name of the deployment. Format: deployments/{deployment_id} |
last_successful_version_id | string | The 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_id | string | The version_id of the most recent deployment version. |
display_name | string | Human-readable name for the deployment, up to 256 characters. Output only: clients update it by setting ``display_name`` when creating a version. |
target_name | string | The bundle target name associated with this deployment. Output only: it is denormalized from the latest version, not set directly on the deployment. |
create_time | string (date-time) | When the deployment was created. |
created_by | string | The user who created the deployment (email or principal name). |
deployment_mode | string | Bundle target deployment mode (development or production), derived from the most recent version's mode. (DEPLOYMENT_MODE_DEVELOPMENT, DEPLOYMENT_MODE_PRODUCTION) |
destroy_time | string (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_by | string | The user who destroyed the deployment (email or principal name). Unset if the deployment has not been destroyed. |
git_info | object | Git provenance of the deployment's source, derived from the latest version. |
initial_parent_path | string | The 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. |
status | string | Current status of the deployment. (DEPLOYMENT_STATUS_ACTIVE, DEPLOYMENT_STATUS_DELETED, DEPLOYMENT_STATUS_FAILED, DEPLOYMENT_STATUS_IN_PROGRESS) |
update_time | string (date-time) | When the deployment was last updated. |
updated_by | string | The user who most recently updated the deployment (email or principal name). |
workspace_info | object | Workspace location of the deployment, derived from the latest version. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
list | select | deployment_name | filter, page_size, page_token | Lists deployments in the workspace. |
create | insert | deployment_name, deployment | Creates a new deployment in the workspace. | |
delete | delete | name, deployment_name | Deletes a deployment. | |
heartbeat | exec | name, deployment_name | Sends 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.
| Name | Datatype | Description |
|---|---|---|
deployment_name | string | The Databricks Workspace Deployment Name (default: dbc-abcd0123-a1bc) |
name | string | The version whose lock to renew. Format: deployments/{deployment_id}/versions/{version_id} |
filter | string | A 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_size | integer | The 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_token | string | A page token, received from a previous ListDeployments call. Provide this to retrieve the subsequent page. |
SELECT examples
- list
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
- create
- Manifest
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
;
# Description fields are for documentation purposes
- name: deployments
props:
- name: deployment_name
value: "{{ deployment_name }}"
description: Required parameter for the deployments resource.
- name: deployment
description: |
The deployment to create. The caller must set ``initial_parent_path``. Other fields are ignored on input and populated by the service.
value:
create_time: "{{ create_time }}"
created_by: "{{ created_by }}"
deployment_mode: "{{ deployment_mode }}"
destroy_time: "{{ destroy_time }}"
destroyed_by: "{{ destroyed_by }}"
display_name: "{{ display_name }}"
git_info:
branch: "{{ branch }}"
commit: "{{ commit }}"
origin_url: "{{ origin_url }}"
initial_parent_path: "{{ initial_parent_path }}"
last_successful_version_id: "{{ last_successful_version_id }}"
last_version_id: "{{ last_version_id }}"
name: "{{ name }}"
status: "{{ status }}"
target_name: "{{ target_name }}"
update_time: "{{ update_time }}"
updated_by: "{{ updated_by }}"
workspace_info:
bundle_root_path: "{{ bundle_root_path }}"
file_path: "{{ file_path }}"
git_folder_path: "{{ git_folder_path }}"
root_path: "{{ root_path }}"
source_linked: {{ source_linked }}
DELETE examples
- delete
Deletes a deployment.
DELETE FROM databricks_workspace.bundledeployments.deployments
WHERE name = '{{ name }}' --required
AND deployment_name = '{{ deployment_name }}' --required
;
Lifecycle Methods
- heartbeat
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
;