w.bundle_deployments: BundleDeployments.v1¶
- class databricks.sdk.service.bundledeployments.BundleDeploymentsAPI¶
Service for managing bundle deployment metadata.
- complete_version(name: str, completion_reason: VersionComplete [, force: Optional[bool]]) Version¶
Marks a version as complete and releases the deployment lock.
The server atomically:
Sets the version status to the provided terminal status.
Sets
complete_timeto the current server timestamp.Releases the lock on the parent deployment.
Updates the parent deployment’s
statusandlast_version_id.
- Parameters:
name – str The name of the version to complete. Format: deployments/{deployment_id}/versions/{version_id}
completion_reason –
VersionCompleteThe reason for completing the version. Must be a terminal reason: VERSION_COMPLETE_SUCCESS, VERSION_COMPLETE_FAILURE, or VERSION_COMPLETE_FORCE_ABORT.force – bool (optional) If true, force-completes the version even if the caller is not the original creator. The completion_reason must be VERSION_COMPLETE_FORCE_ABORT when force is true.
- Returns:
- create_deployment(deployment: Deployment) Deployment¶
Creates a new deployment in the workspace.
- Parameters:
deployment –
DeploymentThe deployment to create.initial_parent_pathis required.display_name,target_name,deployment_mode, andworkspace_infomay be set; every other field is assigned by the service and ignored on input.- Returns:
- create_version(parent: str, version: Version, version_id: str) Version¶
Creates a new version under a deployment.
Creating a version acquires an exclusive lock on the deployment, preventing concurrent deploys. The caller provides a
version_id, a numeric string that must be numerically greater than the deployment’s most recent version, and sets the version’sprevious_version_idto the deployment’s most recent version (leaving it unset for the first version), which the server validates to detect concurrent deploys.The caller also provides the full set of
operationsplanned for this version, each identified by aresource_keyand anaction_type. The server records one operation per resource inOPERATION_STATUS_PENDINGin the same transaction as the version, so the plan is captured atomically. The outcome of each operation is recorded later via UpdateOperation as the resource is applied; the set of operations cannot be changed after the version is created.- Parameters:
parent – str The parent deployment where this version will be created. Format: deployments/{deployment_id}
version –
VersionThe version to create.version_id – str 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 returnsINVALID_PARAMETER_VALUE.
- Returns:
- delete_deployment(name: str)¶
Deletes a deployment.
- Parameters:
name – str Resource name of the deployment to delete. Format: deployments/{deployment_id}
- get_deployment(name: str) Deployment¶
Retrieves a deployment by its resource name.
- Parameters:
name – str Resource name of the deployment to retrieve. Format: deployments/{deployment_id}
- Returns:
- get_operation(name: str) Operation¶
Retrieves a resource operation by its resource name.
- Parameters:
name – str The name of the resource operation to retrieve. Format: deployments/{deployment_id}/versions/{version_id}/operations/{resource_key}
- Returns:
- get_resource(name: str) Resource¶
Retrieves a deployment resource by its resource name.
- Parameters:
name – str The name of the resource to retrieve. Format: deployments/{deployment_id}/resources/{resource_key}
- Returns:
- get_version(name: str) Version¶
Retrieves a version by its resource name.
- Parameters:
name – str The name of the version to retrieve. Format: deployments/{deployment_id}/versions/{version_id}
- Returns:
- heartbeat(name: str) HeartbeatResponse¶
Sends a heartbeat to renew the lock held by a version.
The server validates that the version is the active (non-terminal) version on the parent deployment and resets the lock expiry. If the lock has already expired or the version is no longer active, the server returns
ABORTED.- Parameters:
name – str The version whose lock to renew. Format: deployments/{deployment_id}/versions/{version_id}
- Returns:
- list_deployments([, page_size: Optional[int], page_token: Optional[str]]) Iterator[Deployment]¶
Lists deployments in the workspace.
- Parameters:
page_size – int (optional) 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 1000; values above 1000 will be coerced to 1000.
page_token – str (optional) A page token, received from a previous
ListDeploymentscall. Provide this to retrieve the subsequent page.
- Returns:
Iterator over
Deployment
- list_operations(parent: str [, page_size: Optional[int], page_token: Optional[str]]) Iterator[Operation]¶
Lists resource operations under a version.
- Parameters:
parent – str The parent version. Format: deployments/{deployment_id}/versions/{version_id}
page_size – int (optional) The 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_token – str (optional) A page token, received from a previous
ListOperationscall. Provide this to retrieve the subsequent page.
- Returns:
Iterator over
Operation
- list_resources(parent: str [, page_size: Optional[int], page_token: Optional[str]]) Iterator[Resource]¶
Lists resources under a deployment.
- Parameters:
parent – str The parent deployment. Format: deployments/{deployment_id}
page_size – int (optional) The maximum number of resources to return. The service may return fewer than this value. If unspecified, at most 50 resources will be returned. The maximum value is 1000; values above 1000 will be coerced to 1000.
page_token – str (optional) A page token, received from a previous
ListResourcescall. Provide this to retrieve the subsequent page.
- Returns:
Iterator over
Resource
- list_versions(parent: str [, page_size: Optional[int], page_token: Optional[str]]) Iterator[Version]¶
Lists versions under a deployment, ordered numerically by version_id descending (most recent first).
- Parameters:
parent – str The parent deployment. Format: deployments/{deployment_id}
page_size – int (optional) 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 – str (optional) A page token, received from a previous
ListVersionscall. Provide this to retrieve the subsequent page.
- Returns:
Iterator over
Version
- update_deployment(name: str, deployment: Deployment, update_mask: FieldMask) Deployment¶
Updates a deployment.
- Parameters:
name – str Resource name of the deployment. Format: deployments/{deployment_id}
deployment –
DeploymentThe deployment to update. Itsnameselects the deployment; the fields named inupdate_maskcarry the new values. All other fields are ignored.update_mask – FieldMask The fields to update; supported paths are
display_name,deployment_mode,target_name, andworkspace_info. An empty mask or any other path returns INVALID_PARAMETER_VALUE.
- Returns:
- update_operation(name: str, operation: Operation, update_mask: FieldMask) Operation¶
Updates a resource operation’s mutable fields.
state,error_message,resource_id,status, anddashboard_metadatamay be updated, independently;update_maskmust contain only those paths. All other fields are immutable. The update is guarded by an optimistic-concurrency check: the caller setsoperation.sequence_idto the value it last observed, and the server rejects the update withABORTEDif the operation has been modified since. On success the server incrementssequence_id; updates tostate,resource_id, anddashboard_metadataare mirrored onto the corresponding deployment-level resource. Listingstateinupdate_maskwith no value clears it, which removes the resource, so a delete that is retried until it succeeds must clearstate. The parent version must be in progress, and after the update is applied a succeeded operation cannot carry anerror_message. See thestateandresource_idfields for the rest.- Parameters:
name – str Resource name of the operation. Format: deployments/{deployment_id}/versions/{version_id}/operations/{resource_key}
operation –
OperationThe operation to update. Itsnameselects the operation; the fields named inupdate_maskcarry the new values; andsequence_idcarries the optimistic-concurrency precondition (see the field docs on Operation). All other fields are ignored.update_mask – FieldMask The set of fields to update. Required; supported paths are
state,error_message,resource_id,status, anddashboard_metadata. An empty mask or any other path is rejected with INVALID_PARAMETER_VALUE.
- Returns: