Skip to main content

operations

Creates, updates, deletes, gets or lists an operations resource.

Overview

Nameoperations
TypeResource
Iddatabricks_workspace.bundledeployments.operations

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
namestringResource name of the operation. Format: deployments/{deployment_id}/versions/{version_id}/operations/{resource_key}
resource_idstringID of the actual resource in the workspace (e.g. the job ID, pipeline ID). Optional at creation: CREATE and RECREATE operations produce a new resource whose ID is not yet known when the operation is recorded. Mutable: may be filled in (or corrected) later via UpdateOperation once the ID is known.
sequence_idintegerMonotonically increasing revision used for optimistic concurrency control (the AIP-154 concurrency token for this resource, realized as a sequence number rather than an opaque etag). The server assigns 1 on creation and increments it on every successful UpdateOperation. It is OPTIONAL rather than OUTPUT_ONLY because it is dual-purpose: CreateOperation/GetOperation return the current value, and UpdateOperation reads the caller-supplied value as a precondition. The caller must echo the value it last observed; if it no longer matches the server's value, the update is rejected with ABORTED so the caller can re-read and retry. Ignored on CreateOperation.
action_typestringThe type of operation performed on this resource. (OPERATION_ACTION_TYPE_BIND, OPERATION_ACTION_TYPE_BIND_AND_UPDATE, OPERATION_ACTION_TYPE_CREATE, OPERATION_ACTION_TYPE_DELETE, OPERATION_ACTION_TYPE_INITIAL_REGISTER, OPERATION_ACTION_TYPE_RECREATE, OPERATION_ACTION_TYPE_RESIZE, OPERATION_ACTION_TYPE_UPDATE, OPERATION_ACTION_TYPE_UPDATE_WITH_ID)
create_timestring (date-time)When the operation was recorded.
dashboard_metadataobjectDashboard-specific metadata; set only for dashboard resources.
error_messagestringError message if the operation failed. Set when status is OPERATION_STATUS_FAILED. Captures the error encountered while applying the resource to the workspace. Mutable: may be updated after creation via UpdateOperation; setting it to an empty string clears it. After an update is applied, an operation whose status is OPERATION_STATUS_SUCCEEDED cannot carry an error_message.
resource_keystringResource identifier within the bundle (e.g. "jobs.foo", "pipelines.bar", "jobs.foo.permissions", "files.<rel-path>"). Can be an arbitrary UTF-8 encoded string key. This key links the operation to the corresponding deployment-level Resource.
resource_typestringThe type of the deployment resource this operation applies to. Derived from the ``resource_key`` prefix (e.g. "jobs" → JOB); the caller does not set this field. (DEPLOYMENT_RESOURCE_TYPE_ALERT, DEPLOYMENT_RESOURCE_TYPE_APP, DEPLOYMENT_RESOURCE_TYPE_CATALOG, DEPLOYMENT_RESOURCE_TYPE_CLUSTER, DEPLOYMENT_RESOURCE_TYPE_DASHBOARD, DEPLOYMENT_RESOURCE_TYPE_DATABASE_CATALOG, DEPLOYMENT_RESOURCE_TYPE_DATABASE_INSTANCE, DEPLOYMENT_RESOURCE_TYPE_EXPERIMENT, DEPLOYMENT_RESOURCE_TYPE_EXTERNAL_LOCATION, DEPLOYMENT_RESOURCE_TYPE_JOB, DEPLOYMENT_RESOURCE_TYPE_MODEL, DEPLOYMENT_RESOURCE_TYPE_MODEL_SERVING_ENDPOINT, DEPLOYMENT_RESOURCE_TYPE_PIPELINE, DEPLOYMENT_RESOURCE_TYPE_POSTGRES_BRANCH, DEPLOYMENT_RESOURCE_TYPE_POSTGRES_ENDPOINT, DEPLOYMENT_RESOURCE_TYPE_POSTGRES_PROJECT, DEPLOYMENT_RESOURCE_TYPE_QUALITY_MONITOR, DEPLOYMENT_RESOURCE_TYPE_REGISTERED_MODEL, DEPLOYMENT_RESOURCE_TYPE_SCHEMA, DEPLOYMENT_RESOURCE_TYPE_SECRET_SCOPE, DEPLOYMENT_RESOURCE_TYPE_SQL_WAREHOUSE, DEPLOYMENT_RESOURCE_TYPE_SYNCED_DATABASE_TABLE, DEPLOYMENT_RESOURCE_TYPE_VOLUME)
stateobjectSerialized local config state after the operation. Should be unset for delete operations. Mutable: may be updated after creation via UpdateOperation. When updating, the caller must echo the last-observed ``sequence_id`` as a concurrency precondition.
statusstringWhether the operation succeeded or failed. Mutable: may be updated after creation via UpdateOperation, e.g. when an operation recorded as failed is retried and eventually succeeds. A succeeded operation cannot carry an ``error_message``. (OPERATION_STATUS_FAILED, OPERATION_STATUS_SUCCEEDED)
update_timestring (date-time)When the operation was last updated. Set to ``create_time`` when the operation is created and to the server timestamp on each successful UpdateOperation.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
listselectparent, deployment_namepage_size, page_tokenLists resource operations under a version.
createinsertparent, resource_key, deployment_name, operationCreates a resource operation under a version.
updateupdatename, update_mask, deployment_name, operationUpdates a resource operation's mutable fields.

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)
namestringResource name of the operation. Format: deployments/{deployment_id}/versions/{version_id}/operations/{resource_key}
parentstringThe parent version where this operation will be recorded. Format: deployments/{deployment_id}/versions/{version_id}
resource_keystringThe key identifying the resource this operation applies to. Becomes the final component of the operation's name.
update_maskobjectThe set of fields to update. Required; supported paths are state, error_message, resource_id, and status. An empty mask or any other path is rejected with INVALID_PARAMETER_VALUE.
page_sizeintegerThe maximum number of operations to return. The service may return fewer than this value. If unspecified, at most 50 operations will be returned. The maximum value is 1000; values above 1000 will be coerced to 1000.
page_tokenstringA page token, received from a previous ListOperations call. Provide this to retrieve the subsequent page.

SELECT examples

Lists resource operations under a version.

SELECT
name,
resource_id,
sequence_id,
action_type,
create_time,
dashboard_metadata,
error_message,
resource_key,
resource_type,
state,
status,
update_time
FROM databricks_workspace.bundledeployments.operations
WHERE parent = '{{ parent }}' -- required
AND deployment_name = '{{ deployment_name }}' -- required
AND page_size = '{{ page_size }}'
AND page_token = '{{ page_token }}'
;

INSERT examples

Creates a resource operation under a version.

INSERT INTO databricks_workspace.bundledeployments.operations (
operation,
parent,
resource_key,
deployment_name
)
SELECT
'{{ operation }}' /* required */,
'{{ parent }}',
'{{ resource_key }}',
'{{ deployment_name }}'
RETURNING
name,
resource_id,
sequence_id,
action_type,
create_time,
dashboard_metadata,
error_message,
resource_key,
resource_type,
state,
status,
update_time
;

UPDATE examples

Updates a resource operation's mutable fields.

UPDATE databricks_workspace.bundledeployments.operations
SET
operation = '{{ operation }}'
WHERE
name = '{{ name }}' --required
AND update_mask = '{{ update_mask }}' --required
AND deployment_name = '{{ deployment_name }}' --required
AND operation = '{{ operation }}' --required
RETURNING
name,
resource_id,
sequence_id,
action_type,
create_time,
dashboard_metadata,
error_message,
resource_key,
resource_type,
state,
status,
update_time;