versions
Creates, updates, deletes, gets or lists a versions resource.
Overview
| Name | versions |
| Type | Resource |
| Id | databricks_workspace.bundledeployments.versions |
Fields
The following fields are returned by SELECT queries:
- list
- get
| Name | Datatype | Description |
|---|---|---|
name | string | Resource name of the version. Format: deployments/{deployment_id}/versions/{version_id} |
previous_version_id | string | The 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_id | string | Version 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_name | string | Display 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_name | string | Target name of the deployment, captured at the time of this version. |
cli_version | string | CLI version used to initiate the version. |
complete_time | string (date-time) | When the version completed. Unset while the version is in progress. |
completed_by | string | The user who completed the version (email or principal name). May differ from ``created_by`` when another user force-completes the version. |
completion_reason | string | Why 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_time | string (date-time) | When the version was created. |
created_by | string | The user who created the version (email or principal name). |
deployment_mode | string | Bundle target deployment mode (development or production), captured at the time of this version. (DEPLOYMENT_MODE_DEVELOPMENT, DEPLOYMENT_MODE_PRODUCTION) |
git_info | object | Git provenance of the source, captured at the time of this version. |
status | string | Status of the version: IN_PROGRESS or COMPLETED. (VERSION_STATUS_COMPLETED, VERSION_STATUS_IN_PROGRESS) |
version_type | string | Type of version (deploy or destroy). (VERSION_TYPE_DEPLOY, VERSION_TYPE_DESTROY) |
workspace_info | object | Workspace location of the deployment, captured at the time of this version. |
| Name | Datatype | Description |
|---|---|---|
name | string | Resource name of the version. Format: deployments/{deployment_id}/versions/{version_id} |
previous_version_id | string | The 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_id | string | Version 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_name | string | Display 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_name | string | Target name of the deployment, captured at the time of this version. |
cli_version | string | CLI version used to initiate the version. |
complete_time | string (date-time) | When the version completed. Unset while the version is in progress. |
completed_by | string | The user who completed the version (email or principal name). May differ from ``created_by`` when another user force-completes the version. |
completion_reason | string | Why 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_time | string (date-time) | When the version was created. |
created_by | string | The user who created the version (email or principal name). |
deployment_mode | string | Bundle target deployment mode (development or production), captured at the time of this version. (DEPLOYMENT_MODE_DEVELOPMENT, DEPLOYMENT_MODE_PRODUCTION) |
git_info | object | Git provenance of the source, captured at the time of this version. |
status | string | Status of the version: IN_PROGRESS or COMPLETED. (VERSION_STATUS_COMPLETED, VERSION_STATUS_IN_PROGRESS) |
version_type | string | Type of version (deploy or destroy). (VERSION_TYPE_DEPLOY, VERSION_TYPE_DESTROY) |
workspace_info | object | Workspace location of the deployment, captured at the time of this version. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
list | select | parent, deployment_name | page_size, page_token | Lists versions under a deployment, ordered numerically by version_id descending (most recent first). |
get | select | name, deployment_name | Retrieves a version by its resource name. | |
create | insert | parent, version_id, deployment_name, version | Creates a new version under a deployment. | |
complete | exec | name, deployment_name, completion_reason | Marks 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.
| Name | Datatype | Description |
|---|---|---|
deployment_name | string | The Databricks Workspace Deployment Name (default: dbc-abcd0123-a1bc) |
name | string | The name of the version to complete. Format: deployments/{deployment_id}/versions/{version_id} |
parent | string | The parent deployment where this version will be created. Format: deployments/{deployment_id} |
version_id | string | The 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_size | integer | The 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_token | string | A page token, received from a previous ListVersions call. Provide this to retrieve the subsequent page. |
SELECT examples
- list
- get
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 }}'
;
Retrieves a version by its resource name.
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 name = '{{ name }}' -- required
AND deployment_name = '{{ deployment_name }}' -- required
;
INSERT examples
- create
- Manifest
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
;
# Description fields are for documentation purposes
- name: versions
props:
- name: parent
value: "{{ parent }}"
description: Required parameter for the versions resource.
- name: version_id
value: "{{ version_id }}"
description: Required parameter for the versions resource.
- name: deployment_name
value: "{{ deployment_name }}"
description: Required parameter for the versions resource.
- name: version
description: |
The version to create.
value:
cli_version: "{{ cli_version }}"
version_type: "{{ version_type }}"
complete_time: "{{ complete_time }}"
completed_by: "{{ completed_by }}"
completion_reason: "{{ completion_reason }}"
create_time: "{{ create_time }}"
created_by: "{{ created_by }}"
deployment_mode: "{{ deployment_mode }}"
display_name: "{{ display_name }}"
git_info:
branch: "{{ branch }}"
commit: "{{ commit }}"
origin_url: "{{ origin_url }}"
name: "{{ name }}"
previous_version_id: "{{ previous_version_id }}"
status: "{{ status }}"
target_name: "{{ target_name }}"
version_id: "{{ version_id }}"
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 }}
Lifecycle Methods
- complete
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 }}
}'
;