diff --git a/.codegen/_openapi_sha b/.codegen/_openapi_sha index 7a9cd634a..cbb2ed4ae 100644 --- a/.codegen/_openapi_sha +++ b/.codegen/_openapi_sha @@ -1 +1 @@ -9b38571bfe7bf0bc595480f28eb93a8db3116985 \ No newline at end of file +8921a828d1741af0952eb5c4f0292c194c0d5f38 \ No newline at end of file diff --git a/.gitattributes b/.gitattributes index ef3a43d21..2b2927b41 100644 --- a/.gitattributes +++ b/.gitattributes @@ -2086,14 +2086,16 @@ /home/ubuntu/workspace/databricks-sdk-java/databricks-sdk-java/src/main/java/com/databricks/sdk/service/postgres/CreateRoleOperation.java linguist-generated=true /home/ubuntu/workspace/databricks-sdk-java/databricks-sdk-java/src/main/java/com/databricks/sdk/service/postgres/CreateRoleRequest.java linguist-generated=true /home/ubuntu/workspace/databricks-sdk-java/databricks-sdk-java/src/main/java/com/databricks/sdk/service/postgres/DatabricksServiceExceptionWithDetailsProto.java linguist-generated=true +/home/ubuntu/workspace/databricks-sdk-java/databricks-sdk-java/src/main/java/com/databricks/sdk/service/postgres/DeleteBranchOperation.java linguist-generated=true /home/ubuntu/workspace/databricks-sdk-java/databricks-sdk-java/src/main/java/com/databricks/sdk/service/postgres/DeleteBranchRequest.java linguist-generated=true +/home/ubuntu/workspace/databricks-sdk-java/databricks-sdk-java/src/main/java/com/databricks/sdk/service/postgres/DeleteEndpointOperation.java linguist-generated=true /home/ubuntu/workspace/databricks-sdk-java/databricks-sdk-java/src/main/java/com/databricks/sdk/service/postgres/DeleteEndpointRequest.java linguist-generated=true +/home/ubuntu/workspace/databricks-sdk-java/databricks-sdk-java/src/main/java/com/databricks/sdk/service/postgres/DeleteProjectOperation.java linguist-generated=true /home/ubuntu/workspace/databricks-sdk-java/databricks-sdk-java/src/main/java/com/databricks/sdk/service/postgres/DeleteProjectRequest.java linguist-generated=true /home/ubuntu/workspace/databricks-sdk-java/databricks-sdk-java/src/main/java/com/databricks/sdk/service/postgres/DeleteRoleOperation.java linguist-generated=true /home/ubuntu/workspace/databricks-sdk-java/databricks-sdk-java/src/main/java/com/databricks/sdk/service/postgres/DeleteRoleRequest.java linguist-generated=true /home/ubuntu/workspace/databricks-sdk-java/databricks-sdk-java/src/main/java/com/databricks/sdk/service/postgres/Endpoint.java linguist-generated=true /home/ubuntu/workspace/databricks-sdk-java/databricks-sdk-java/src/main/java/com/databricks/sdk/service/postgres/EndpointOperationMetadata.java linguist-generated=true -/home/ubuntu/workspace/databricks-sdk-java/databricks-sdk-java/src/main/java/com/databricks/sdk/service/postgres/EndpointPoolerMode.java linguist-generated=true /home/ubuntu/workspace/databricks-sdk-java/databricks-sdk-java/src/main/java/com/databricks/sdk/service/postgres/EndpointSettings.java linguist-generated=true /home/ubuntu/workspace/databricks-sdk-java/databricks-sdk-java/src/main/java/com/databricks/sdk/service/postgres/EndpointSpec.java linguist-generated=true /home/ubuntu/workspace/databricks-sdk-java/databricks-sdk-java/src/main/java/com/databricks/sdk/service/postgres/EndpointStatus.java linguist-generated=true diff --git a/NEXT_CHANGELOG.md b/NEXT_CHANGELOG.md index 317db9ab1..8044601d2 100644 --- a/NEXT_CHANGELOG.md +++ b/NEXT_CHANGELOG.md @@ -16,3 +16,16 @@ * Add `TABLE_DELTASHARING_OPEN_DIR_BASED` enum value for `com.databricks.sdk.service.catalog.SecurableKind`. * Add `CREATING` and `CREATE_FAILED` enum values for `com.databricks.sdk.service.settings.NccPrivateEndpointRulePrivateLinkConnectionState`. * [Breaking] Remove `accessModes` and `storageLocation` fields for `com.databricks.sdk.service.sharing.Table`. +* Add `errorMessage` field for `com.databricks.sdk.service.settings.CreatePrivateEndpointRule`. +* Add `errorMessage` field for `com.databricks.sdk.service.settings.NccPrivateEndpointRule`. +* Add `errorMessage` field for `com.databricks.sdk.service.settings.UpdatePrivateEndpointRule`. +* Add `RATE_LIMITED` enum value for `com.databricks.sdk.service.compute.TerminationReasonCode`. +* Add `RATE_LIMITED` enum value for `com.databricks.sdk.service.sql.TerminationReasonCode`. +* [Breaking] Add long-running operation configuration for `workspaceClient.postgres().deleteBranch()` method. +* [Breaking] Add long-running operation configuration for `workspaceClient.postgres().deleteEndpoint()` method. +* [Breaking] Add long-running operation configuration for `workspaceClient.postgres().deleteProject()` method. +* [Breaking] Change `deleteBranch()`, `deleteEndpoint()` and `deleteProject()` methods for `workspaceClient.postgres()` service to return `com.databricks.sdk.service.postgres.Operation` class. +* [Breaking] Remove `pgbouncerSettings` field for `com.databricks.sdk.service.postgres.EndpointSettings`. +* [Breaking] Remove `poolerMode` field for `com.databricks.sdk.service.postgres.EndpointSpec`. +* [Breaking] Remove `poolerMode` field for `com.databricks.sdk.service.postgres.EndpointStatus`. +* [Breaking] Remove `pgbouncerSettings` field for `com.databricks.sdk.service.postgres.ProjectDefaultEndpointSettings`. \ No newline at end of file diff --git a/databricks-sdk-java/src/main/java/com/databricks/sdk/WorkspaceClient.java b/databricks-sdk-java/src/main/java/com/databricks/sdk/WorkspaceClient.java index 0ddab50a1..3fd68fc01 100644 --- a/databricks-sdk-java/src/main/java/com/databricks/sdk/WorkspaceClient.java +++ b/databricks-sdk-java/src/main/java/com/databricks/sdk/WorkspaceClient.java @@ -586,7 +586,7 @@ public AlertsV2API alertsV2() { } /** - * Apps run directly on a customer’s Databricks instance, integrate with their data, use and + * Apps run directly on a customer's Databricks instance, integrate with their data, use and * extend Databricks services, and enable users to interact through single sign-on. */ public AppsAPI apps() { @@ -1419,7 +1419,10 @@ public ProvidersAPI providers() { return providersAPI; } - /** Manage data quality of UC objects (currently support `schema`) */ + /** + * [DEPRECATED] This API is deprecated. Please use the Data Quality Monitoring API instead (REST: + * /api/data-quality/v1/monitors). Manage data quality of UC objects (currently support `schema`). + */ public QualityMonitorV2API qualityMonitorV2() { return qualityMonitorV2API; } diff --git a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/apps/AppsAPI.java b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/apps/AppsAPI.java old mode 100755 new mode 100644 index dee0d4745..5e739d433 --- a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/apps/AppsAPI.java +++ b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/apps/AppsAPI.java @@ -14,7 +14,7 @@ import org.slf4j.LoggerFactory; /** - * Apps run directly on a customer’s Databricks instance, integrate with their data, use and extend + * Apps run directly on a customer's Databricks instance, integrate with their data, use and extend * Databricks services, and enable users to interact through single sign-on. */ @Generated diff --git a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/apps/AppsService.java b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/apps/AppsService.java old mode 100755 new mode 100644 index 31742387d..0a84a93f7 --- a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/apps/AppsService.java +++ b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/apps/AppsService.java @@ -4,7 +4,7 @@ import com.databricks.sdk.support.Generated; /** - * Apps run directly on a customer’s Databricks instance, integrate with their data, use and extend + * Apps run directly on a customer's Databricks instance, integrate with their data, use and extend * Databricks services, and enable users to interact through single sign-on. * *

This is the high-level interface, that contains generated methods. diff --git a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/compute/TerminationReasonCode.java b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/compute/TerminationReasonCode.java index 641c74395..55fce9173 100644 --- a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/compute/TerminationReasonCode.java +++ b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/compute/TerminationReasonCode.java @@ -153,6 +153,7 @@ public enum TerminationReasonCode { NPIP_TUNNEL_TOKEN_FAILURE, POD_ASSIGNMENT_FAILURE, POD_SCHEDULING_FAILURE, + RATE_LIMITED, REQUEST_REJECTED, REQUEST_THROTTLED, RESOURCE_USAGE_BLOCKED, diff --git a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/database/DatabaseInstance.java b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/database/DatabaseInstance.java old mode 100755 new mode 100644 index f52760290..fcf25e60f --- a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/database/DatabaseInstance.java +++ b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/database/DatabaseInstance.java @@ -36,41 +36,69 @@ public class DatabaseInstance { @JsonProperty("custom_tags") private Collection customTags; - /** Deprecated. The sku of the instance; this field will always match the value of capacity. */ + /** + * Deprecated. The sku of the instance; this field will always match the value of capacity. This + * is an output only field that contains the value computed from the input field combined with + * server side defaults. Use the field without the effective_ prefix to set the value. + */ @JsonProperty("effective_capacity") private String effectiveCapacity; - /** The recorded custom tags associated with the instance. */ + /** + * The recorded custom tags associated with the instance. This is an output only field that + * contains the value computed from the input field combined with server side defaults. Use the + * field without the effective_ prefix to set the value. + */ @JsonProperty("effective_custom_tags") private Collection effectiveCustomTags; - /** Whether the instance has PG native password login enabled. */ + /** + * Whether the instance has PG native password login enabled. This is an output only field that + * contains the value computed from the input field combined with server side defaults. Use the + * field without the effective_ prefix to set the value. + */ @JsonProperty("effective_enable_pg_native_login") private Boolean effectiveEnablePgNativeLogin; - /** Whether secondaries serving read-only traffic are enabled. Defaults to false. */ + /** + * Whether secondaries serving read-only traffic are enabled. Defaults to false. This is an output + * only field that contains the value computed from the input field combined with server side + * defaults. Use the field without the effective_ prefix to set the value. + */ @JsonProperty("effective_enable_readable_secondaries") private Boolean effectiveEnableReadableSecondaries; /** * The number of nodes in the instance, composed of 1 primary and 0 or more secondaries. Defaults - * to 1 primary and 0 secondaries. + * to 1 primary and 0 secondaries. This is an output only field that contains the value computed + * from the input field combined with server side defaults. Use the field without the effective_ + * prefix to set the value. */ @JsonProperty("effective_node_count") private Long effectiveNodeCount; /** * The retention window for the instance. This is the time window in days for which the historical - * data is retained. + * data is retained. This is an output only field that contains the value computed from the input + * field combined with server side defaults. Use the field without the effective_ prefix to set + * the value. */ @JsonProperty("effective_retention_window_in_days") private Long effectiveRetentionWindowInDays; - /** Whether the instance is stopped. */ + /** + * Whether the instance is stopped. This is an output only field that contains the value computed + * from the input field combined with server side defaults. Use the field without the effective_ + * prefix to set the value. + */ @JsonProperty("effective_stopped") private Boolean effectiveStopped; - /** The policy that is applied to the instance. */ + /** + * The policy that is applied to the instance. This is an output only field that contains the + * value computed from the input field combined with server side defaults. Use the field without + * the effective_ prefix to set the value. + */ @JsonProperty("effective_usage_policy_id") private String effectiveUsagePolicyId; diff --git a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/database/DatabaseInstanceRef.java b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/database/DatabaseInstanceRef.java old mode 100755 new mode 100644 index 89cff10b9..ee4458cc3 --- a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/database/DatabaseInstanceRef.java +++ b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/database/DatabaseInstanceRef.java @@ -30,7 +30,9 @@ public class DatabaseInstanceRef { /** * For a parent ref instance, this is the LSN on the parent instance from which the instance was * created. For a child ref instance, this is the LSN on the instance from which the child - * instance was created. + * instance was created. This is an output only field that contains the value computed from the + * input field combined with server side defaults. Use the field without the effective_ prefix to + * set the value. */ @JsonProperty("effective_lsn") private String effectiveLsn; diff --git a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/database/DatabaseInstanceRole.java b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/database/DatabaseInstanceRole.java old mode 100755 new mode 100644 index 9f0c7010a..c58317a87 --- a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/database/DatabaseInstanceRole.java +++ b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/database/DatabaseInstanceRole.java @@ -14,7 +14,11 @@ public class DatabaseInstanceRole { @JsonProperty("attributes") private DatabaseInstanceRoleAttributes attributes; - /** The attributes that are applied to the role. */ + /** + * The attributes that are applied to the role. This is an output only field that contains the + * value computed from the input field combined with server side defaults. Use the field without + * the effective_ prefix to set the value. + */ @JsonProperty("effective_attributes") private DatabaseInstanceRoleAttributes effectiveAttributes; diff --git a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/database/SyncedDatabaseTable.java b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/database/SyncedDatabaseTable.java old mode 100755 new mode 100644 index 805437b45..8ea0b5343 --- a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/database/SyncedDatabaseTable.java +++ b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/database/SyncedDatabaseTable.java @@ -27,12 +27,18 @@ public class SyncedDatabaseTable { /** * The name of the database instance that this table is registered to. This field is always * returned, and for tables inside database catalogs is inferred database instance associated with - * the catalog. + * the catalog. This is an output only field that contains the value computed from the input field + * combined with server side defaults. Use the field without the effective_ prefix to set the + * value. */ @JsonProperty("effective_database_instance_name") private String effectiveDatabaseInstanceName; - /** The name of the logical database that this table is registered to. */ + /** + * The name of the logical database that this table is registered to. This is an output only field + * that contains the value computed from the input field combined with server side defaults. Use + * the field without the effective_ prefix to set the value. + */ @JsonProperty("effective_logical_database_name") private String effectiveLogicalDatabaseName; diff --git a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/postgres/DatabricksServiceExceptionWithDetailsProto.java b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/postgres/DatabricksServiceExceptionWithDetailsProto.java index d9fcd43ed..fd278336e 100644 --- a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/postgres/DatabricksServiceExceptionWithDetailsProto.java +++ b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/postgres/DatabricksServiceExceptionWithDetailsProto.java @@ -11,9 +11,7 @@ /** Databricks Error that is returned by all Databricks APIs. */ @Generated public class DatabricksServiceExceptionWithDetailsProto { - /** - * @pbjson-skip - */ + /** */ @JsonProperty("details") private Collection details; diff --git a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/postgres/DeleteBranchOperation.java b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/postgres/DeleteBranchOperation.java new file mode 100644 index 000000000..070558e24 --- /dev/null +++ b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/postgres/DeleteBranchOperation.java @@ -0,0 +1,161 @@ +// Code generated from OpenAPI specs by Databricks SDK Generator. DO NOT EDIT. +package com.databricks.sdk.service.postgres; + +import com.databricks.sdk.core.DatabricksException; +import com.databricks.sdk.core.utils.SerDeUtils; +import com.databricks.sdk.service.common.lro.LroOptions; +import com.databricks.sdk.support.Generated; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.ObjectMapper; +import java.time.Duration; +import java.util.Optional; +import java.util.concurrent.TimeoutException; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * Wrapper for interacting with a long-running deleteBranch operation. Provides methods to wait for + * completion, check status, cancel, and access metadata. + */ +@Generated +public class DeleteBranchOperation { + private static final Logger LOG = LoggerFactory.getLogger(DeleteBranchOperation.class); + + private final PostgresService impl; + private Operation operation; + private final ObjectMapper objectMapper; + + public DeleteBranchOperation(PostgresService impl, Operation operation) { + this.impl = impl; + this.operation = operation; + this.objectMapper = SerDeUtils.createMapper(); + } + + /** + * Wait for the operation to complete and return the resulting . Waits indefinitely if no timeout + * is specified. + * + * @return the created + * @throws TimeoutException if the operation doesn't complete within the timeout + * @throws DatabricksException if the operation fails + */ + public void waitForCompletion() throws TimeoutException { + waitForCompletion(Optional.empty()); + } + + /** + * Wait for the operation to complete and return the resulting . + * + * @param options the options for configuring the wait behavior, can be empty for defaults + * @return the created + * @throws TimeoutException if the operation doesn't complete within the timeout + * @throws DatabricksException if the operation fails + */ + public void waitForCompletion(Optional options) throws TimeoutException { + Optional timeout = options.flatMap(LroOptions::getTimeout); + long deadline = + timeout.isPresent() + ? System.currentTimeMillis() + timeout.get().toMillis() + : Long.MAX_VALUE; + String statusMessage = "polling operation..."; + int attempt = 1; + + while (System.currentTimeMillis() < deadline) { + // Refresh the operation state + refreshOperation(); + + if (operation.getDone() != null && operation.getDone()) { + // Operation completed, check for success or failure + if (operation.getError() != null) { + String errorMsg = "unknown error"; + if (operation.getError().getMessage() != null + && !operation.getError().getMessage().isEmpty()) { + errorMsg = operation.getError().getMessage(); + } + + if (operation.getError().getErrorCode() != null) { + errorMsg = String.format("[%s] %s", operation.getError().getErrorCode(), errorMsg); + } + + throw new DatabricksException("Operation failed: " + errorMsg); + } + + // Operation completed successfully, unmarshal response + if (operation.getResponse() == null) { + throw new DatabricksException("Operation completed but no response available"); + } + + try { + JsonNode responseJson = objectMapper.valueToTree(operation.getResponse()); + objectMapper.treeToValue(responseJson, Void.class); + } catch (JsonProcessingException e) { + throw new DatabricksException("Failed to unmarshal response: " + e.getMessage(), e); + } + } + + // Operation still in progress, wait before polling again + String prefix = String.format("operation=%s", operation.getName()); + int sleep = Math.min(attempt, 10); // sleep 10s max per attempt + LOG.info("{}: operation in progress (sleeping ~{}s)", prefix, sleep); + + try { + Thread.sleep((long) (sleep * 1000L + Math.random() * 1000)); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new DatabricksException("Current thread was interrupted", e); + } + attempt++; + } + + String timeoutMessage = + timeout.isPresent() + ? String.format("Operation timed out after %s: %s", timeout.get(), statusMessage) + : String.format("Operation timed out: %s", statusMessage); + throw new TimeoutException(timeoutMessage); + } + + /** + * Get the operation name. + * + * @return the operation name + */ + public String getName() { + return operation.getName(); + } + + /** + * Get the operation metadata. + * + * @return the operation metadata, or null if not available + * @throws DatabricksException if the metadata cannot be deserialized + */ + public BranchOperationMetadata getMetadata() { + if (operation.getMetadata() == null) { + return null; + } + + try { + JsonNode metadataJson = objectMapper.valueToTree(operation.getMetadata()); + return objectMapper.treeToValue(metadataJson, BranchOperationMetadata.class); + } catch (JsonProcessingException e) { + throw new DatabricksException("Failed to unmarshal operation metadata: " + e.getMessage(), e); + } + } + + /** + * Check if the operation is done. This method refreshes the operation state before checking. + * + * @return true if the operation is complete, false otherwise + * @throws DatabricksException if the status check fails + */ + public boolean isDone() { + refreshOperation(); + return operation.getDone() != null && operation.getDone(); + } + + /** Refresh the operation state by polling the server. */ + private void refreshOperation() { + operation = impl.getOperation(new GetOperationRequest().setName(operation.getName())); + } +} diff --git a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/postgres/DeleteEndpointOperation.java b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/postgres/DeleteEndpointOperation.java new file mode 100644 index 000000000..dc868d52a --- /dev/null +++ b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/postgres/DeleteEndpointOperation.java @@ -0,0 +1,161 @@ +// Code generated from OpenAPI specs by Databricks SDK Generator. DO NOT EDIT. +package com.databricks.sdk.service.postgres; + +import com.databricks.sdk.core.DatabricksException; +import com.databricks.sdk.core.utils.SerDeUtils; +import com.databricks.sdk.service.common.lro.LroOptions; +import com.databricks.sdk.support.Generated; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.ObjectMapper; +import java.time.Duration; +import java.util.Optional; +import java.util.concurrent.TimeoutException; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * Wrapper for interacting with a long-running deleteEndpoint operation. Provides methods to wait + * for completion, check status, cancel, and access metadata. + */ +@Generated +public class DeleteEndpointOperation { + private static final Logger LOG = LoggerFactory.getLogger(DeleteEndpointOperation.class); + + private final PostgresService impl; + private Operation operation; + private final ObjectMapper objectMapper; + + public DeleteEndpointOperation(PostgresService impl, Operation operation) { + this.impl = impl; + this.operation = operation; + this.objectMapper = SerDeUtils.createMapper(); + } + + /** + * Wait for the operation to complete and return the resulting . Waits indefinitely if no timeout + * is specified. + * + * @return the created + * @throws TimeoutException if the operation doesn't complete within the timeout + * @throws DatabricksException if the operation fails + */ + public void waitForCompletion() throws TimeoutException { + waitForCompletion(Optional.empty()); + } + + /** + * Wait for the operation to complete and return the resulting . + * + * @param options the options for configuring the wait behavior, can be empty for defaults + * @return the created + * @throws TimeoutException if the operation doesn't complete within the timeout + * @throws DatabricksException if the operation fails + */ + public void waitForCompletion(Optional options) throws TimeoutException { + Optional timeout = options.flatMap(LroOptions::getTimeout); + long deadline = + timeout.isPresent() + ? System.currentTimeMillis() + timeout.get().toMillis() + : Long.MAX_VALUE; + String statusMessage = "polling operation..."; + int attempt = 1; + + while (System.currentTimeMillis() < deadline) { + // Refresh the operation state + refreshOperation(); + + if (operation.getDone() != null && operation.getDone()) { + // Operation completed, check for success or failure + if (operation.getError() != null) { + String errorMsg = "unknown error"; + if (operation.getError().getMessage() != null + && !operation.getError().getMessage().isEmpty()) { + errorMsg = operation.getError().getMessage(); + } + + if (operation.getError().getErrorCode() != null) { + errorMsg = String.format("[%s] %s", operation.getError().getErrorCode(), errorMsg); + } + + throw new DatabricksException("Operation failed: " + errorMsg); + } + + // Operation completed successfully, unmarshal response + if (operation.getResponse() == null) { + throw new DatabricksException("Operation completed but no response available"); + } + + try { + JsonNode responseJson = objectMapper.valueToTree(operation.getResponse()); + objectMapper.treeToValue(responseJson, Void.class); + } catch (JsonProcessingException e) { + throw new DatabricksException("Failed to unmarshal response: " + e.getMessage(), e); + } + } + + // Operation still in progress, wait before polling again + String prefix = String.format("operation=%s", operation.getName()); + int sleep = Math.min(attempt, 10); // sleep 10s max per attempt + LOG.info("{}: operation in progress (sleeping ~{}s)", prefix, sleep); + + try { + Thread.sleep((long) (sleep * 1000L + Math.random() * 1000)); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new DatabricksException("Current thread was interrupted", e); + } + attempt++; + } + + String timeoutMessage = + timeout.isPresent() + ? String.format("Operation timed out after %s: %s", timeout.get(), statusMessage) + : String.format("Operation timed out: %s", statusMessage); + throw new TimeoutException(timeoutMessage); + } + + /** + * Get the operation name. + * + * @return the operation name + */ + public String getName() { + return operation.getName(); + } + + /** + * Get the operation metadata. + * + * @return the operation metadata, or null if not available + * @throws DatabricksException if the metadata cannot be deserialized + */ + public EndpointOperationMetadata getMetadata() { + if (operation.getMetadata() == null) { + return null; + } + + try { + JsonNode metadataJson = objectMapper.valueToTree(operation.getMetadata()); + return objectMapper.treeToValue(metadataJson, EndpointOperationMetadata.class); + } catch (JsonProcessingException e) { + throw new DatabricksException("Failed to unmarshal operation metadata: " + e.getMessage(), e); + } + } + + /** + * Check if the operation is done. This method refreshes the operation state before checking. + * + * @return true if the operation is complete, false otherwise + * @throws DatabricksException if the status check fails + */ + public boolean isDone() { + refreshOperation(); + return operation.getDone() != null && operation.getDone(); + } + + /** Refresh the operation state by polling the server. */ + private void refreshOperation() { + operation = impl.getOperation(new GetOperationRequest().setName(operation.getName())); + } +} diff --git a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/postgres/DeleteProjectOperation.java b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/postgres/DeleteProjectOperation.java new file mode 100644 index 000000000..289d193fa --- /dev/null +++ b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/postgres/DeleteProjectOperation.java @@ -0,0 +1,161 @@ +// Code generated from OpenAPI specs by Databricks SDK Generator. DO NOT EDIT. +package com.databricks.sdk.service.postgres; + +import com.databricks.sdk.core.DatabricksException; +import com.databricks.sdk.core.utils.SerDeUtils; +import com.databricks.sdk.service.common.lro.LroOptions; +import com.databricks.sdk.support.Generated; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.ObjectMapper; +import java.time.Duration; +import java.util.Optional; +import java.util.concurrent.TimeoutException; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * Wrapper for interacting with a long-running deleteProject operation. Provides methods to wait for + * completion, check status, cancel, and access metadata. + */ +@Generated +public class DeleteProjectOperation { + private static final Logger LOG = LoggerFactory.getLogger(DeleteProjectOperation.class); + + private final PostgresService impl; + private Operation operation; + private final ObjectMapper objectMapper; + + public DeleteProjectOperation(PostgresService impl, Operation operation) { + this.impl = impl; + this.operation = operation; + this.objectMapper = SerDeUtils.createMapper(); + } + + /** + * Wait for the operation to complete and return the resulting . Waits indefinitely if no timeout + * is specified. + * + * @return the created + * @throws TimeoutException if the operation doesn't complete within the timeout + * @throws DatabricksException if the operation fails + */ + public void waitForCompletion() throws TimeoutException { + waitForCompletion(Optional.empty()); + } + + /** + * Wait for the operation to complete and return the resulting . + * + * @param options the options for configuring the wait behavior, can be empty for defaults + * @return the created + * @throws TimeoutException if the operation doesn't complete within the timeout + * @throws DatabricksException if the operation fails + */ + public void waitForCompletion(Optional options) throws TimeoutException { + Optional timeout = options.flatMap(LroOptions::getTimeout); + long deadline = + timeout.isPresent() + ? System.currentTimeMillis() + timeout.get().toMillis() + : Long.MAX_VALUE; + String statusMessage = "polling operation..."; + int attempt = 1; + + while (System.currentTimeMillis() < deadline) { + // Refresh the operation state + refreshOperation(); + + if (operation.getDone() != null && operation.getDone()) { + // Operation completed, check for success or failure + if (operation.getError() != null) { + String errorMsg = "unknown error"; + if (operation.getError().getMessage() != null + && !operation.getError().getMessage().isEmpty()) { + errorMsg = operation.getError().getMessage(); + } + + if (operation.getError().getErrorCode() != null) { + errorMsg = String.format("[%s] %s", operation.getError().getErrorCode(), errorMsg); + } + + throw new DatabricksException("Operation failed: " + errorMsg); + } + + // Operation completed successfully, unmarshal response + if (operation.getResponse() == null) { + throw new DatabricksException("Operation completed but no response available"); + } + + try { + JsonNode responseJson = objectMapper.valueToTree(operation.getResponse()); + objectMapper.treeToValue(responseJson, Void.class); + } catch (JsonProcessingException e) { + throw new DatabricksException("Failed to unmarshal response: " + e.getMessage(), e); + } + } + + // Operation still in progress, wait before polling again + String prefix = String.format("operation=%s", operation.getName()); + int sleep = Math.min(attempt, 10); // sleep 10s max per attempt + LOG.info("{}: operation in progress (sleeping ~{}s)", prefix, sleep); + + try { + Thread.sleep((long) (sleep * 1000L + Math.random() * 1000)); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new DatabricksException("Current thread was interrupted", e); + } + attempt++; + } + + String timeoutMessage = + timeout.isPresent() + ? String.format("Operation timed out after %s: %s", timeout.get(), statusMessage) + : String.format("Operation timed out: %s", statusMessage); + throw new TimeoutException(timeoutMessage); + } + + /** + * Get the operation name. + * + * @return the operation name + */ + public String getName() { + return operation.getName(); + } + + /** + * Get the operation metadata. + * + * @return the operation metadata, or null if not available + * @throws DatabricksException if the metadata cannot be deserialized + */ + public ProjectOperationMetadata getMetadata() { + if (operation.getMetadata() == null) { + return null; + } + + try { + JsonNode metadataJson = objectMapper.valueToTree(operation.getMetadata()); + return objectMapper.treeToValue(metadataJson, ProjectOperationMetadata.class); + } catch (JsonProcessingException e) { + throw new DatabricksException("Failed to unmarshal operation metadata: " + e.getMessage(), e); + } + } + + /** + * Check if the operation is done. This method refreshes the operation state before checking. + * + * @return true if the operation is complete, false otherwise + * @throws DatabricksException if the status check fails + */ + public boolean isDone() { + refreshOperation(); + return operation.getDone() != null && operation.getDone(); + } + + /** Refresh the operation state by polling the server. */ + private void refreshOperation() { + operation = impl.getOperation(new GetOperationRequest().setName(operation.getName())); + } +} diff --git a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/postgres/EndpointPoolerMode.java b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/postgres/EndpointPoolerMode.java deleted file mode 100644 index 061d5b86f..000000000 --- a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/postgres/EndpointPoolerMode.java +++ /dev/null @@ -1,11 +0,0 @@ -// Code generated from OpenAPI specs by Databricks SDK Generator. DO NOT EDIT. - -package com.databricks.sdk.service.postgres; - -import com.databricks.sdk.support.Generated; - -/** The connection pooler mode. Lakebase supports PgBouncer in `transaction` mode only. */ -@Generated -public enum EndpointPoolerMode { - TRANSACTION, -} diff --git a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/postgres/EndpointSettings.java b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/postgres/EndpointSettings.java index 007a645ce..9625626b6 100644 --- a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/postgres/EndpointSettings.java +++ b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/postgres/EndpointSettings.java @@ -15,10 +15,6 @@ public class EndpointSettings { @JsonProperty("pg_settings") private Map pgSettings; - /** A raw representation of PgBouncer settings. */ - @JsonProperty("pgbouncer_settings") - private Map pgbouncerSettings; - public EndpointSettings setPgSettings(Map pgSettings) { this.pgSettings = pgSettings; return this; @@ -28,34 +24,21 @@ public Map getPgSettings() { return pgSettings; } - public EndpointSettings setPgbouncerSettings(Map pgbouncerSettings) { - this.pgbouncerSettings = pgbouncerSettings; - return this; - } - - public Map getPgbouncerSettings() { - return pgbouncerSettings; - } - @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; EndpointSettings that = (EndpointSettings) o; - return Objects.equals(pgSettings, that.pgSettings) - && Objects.equals(pgbouncerSettings, that.pgbouncerSettings); + return Objects.equals(pgSettings, that.pgSettings); } @Override public int hashCode() { - return Objects.hash(pgSettings, pgbouncerSettings); + return Objects.hash(pgSettings); } @Override public String toString() { - return new ToStringer(EndpointSettings.class) - .add("pgSettings", pgSettings) - .add("pgbouncerSettings", pgbouncerSettings) - .toString(); + return new ToStringer(EndpointSettings.class).add("pgSettings", pgSettings).toString(); } } diff --git a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/postgres/EndpointSpec.java b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/postgres/EndpointSpec.java index 74fe3672b..21d7e5676 100644 --- a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/postgres/EndpointSpec.java +++ b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/postgres/EndpointSpec.java @@ -30,10 +30,6 @@ public class EndpointSpec { @JsonProperty("endpoint_type") private EndpointType endpointType; - /** */ - @JsonProperty("pooler_mode") - private EndpointPoolerMode poolerMode; - /** */ @JsonProperty("settings") private EndpointSettings settings; @@ -78,15 +74,6 @@ public EndpointType getEndpointType() { return endpointType; } - public EndpointSpec setPoolerMode(EndpointPoolerMode poolerMode) { - this.poolerMode = poolerMode; - return this; - } - - public EndpointPoolerMode getPoolerMode() { - return poolerMode; - } - public EndpointSpec setSettings(EndpointSettings settings) { this.settings = settings; return this; @@ -114,7 +101,6 @@ public boolean equals(Object o) { && Objects.equals(autoscalingLimitMinCu, that.autoscalingLimitMinCu) && Objects.equals(disabled, that.disabled) && Objects.equals(endpointType, that.endpointType) - && Objects.equals(poolerMode, that.poolerMode) && Objects.equals(settings, that.settings) && Objects.equals(suspendTimeoutDuration, that.suspendTimeoutDuration); } @@ -126,7 +112,6 @@ public int hashCode() { autoscalingLimitMinCu, disabled, endpointType, - poolerMode, settings, suspendTimeoutDuration); } @@ -138,7 +123,6 @@ public String toString() { .add("autoscalingLimitMinCu", autoscalingLimitMinCu) .add("disabled", disabled) .add("endpointType", endpointType) - .add("poolerMode", poolerMode) .add("settings", settings) .add("suspendTimeoutDuration", suspendTimeoutDuration) .toString(); diff --git a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/postgres/EndpointStatus.java b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/postgres/EndpointStatus.java index 4781f087d..53654a5cc 100644 --- a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/postgres/EndpointStatus.java +++ b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/postgres/EndpointStatus.java @@ -50,10 +50,6 @@ public class EndpointStatus { @JsonProperty("pending_state") private EndpointStatusState pendingState; - /** */ - @JsonProperty("pooler_mode") - private EndpointPoolerMode poolerMode; - /** */ @JsonProperty("settings") private EndpointSettings settings; @@ -142,15 +138,6 @@ public EndpointStatusState getPendingState() { return pendingState; } - public EndpointStatus setPoolerMode(EndpointPoolerMode poolerMode) { - this.poolerMode = poolerMode; - return this; - } - - public EndpointPoolerMode getPoolerMode() { - return poolerMode; - } - public EndpointStatus setSettings(EndpointSettings settings) { this.settings = settings; return this; @@ -200,7 +187,6 @@ public boolean equals(Object o) { && Objects.equals(host, that.host) && Objects.equals(lastActiveTime, that.lastActiveTime) && Objects.equals(pendingState, that.pendingState) - && Objects.equals(poolerMode, that.poolerMode) && Objects.equals(settings, that.settings) && Objects.equals(startTime, that.startTime) && Objects.equals(suspendTime, that.suspendTime) @@ -218,7 +204,6 @@ public int hashCode() { host, lastActiveTime, pendingState, - poolerMode, settings, startTime, suspendTime, @@ -236,7 +221,6 @@ public String toString() { .add("host", host) .add("lastActiveTime", lastActiveTime) .add("pendingState", pendingState) - .add("poolerMode", poolerMode) .add("settings", settings) .add("startTime", startTime) .add("suspendTime", suspendTime) diff --git a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/postgres/PostgresAPI.java b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/postgres/PostgresAPI.java index b41027c27..94535ee19 100644 --- a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/postgres/PostgresAPI.java +++ b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/postgres/PostgresAPI.java @@ -48,31 +48,34 @@ public CreateRoleOperation createRole(CreateRoleRequest request) { return new CreateRoleOperation(impl, operation); } - public void deleteBranch(String name) { - deleteBranch(new DeleteBranchRequest().setName(name)); + public DeleteBranchOperation deleteBranch(String name) { + return deleteBranch(new DeleteBranchRequest().setName(name)); } /** Delete a Branch. */ - public void deleteBranch(DeleteBranchRequest request) { - impl.deleteBranch(request); + public DeleteBranchOperation deleteBranch(DeleteBranchRequest request) { + Operation operation = impl.deleteBranch(request); + return new DeleteBranchOperation(impl, operation); } - public void deleteEndpoint(String name) { - deleteEndpoint(new DeleteEndpointRequest().setName(name)); + public DeleteEndpointOperation deleteEndpoint(String name) { + return deleteEndpoint(new DeleteEndpointRequest().setName(name)); } /** Delete an Endpoint. */ - public void deleteEndpoint(DeleteEndpointRequest request) { - impl.deleteEndpoint(request); + public DeleteEndpointOperation deleteEndpoint(DeleteEndpointRequest request) { + Operation operation = impl.deleteEndpoint(request); + return new DeleteEndpointOperation(impl, operation); } - public void deleteProject(String name) { - deleteProject(new DeleteProjectRequest().setName(name)); + public DeleteProjectOperation deleteProject(String name) { + return deleteProject(new DeleteProjectRequest().setName(name)); } /** Delete a Project. */ - public void deleteProject(DeleteProjectRequest request) { - impl.deleteProject(request); + public DeleteProjectOperation deleteProject(DeleteProjectRequest request) { + Operation operation = impl.deleteProject(request); + return new DeleteProjectOperation(impl, operation); } public DeleteRoleOperation deleteRole(String name) { diff --git a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/postgres/PostgresImpl.java b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/postgres/PostgresImpl.java index a91a37155..891225717 100644 --- a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/postgres/PostgresImpl.java +++ b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/postgres/PostgresImpl.java @@ -77,42 +77,42 @@ public Operation createRole(CreateRoleRequest request) { } @Override - public void deleteBranch(DeleteBranchRequest request) { + public Operation deleteBranch(DeleteBranchRequest request) { String path = String.format("/api/2.0/postgres/%s", request.getName()); try { Request req = new Request("DELETE", path); ApiClient.setQuery(req, request); req.withHeader("Accept", "application/json"); - apiClient.execute(req, Void.class); + return apiClient.execute(req, Operation.class); } catch (IOException e) { throw new DatabricksException("IO error: " + e.getMessage(), e); } } @Override - public void deleteEndpoint(DeleteEndpointRequest request) { + public Operation deleteEndpoint(DeleteEndpointRequest request) { String path = String.format("/api/2.0/postgres/%s", request.getName()); try { Request req = new Request("DELETE", path); ApiClient.setQuery(req, request); req.withHeader("Accept", "application/json"); - apiClient.execute(req, Void.class); + return apiClient.execute(req, Operation.class); } catch (IOException e) { throw new DatabricksException("IO error: " + e.getMessage(), e); } } @Override - public void deleteProject(DeleteProjectRequest request) { + public Operation deleteProject(DeleteProjectRequest request) { String path = String.format("/api/2.0/postgres/%s", request.getName()); try { Request req = new Request("DELETE", path); ApiClient.setQuery(req, request); req.withHeader("Accept", "application/json"); - apiClient.execute(req, Void.class); + return apiClient.execute(req, Operation.class); } catch (IOException e) { throw new DatabricksException("IO error: " + e.getMessage(), e); } diff --git a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/postgres/PostgresService.java b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/postgres/PostgresService.java index e5b7d832f..dce1e22ae 100644 --- a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/postgres/PostgresService.java +++ b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/postgres/PostgresService.java @@ -25,13 +25,13 @@ public interface PostgresService { Operation createRole(CreateRoleRequest createRoleRequest); /** Delete a Branch. */ - void deleteBranch(DeleteBranchRequest deleteBranchRequest); + Operation deleteBranch(DeleteBranchRequest deleteBranchRequest); /** Delete an Endpoint. */ - void deleteEndpoint(DeleteEndpointRequest deleteEndpointRequest); + Operation deleteEndpoint(DeleteEndpointRequest deleteEndpointRequest); /** Delete a Project. */ - void deleteProject(DeleteProjectRequest deleteProjectRequest); + Operation deleteProject(DeleteProjectRequest deleteProjectRequest); /** Delete a role in a branch. */ Operation deleteRole(DeleteRoleRequest deleteRoleRequest); diff --git a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/postgres/ProjectDefaultEndpointSettings.java b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/postgres/ProjectDefaultEndpointSettings.java index a66bc6d5d..fa5404d7c 100644 --- a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/postgres/ProjectDefaultEndpointSettings.java +++ b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/postgres/ProjectDefaultEndpointSettings.java @@ -24,10 +24,6 @@ public class ProjectDefaultEndpointSettings { @JsonProperty("pg_settings") private Map pgSettings; - /** A raw representation of PgBouncer settings. */ - @JsonProperty("pgbouncer_settings") - private Map pgbouncerSettings; - /** Duration of inactivity after which the compute endpoint is automatically suspended. */ @JsonProperty("suspend_timeout_duration") private Duration suspendTimeoutDuration; @@ -59,16 +55,6 @@ public Map getPgSettings() { return pgSettings; } - public ProjectDefaultEndpointSettings setPgbouncerSettings( - Map pgbouncerSettings) { - this.pgbouncerSettings = pgbouncerSettings; - return this; - } - - public Map getPgbouncerSettings() { - return pgbouncerSettings; - } - public ProjectDefaultEndpointSettings setSuspendTimeoutDuration(Duration suspendTimeoutDuration) { this.suspendTimeoutDuration = suspendTimeoutDuration; return this; @@ -86,18 +72,13 @@ public boolean equals(Object o) { return Objects.equals(autoscalingLimitMaxCu, that.autoscalingLimitMaxCu) && Objects.equals(autoscalingLimitMinCu, that.autoscalingLimitMinCu) && Objects.equals(pgSettings, that.pgSettings) - && Objects.equals(pgbouncerSettings, that.pgbouncerSettings) && Objects.equals(suspendTimeoutDuration, that.suspendTimeoutDuration); } @Override public int hashCode() { return Objects.hash( - autoscalingLimitMaxCu, - autoscalingLimitMinCu, - pgSettings, - pgbouncerSettings, - suspendTimeoutDuration); + autoscalingLimitMaxCu, autoscalingLimitMinCu, pgSettings, suspendTimeoutDuration); } @Override @@ -106,7 +87,6 @@ public String toString() { .add("autoscalingLimitMaxCu", autoscalingLimitMaxCu) .add("autoscalingLimitMinCu", autoscalingLimitMinCu) .add("pgSettings", pgSettings) - .add("pgbouncerSettings", pgbouncerSettings) .add("suspendTimeoutDuration", suspendTimeoutDuration) .toString(); } diff --git a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/qualitymonitorv2/QualityMonitorV2API.java b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/qualitymonitorv2/QualityMonitorV2API.java old mode 100755 new mode 100644 index 9f50f085f..e74d025b9 --- a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/qualitymonitorv2/QualityMonitorV2API.java +++ b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/qualitymonitorv2/QualityMonitorV2API.java @@ -7,7 +7,10 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; -/** Manage data quality of UC objects (currently support `schema`) */ +/** + * [DEPRECATED] This API is deprecated. Please use the Data Quality Monitoring API instead (REST: + * /api/data-quality/v1/monitors). Manage data quality of UC objects (currently support `schema`). + */ @Generated public class QualityMonitorV2API { private static final Logger LOG = LoggerFactory.getLogger(QualityMonitorV2API.class); @@ -24,7 +27,9 @@ public QualityMonitorV2API(QualityMonitorV2Service mock) { impl = mock; } - /** Create a quality monitor on UC object */ + /** + * [DEPRECATED] Create a quality monitor on UC object. Use Data Quality Monitoring API instead. + */ public QualityMonitor createQualityMonitor(CreateQualityMonitorRequest request) { return impl.createQualityMonitor(request); } @@ -34,7 +39,9 @@ public void deleteQualityMonitor(String objectType, String objectId) { new DeleteQualityMonitorRequest().setObjectType(objectType).setObjectId(objectId)); } - /** Delete a quality monitor on UC object */ + /** + * [DEPRECATED] Delete a quality monitor on UC object. Use Data Quality Monitoring API instead. + */ public void deleteQualityMonitor(DeleteQualityMonitorRequest request) { impl.deleteQualityMonitor(request); } @@ -44,12 +51,14 @@ public QualityMonitor getQualityMonitor(String objectType, String objectId) { new GetQualityMonitorRequest().setObjectType(objectType).setObjectId(objectId)); } - /** Read a quality monitor on UC object */ + /** [DEPRECATED] Read a quality monitor on UC object. Use Data Quality Monitoring API instead. */ public QualityMonitor getQualityMonitor(GetQualityMonitorRequest request) { return impl.getQualityMonitor(request); } - /** (Unimplemented) List quality monitors */ + /** + * [DEPRECATED] (Unimplemented) List quality monitors. Use Data Quality Monitoring API instead. + */ public Iterable listQualityMonitor(ListQualityMonitorRequest request) { return new Paginator<>( request, @@ -64,7 +73,10 @@ public Iterable listQualityMonitor(ListQualityMonitorRequest req }); } - /** (Unimplemented) Update a quality monitor on UC object */ + /** + * [DEPRECATED] (Unimplemented) Update a quality monitor on UC object. Use Data Quality Monitoring + * API instead. + */ public QualityMonitor updateQualityMonitor(UpdateQualityMonitorRequest request) { return impl.updateQualityMonitor(request); } diff --git a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/qualitymonitorv2/QualityMonitorV2Service.java b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/qualitymonitorv2/QualityMonitorV2Service.java old mode 100755 new mode 100644 index aae677aa9..b0d721f3f --- a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/qualitymonitorv2/QualityMonitorV2Service.java +++ b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/qualitymonitorv2/QualityMonitorV2Service.java @@ -4,7 +4,8 @@ import com.databricks.sdk.support.Generated; /** - * Manage data quality of UC objects (currently support `schema`) + * [DEPRECATED] This API is deprecated. Please use the Data Quality Monitoring API instead (REST: + * /api/data-quality/v1/monitors). Manage data quality of UC objects (currently support `schema`). * *

This is the high-level interface, that contains generated methods. * @@ -12,19 +13,28 @@ */ @Generated public interface QualityMonitorV2Service { - /** Create a quality monitor on UC object */ + /** + * [DEPRECATED] Create a quality monitor on UC object. Use Data Quality Monitoring API instead. + */ QualityMonitor createQualityMonitor(CreateQualityMonitorRequest createQualityMonitorRequest); - /** Delete a quality monitor on UC object */ + /** + * [DEPRECATED] Delete a quality monitor on UC object. Use Data Quality Monitoring API instead. + */ void deleteQualityMonitor(DeleteQualityMonitorRequest deleteQualityMonitorRequest); - /** Read a quality monitor on UC object */ + /** [DEPRECATED] Read a quality monitor on UC object. Use Data Quality Monitoring API instead. */ QualityMonitor getQualityMonitor(GetQualityMonitorRequest getQualityMonitorRequest); - /** (Unimplemented) List quality monitors */ + /** + * [DEPRECATED] (Unimplemented) List quality monitors. Use Data Quality Monitoring API instead. + */ ListQualityMonitorResponse listQualityMonitor( ListQualityMonitorRequest listQualityMonitorRequest); - /** (Unimplemented) Update a quality monitor on UC object */ + /** + * [DEPRECATED] (Unimplemented) Update a quality monitor on UC object. Use Data Quality Monitoring + * API instead. + */ QualityMonitor updateQualityMonitor(UpdateQualityMonitorRequest updateQualityMonitorRequest); } diff --git a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/settings/CreatePrivateEndpointRule.java b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/settings/CreatePrivateEndpointRule.java old mode 100755 new mode 100644 index 51630a687..fb1e1a5bd --- a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/settings/CreatePrivateEndpointRule.java +++ b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/settings/CreatePrivateEndpointRule.java @@ -30,6 +30,10 @@ public class CreatePrivateEndpointRule { @JsonProperty("endpoint_service") private String endpointService; + /** */ + @JsonProperty("error_message") + private String errorMessage; + /** * Not used by customer-managed private endpoint services. * @@ -72,6 +76,15 @@ public String getEndpointService() { return endpointService; } + public CreatePrivateEndpointRule setErrorMessage(String errorMessage) { + this.errorMessage = errorMessage; + return this; + } + + public String getErrorMessage() { + return errorMessage; + } + public CreatePrivateEndpointRule setGroupId(String groupId) { this.groupId = groupId; return this; @@ -106,6 +119,7 @@ public boolean equals(Object o) { CreatePrivateEndpointRule that = (CreatePrivateEndpointRule) o; return Objects.equals(domainNames, that.domainNames) && Objects.equals(endpointService, that.endpointService) + && Objects.equals(errorMessage, that.errorMessage) && Objects.equals(groupId, that.groupId) && Objects.equals(resourceId, that.resourceId) && Objects.equals(resourceNames, that.resourceNames); @@ -113,7 +127,8 @@ public boolean equals(Object o) { @Override public int hashCode() { - return Objects.hash(domainNames, endpointService, groupId, resourceId, resourceNames); + return Objects.hash( + domainNames, endpointService, errorMessage, groupId, resourceId, resourceNames); } @Override @@ -121,6 +136,7 @@ public String toString() { return new ToStringer(CreatePrivateEndpointRule.class) .add("domainNames", domainNames) .add("endpointService", endpointService) + .add("errorMessage", errorMessage) .add("groupId", groupId) .add("resourceId", resourceId) .add("resourceNames", resourceNames) diff --git a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/settings/NccPrivateEndpointRule.java b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/settings/NccPrivateEndpointRule.java index a65581fc1..d4e51fc01 100644 --- a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/settings/NccPrivateEndpointRule.java +++ b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/settings/NccPrivateEndpointRule.java @@ -75,6 +75,10 @@ public class NccPrivateEndpointRule { @JsonProperty("endpoint_service") private String endpointService; + /** */ + @JsonProperty("error_message") + private String errorMessage; + /** * Not used by customer-managed private endpoint services. * @@ -203,6 +207,15 @@ public String getEndpointService() { return endpointService; } + public NccPrivateEndpointRule setErrorMessage(String errorMessage) { + this.errorMessage = errorMessage; + return this; + } + + public String getErrorMessage() { + return errorMessage; + } + public NccPrivateEndpointRule setGroupId(String groupId) { this.groupId = groupId; return this; @@ -280,6 +293,7 @@ public boolean equals(Object o) { && Objects.equals(enabled, that.enabled) && Objects.equals(endpointName, that.endpointName) && Objects.equals(endpointService, that.endpointService) + && Objects.equals(errorMessage, that.errorMessage) && Objects.equals(groupId, that.groupId) && Objects.equals(networkConnectivityConfigId, that.networkConnectivityConfigId) && Objects.equals(resourceId, that.resourceId) @@ -301,6 +315,7 @@ public int hashCode() { enabled, endpointName, endpointService, + errorMessage, groupId, networkConnectivityConfigId, resourceId, @@ -322,6 +337,7 @@ public String toString() { .add("enabled", enabled) .add("endpointName", endpointName) .add("endpointService", endpointService) + .add("errorMessage", errorMessage) .add("groupId", groupId) .add("networkConnectivityConfigId", networkConnectivityConfigId) .add("resourceId", resourceId) diff --git a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/settings/UpdatePrivateEndpointRule.java b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/settings/UpdatePrivateEndpointRule.java old mode 100755 new mode 100644 index 94975cd2e..1936954b2 --- a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/settings/UpdatePrivateEndpointRule.java +++ b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/settings/UpdatePrivateEndpointRule.java @@ -32,6 +32,10 @@ public class UpdatePrivateEndpointRule { @JsonProperty("enabled") private Boolean enabled; + /** */ + @JsonProperty("error_message") + private String errorMessage; + /** * Only used by private endpoints towards AWS S3 service. * @@ -61,6 +65,15 @@ public Boolean getEnabled() { return enabled; } + public UpdatePrivateEndpointRule setErrorMessage(String errorMessage) { + this.errorMessage = errorMessage; + return this; + } + + public String getErrorMessage() { + return errorMessage; + } + public UpdatePrivateEndpointRule setResourceNames(Collection resourceNames) { this.resourceNames = resourceNames; return this; @@ -77,12 +90,13 @@ public boolean equals(Object o) { UpdatePrivateEndpointRule that = (UpdatePrivateEndpointRule) o; return Objects.equals(domainNames, that.domainNames) && Objects.equals(enabled, that.enabled) + && Objects.equals(errorMessage, that.errorMessage) && Objects.equals(resourceNames, that.resourceNames); } @Override public int hashCode() { - return Objects.hash(domainNames, enabled, resourceNames); + return Objects.hash(domainNames, enabled, errorMessage, resourceNames); } @Override @@ -90,6 +104,7 @@ public String toString() { return new ToStringer(UpdatePrivateEndpointRule.class) .add("domainNames", domainNames) .add("enabled", enabled) + .add("errorMessage", errorMessage) .add("resourceNames", resourceNames) .toString(); } diff --git a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/sql/TerminationReasonCode.java b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/sql/TerminationReasonCode.java index 2d8dd713b..b9d931467 100644 --- a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/sql/TerminationReasonCode.java +++ b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/sql/TerminationReasonCode.java @@ -153,6 +153,7 @@ public enum TerminationReasonCode { NPIP_TUNNEL_TOKEN_FAILURE, POD_ASSIGNMENT_FAILURE, POD_SCHEDULING_FAILURE, + RATE_LIMITED, REQUEST_REJECTED, REQUEST_THROTTLED, RESOURCE_USAGE_BLOCKED, diff --git a/databricks-sdk-java/src/test/java/com/databricks/sdk/service/lrotesting/DatabricksServiceExceptionWithDetailsProto.java b/databricks-sdk-java/src/test/java/com/databricks/sdk/service/lrotesting/DatabricksServiceExceptionWithDetailsProto.java old mode 100755 new mode 100644 index 011067330..09ced1ed1 --- a/databricks-sdk-java/src/test/java/com/databricks/sdk/service/lrotesting/DatabricksServiceExceptionWithDetailsProto.java +++ b/databricks-sdk-java/src/test/java/com/databricks/sdk/service/lrotesting/DatabricksServiceExceptionWithDetailsProto.java @@ -11,9 +11,7 @@ /** Databricks Error that is returned by all Databricks APIs. */ @Generated public class DatabricksServiceExceptionWithDetailsProto { - /** - * @pbjson-skip - */ + /** */ @JsonProperty("details") private Collection details;