Skip to main content

versions

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

Overview

Nameversions
TypeResource
Iddatabricks_workspace.bundledeployments.versions

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
namestringResource name of the version. Format: deployments/{deployment_id}/versions/{version_id}
previous_version_idstringThe version_id this version was created on top of — the deployment's most recent version at creation time. Leave unset when creating the first version (the deployment has no prior versions). Set by the client on creation and immutable thereafter. Acts as an optimistic-concurrency precondition: the server requires it to equal the deployment's current most-recent version (and to be unset when the deployment has no versions) and returns ``INVALID_PARAMETER_VALUE`` on mismatch, so a deploy racing against a concurrent deploy is rejected rather than silently overwriting it.
version_idstringVersion identifier within the parent deployment, assigned by the client on creation. A numeric string (base-10, fits in a signed 64-bit integer) that is greater than or equal to 1. Version IDs are strictly increasing within a deployment but are not required to start at 1 or to be contiguous.
display_namestringDisplay name for the deployment, captured at the time of this version. Up to 256 characters. When present, creating the version updates the deployment display name. An empty value clears it; an absent value leaves the current deployment display name unchanged.
target_namestringTarget name of the deployment, captured at the time of this version.
cli_versionstringCLI version used to initiate the version.
complete_timestring (date-time)When the version completed. Unset while the version is in progress.
completed_bystringThe user who completed the version (email or principal name). May differ from ``created_by`` when another user force-completes the version.
completion_reasonstringWhy the version was completed. Unset while in progress. Set when status transitions to COMPLETED. (VERSION_COMPLETE_FAILURE, VERSION_COMPLETE_FORCE_ABORT, VERSION_COMPLETE_LEASE_EXPIRED, VERSION_COMPLETE_SUCCESS)
create_timestring (date-time)When the version was created.
created_bystringThe user who created the version (email or principal name).
deployment_modestringBundle target deployment mode (development or production), captured at the time of this version. (DEPLOYMENT_MODE_DEVELOPMENT, DEPLOYMENT_MODE_PRODUCTION)
git_infoobjectGit provenance of the source, captured at the time of this version.
statusstringStatus of the version: IN_PROGRESS or COMPLETED. (VERSION_STATUS_COMPLETED, VERSION_STATUS_IN_PROGRESS)
version_typestringType of version (deploy or destroy). (VERSION_TYPE_DEPLOY, VERSION_TYPE_DESTROY)
workspace_infoobjectWorkspace location of the deployment, captured at the time of this version.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
listselectparent, deployment_namepage_size, page_tokenLists versions under a deployment, ordered numerically by version_id descending (most recent first).
getselectname, deployment_nameRetrieves a version by its resource name.
createinsertparent, version_id, deployment_name, versionCreates a new version under a deployment.
completeexecname, deployment_name, completion_reasonMarks a version as complete and releases the deployment lock.

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 name of the version to complete. Format: deployments/{deployment_id}/versions/{version_id}
parentstringThe parent deployment where this version will be created. Format: deployments/{deployment_id}
version_idstringThe ID to use for the version, which becomes the final component of the version's resource name. A numeric string (base-10, fits in a signed 64-bit integer) chosen by the caller; must be greater than or equal to 1. Must be numerically greater than the deployment's most recent version (see version.previous_version_id); it does not need to start at 1 or increase by exactly 1. If the value is not numerically greater, the server returns INVALID_PARAMETER_VALUE.
page_sizeintegerThe maximum number of versions to return. The service may return fewer than this value. If unspecified, at most 20 versions will be returned. The maximum value is 100; values above 100 will be coerced to 100.
page_tokenstringA page token, received from a previous ListVersions call. Provide this to retrieve the subsequent page.

SELECT examples

Lists versions under a deployment, ordered numerically by version_id descending (most recent first).

SELECT
name,
previous_version_id,
version_id,
display_name,
target_name,
cli_version,
complete_time,
completed_by,
completion_reason,
create_time,
created_by,
deployment_mode,
git_info,
status,
version_type,
workspace_info
FROM databricks_workspace.bundledeployments.versions
WHERE parent = '{{ parent }}' -- required
AND deployment_name = '{{ deployment_name }}' -- required
AND page_size = '{{ page_size }}'
AND page_token = '{{ page_token }}'
;

INSERT examples

Creates a new version under a deployment.

INSERT INTO databricks_workspace.bundledeployments.versions (
version,
parent,
version_id,
deployment_name
)
SELECT
'{{ version }}' /* required */,
'{{ parent }}',
'{{ version_id }}',
'{{ deployment_name }}'
RETURNING
name,
previous_version_id,
version_id,
display_name,
target_name,
cli_version,
complete_time,
completed_by,
completion_reason,
create_time,
created_by,
deployment_mode,
git_info,
status,
version_type,
workspace_info
;

Lifecycle Methods

Marks a version as complete and releases the deployment lock.

EXEC databricks_workspace.bundledeployments.versions.complete
@name='{{ name }}' --required,
@deployment_name='{{ deployment_name }}' --required
@@json=
'{
"completion_reason": "{{ completion_reason }}",
"force": {{ force }}
}'
;