diff --git a/.codegen/_openapi_sha b/.codegen/_openapi_sha index eed3c8e0d..1f8d63cb3 100644 --- a/.codegen/_openapi_sha +++ b/.codegen/_openapi_sha @@ -1 +1 @@ -d82f531319f8217ca03dd34c2bc15f51ba6ada0c \ No newline at end of file +bfbf36f3d00ae4fc2ec5ad1a854ddac294d41733 \ No newline at end of file diff --git a/.gitattributes b/.gitattributes index eefcde7dc..185259c36 100644 --- a/.gitattributes +++ b/.gitattributes @@ -283,7 +283,6 @@ databricks-sdk-java/src/main/java/com/databricks/sdk/service/bundledeployments/B databricks-sdk-java/src/main/java/com/databricks/sdk/service/bundledeployments/BundleDeploymentsService.java linguist-generated=true databricks-sdk-java/src/main/java/com/databricks/sdk/service/bundledeployments/CompleteVersionRequest.java linguist-generated=true databricks-sdk-java/src/main/java/com/databricks/sdk/service/bundledeployments/CreateDeploymentRequest.java linguist-generated=true -databricks-sdk-java/src/main/java/com/databricks/sdk/service/bundledeployments/CreateOperationRequest.java linguist-generated=true databricks-sdk-java/src/main/java/com/databricks/sdk/service/bundledeployments/CreateVersionRequest.java linguist-generated=true databricks-sdk-java/src/main/java/com/databricks/sdk/service/bundledeployments/DashboardMetadata.java linguist-generated=true databricks-sdk-java/src/main/java/com/databricks/sdk/service/bundledeployments/DeleteDeploymentRequest.java linguist-generated=true diff --git a/NEXT_CHANGELOG.md b/NEXT_CHANGELOG.md index 238c3b221..141d08e63 100644 --- a/NEXT_CHANGELOG.md +++ b/NEXT_CHANGELOG.md @@ -28,4 +28,7 @@ * Add `PG_SPECIFIC_TYPE_HALFVEC` and `PG_SPECIFIC_TYPE_VARCHAR` enum values for `com.databricks.sdk.service.postgres.SyncedTableSyncedTableSpecPgSpecificType`. * [Breaking] Add pagination for `accountClient.accountIamV2().listWorkspaceAssignments()` method. * [Breaking] Add pagination for `workspaceClient.workspaceIamV2().listWorkspaceAssignmentsProxy()` method. -* Add `linkedinAdsOptions` and `marketoOptions` fields for `com.databricks.sdk.service.pipelines.ConnectorOptions`. \ No newline at end of file +* Add `linkedinAdsOptions` and `marketoOptions` fields for `com.databricks.sdk.service.pipelines.ConnectorOptions`. +* [Breaking] Change `actionType` and `status` fields for `com.databricks.sdk.service.bundledeployments.Operation` to no longer be required. +* Change `actionType` and `status` fields for `com.databricks.sdk.service.bundledeployments.Operation` to no longer be required. +* [Breaking] Remove `createOperation()` method for `workspaceClient.bundleDeployments()` service. \ No newline at end of file diff --git a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/bundledeployments/BundleDeploymentsAPI.java b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/bundledeployments/BundleDeploymentsAPI.java index 6dd537345..243022ba3 100644 --- a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/bundledeployments/BundleDeploymentsAPI.java +++ b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/bundledeployments/BundleDeploymentsAPI.java @@ -40,21 +40,6 @@ public Deployment createDeployment(CreateDeploymentRequest request) { return impl.createDeployment(request); } - /** - * Creates a resource operation under a version. - * - *
The caller must provide a `resource_key` which becomes the final component of the - * operation's name. If an operation with the same key already exists under the version, the - * server returns `ALREADY_EXISTS`. - * - *
On success the server also updates the corresponding deployment-level resource, creating it - * if this is the first operation for that resource_key and removing it if the operation records - * no `state` (see that field). - */ - public Operation createOperation(CreateOperationRequest request) { - return impl.createOperation(request); - } - /** * Creates a new version under a deployment. * @@ -63,6 +48,12 @@ public Operation createOperation(CreateOperationRequest request) { * than the deployment's most recent version, and sets the version's `previous_version_id` to 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 `operations` planned for this version, each
+ * identified by a `resource_key` and an `action_type`. The server records one operation per
+ * resource in `OPERATION_STATUS_PENDING` in 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.
*/
public Version createVersion(CreateVersionRequest request) {
return impl.createVersion(request);
@@ -202,16 +193,16 @@ public Iterable `state`, `error_message`, `resource_id`, and `status` may be updated, independently;
- * `update_mask` must contain only those paths. All other fields are immutable. The update is
- * guarded by an optimistic-concurrency check: the caller sets `operation.sequence_id` to the
- * value it last observed, and the server rejects the update with `ABORTED` if the operation has
- * been modified since. On success the server increments `sequence_id`; updates to `state` and
- * `resource_id` are mirrored onto the corresponding deployment-level resource. Listing `state` in
- * `update_mask` with no value clears it, which removes the resource, so a delete that is retried
- * until it succeeds must clear `state`. The parent version must be in progress, and after the
- * update is applied a succeeded operation cannot carry an `error_message`. See the `state` and
- * `resource_id` fields for the rest.
+ * `state`, `error_message`, `resource_id`, `status`, and `dashboard_metadata` may be updated,
+ * independently; `update_mask` must contain only those paths. All other fields are immutable. The
+ * update is guarded by an optimistic-concurrency check: the caller sets `operation.sequence_id`
+ * to the value it last observed, and the server rejects the update with `ABORTED` if the
+ * operation has been modified since. On success the server increments `sequence_id`; updates to
+ * `state`, `resource_id`, and `dashboard_metadata` are mirrored onto the corresponding
+ * deployment-level resource. Listing `state` in `update_mask` with no value clears it, which
+ * removes the resource, so a delete that is retried until it succeeds must clear `state`. The
+ * parent version must be in progress, and after the update is applied a succeeded operation
+ * cannot carry an `error_message`. See the `state` and `resource_id` fields for the rest.
*/
public Operation updateOperation(UpdateOperationRequest request) {
return impl.updateOperation(request);
diff --git a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/bundledeployments/BundleDeploymentsImpl.java b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/bundledeployments/BundleDeploymentsImpl.java
index e7bb2c68d..b3531a66c 100644
--- a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/bundledeployments/BundleDeploymentsImpl.java
+++ b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/bundledeployments/BundleDeploymentsImpl.java
@@ -52,24 +52,6 @@ public Deployment createDeployment(CreateDeploymentRequest request) {
}
}
- @Override
- public Operation createOperation(CreateOperationRequest request) {
- String path = String.format("/api/2.0/bundle/%s/operations", request.getParent());
- try {
- Request req = new Request("POST", path, apiClient.serialize(request.getOperation()));
-
- ApiClient.setQuery(req, request);
- req.withHeader("Accept", "application/json");
- req.withHeader("Content-Type", "application/json");
- if (apiClient.workspaceId() != null) {
- req.withHeader("X-Databricks-Workspace-Id", apiClient.workspaceId());
- }
- return apiClient.execute(req, Operation.class);
- } catch (IOException e) {
- throw new DatabricksException("IO error: " + e.getMessage(), e);
- }
- }
-
@Override
public Version createVersion(CreateVersionRequest request) {
String path = String.format("/api/2.0/bundle/%s/versions", request.getParent());
diff --git a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/bundledeployments/BundleDeploymentsService.java b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/bundledeployments/BundleDeploymentsService.java
index 4d39a05fa..9daaf27a1 100644
--- a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/bundledeployments/BundleDeploymentsService.java
+++ b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/bundledeployments/BundleDeploymentsService.java
@@ -24,19 +24,6 @@ public interface BundleDeploymentsService {
/** Creates a new deployment in the workspace. */
Deployment createDeployment(CreateDeploymentRequest createDeploymentRequest);
- /**
- * Creates a resource operation under a version.
- *
- * The caller must provide a `resource_key` which becomes the final component of the
- * operation's name. If an operation with the same key already exists under the version, the
- * server returns `ALREADY_EXISTS`.
- *
- * On success the server also updates the corresponding deployment-level resource, creating it
- * if this is the first operation for that resource_key and removing it if the operation records
- * no `state` (see that field).
- */
- Operation createOperation(CreateOperationRequest createOperationRequest);
-
/**
* Creates a new version under a deployment.
*
@@ -45,6 +32,12 @@ public interface BundleDeploymentsService {
* than the deployment's most recent version, and sets the version's `previous_version_id` to 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 `operations` planned for this version, each
+ * identified by a `resource_key` and an `action_type`. The server records one operation per
+ * resource in `OPERATION_STATUS_PENDING` in 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.
*/
Version createVersion(CreateVersionRequest createVersionRequest);
@@ -90,16 +83,16 @@ public interface BundleDeploymentsService {
/**
* Updates a resource operation's mutable fields.
*
- * `state`, `error_message`, `resource_id`, and `status` may be updated, independently;
- * `update_mask` must contain only those paths. All other fields are immutable. The update is
- * guarded by an optimistic-concurrency check: the caller sets `operation.sequence_id` to the
- * value it last observed, and the server rejects the update with `ABORTED` if the operation has
- * been modified since. On success the server increments `sequence_id`; updates to `state` and
- * `resource_id` are mirrored onto the corresponding deployment-level resource. Listing `state` in
- * `update_mask` with no value clears it, which removes the resource, so a delete that is retried
- * until it succeeds must clear `state`. The parent version must be in progress, and after the
- * update is applied a succeeded operation cannot carry an `error_message`. See the `state` and
- * `resource_id` fields for the rest.
+ * `state`, `error_message`, `resource_id`, `status`, and `dashboard_metadata` may be updated,
+ * independently; `update_mask` must contain only those paths. All other fields are immutable. The
+ * update is guarded by an optimistic-concurrency check: the caller sets `operation.sequence_id`
+ * to the value it last observed, and the server rejects the update with `ABORTED` if the
+ * operation has been modified since. On success the server increments `sequence_id`; updates to
+ * `state`, `resource_id`, and `dashboard_metadata` are mirrored onto the corresponding
+ * deployment-level resource. Listing `state` in `update_mask` with no value clears it, which
+ * removes the resource, so a delete that is retried until it succeeds must clear `state`. The
+ * parent version must be in progress, and after the update is applied a succeeded operation
+ * cannot carry an `error_message`. See the `state` and `resource_id` fields for the rest.
*/
Operation updateOperation(UpdateOperationRequest updateOperationRequest);
}
diff --git a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/bundledeployments/CreateOperationRequest.java b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/bundledeployments/CreateOperationRequest.java
deleted file mode 100644
index cd68f6929..000000000
--- a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/bundledeployments/CreateOperationRequest.java
+++ /dev/null
@@ -1,82 +0,0 @@
-// Code generated from OpenAPI specs by Databricks SDK Generator. DO NOT EDIT.
-
-package com.databricks.sdk.service.bundledeployments;
-
-import com.databricks.sdk.support.Generated;
-import com.databricks.sdk.support.QueryParam;
-import com.databricks.sdk.support.ToStringer;
-import com.fasterxml.jackson.annotation.JsonIgnore;
-import com.fasterxml.jackson.annotation.JsonProperty;
-import java.util.Objects;
-
-@Generated
-public class CreateOperationRequest {
- /** The resource operation to create. */
- @JsonProperty("operation")
- private Operation operation;
-
- /**
- * The parent version where this operation will be recorded. Format:
- * deployments/{deployment_id}/versions/{version_id}
- */
- @JsonIgnore private String parent;
-
- /**
- * The key identifying the resource this operation applies to. Becomes the final component of the
- * operation's name.
- */
- @JsonIgnore
- @QueryParam("resource_key")
- private String resourceKey;
-
- public CreateOperationRequest setOperation(Operation operation) {
- this.operation = operation;
- return this;
- }
-
- public Operation getOperation() {
- return operation;
- }
-
- public CreateOperationRequest setParent(String parent) {
- this.parent = parent;
- return this;
- }
-
- public String getParent() {
- return parent;
- }
-
- public CreateOperationRequest setResourceKey(String resourceKey) {
- this.resourceKey = resourceKey;
- return this;
- }
-
- public String getResourceKey() {
- return resourceKey;
- }
-
- @Override
- public boolean equals(Object o) {
- if (this == o) return true;
- if (o == null || getClass() != o.getClass()) return false;
- CreateOperationRequest that = (CreateOperationRequest) o;
- return Objects.equals(operation, that.operation)
- && Objects.equals(parent, that.parent)
- && Objects.equals(resourceKey, that.resourceKey);
- }
-
- @Override
- public int hashCode() {
- return Objects.hash(operation, parent, resourceKey);
- }
-
- @Override
- public String toString() {
- return new ToStringer(CreateOperationRequest.class)
- .add("operation", operation)
- .add("parent", parent)
- .add("resourceKey", resourceKey)
- .toString();
- }
-}
diff --git a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/bundledeployments/Operation.java b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/bundledeployments/Operation.java
index 65cf413eb..a3a41101d 100644
--- a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/bundledeployments/Operation.java
+++ b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/bundledeployments/Operation.java
@@ -9,14 +9,20 @@
import java.util.Objects;
/**
- * An operation on a single resource performed during a version. Operations record the result of
- * applying a resource change to the workspace. Most fields are immutable once recorded; `state`,
- * `error_message`, `resource_id`, and `status` may be updated afterwards (via UpdateOperation),
- * guarded by `sequence_id` for optimistic concurrency control.
+ * An operation on a single resource performed during a version. The full set of operations for a
+ * version is recorded when the version is created: each carries its `resource_key` and
+ * `action_type` and starts in `OPERATION_STATUS_PENDING`. As each resource is applied, its
+ * operation is updated (via UpdateOperation) to record the result of applying the change to the
+ * workspace. `state`, `error_message`, `resource_id`, `status`, and `dashboard_metadata` may be
+ * updated afterwards, guarded by `sequence_id` for optimistic concurrency control; all other fields
+ * are immutable once recorded.
*/
@Generated
public class Operation {
- /** The type of operation performed on this resource. */
+ /**
+ * The type of operation performed on this resource. Set when the version is created and immutable
+ * thereafter.
+ */
@JsonProperty("action_type")
private OperationActionType actionType;
@@ -24,7 +30,11 @@ public class Operation {
@JsonProperty("create_time")
private Timestamp createTime;
- /** Dashboard-specific metadata; set only for dashboard resources. */
+ /**
+ * Dashboard-specific metadata; set only for dashboard resources. Mutable: may be set or updated
+ * via UpdateOperation as the resource is applied, and is mirrored onto the corresponding
+ * deployment-level resource.
+ */
@JsonProperty("dashboard_metadata")
private DashboardMetadata dashboardMetadata;
@@ -56,7 +66,8 @@ public class Operation {
/**
* Resource identifier within the bundle (e.g. "jobs.foo", "pipelines.bar",
* "jobs.foo.permissions", "files.