From 72bd702fc93af1f51afdd88088726ff902b49aca Mon Sep 17 00:00:00 2001 From: "databricks-ci-ghec-1[bot]" <184311507+databricks-ci-ghec-1[bot]@users.noreply.github.com> Date: Mon, 23 Nov 2026 03:21:42 +0000 Subject: [PATCH] Release databricks-sdk-java --- .codegen/_last_sha | 2 +- CHANGELOG.md | 17 + databricks-sdk-java/lockfile.json | 2 +- databricks-sdk-java/pom.xml | 2 +- .../databricks/sdk/core/DatabricksConfig.java | 29 + .../com/databricks/sdk/core/UserAgent.java | 2 +- .../sdk/mixin/FilesExtEndpoint.java | 70 + .../sdk/mixin/FilesExtEndpoints.java | 497 +++++++ .../sdk/service/agentkit/AgentKitAPI.java | 5 +- .../sdk/service/agentkit/AgentKitService.java | 5 +- .../aifunctions/AiClassifyRequest.java | 2 +- .../service/aifunctions/AiDecideOptions.java | 3 +- .../service/aifunctions/AiFunctionsAPI.java | 5 +- .../aifunctions/AiFunctionsService.java | 5 +- .../sdk/service/aifunctions/Batch.java | 18 +- .../aifunctions/CancelBatchRequest.java | 2 +- .../service/aifunctions/GetBatchRequest.java | 2 +- .../aisearch/EndpointScalingInfoPhase.java | 1 + .../sdk/service/apps/AppDeployment.java | 33 +- .../sdk/service/apps/AppDeploymentStatus.java | 5 +- .../databricks/sdk/service/apps/AppsAPI.java | 12 +- .../sdk/service/apps/AppsService.java | 12 +- .../apps/ListAppDeploymentsRequest.java | 4 +- .../apps/ListAppDeploymentsResponse.java | 4 +- .../databricks/sdk/service/apps/Space.java | 23 +- .../sdk/service/apps/UpdateSpaceRequest.java | 14 +- .../catalog/AccessRequestDestinations.java | 32 +- .../sdk/service/catalog/ConnectionType.java | 1 + .../service/catalog/CreateSkillRequest.java | 5 +- .../service/catalog/CreateTableRequest.java | 7 +- .../catalog/DeleteModelVersionRequest.java | 5 +- .../sdk/service/catalog/Dependency.java | 8 +- .../GetCatalogWorkspaceBindingsResponse.java | 2 +- .../sdk/service/catalog/GetGrantRequest.java | 10 +- .../catalog/GetModelVersionRequest.java | 5 +- .../service/catalog/ListSecretsRequest.java | 4 +- .../sdk/service/catalog/ModelVersionInfo.java | 9 +- .../service/catalog/PermissionsChange.java | 5 +- .../service/catalog/PrivilegeAssignment.java | 5 +- .../sdk/service/catalog/RfaAPI.java | 6 + .../sdk/service/catalog/RfaService.java | 6 + .../sdk/service/catalog/Secret.java | 11 +- .../sdk/service/catalog/SecretsUcAPI.java | 40 +- .../sdk/service/catalog/SecretsUcService.java | 40 +- .../databricks/sdk/service/catalog/Skill.java | 21 +- .../sdk/service/catalog/TableInfo.java | 7 +- ...pdateCatalogWorkspaceBindingsResponse.java | 2 +- .../catalog/UpdateModelVersionRequest.java | 9 +- .../service/catalog/UpdatePermissions.java | 14 +- .../service/catalog/UpdateSkillRequest.java | 8 +- .../catalog/UpdateWorkspaceBindings.java | 4 +- .../sdk/service/catalog/UrlConfiguration.java | 99 ++ .../sdk/service/catalog/WorkspaceBinding.java | 11 +- .../compute/CreateComputePolicyRequest.java | 44 + .../compute/DeleteComputePolicyRequest.java | 43 + .../compute/GetComputePolicyRequest.java | 43 + .../sdk/service/compute/NodeType.java | 4 +- .../compute/ServerlessComputeServiceAPI.java | 35 + .../compute/ServerlessComputeServiceImpl.java | 70 + .../ServerlessComputeServiceService.java | 19 + .../compute/UpdateComputePolicyRequest.java | 87 ++ .../DataClassificationAPI.java | 14 + .../DataClassificationImpl.java | 18 + .../DataClassificationService.java | 12 + .../RescanCatalogRequest.java | 42 + .../RescanCatalogResponse.java | 29 + .../DefaultWorkspaceBaseEnvironment.java | 3 +- .../genieagents/UpdateGenieAgentRequest.java | 6 +- .../sdk/service/iamv2/AccountIamV2API.java | 81 +- .../service/iamv2/AccountIamV2Service.java | 81 +- .../sdk/service/iamv2/DirectGroupMember.java | 9 +- .../service/iamv2/TransitiveParentGroup.java | 8 +- .../sdk/service/iamv2/WorkspaceIamV2API.java | 84 +- .../service/iamv2/WorkspaceIamV2Service.java | 84 +- .../jobs/AiRuntimeTaskPriorityClass.java | 1 + .../sdk/service/jobs/PythonOperatorTask.java | 2 +- .../lakewatch/CloudWatchLogsEnvelope.java | 3 +- .../sdk/service/lakewatch/Rule.java | 24 +- .../service/lakewatch/RuleInputStreaming.java | 62 + .../service/lakewatch/StreamingPredicate.java | 46 + .../service/lakewatch/StreamingSource.java | 43 + .../sdk/service/ml/EntityBinding.java | 56 + .../databricks/sdk/service/ml/Function.java | 40 +- .../sdk/service/ml/InputReference.java | 46 + .../com/databricks/sdk/service/ml/Issue.java | 3 +- .../com/databricks/sdk/service/ml/Lookup.java | 72 + .../sdk/service/ml/SecondaryKeys.java | 86 ++ .../sdk/service/pipelines/SchemaSpec.java | 2 +- .../sdk/service/pipelines/Transformer.java | 7 +- .../sdk/service/postgres/ProjectStatus.java | 16 + .../sdk/service/sandbox/NetworkSpec.java | 46 + .../sdk/service/sandbox/SandboxSpec.java | 20 +- .../settings/CreateOboTokenRequest.java | 5 +- .../service/settings/CreateTokenRequest.java | 3 +- .../sdk/service/sharing/CreateShare.java | 6 +- .../sdk/service/sharing/GetShareRequest.java | 5 +- .../sdk/service/sharing/Partition.java | 5 +- .../sdk/service/sharing/PartitionValue.java | 5 +- .../service/sharing/PermissionsChange.java | 5 +- .../service/sharing/PrivilegeAssignment.java | 5 +- .../sdk/service/sharing/ShareInfo.java | 16 +- .../sdk/service/sharing/SharedDataObject.java | 32 +- .../sharing/SharedDataObjectUpdate.java | 11 +- .../sdk/service/sharing/UpdateShare.java | 11 +- .../com/databricks/sdk/service/sql/Alert.java | 54 +- .../sdk/service/sql/AlertCondition.java | 18 +- .../service/sql/AlertConditionOperand.java | 2 +- .../service/sql/AlertConditionThreshold.java | 2 +- .../sdk/service/sql/AlertOperandColumn.java | 2 +- .../sdk/service/sql/AlertOperandValue.java | 6 +- .../databricks/sdk/service/sql/AlertsAPI.java | 6 +- .../sdk/service/sql/AlertsService.java | 6 +- .../sdk/service/sql/CreateAlertRequest.java | 2 +- .../service/sql/CreateAlertRequestAlert.java | 47 +- .../sdk/service/sql/GetAlertRequest.java | 2 +- .../sdk/service/sql/ListAlertsRequest.java | 4 +- .../sdk/service/sql/ListAlertsResponse.java | 4 +- .../service/sql/ListAlertsResponseAlert.java | 49 +- .../sdk/service/sql/TrashAlertRequest.java | 2 +- .../sdk/service/sql/UpdateAlertRequest.java | 17 +- .../service/sql/UpdateAlertRequestAlert.java | 42 +- .../supervisoragents/SupervisorAgent.java | 43 +- .../supervisoragents/SupervisorAgentsAPI.java | 16 +- .../SupervisorAgentsService.java | 16 +- .../UpdateSupervisorAgentRequest.java | 16 +- .../EndpointScalingInfoScalingPhase.java | 1 + .../sdk/service/workspace/ReposAPI.java | 7 +- .../sdk/service/workspace/ReposService.java | 7 +- .../sdk/core/DatabricksConfigTest.java | 126 ++ .../sdk/mixin/FilesExtEndpointsTest.java | 1215 +++++++++++++++++ examples/docs/pom.xml | 2 +- examples/spring-boot-oauth-u2m-demo/pom.xml | 2 +- lockfile.json | 2 +- pom.xml | 2 +- shaded/pom.xml | 2 +- 135 files changed, 4043 insertions(+), 331 deletions(-) create mode 100644 databricks-sdk-java/src/main/java/com/databricks/sdk/mixin/FilesExtEndpoint.java create mode 100644 databricks-sdk-java/src/main/java/com/databricks/sdk/mixin/FilesExtEndpoints.java create mode 100644 databricks-sdk-java/src/main/java/com/databricks/sdk/service/catalog/UrlConfiguration.java create mode 100644 databricks-sdk-java/src/main/java/com/databricks/sdk/service/compute/CreateComputePolicyRequest.java create mode 100644 databricks-sdk-java/src/main/java/com/databricks/sdk/service/compute/DeleteComputePolicyRequest.java create mode 100644 databricks-sdk-java/src/main/java/com/databricks/sdk/service/compute/GetComputePolicyRequest.java create mode 100644 databricks-sdk-java/src/main/java/com/databricks/sdk/service/compute/UpdateComputePolicyRequest.java create mode 100644 databricks-sdk-java/src/main/java/com/databricks/sdk/service/dataclassification/RescanCatalogRequest.java create mode 100644 databricks-sdk-java/src/main/java/com/databricks/sdk/service/dataclassification/RescanCatalogResponse.java create mode 100644 databricks-sdk-java/src/main/java/com/databricks/sdk/service/lakewatch/RuleInputStreaming.java create mode 100644 databricks-sdk-java/src/main/java/com/databricks/sdk/service/lakewatch/StreamingPredicate.java create mode 100644 databricks-sdk-java/src/main/java/com/databricks/sdk/service/lakewatch/StreamingSource.java create mode 100644 databricks-sdk-java/src/main/java/com/databricks/sdk/service/ml/EntityBinding.java create mode 100644 databricks-sdk-java/src/main/java/com/databricks/sdk/service/ml/InputReference.java create mode 100644 databricks-sdk-java/src/main/java/com/databricks/sdk/service/ml/Lookup.java create mode 100644 databricks-sdk-java/src/main/java/com/databricks/sdk/service/ml/SecondaryKeys.java create mode 100644 databricks-sdk-java/src/main/java/com/databricks/sdk/service/sandbox/NetworkSpec.java create mode 100644 databricks-sdk-java/src/test/java/com/databricks/sdk/mixin/FilesExtEndpointsTest.java diff --git a/.codegen/_last_sha b/.codegen/_last_sha index a9645feac..323564dc8 100644 --- a/.codegen/_last_sha +++ b/.codegen/_last_sha @@ -1 +1 @@ -874d8f1733df5029f169c35ed088d2f081eb6687 \ No newline at end of file +64023bb8acefdd6c8861e4ebb9238af23f134471 \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 2872f3eb3..a3e7797bc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,22 @@ # Version changelog +## Release v0.185.0 (2026-11-23) + +### API Changes +* Add `createComputePolicy()`, `deleteComputePolicy()`, `getComputePolicy()` and `updateComputePolicy()` methods for `workspaceClient.serverlessComputeService()` service. +* Add `rescanCatalog()` method for `workspaceClient.dataClassification()` service. +* Add `urlConfiguration` field for `com.databricks.sdk.service.catalog.AccessRequestDestinations`. +* Add `streaming` field for `com.databricks.sdk.service.lakewatch.Rule`. +* Add `lookup` and `secondaryKeys` fields for `com.databricks.sdk.service.ml.Function`. +* Add `computePolicyId` field for `com.databricks.sdk.service.postgres.ProjectStatus`. +* Add `network` field for `com.databricks.sdk.service.sandbox.SandboxSpec`. +* Add `FINALIZING` enum value for `com.databricks.sdk.service.aisearch.EndpointScalingInfoPhase`. +* Add `GOOGLE_ADS` enum value for `com.databricks.sdk.service.catalog.ConnectionType`. +* Add `PREEMPTABLE` enum value for `com.databricks.sdk.service.jobs.AiRuntimeTaskPriorityClass`. +* Add `FINALIZING` enum value for `com.databricks.sdk.service.vectorsearch.EndpointScalingInfoScalingPhase`. +* [Breaking] Change `schedule` field for `com.databricks.sdk.service.lakewatch.Rule` to no longer be required. +* Change `schedule` field for `com.databricks.sdk.service.lakewatch.Rule` to no longer be required. + ## Release v0.184.0 (2026-11-19) ### API Changes diff --git a/databricks-sdk-java/lockfile.json b/databricks-sdk-java/lockfile.json index 8c4cb75dc..1b396ead5 100644 --- a/databricks-sdk-java/lockfile.json +++ b/databricks-sdk-java/lockfile.json @@ -1,7 +1,7 @@ { "artifactId": "databricks-sdk-java", "groupId": "com.databricks", - "version": "0.184.0", + "version": "0.185.0", "lockFileVersion": 1, "dependencies": [ { diff --git a/databricks-sdk-java/pom.xml b/databricks-sdk-java/pom.xml index 2eb72b272..47ca3d3a3 100644 --- a/databricks-sdk-java/pom.xml +++ b/databricks-sdk-java/pom.xml @@ -5,7 +5,7 @@ com.databricks databricks-sdk-parent - 0.184.0 + 0.185.0 databricks-sdk-java Databricks SDK for Java diff --git a/databricks-sdk-java/src/main/java/com/databricks/sdk/core/DatabricksConfig.java b/databricks-sdk-java/src/main/java/com/databricks/sdk/core/DatabricksConfig.java index 7a50eed72..f176c548b 100644 --- a/databricks-sdk-java/src/main/java/com/databricks/sdk/core/DatabricksConfig.java +++ b/databricks-sdk-java/src/main/java/com/databricks/sdk/core/DatabricksConfig.java @@ -13,6 +13,7 @@ import com.databricks.sdk.core.oauth.TokenSource; import com.databricks.sdk.core.utils.Cloud; import com.databricks.sdk.core.utils.Environment; +import com.databricks.sdk.support.InternalApi; import com.fasterxml.jackson.databind.ObjectMapper; import java.io.File; import java.io.IOException; @@ -204,6 +205,22 @@ public class DatabricksConfig { @ConfigAttribute(env = "DATABRICKS_DISABLE_OAUTH_REFRESH_TOKEN") private Boolean disableOauthRefreshToken; + /** + * Turns off the Files transfer extension (FilesExt), from the environment or a profile only. It + * is not a public option, which is why it has no setter. + */ + @ConfigAttribute(env = "DATABRICKS_DISABLE_EXPERIMENTAL_FILES_API_CLIENT") + private Boolean disableExperimentalFilesApiClient; + + /** + * Turns on endpoint discovery for the Files transfer extension: asking the workspace which + * endpoints to transfer through. From the environment or a profile only. It defaults off, while + * the Python SDK defaults it on. It is not a public option, which is why it has no setter. The + * extension's off switch wins over it. + */ + @ConfigAttribute(env = "DATABRICKS_EXPERIMENTAL_FILES_EXT_ENABLE_ENDPOINTS_API") + private Boolean experimentalFilesExtEnableEndpointsApi; + public Environment getEnv() { return env; } @@ -713,6 +730,18 @@ public boolean getDisableOauthRefreshToken() { return disableOauthRefreshToken != null && disableOauthRefreshToken; } + /** Whether the Files transfer extension is turned off; see the field. */ + @InternalApi + public boolean getDisableExperimentalFilesApiClient() { + return disableExperimentalFilesApiClient != null && disableExperimentalFilesApiClient; + } + + /** Whether the Files transfer extension asks the workspace for its endpoints; see the field. */ + @InternalApi + public boolean getExperimentalFilesExtEnableEndpointsApi() { + return experimentalFilesExtEnableEndpointsApi != null && experimentalFilesExtEnableEndpointsApi; + } + public DatabricksConfig setDisableOauthRefreshToken(boolean disable) { this.disableOauthRefreshToken = disable; return this; diff --git a/databricks-sdk-java/src/main/java/com/databricks/sdk/core/UserAgent.java b/databricks-sdk-java/src/main/java/com/databricks/sdk/core/UserAgent.java index 4bf7a3a06..bd26c25fa 100644 --- a/databricks-sdk-java/src/main/java/com/databricks/sdk/core/UserAgent.java +++ b/databricks-sdk-java/src/main/java/com/databricks/sdk/core/UserAgent.java @@ -36,7 +36,7 @@ public String getValue() { // TODO: check if reading from // /META-INF/maven/com.databricks/databrics-sdk-java/pom.properties // or getClass().getPackage().getImplementationVersion() is enough. - private static final String version = "0.184.0"; + private static final String version = "0.185.0"; public static void withProduct(String product, String productVersion) { UserAgent.product = product; diff --git a/databricks-sdk-java/src/main/java/com/databricks/sdk/mixin/FilesExtEndpoint.java b/databricks-sdk-java/src/main/java/com/databricks/sdk/mixin/FilesExtEndpoint.java new file mode 100644 index 000000000..f61083bf5 --- /dev/null +++ b/databricks-sdk-java/src/main/java/com/databricks/sdk/mixin/FilesExtEndpoint.java @@ -0,0 +1,70 @@ +package com.databricks.sdk.mixin; + +import java.util.Objects; + +/** One entry of the ordered endpoint list a file transfer walks, best first. */ +final class FilesExtEndpoint { + + /** + * A file transfer protocol this SDK can speak, identified by the {@code (api, api_version)} pair + * the endpoints API returns. + */ + enum Kind { + IO_OFFLOAD, + FILES_API_V2, + FILES_API_V3 + } + + private final Kind kind; + private final String baseUrl; + private final boolean multipartUploadSupported; + + FilesExtEndpoint(Kind kind, String baseUrl, boolean multipartUploadSupported) { + this.kind = Objects.requireNonNull(kind, "kind"); + this.baseUrl = Objects.requireNonNull(baseUrl, "baseUrl"); + this.multipartUploadSupported = multipartUploadSupported; + } + + Kind kind() { + return kind; + } + + /** Scheme and hostname as returned by the server, e.g. https://example.cloud.databricks.com. */ + String baseUrl() { + return baseUrl; + } + + boolean multipartUploadSupported() { + return multipartUploadSupported; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (!(o instanceof FilesExtEndpoint)) { + return false; + } + FilesExtEndpoint that = (FilesExtEndpoint) o; + return kind == that.kind + && baseUrl.equals(that.baseUrl) + && multipartUploadSupported == that.multipartUploadSupported; + } + + @Override + public int hashCode() { + return Objects.hash(kind, baseUrl, multipartUploadSupported); + } + + @Override + public String toString() { + return "FilesExtEndpoint{" + + kind + + ", " + + baseUrl + + ", multipartUploadSupported=" + + multipartUploadSupported + + "}"; + } +} diff --git a/databricks-sdk-java/src/main/java/com/databricks/sdk/mixin/FilesExtEndpoints.java b/databricks-sdk-java/src/main/java/com/databricks/sdk/mixin/FilesExtEndpoints.java new file mode 100644 index 000000000..e7e9fd49a --- /dev/null +++ b/databricks-sdk-java/src/main/java/com/databricks/sdk/mixin/FilesExtEndpoints.java @@ -0,0 +1,497 @@ +package com.databricks.sdk.mixin; + +import com.databricks.sdk.core.DatabricksConfig; +import com.databricks.sdk.core.UserAgent; +import com.databricks.sdk.core.http.HttpClient; +import com.databricks.sdk.core.http.Request; +import com.databricks.sdk.core.http.Response; +import com.databricks.sdk.core.logging.Logger; +import com.databricks.sdk.core.logging.LoggerFactory; +import com.databricks.sdk.core.utils.ClockSupplier; +import com.databricks.sdk.core.utils.UtcClockSupplier; +import com.databricks.sdk.mixin.FilesExtEndpoint.Kind; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.ObjectMapper; +import java.io.InputStream; +import java.net.URI; +import java.net.URISyntaxException; +import java.time.Duration; +import java.time.Instant; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collections; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Locale; +import java.util.Map; +import java.util.Set; +import java.util.concurrent.ExecutionException; +import java.util.concurrent.FutureTask; +import java.util.concurrent.TimeUnit; +import java.util.concurrent.TimeoutException; +import java.util.concurrent.locks.ReentrantLock; + +/** + * The ordered endpoints a file transfer walks, as the workspace's endpoints API returns them. + * + *

The server's answer, including a failure, is kept until its TTL passes; anything short of a + * usable list gives the built-in order, so discovery never fails a transfer. + * + *

The request goes through the configured {@link HttpClient}, which keeps the user's proxy, TLS + * and test clients. Because that client's pool may be held by transfers, the request runs on a + * daemon thread that the caller waits for at most {@link #RESOLVE_TIMEOUT}. A timeout counts as a + * transient failure. + */ +final class FilesExtEndpoints { + private static final Logger LOG = LoggerFactory.getLogger(FilesExtEndpoints.class); + private static final ObjectMapper MAPPER = new ObjectMapper(); + + static final String ENDPOINTS_API_PATH = "/api/2.0/fs/endpoints"; + + /** The name of the daemon thread each refresh asks the server on. */ + static final String DISCOVERY_THREAD_NAME = "databricks-files-ext-discovery"; + + /** + * How long a caller waits for the server's answer, including any wait for a connection. Discovery + * precedes a transfer, so it is one attempt that fails fast to the built-in order. + */ + static final Duration RESOLVE_TIMEOUT = Duration.ofSeconds(10); + + /** How long a usable list is kept before asking again, so that server changes reach clients. */ + static final Duration CACHE_TTL = Duration.ofMinutes(30); + + /** How long a failed answer is kept before asking again. */ + static final Duration FAILURE_CACHE_TTL = Duration.ofMinutes(30); + + /** + * How long after the server's last answer a list is kept through refreshes that fail transiently. + * Past it, discovery that keeps failing moves the client to the built-in order. + */ + static final Duration MAX_STALE = Duration.ofHours(2); + + /** Statuses that may succeed on a later ask; any other non-200 answer is definitive. */ + private static final Set RETRYABLE_STATUS_CODES = + new HashSet<>(Arrays.asList(408, 429, 502, 503, 504)); + + /** + * The protocols this SDK speaks, by the server's {@code api} and {@code api_version}. Other pairs + * are skipped, so the server can list newer protocols without breaking this SDK. IO_OFFLOAD is + * unversioned during the preview, so a versioned IO_OFFLOAD is newer than this SDK. + */ + private static final Map RECOGNIZED_ENDPOINTS = new HashMap<>(); + + static { + RECOGNIZED_ENDPOINTS.put(recognizedKey("IO_OFFLOAD", null), Kind.IO_OFFLOAD); + RECOGNIZED_ENDPOINTS.put(recognizedKey("FILES_API", "2.0"), Kind.FILES_API_V2); + RECOGNIZED_ENDPOINTS.put(recognizedKey("FILES_API", "3.0"), Kind.FILES_API_V3); + } + + private final DatabricksConfig config; + private final boolean enabled; + private final ClockSupplier clock; + private final Duration resolveTimeout; + + /** Guards {@link #cached}; held only to read or replace it. */ + private final Object cacheLock = new Object(); + + private Cached cached; + + /** Held by the one caller that asks the server, so that concurrent transfers do not each ask. */ + private final ReentrantLock refreshLock = new ReentrantLock(); + + /** The thread of the last request to the server; guarded by {@link #refreshLock}. */ + private Thread worker; + + FilesExtEndpoints(DatabricksConfig config, boolean enabled) { + this(config, enabled, new UtcClockSupplier(), RESOLVE_TIMEOUT); + } + + FilesExtEndpoints( + DatabricksConfig config, boolean enabled, ClockSupplier clock, Duration resolveTimeout) { + this.config = config; + this.enabled = enabled; + this.clock = clock; + this.resolveTimeout = resolveTimeout; + } + + /** Returns the endpoints to try for a transfer, best first. The caller may modify the list. */ + List resolve() { + if (!enabled) { + return defaultEndpoints(); + } + Cached current = cached(); + if (current != null && !current.isExpired(now())) { + return new ArrayList<>(current.endpoints); + } + if (current == null) { + // Nothing to serve yet: wait for whichever caller is asking. + refreshLock.lock(); + } else if (!refreshLock.tryLock()) { + // Another caller is asking: keep transferring on the expired list rather than wait for it, + // unless the list is past the stale limit, which must hold however long that caller takes. + if (isPastStaleLimit(current, now())) { + return defaultEndpoints(); + } + return new ArrayList<>(current.endpoints); + } + try { + current = cached(); + if (current != null && !current.isExpired(now())) { + // Refreshed by another caller while this one waited. + return new ArrayList<>(current.endpoints); + } + List fetched; + try { + fetched = fetchWithTimeout(); + } catch (InterruptedException e) { + // The caller gave up, which says nothing about the server: leave the cache for the next + // caller to refresh, and serve this one as a caller that did not ask would be served. + Thread.currentThread().interrupt(); + if (current != null && !isPastStaleLimit(current, now())) { + return new ArrayList<>(current.endpoints); + } + return defaultEndpoints(); + } + Instant now = now(); + Cached next; + if (fetched == null + && current != null + && current.fromServer + && !isPastStaleLimit(current, now)) { + // A blip in discovery must not move a working client off the server's endpoints. A + // definitive answer, such as discovery being turned off, still does, and so does a failure + // that outlasts the stale limit. + Instant staleLimit = current.fetchedAt.plus(MAX_STALE); + Instant failureExpiry = now.plus(FAILURE_CACHE_TTL); + next = + new Cached( + current.endpoints, + failureExpiry.isBefore(staleLimit) ? failureExpiry : staleLimit, + true, + current.fetchedAt); + } else if (fetched != null && !fetched.isEmpty()) { + next = new Cached(fetched, now.plus(CACHE_TTL), true, now); + } else { + next = new Cached(defaultEndpoints(), now.plus(FAILURE_CACHE_TTL), false, now); + } + synchronized (cacheLock) { + cached = next; + } + return new ArrayList<>(next.endpoints); + } finally { + refreshLock.unlock(); + } + } + + /** + * The built-in order: presigned URLs, then the Files API on the workspace host, which takes + * uploads only in a single shot. + */ + List defaultEndpoints() { + String host = workspaceHost(config); + List endpoints = new ArrayList<>(); + endpoints.add(new FilesExtEndpoint(Kind.IO_OFFLOAD, host, true)); + endpoints.add(new FilesExtEndpoint(Kind.FILES_API_V2, host, false)); + return endpoints; + } + + /** + * The workspace host. A credentials provider may set it only when it is first configured, which + * authenticating does, so it is read after that. A failure to authenticate is the caller's: the + * transfer could not reach the workspace either. + */ + static String workspaceHost(DatabricksConfig config) { + if (config.getHost() == null) { + config.authenticate(); + } + return config.getHost(); + } + + private Cached cached() { + synchronized (cacheLock) { + return cached; + } + } + + private Instant now() { + return clock.getClock().instant(); + } + + private static boolean isPastStaleLimit(Cached cached, Instant now) { + return cached.fromServer && !now.isBefore(cached.fetchedAt.plus(MAX_STALE)); + } + + /** + * Asks the server on a daemon thread and waits at most {@link #resolveTimeout}. Returns null if + * the failure may be transient, including a timeout, and an empty list if the answer leaves + * nothing to use. + * + * @throws InterruptedException if the caller is interrupted while it waits + */ + private List fetchWithTimeout() throws InterruptedException { + long deadline = System.nanoTime() + resolveTimeout.toNanos(); + if (worker != null) { + // A request that outlived its caller, in a client that ignores interrupts or after the + // caller was interrupted, still holds its connection: wait for it within the same bound, so + // that at most one request is in flight. + TimeUnit.NANOSECONDS.timedJoin(worker, resolveTimeout.toNanos()); + if (worker.isAlive()) { + LOG.warn( + "The last request for file endpoints is still running after {}s, using the default" + + " endpoints.", + resolveTimeout.getSeconds()); + return null; + } + } + FutureTask> task = new FutureTask<>(this::fetch); + Thread thread = new Thread(task, DISCOVERY_THREAD_NAME); + thread.setDaemon(true); + try { + thread.start(); + } catch (OutOfMemoryError | RuntimeException e) { + // No thread to ask on, as when the process has run out of them: a transient failure, so that + // discovery does not fail the transfer. + LOG.warn("Failed to start resolving file endpoints, using the default endpoints: {}", e); + return null; + } + worker = thread; + try { + return task.get(Math.max(0, deadline - System.nanoTime()), TimeUnit.NANOSECONDS); + } catch (TimeoutException e) { + // Interrupting frees a request waiting for a pooled connection. A user's HttpClient may not + // stop, and the next refresh waits for it. + task.cancel(true); + LOG.warn( + "Timed out after {}s resolving file endpoints, using the default endpoints.", + resolveTimeout.getSeconds()); + return null; + } catch (InterruptedException e) { + task.cancel(true); + throw e; + } catch (ExecutionException e) { + LOG.warn("Failed to resolve file endpoints, using the default endpoints: {}", e.getCause()); + return null; + } + } + + /** + * Fetches the endpoint list, keeping only entries this SDK can speak. Returns null if the failure + * may be transient (no response, a retryable status, or a body that does not parse), and an empty + * list if the server's answer leaves nothing to use. + */ + private List fetch() { + HttpClient httpClient = config.getHttpClient(); + Response response; + try { + // Authenticating first: it may set the host. + Map headers = config.authenticate(); + Request request = + new Request("GET", config.getHost() + ENDPOINTS_API_PATH) + .withHeaders(headers) + .withHeader("Accept", "application/json") + .withHeader("User-Agent", UserAgent.asString()); + // The workspace this config names, as every workspace call sends it, so that a host serving + // several workspaces answers for this one. + if (config.getWorkspaceId() != null) { + request.withHeader("X-Databricks-Workspace-Id", config.getWorkspaceId()); + } + // A redirect would carry the workspace's credentials to wherever it points: it is not + // followed, and the transfer uses the built-in order. + request.setRedirectionBehavior(false); + response = httpClient.execute(request); + } catch (Exception e) { + // Broad on purpose: network and auth failures must all fail safe to the default order. + LOG.warn("Failed to resolve file endpoints, using the default endpoints: {}", e); + return null; + } + + // Lets a failure below be traced to the server's request log. + String requestId = response.getFirstHeader("x-request-id"); + JsonNode body; + try (InputStream in = response.getBody()) { + int status = response.getStatusCode(); + if (status == 404) { + // Not a warning: until the server-side rollout completes, some workspaces do not serve it. + LOG.info( + "Endpoints API is not served for this workspace (request ID {}), using the default" + + " endpoints.", + requestId); + return Collections.emptyList(); + } + if (status != 200) { + LOG.warn( + "Unexpected status resolving file endpoints ({}, request ID {}), using the default" + + " endpoints.", + status, + requestId); + boolean transient_ = status >= 500 || RETRYABLE_STATUS_CODES.contains(status); + return transient_ ? null : Collections.emptyList(); + } + if (in == null) { + throw new IllegalStateException("empty response body"); + } + body = MAPPER.readTree(in); + if (body == null || body.isMissingNode()) { + throw new IllegalStateException("empty response body"); + } + } catch (Exception e) { + LOG.warn( + "Failed to parse endpoints response (request ID {}), using the default endpoints: {}", + requestId, + e); + return null; + } + + // Proto3 JSON leaves out an empty repeated field. + JsonNode entries = body.isObject() ? body.path("endpoints") : null; + if (entries != null && entries.isMissingNode()) { + entries = MAPPER.createArrayNode(); + } + if (entries == null || !entries.isArray()) { + LOG.warn( + "Unexpected endpoints response (request ID {}), using the default endpoints: {}", + requestId, + body); + return Collections.emptyList(); + } + List endpoints = new ArrayList<>(); + for (JsonNode entry : entries) { + Kind kind = endpointKind(entry); + if (kind == null) { + // Not a warning: an older SDK is expected to skip entries for APIs added after it shipped. + LOG.info("Skipping endpoint this SDK cannot use (request ID {}): {}", requestId, entry); + continue; + } + FilesExtEndpoint endpoint = parseEndpoint(entry, kind); + if (endpoint == null) { + LOG.warn( + "Skipping {} endpoint with an unusable address (request ID {}): {}", + kind, + requestId, + entry); + continue; + } + endpoints.add(endpoint); + } + if (endpoints.isEmpty()) { + LOG.warn( + "No usable endpoints in the response (request ID {}), using the default endpoints.", + requestId); + } + return endpoints; + } + + /** Returns the protocol of a listed endpoint, or null if this SDK does not speak it. */ + private static Kind endpointKind(JsonNode entry) { + if (!entry.isObject()) { + return null; + } + JsonNode api = entry.path("api"); + JsonNode apiVersion = entry.path("api_version"); + // IO_OFFLOAD entries have no api_version, so a missing or null version is allowed. + boolean versionAbsent = apiVersion.isMissingNode() || apiVersion.isNull(); + if (!api.isTextual() || !(versionAbsent || apiVersion.isTextual())) { + return null; + } + return RECOGNIZED_ENDPOINTS.get( + recognizedKey(api.textValue(), versionAbsent ? null : apiVersion.textValue())); + } + + private FilesExtEndpoint parseEndpoint(JsonNode entry, Kind kind) { + JsonNode schemeNode = entry.path("scheme"); + JsonNode hostnameNode = entry.path("hostname"); + if (!schemeNode.isTextual() || !hostnameNode.isTextual()) { + return null; + } + String scheme = schemeNode.textValue(); + String hostname = hostnameNode.textValue(); + if (!(scheme.equals("http") || scheme.equals("https")) || hostname.isEmpty()) { + return null; + } + // A Files API 3.0 host is reached over the internet with workspace credentials: it needs TLS. + if (kind == Kind.FILES_API_V3 && !scheme.equals("https")) { + return null; + } + String baseUrl = scheme + "://" + hostname; + // Only a bare host and port. Transfers route by the host parsed here, so it must be the host + // the request reaches, and an address that fails to parse mid-transfer must not get that far. + String host = bareHost(baseUrl, hostname); + if (host == null) { + return null; + } + // Plain HTTP carries workspace credentials in the clear. The workspace host may use it only if + // the SDK is configured to reach the workspace that way; another host only for Files API 2.0, + // i.e. the in-cluster storage proxy. + if (scheme.equals("http")) { + URI workspace = URI.create(workspaceHost(config)); + String workspaceHost = + workspace.getHost() == null ? "" : workspace.getHost().toLowerCase(Locale.ROOT); + if (host.equals(workspaceHost)) { + if (!"http".equalsIgnoreCase(workspace.getScheme())) { + return null; + } + } else if (kind != Kind.FILES_API_V2) { + return null; + } + } + // Mirrors the proto getter: an unset optional bool reads as false. + JsonNode multipart = entry.path("multipart_upload_supported"); + return new FilesExtEndpoint(kind, baseUrl, multipart.isBoolean() && multipart.booleanValue()); + } + + /** + * The lowercased host of {@code baseUrl}, or null unless {@code hostname} is exactly a host and + * an optional port: no user info, path, query or fragment, and a port in range. + */ + private static String bareHost(String baseUrl, String hostname) { + URI uri; + try { + uri = new URI(baseUrl).parseServerAuthority(); + } catch (URISyntaxException e) { + return null; + } + if (uri.getHost() == null + || uri.getRawUserInfo() != null + || !hostname.equals(uri.getRawAuthority()) + || !uri.getRawPath().isEmpty() + || uri.getRawQuery() != null + || uri.getRawFragment() != null + || uri.getPort() > 65535) { + return null; + } + return uri.getHost().toLowerCase(Locale.ROOT); + } + + /** A key that keeps an absent version apart from every version string, including "". */ + private static String recognizedKey(String api, String apiVersion) { + return apiVersion == null ? api : api + "\u0000" + apiVersion; + } + + /** The endpoint list a client resolved, and when to ask the server again. */ + private static final class Cached { + final List endpoints; + final Instant expiresAt; + + /** The endpoints are the server's list, not the built-in order. */ + final boolean fromServer; + + /** When the server gave the list. Meaningless unless {@link #fromServer}. */ + final Instant fetchedAt; + + Cached( + List endpoints, + Instant expiresAt, + boolean fromServer, + Instant fetchedAt) { + this.endpoints = Collections.unmodifiableList(new ArrayList<>(endpoints)); + this.expiresAt = expiresAt; + this.fromServer = fromServer; + this.fetchedAt = fetchedAt; + } + + boolean isExpired(Instant now) { + return !now.isBefore(expiresAt); + } + } +} diff --git a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/agentkit/AgentKitAPI.java b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/agentkit/AgentKitAPI.java index e3a26ea15..ac48f33fc 100644 --- a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/agentkit/AgentKitAPI.java +++ b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/agentkit/AgentKitAPI.java @@ -73,7 +73,10 @@ public void deleteMemory(String name) { /** * Deletes a memory entry by resource name. Returns `NOT_FOUND` when the entry does not exist in - * the caller's workspace. + * the caller's workspace. The entry stops appearing in Get, List and Search. In a store that + * records memory history, the versions written before the delete, including their content, stay + * readable through `ListMemoryChanges` and `GetMemoryChange` to anyone who can read the store, + * until the store itself is deleted. */ public void deleteMemory(DeleteManagedMemoryEntryRequest request) { impl.deleteMemory(request); diff --git a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/agentkit/AgentKitService.java b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/agentkit/AgentKitService.java index 388ddcf8a..819c3411d 100644 --- a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/agentkit/AgentKitService.java +++ b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/agentkit/AgentKitService.java @@ -45,7 +45,10 @@ ManagedMemoryStore createMemoryStore( /** * Deletes a memory entry by resource name. Returns `NOT_FOUND` when the entry does not exist in - * the caller's workspace. + * the caller's workspace. The entry stops appearing in Get, List and Search. In a store that + * records memory history, the versions written before the delete, including their content, stay + * readable through `ListMemoryChanges` and `GetMemoryChange` to anyone who can read the store, + * until the store itself is deleted. */ void deleteMemory(DeleteManagedMemoryEntryRequest deleteManagedMemoryEntryRequest); diff --git a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/aifunctions/AiClassifyRequest.java b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/aifunctions/AiClassifyRequest.java index b18181e84..7fb089ada 100644 --- a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/aifunctions/AiClassifyRequest.java +++ b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/aifunctions/AiClassifyRequest.java @@ -20,7 +20,7 @@ public class AiClassifyRequest { /** * The label set to classify as. Either a JSON array of label strings (e.g. ["spam", "not_spam"]), * or a JSON object mapping each label to a description (e.g. {"spam": "unsolicited bulk message", - * "not_spam": "a legitimate message"}). Accepts 2 to 500 labels, each 1 to 100 characters. When + * "not_spam": "a legitimate message"}). Accepts 2 to 5000 labels, each 1 to 100 characters. When * multilabel is true, a single label is also accepted. */ @JsonProperty("labels") diff --git a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/aifunctions/AiDecideOptions.java b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/aifunctions/AiDecideOptions.java index 84d9add93..3bef1da06 100644 --- a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/aifunctions/AiDecideOptions.java +++ b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/aifunctions/AiDecideOptions.java @@ -11,8 +11,7 @@ @Generated public class AiDecideOptions { /** - * The function API version to invoke. If unset, the version is inferred per row. Supported - * versions: ["1.0"]. + * The function API version to invoke. If unset, version 1.0 is used. Supported versions: ["1.0"]. */ @JsonProperty("version") private String version; diff --git a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/aifunctions/AiFunctionsAPI.java b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/aifunctions/AiFunctionsAPI.java index 26fbbf780..4ed77e83e 100644 --- a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/aifunctions/AiFunctionsAPI.java +++ b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/aifunctions/AiFunctionsAPI.java @@ -58,8 +58,9 @@ public AiParseDocumentResponse aiParseDocument(AiParseDocumentRequest request) { } /** - * Starts the asynchronous cancellation of a batch. Requests in progress are drained first. - * Cancellation is best effort, so the batch can still complete. + * Starts the asynchronous cancellation of a batch. Requests in progress are stopped, and the + * results of the requests that finished are kept. Cancellation is best effort, so the batch can + * still complete. */ public CancelBatchResponse cancelBatch(CancelBatchRequest request) { return impl.cancelBatch(request); diff --git a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/aifunctions/AiFunctionsService.java b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/aifunctions/AiFunctionsService.java index 97c5eba33..6ef22ea30 100644 --- a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/aifunctions/AiFunctionsService.java +++ b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/aifunctions/AiFunctionsService.java @@ -38,8 +38,9 @@ public interface AiFunctionsService { AiParseDocumentResponse aiParseDocument(AiParseDocumentRequest aiParseDocumentRequest); /** - * Starts the asynchronous cancellation of a batch. Requests in progress are drained first. - * Cancellation is best effort, so the batch can still complete. + * Starts the asynchronous cancellation of a batch. Requests in progress are stopped, and the + * results of the requests that finished are kept. Cancellation is best effort, so the batch can + * still complete. */ CancelBatchResponse cancelBatch(CancelBatchRequest cancelBatchRequest); diff --git a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/aifunctions/Batch.java b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/aifunctions/Batch.java index 3c1c6f027..d99996d38 100644 --- a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/aifunctions/Batch.java +++ b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/aifunctions/Batch.java @@ -14,6 +14,11 @@ * The AI Functions Asynchronous API lets you process large volumes of requests as a batch in a * single call. It is in Beta: a workspace admin must turn on the **AI Functions Asynchronous API** * preview on the workspace Previews page before you can call it. + * + *

For examples, see + * [`ai_parse_document`](/agents/agent-bricks/document-parsing#asynchronous-api), + * [`ai_extract`](/agents/agent-bricks/info-extraction#asynchronous-api), and + * [`ai_classify`](/agents/agent-bricks/classification#asynchronous-api). */ @Generated public class Batch { @@ -33,9 +38,7 @@ public class Batch { @JsonProperty("input_ref") private String inputRef; - /** - * Output only. Identifier. Resource name of the batch, returned by create. Format: `batch_`. - */ + /** Output only. Unique identifier of the batch, returned by create. Format: `batch_`. */ @JsonProperty("name") private String name; @@ -43,7 +46,7 @@ public class Batch { * Unity Catalog volume path to write the JSONL output file to. If the path is a directory, the * file is `/_output.jsonl`. Each line is the result of one request, in the form * `{"custom_id": ..., "response": ...}`, or `{"custom_id": ..., "error": {"type": ..., "message": - * ...}}` for a request that failed. + * ...}}` for a request that failed or did not finish. */ @JsonProperty("output_ref") private String outputRef; @@ -71,7 +74,12 @@ public class Batch { @JsonProperty("request_counts") private BatchRequestCounts requestCounts; - /** Output only. The status of the batch. */ + /** + * Output only. The status of the batch. A batch starts as `PENDING`, runs as `IN_PROGRESS`, is + * `FINALIZING` while the output file is written, and ends as `COMPLETED`. A running batch that is + * cancelled is `CANCELLING`, then `CANCELLED`. A `COMPLETED` batch can include requests that + * failed, and a `FAILED` batch has no `output_ref`. + */ @JsonProperty("status") private BatchStatus status; diff --git a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/aifunctions/CancelBatchRequest.java b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/aifunctions/CancelBatchRequest.java index df9cc0ded..a41b4d46d 100644 --- a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/aifunctions/CancelBatchRequest.java +++ b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/aifunctions/CancelBatchRequest.java @@ -9,7 +9,7 @@ @Generated public class CancelBatchRequest { - /** Resource name of the batch. Format: `batch_`. */ + /** Unique identifier of the batch. Format: `batch_`. */ @JsonIgnore private String name; public CancelBatchRequest setName(String name) { diff --git a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/aifunctions/GetBatchRequest.java b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/aifunctions/GetBatchRequest.java index bac8afbf5..6660148eb 100644 --- a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/aifunctions/GetBatchRequest.java +++ b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/aifunctions/GetBatchRequest.java @@ -9,7 +9,7 @@ @Generated public class GetBatchRequest { - /** Resource name of the batch. Format: `batch_`. */ + /** Unique identifier of the batch. Format: `batch_`. */ @JsonIgnore private String name; public GetBatchRequest setName(String name) { diff --git a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/aisearch/EndpointScalingInfoPhase.java b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/aisearch/EndpointScalingInfoPhase.java index 0428cde23..0215433b2 100644 --- a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/aisearch/EndpointScalingInfoPhase.java +++ b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/aisearch/EndpointScalingInfoPhase.java @@ -9,5 +9,6 @@ public enum EndpointScalingInfoPhase { ADJUSTING_CAPACITY, ESTIMATING, + FINALIZING, INITIALIZING_INDEX, } diff --git a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/apps/AppDeployment.java b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/apps/AppDeployment.java index 6f0084d02..5d8192e82 100644 --- a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/apps/AppDeployment.java +++ b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/apps/AppDeployment.java @@ -8,6 +8,11 @@ import java.util.Collection; import java.util.Objects; +/** + * A deployment of an app's source code, taken from a workspace path or a Git reference. When a + * deployment succeeds, it becomes the app's active deployment. See + * https://docs.databricks.com/aws/en/dev-tools/databricks-apps/deploy. + */ @Generated public class AppDeployment { /** @@ -17,11 +22,11 @@ public class AppDeployment { @JsonProperty("command") private Collection command; - /** The creation time of the deployment. Formatted timestamp in ISO 6801. */ + /** The creation time of the deployment. Formatted timestamp in ISO 8601. */ @JsonProperty("create_time") private String createTime; - /** The email of the user creates the deployment. */ + /** The email of the user that created the deployment. */ @JsonProperty("creator") private String creator; @@ -29,18 +34,24 @@ public class AppDeployment { @JsonProperty("deployment_artifacts") private AppDeploymentArtifacts deploymentArtifacts; - /** The unique id of the deployment. */ + /** + * The unique ID of the deployment. Databricks generates the ID when the deployment is created. + */ @JsonProperty("deployment_id") private String deploymentId; /** * The environment variables to set in the app runtime environment. This will override the - * environment variables specified in the app.yaml file. + * environment variables specified in the app.yaml file. Responses return only the variable names, + * not their values. */ @JsonProperty("env_vars") private Collection envVars; - /** Git repository to use as the source for the app deployment. */ + /** + * Git repository to use as the source for the app deployment. The repository itself is configured + * on the app, so set only the branch, tag or commit here, and optionally `source_code_path`. + */ @JsonProperty("git_source") private GitSource gitSource; @@ -51,7 +62,10 @@ public class AppDeployment { @JsonProperty("health_check") private AppHealthCheck healthCheck; - /** The mode of which the deployment will manage the source code. */ + /** + * The mode in which the deployment manages the source code. The mode defaults to `SNAPSHOT`, + * which is the only supported mode. + */ @JsonProperty("mode") private AppDeploymentMode mode; @@ -82,16 +96,17 @@ public class AppDeployment { * different from `deployment_artifacts.source_code_path`, which is the path used by the deployed * app. The former refers to the original source code location of the app in the workspace during * deployment creation, whereas the latter provides a system generated stable snapshotted source - * code path used by the deployment. + * code path used by the deployment. Set either `source_code_path` or `git_source`, not both. If + * neither is set, the deployment reuses the source of the app's active deployment. */ @JsonProperty("source_code_path") private String sourceCodePath; - /** Status and status message of the deployment */ + /** The current state of the deployment and a message that describes its progress or failure. */ @JsonProperty("status") private AppDeploymentStatus status; - /** The update time of the deployment. Formatted timestamp in ISO 6801. */ + /** The update time of the deployment. Formatted timestamp in ISO 8601. */ @JsonProperty("update_time") private String updateTime; diff --git a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/apps/AppDeploymentStatus.java b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/apps/AppDeploymentStatus.java index 095be8232..cd2f4b462 100644 --- a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/apps/AppDeploymentStatus.java +++ b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/apps/AppDeploymentStatus.java @@ -13,7 +13,10 @@ public class AppDeploymentStatus { @JsonProperty("message") private String message; - /** State of the deployment. */ + /** + * State of the deployment. A deployment starts in `IN_PROGRESS` and ends in `SUCCEEDED`, `FAILED` + * or `CANCELLED`. + */ @JsonProperty("state") private AppDeploymentState state; 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 index bdf761073..1cd0d5a3a 100644 --- 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 @@ -280,7 +280,12 @@ public DeleteSpaceOperation deleteSpace(DeleteSpaceRequest request) { return new DeleteSpaceOperation(impl, operation); } - /** Creates an app deployment for the app with the supplied name. */ + /** + * Creates an app deployment for the app with the supplied name. The call returns while the + * deployment is still `IN_PROGRESS`; poll the deployment until it reaches a terminal state. The + * request fails with RESOURCE_CONFLICT if another deployment of the same app is still pending and + * has not timed out. + */ public Wait deploy(CreateAppDeploymentRequest request) { AppDeployment response = impl.deploy(request); return new Wait<>( @@ -404,7 +409,10 @@ public Iterable listDeployments(String appName) { return listDeployments(new ListAppDeploymentsRequest().setAppName(appName)); } - /** Lists all app deployments for the app with the supplied name. */ + /** + * Lists all app deployments for the app with the supplied name. The history holds only the app's + * most recent deployments. + */ public Iterable listDeployments(ListAppDeploymentsRequest request) { return Paginator.newTokenPagination( request, 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 index 90ee29ba3..8da26b9a6 100644 --- 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 @@ -34,7 +34,12 @@ public interface AppsService { /** Deletes an app space. */ Operation deleteSpace(DeleteSpaceRequest deleteSpaceRequest); - /** Creates an app deployment for the app with the supplied name. */ + /** + * Creates an app deployment for the app with the supplied name. The call returns while the + * deployment is still `IN_PROGRESS`; poll the deployment until it reaches a terminal state. The + * request fails with RESOURCE_CONFLICT if another deployment of the same app is still pending and + * has not timed out. + */ AppDeployment deploy(CreateAppDeploymentRequest createAppDeploymentRequest); /** Retrieves information for the app with the supplied name. */ @@ -70,7 +75,10 @@ GetAppPermissionLevelsResponse getPermissionLevels( ListAppDeploymentScanFindingsResponse listAppDeploymentScanFindings( ListAppDeploymentScanFindingsRequest listAppDeploymentScanFindingsRequest); - /** Lists all app deployments for the app with the supplied name. */ + /** + * Lists all app deployments for the app with the supplied name. The history holds only the app's + * most recent deployments. + */ ListAppDeploymentsResponse listDeployments(ListAppDeploymentsRequest listAppDeploymentsRequest); /** Lists all app spaces in the workspace. */ diff --git a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/apps/ListAppDeploymentsRequest.java b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/apps/ListAppDeploymentsRequest.java index c6601522e..e2885db74 100644 --- a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/apps/ListAppDeploymentsRequest.java +++ b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/apps/ListAppDeploymentsRequest.java @@ -13,12 +13,12 @@ public class ListAppDeploymentsRequest { /** The name of the app. */ @JsonIgnore private String appName; - /** Upper bound for items returned. */ + /** Upper bound for items returned. The default is 100 and the maximum is 1000. */ @JsonIgnore @QueryParam("page_size") private Long pageSize; - /** Pagination token to go to the next page of apps. Requests first page if absent. */ + /** Pagination token to go to the next page of deployments. Requests first page if absent. */ @JsonIgnore @QueryParam("page_token") private String pageToken; diff --git a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/apps/ListAppDeploymentsResponse.java b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/apps/ListAppDeploymentsResponse.java index 3feef0752..689dd549d 100644 --- a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/apps/ListAppDeploymentsResponse.java +++ b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/apps/ListAppDeploymentsResponse.java @@ -10,11 +10,11 @@ @Generated public class ListAppDeploymentsResponse { - /** Deployment history of the app. */ + /** Deployment history of the app, most recent deployment first. */ @JsonProperty("app_deployments") private Collection appDeployments; - /** Pagination token to request the next page of apps. */ + /** Pagination token to request the next page of deployments. */ @JsonProperty("next_page_token") private String nextPageToken; diff --git a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/apps/Space.java b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/apps/Space.java index 601807ebb..b52c756c0 100644 --- a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/apps/Space.java +++ b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/apps/Space.java @@ -9,6 +9,11 @@ import java.util.Collection; import java.util.Objects; +/** + * An app space groups Databricks apps and shares configuration across them. Resources, user API + * scopes and the usage policy configured on a space apply to every app in the space. See + * https://docs.databricks.com/aws/en/dev-tools/databricks-apps/app-spaces. + */ @Generated public class Space { /** @@ -19,7 +24,7 @@ public class Space { @JsonProperty("assume_group_id") private String assumeGroupId; - /** The creation time of the app space. Formatted timestamp in ISO 6801. */ + /** The creation time of the app space. Formatted timestamp in ISO 8601. */ @JsonProperty("create_time") private Timestamp createTime; @@ -45,7 +50,8 @@ public class Space { /** * The name of the app space. The name must contain only lowercase alphanumeric characters and - * hyphens. It must be unique within the workspace. + * hyphens. It must be unique within the workspace. It can't start or end with a hyphen, and it + * can't be changed after the space is created. */ @JsonProperty("name") private String name; @@ -57,15 +63,15 @@ public class Space { @JsonProperty("resources") private Collection resources; - /** The service principal client ID for the app space. */ + /** OAuth client ID of the app space's service principal. */ @JsonProperty("service_principal_client_id") private String servicePrincipalClientId; - /** The service principal ID for the app space. */ + /** Numeric ID of the app space's service principal. */ @JsonProperty("service_principal_id") private Long servicePrincipalId; - /** The service principal name for the app space. */ + /** Display name of the app space's service principal. */ @JsonProperty("service_principal_name") private String servicePrincipalName; @@ -73,7 +79,7 @@ public class Space { @JsonProperty("status") private SpaceStatus status; - /** The update time of the app space. Formatted timestamp in ISO 6801. */ + /** The update time of the app space. Formatted timestamp in ISO 8601. */ @JsonProperty("update_time") private Timestamp updateTime; @@ -85,7 +91,10 @@ public class Space { @JsonProperty("usage_policy_id") private String usagePolicyId; - /** OAuth scopes for apps in the space. */ + /** + * API scopes that apps in the space can request for user authorization. See + * https://docs.databricks.com/aws/en/dev-tools/databricks-apps/auth. + */ @JsonProperty("user_api_scopes") private Collection userApiScopes; diff --git a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/apps/UpdateSpaceRequest.java b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/apps/UpdateSpaceRequest.java index 7b4af79be..42f3859b4 100644 --- a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/apps/UpdateSpaceRequest.java +++ b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/apps/UpdateSpaceRequest.java @@ -14,7 +14,8 @@ public class UpdateSpaceRequest { /** * The name of the app space. The name must contain only lowercase alphanumeric characters and - * hyphens. It must be unique within the workspace. + * hyphens. It must be unique within the workspace. It can't start or end with a hyphen, and it + * can't be changed after the space is created. */ @JsonIgnore private String name; @@ -23,15 +24,8 @@ public class UpdateSpaceRequest { private Space space; /** - * The field mask must be a single string, with multiple fields separated by commas (no spaces). - * The field path is relative to the resource object, using a dot (`.`) to navigate sub-fields - * (e.g., `author.given_name`). Specification of elements in sequence or map fields is not - * allowed, as only the entire collection field can be specified. Field names must exactly match - * the resource field names. - * - *

A field mask of `*` indicates full replacement. It’s recommended to always explicitly list - * the fields being updated and avoid using `*` wildcards, as it can lead to unintended results if - * the API changes in the future. + * Comma-separated names of the `space` fields to update, such as `description` or `resources`. A + * field named in the mask but absent from `space` is cleared. */ @JsonIgnore @QueryParam("update_mask") diff --git a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/catalog/AccessRequestDestinations.java b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/catalog/AccessRequestDestinations.java index ac8bc16c5..0d8994230 100644 --- a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/catalog/AccessRequestDestinations.java +++ b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/catalog/AccessRequestDestinations.java @@ -46,6 +46,22 @@ public class AccessRequestDestinations { @JsonProperty("securable_type") private String securableType; + /** + * The access request URLs shared by every workspace in the metastore. Only set when the securable + * is a metastore. These URLs are used when neither the requested securable nor its parents have + * an explicit destination or a default owner email destination, and they take precedence over + * metastore destinations. + * + *

A **dynamic_url** and default owner email destinations cannot both be on: saving one turns + * the other off. Saving a **dynamic_url** while they are on requires a metastore admin. + * + *

Setting this field removes the metastore destinations in this workspace. The first save also + * removes the metastore URL destinations of other workspaces. Once set, the configuration can be + * cleared but not removed. + */ + @JsonProperty("url_configuration") + private UrlConfiguration urlConfiguration; + public AccessRequestDestinations setAreAnyDestinationsHidden(Boolean areAnyDestinationsHidden) { this.areAnyDestinationsHidden = areAnyDestinationsHidden; return this; @@ -102,6 +118,15 @@ public String getSecurableType() { return securableType; } + public AccessRequestDestinations setUrlConfiguration(UrlConfiguration urlConfiguration) { + this.urlConfiguration = urlConfiguration; + return this; + } + + public UrlConfiguration getUrlConfiguration() { + return urlConfiguration; + } + @Override public boolean equals(Object o) { if (this == o) return true; @@ -112,7 +137,8 @@ public boolean equals(Object o) { && Objects.equals(destinations, that.destinations) && Objects.equals(fullName, that.fullName) && Objects.equals(securable, that.securable) - && Objects.equals(securableType, that.securableType); + && Objects.equals(securableType, that.securableType) + && Objects.equals(urlConfiguration, that.urlConfiguration); } @Override @@ -123,7 +149,8 @@ public int hashCode() { destinations, fullName, securable, - securableType); + securableType, + urlConfiguration); } @Override @@ -135,6 +162,7 @@ public String toString() { .add("fullName", fullName) .add("securable", securable) .add("securableType", securableType) + .add("urlConfiguration", urlConfiguration) .toString(); } } diff --git a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/catalog/ConnectionType.java b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/catalog/ConnectionType.java index 515086420..67ffea54e 100644 --- a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/catalog/ConnectionType.java +++ b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/catalog/ConnectionType.java @@ -15,6 +15,7 @@ public enum ConnectionType { GA4_RAW_DATA, GITHUB, GLUE, + GOOGLE_ADS, HIVE_METASTORE, HTTP, HUBSPOT, diff --git a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/catalog/CreateSkillRequest.java b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/catalog/CreateSkillRequest.java index d799849f5..e33849ab2 100644 --- a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/catalog/CreateSkillRequest.java +++ b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/catalog/CreateSkillRequest.java @@ -27,8 +27,9 @@ public class CreateSkillRequest { private Skill skill; /** - * Name for the skill, e.g. "basic-math". The server normalizes this identifier to lowercase. It - * is independent of the bundle name read from SKILL.md. + * Name of the skill within the parent schema. The name must not contain periods, spaces, forward + * slashes, percent signs, or control characters, and it is stored in lowercase. It is independent + * of the bundle name read from SKILL.md. */ @JsonIgnore @QueryParam("skill_id") diff --git a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/catalog/CreateTableRequest.java b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/catalog/CreateTableRequest.java index 9c442721e..03739cc13 100644 --- a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/catalog/CreateTableRequest.java +++ b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/catalog/CreateTableRequest.java @@ -11,7 +11,7 @@ @Generated public class CreateTableRequest { - /** Name of parent catalog. */ + /** Name of parent catalog. Required for creation using catalog and schema names. */ @JsonProperty("catalog_name") private String catalogName; @@ -35,7 +35,10 @@ public class CreateTableRequest { @JsonProperty("properties") private Map properties; - /** Name of parent schema relative to its parent catalog. */ + /** + * Name of parent schema relative to its parent catalog. Required for creation using catalog and + * schema names. + */ @JsonProperty("schema_name") private String schemaName; diff --git a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/catalog/DeleteModelVersionRequest.java b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/catalog/DeleteModelVersionRequest.java index 4ac19d9d1..bf485cfd7 100644 --- a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/catalog/DeleteModelVersionRequest.java +++ b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/catalog/DeleteModelVersionRequest.java @@ -9,7 +9,10 @@ @Generated public class DeleteModelVersionRequest { - /** The three-level (fully qualified) name of the model version */ + /** + * The three-level (fully qualified) name of the parent registered model, in the form + * `catalog_name.schema_name.model_name`. + */ @JsonIgnore private String fullName; /** The integer version number of the model version */ diff --git a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/catalog/Dependency.java b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/catalog/Dependency.java index 00f9f76e5..20da20c4f 100644 --- a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/catalog/Dependency.java +++ b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/catalog/Dependency.java @@ -13,19 +13,19 @@ */ @Generated public class Dependency { - /** */ + /** A dependency on a Unity Catalog connection. */ @JsonProperty("connection") private ConnectionDependency connection; - /** */ + /** A dependency on a Unity Catalog credential. */ @JsonProperty("credential") private CredentialDependency credential; - /** */ + /** A dependency on a Unity Catalog function. */ @JsonProperty("function") private FunctionDependency function; - /** */ + /** A dependency on a Unity Catalog table. */ @JsonProperty("table") private TableDependency table; diff --git a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/catalog/GetCatalogWorkspaceBindingsResponse.java b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/catalog/GetCatalogWorkspaceBindingsResponse.java index b2aedb9a5..b9f485476 100644 --- a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/catalog/GetCatalogWorkspaceBindingsResponse.java +++ b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/catalog/GetCatalogWorkspaceBindingsResponse.java @@ -10,7 +10,7 @@ @Generated public class GetCatalogWorkspaceBindingsResponse { - /** A list of workspace IDs */ + /** The IDs of the workspaces that are bound to the catalog. */ @JsonProperty("workspaces") private Collection workspaces; diff --git a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/catalog/GetGrantRequest.java b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/catalog/GetGrantRequest.java index 59e2565c2..563c2ce6b 100644 --- a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/catalog/GetGrantRequest.java +++ b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/catalog/GetGrantRequest.java @@ -10,7 +10,10 @@ @Generated public class GetGrantRequest { - /** Full name of securable. */ + /** + * Full name of the securable. Tables, views, volumes and functions use the three-level name + * `catalog.schema.object`; a metastore uses its metastore ID. + */ @JsonIgnore private String fullName; /** @@ -38,7 +41,10 @@ public class GetGrantRequest { @QueryParam("principal") private String principal; - /** Type of securable. */ + /** + * Type of the securable, such as `catalog`, `schema`, `table` or `volume`. The value is + * case-insensitive. + */ @JsonIgnore private String securableType; public GetGrantRequest setFullName(String fullName) { diff --git a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/catalog/GetModelVersionRequest.java b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/catalog/GetModelVersionRequest.java index a591c72ad..b93492d1c 100644 --- a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/catalog/GetModelVersionRequest.java +++ b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/catalog/GetModelVersionRequest.java @@ -10,7 +10,10 @@ @Generated public class GetModelVersionRequest { - /** The three-level (fully qualified) name of the model version */ + /** + * The three-level (fully qualified) name of the parent registered model, in the form + * `catalog_name.schema_name.model_name`. + */ @JsonIgnore private String fullName; /** Whether to include aliases associated with the model version in the response */ diff --git a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/catalog/ListSecretsRequest.java b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/catalog/ListSecretsRequest.java index c5b817a58..d13075651 100644 --- a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/catalog/ListSecretsRequest.java +++ b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/catalog/ListSecretsRequest.java @@ -30,8 +30,8 @@ public class ListSecretsRequest { private Long pageSize; /** - * Opaque pagination token to go to the next page based on previous query. The maximum page length - * is determined by a server configured value. + * Opaque pagination token for the next page of results. Set it to the **next_page_token** value + * from the previous response. */ @JsonIgnore @QueryParam("page_token") diff --git a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/catalog/ModelVersionInfo.java b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/catalog/ModelVersionInfo.java index dd2cc00b9..063282285 100644 --- a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/catalog/ModelVersionInfo.java +++ b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/catalog/ModelVersionInfo.java @@ -8,6 +8,11 @@ import java.util.Collection; import java.util.Objects; +/** + * A numbered version of a registered model in Unity Catalog. A model version is identified by the + * full name of its parent registered model and its version number, or by an alias that points to + * it. See https://docs.databricks.com/aws/en/machine-learning/manage-model-lifecycle/. + */ @Generated public class ModelVersionInfo { /** List of aliases associated with the model version */ @@ -22,7 +27,7 @@ public class ModelVersionInfo { @JsonProperty("comment") private String comment; - /** */ + /** Time at which the model version was created, in epoch milliseconds. */ @JsonProperty("created_at") private Long createdAt; @@ -81,7 +86,7 @@ public class ModelVersionInfo { @JsonProperty("storage_location") private String storageLocation; - /** */ + /** Time at which the model version was last updated, in epoch milliseconds. */ @JsonProperty("updated_at") private Long updatedAt; diff --git a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/catalog/PermissionsChange.java b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/catalog/PermissionsChange.java index cbd425817..548721fde 100644 --- a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/catalog/PermissionsChange.java +++ b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/catalog/PermissionsChange.java @@ -14,10 +14,7 @@ public class PermissionsChange { @JsonProperty("add") private Collection add; - /** - * The principal whose privileges we are changing. Only one of principal or principal_id should be - * specified, never both at the same time. - */ + /** The principal whose privileges we are changing. */ @JsonProperty("principal") private String principal; diff --git a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/catalog/PrivilegeAssignment.java b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/catalog/PrivilegeAssignment.java index 3781e98f5..9c9f97d13 100644 --- a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/catalog/PrivilegeAssignment.java +++ b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/catalog/PrivilegeAssignment.java @@ -10,10 +10,7 @@ @Generated public class PrivilegeAssignment { - /** - * The principal (user email address or group name). For deleted principals, `principal` is empty - * while `principal_id` is populated. - */ + /** The principal (user email address or group name). */ @JsonProperty("principal") private String principal; diff --git a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/catalog/RfaAPI.java b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/catalog/RfaAPI.java index 2af56abcd..605e36033 100644 --- a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/catalog/RfaAPI.java +++ b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/catalog/RfaAPI.java @@ -74,6 +74,12 @@ public AccessRequestDestinations getAccessRequestDestinations( * *

The supported securable types are: "metastore", "catalog", "schema", "table", * "external_location", "connection", "credential", "function", "registered_model", and "volume". + * + *

On a metastore that has a **url_configuration**, its URLs are shared by every workspace, + * while emails and webhooks are still saved per workspace. There, a URL destination replaces the + * configuration's **redirect_url** and clears its **dynamic_url**, so requests that used the + * **dynamic_url** go to the new URL. An update that has no URL destination and does not set + * **url_configuration** clears both URLs, in every workspace. */ public AccessRequestDestinations updateAccessRequestDestinations( UpdateAccessRequestDestinationsRequest request) { diff --git a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/catalog/RfaService.java b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/catalog/RfaService.java index 2eeac9983..89a42fb2f 100644 --- a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/catalog/RfaService.java +++ b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/catalog/RfaService.java @@ -49,6 +49,12 @@ AccessRequestDestinations getAccessRequestDestinations( * *

The supported securable types are: "metastore", "catalog", "schema", "table", * "external_location", "connection", "credential", "function", "registered_model", and "volume". + * + *

On a metastore that has a **url_configuration**, its URLs are shared by every workspace, + * while emails and webhooks are still saved per workspace. There, a URL destination replaces the + * configuration's **redirect_url** and clears its **dynamic_url**, so requests that used the + * **dynamic_url** go to the new URL. An update that has no URL destination and does not set + * **url_configuration** clears both URLs, in every workspace. */ AccessRequestDestinations updateAccessRequestDestinations( UpdateAccessRequestDestinationsRequest updateAccessRequestDestinationsRequest); diff --git a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/catalog/Secret.java b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/catalog/Secret.java index 4035a4d94..220c21ff6 100644 --- a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/catalog/Secret.java +++ b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/catalog/Secret.java @@ -69,8 +69,8 @@ public class Secret { private String name; /** - * The owner of the secret. Defaults to the creating principal on creation. Can be updated to - * transfer ownership of the secret to another principal. + * The owner of the secret. It cannot be set when creating a secret and defaults to the creating + * principal. Set it in UpdateSecret to transfer ownership of the secret to another principal. */ @JsonProperty("owner") private String owner; @@ -88,10 +88,9 @@ public class Secret { private String updatedBy; /** - * The secret value to store. This field is input-only and is not returned in responses — use the - * **effective_value** field (via GetSecret with **include_value** set to true) to read the secret - * value. The maximum size is 60 KiB (pre-encryption). Accepted content includes passwords, - * tokens, keys, and other sensitive credential data. + * The secret value to store, such as a password, token, or key. It is never returned in + * responses. To read it, call GetSecret with **include_value** set to true and use the + * **effective_value** field. The maximum size is 60 KiB before encryption. */ @JsonProperty("value") private String value; diff --git a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/catalog/SecretsUcAPI.java b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/catalog/SecretsUcAPI.java index b9569f509..2e3baf87e 100644 --- a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/catalog/SecretsUcAPI.java +++ b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/catalog/SecretsUcAPI.java @@ -64,25 +64,31 @@ public Secret getSecret(String fullName) { /** * Gets a secret by its three-level (fully qualified) name. * - *

You must be a metastore admin, the owner of the secret, or have the **MANAGE** privilege on - * the secret. + *

You must be a metastore admin or the owner of the secret, or have the **MANAGE** privilege + * on the secret (together with **USE CATALOG** on its catalog and **USE SCHEMA** on its schema), + * on its schema (together with **USE CATALOG** on its catalog), or on its catalog. Alternatively, + * you can have the **READ_SECRET**, **WRITE_SECRET**, or **REFERENCE_SECRET** privilege on the + * secret, its schema, or its catalog, together with **USE CATALOG** on its catalog and **USE + * SCHEMA** on its schema. * - *

The secret value isn't returned by default. To retrieve it, you must also have the - * **READ_SECRET** privilege and set **include_value** to true in the request. + *

The secret value isn't returned by default. To retrieve it, set **include_value** to true in + * the request; this requires ownership of the secret or the **READ_SECRET** privilege. */ public Secret getSecret(GetSecretRequest request) { return impl.getSecret(request); } /** - * Lists secrets in Unity Catalog. + * Lists the secrets in a schema. * - *

You must be a metastore admin, the owner of the secret, or have the **MANAGE** privilege on - * the secret. + *

With **USE CATALOG** on the catalog and **USE SCHEMA** on the schema, the response contains + * the secrets that you own or hold a privilege on. Metastore admins, principals with the + * **MANAGE** privilege on the catalog, and principals with the **MANAGE** privilege on the schema + * together with **USE CATALOG** on the catalog see every secret in the schema. * - *

Both **catalog_name** and **schema_name** must be specified together to filter secrets - * within a specific schema. Results are paginated; use the **page_token** field from the response - * to retrieve subsequent pages. + *

Secrets are listed within a single schema, so both **catalog_name** and **schema_name** must + * be specified. Results are paginated; pass the **next_page_token** value from the response as + * **page_token** to retrieve the next page. */ public Iterable listSecrets(ListSecretsRequest request) { return Paginator.newTokenPagination( @@ -101,11 +107,17 @@ public Iterable listSecrets(ListSecretsRequest request) { /** * Updates an existing secret in Unity Catalog. * - *

You must be the owner of the secret or a metastore admin. If you are a metastore admin, only - * the **owner** field can be changed. + *

To change **value**, you must be the owner of the secret, or have the **WRITE_SECRET** + * privilege on it together with **USE CATALOG** on its catalog and **USE SCHEMA** on its schema. + * To change **comment** or **expire_time**, you must be the owner or have the **MANAGE** + * privilege on the secret (together with **USE CATALOG** on its catalog and **USE SCHEMA** on its + * schema), on its schema (together with **USE CATALOG** on its catalog), or on its catalog. To + * change **owner**, you must be the owner, a metastore admin, or have the **MANAGE** privilege on + * the secret (together with **USE CATALOG** on its catalog and **USE SCHEMA** on its schema), on + * its schema (together with **USE CATALOG** on its catalog), or on its catalog. A metastore admin + * can change only the **owner** field. * - *

Use the **update_mask** field to specify which fields to update. Supported updatable fields - * include **value**, **comment**, **owner**, and **expire_time**. + *

Use the **update_mask** field to specify which fields to update. */ public Secret updateSecret(UpdateSecretRequest request) { return impl.updateSecret(request); diff --git a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/catalog/SecretsUcService.java b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/catalog/SecretsUcService.java index 8e753c35b..271b37d83 100644 --- a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/catalog/SecretsUcService.java +++ b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/catalog/SecretsUcService.java @@ -38,34 +38,46 @@ public interface SecretsUcService { /** * Gets a secret by its three-level (fully qualified) name. * - *

You must be a metastore admin, the owner of the secret, or have the **MANAGE** privilege on - * the secret. + *

You must be a metastore admin or the owner of the secret, or have the **MANAGE** privilege + * on the secret (together with **USE CATALOG** on its catalog and **USE SCHEMA** on its schema), + * on its schema (together with **USE CATALOG** on its catalog), or on its catalog. Alternatively, + * you can have the **READ_SECRET**, **WRITE_SECRET**, or **REFERENCE_SECRET** privilege on the + * secret, its schema, or its catalog, together with **USE CATALOG** on its catalog and **USE + * SCHEMA** on its schema. * - *

The secret value isn't returned by default. To retrieve it, you must also have the - * **READ_SECRET** privilege and set **include_value** to true in the request. + *

The secret value isn't returned by default. To retrieve it, set **include_value** to true in + * the request; this requires ownership of the secret or the **READ_SECRET** privilege. */ Secret getSecret(GetSecretRequest getSecretRequest); /** - * Lists secrets in Unity Catalog. + * Lists the secrets in a schema. * - *

You must be a metastore admin, the owner of the secret, or have the **MANAGE** privilege on - * the secret. + *

With **USE CATALOG** on the catalog and **USE SCHEMA** on the schema, the response contains + * the secrets that you own or hold a privilege on. Metastore admins, principals with the + * **MANAGE** privilege on the catalog, and principals with the **MANAGE** privilege on the schema + * together with **USE CATALOG** on the catalog see every secret in the schema. * - *

Both **catalog_name** and **schema_name** must be specified together to filter secrets - * within a specific schema. Results are paginated; use the **page_token** field from the response - * to retrieve subsequent pages. + *

Secrets are listed within a single schema, so both **catalog_name** and **schema_name** must + * be specified. Results are paginated; pass the **next_page_token** value from the response as + * **page_token** to retrieve the next page. */ ListSecretsResponse listSecrets(ListSecretsRequest listSecretsRequest); /** * Updates an existing secret in Unity Catalog. * - *

You must be the owner of the secret or a metastore admin. If you are a metastore admin, only - * the **owner** field can be changed. + *

To change **value**, you must be the owner of the secret, or have the **WRITE_SECRET** + * privilege on it together with **USE CATALOG** on its catalog and **USE SCHEMA** on its schema. + * To change **comment** or **expire_time**, you must be the owner or have the **MANAGE** + * privilege on the secret (together with **USE CATALOG** on its catalog and **USE SCHEMA** on its + * schema), on its schema (together with **USE CATALOG** on its catalog), or on its catalog. To + * change **owner**, you must be the owner, a metastore admin, or have the **MANAGE** privilege on + * the secret (together with **USE CATALOG** on its catalog and **USE SCHEMA** on its schema), on + * its schema (together with **USE CATALOG** on its catalog), or on its catalog. A metastore admin + * can change only the **owner** field. * - *

Use the **update_mask** field to specify which fields to update. Supported updatable fields - * include **value**, **comment**, **owner**, and **expire_time**. + *

Use the **update_mask** field to specify which fields to update. */ Secret updateSecret(UpdateSecretRequest updateSecretRequest); } diff --git a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/catalog/Skill.java b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/catalog/Skill.java index 3daa5b1f2..1c0104df2 100644 --- a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/catalog/Skill.java +++ b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/catalog/Skill.java @@ -23,11 +23,10 @@ public class Skill { private String bundleName; /** - * User-provided comment for the skill. Free-text, user-editable via UpdateSkill (listed in its - * `update_mask`). DISTINCT from `description`, which is the server-parsed, OUTPUT_ONLY SKILL.md - * frontmatter value: `comment` is the customer's own annotation and is preserved across bundle - * re-uploads. When `comment` is in the update mask, omitting it clears the field, while an - * explicitly empty string is retained. + * User-provided comment for the skill, which you can change with UpdateSkill. It is separate from + * `description`, which the server reads from the SKILL.md frontmatter, and it is preserved across + * bundle re-uploads and FinalizeSkill. When `comment` is in the update mask, omitting it clears + * the field, while an explicitly empty string is retained. */ @JsonProperty("comment") private String comment; @@ -36,7 +35,7 @@ public class Skill { @JsonProperty("create_time") private Timestamp createTime; - /** Creator identity. */ + /** Username or service principal application ID of the principal that created the skill. */ @JsonProperty("created_by") private String createdBy; @@ -47,7 +46,7 @@ public class Skill { @JsonProperty("description") private String description; - /** Owner of the skill. */ + /** Username, group name, or service principal application ID of the skill owner. */ @JsonProperty("effective_owner") private String effectiveOwner; @@ -63,14 +62,14 @@ public class Skill { @JsonProperty("finalize_time") private Timestamp finalizeTime; - /** Metastore hosting the skill. */ + /** Unique identifier of the metastore that contains the skill. */ @JsonProperty("metastore_id") private String metastoreId; /** * Resource name of the skill. Format: `skills/{catalog}.{schema}.{skill}`. Each `{...}` component - * is capped at 255 characters individually. Server-derived on Create from `parent` + `skill_id`; - * required and immutable on Update/Get/Delete. + * is capped at 255 characters individually. The server derives the name on Create from `parent` + * and `skill_id`; it is required and immutable on Update, Get, and Delete. */ @JsonProperty("name") private String name; @@ -82,7 +81,7 @@ public class Skill { @JsonProperty("update_time") private Timestamp updateTime; - /** Identity of the last updater. */ + /** Username or service principal application ID of the principal that last updated the skill. */ @JsonProperty("updated_by") private String updatedBy; diff --git a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/catalog/TableInfo.java b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/catalog/TableInfo.java index 8aedd06ae..db19f43e7 100644 --- a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/catalog/TableInfo.java +++ b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/catalog/TableInfo.java @@ -28,7 +28,7 @@ public class TableInfo { @JsonProperty("browse_only") private Boolean browseOnly; - /** Name of parent catalog. */ + /** Name of parent catalog. Required for creation using catalog and schema names. */ @JsonProperty("catalog_name") private String catalogName; @@ -128,7 +128,10 @@ public class TableInfo { @JsonProperty("row_filter") private TableRowFilter rowFilter; - /** Name of parent schema relative to its parent catalog. */ + /** + * Name of parent schema relative to its parent catalog. Required for creation using catalog and + * schema names. + */ @JsonProperty("schema_name") private String schemaName; diff --git a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/catalog/UpdateCatalogWorkspaceBindingsResponse.java b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/catalog/UpdateCatalogWorkspaceBindingsResponse.java index d3a70c499..b7b9fd170 100644 --- a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/catalog/UpdateCatalogWorkspaceBindingsResponse.java +++ b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/catalog/UpdateCatalogWorkspaceBindingsResponse.java @@ -10,7 +10,7 @@ @Generated public class UpdateCatalogWorkspaceBindingsResponse { - /** A list of workspace IDs */ + /** The IDs of the workspaces that are bound to the catalog. */ @JsonProperty("workspaces") private Collection workspaces; diff --git a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/catalog/UpdateModelVersionRequest.java b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/catalog/UpdateModelVersionRequest.java index b49178472..3c413ac82 100644 --- a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/catalog/UpdateModelVersionRequest.java +++ b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/catalog/UpdateModelVersionRequest.java @@ -23,7 +23,7 @@ public class UpdateModelVersionRequest { @JsonProperty("comment") private String comment; - /** */ + /** Time at which the model version was created, in epoch milliseconds. */ @JsonProperty("created_at") private Long createdAt; @@ -31,7 +31,10 @@ public class UpdateModelVersionRequest { @JsonProperty("created_by") private String createdBy; - /** The three-level (fully qualified) name of the model version */ + /** + * The three-level (fully qualified) name of the parent registered model, in the form + * `catalog_name.schema_name.model_name`. + */ @JsonIgnore private String fullName; /** The unique identifier of the model version */ @@ -85,7 +88,7 @@ public class UpdateModelVersionRequest { @JsonProperty("storage_location") private String storageLocation; - /** */ + /** Time at which the model version was last updated, in epoch milliseconds. */ @JsonProperty("updated_at") private Long updatedAt; diff --git a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/catalog/UpdatePermissions.java b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/catalog/UpdatePermissions.java index e1b9522a2..ebdc743b6 100644 --- a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/catalog/UpdatePermissions.java +++ b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/catalog/UpdatePermissions.java @@ -15,17 +15,23 @@ public class UpdatePermissions { @JsonProperty("changes") private Collection changes; - /** Full name of securable. */ + /** + * Full name of the securable. Tables, views, volumes and functions use the three-level name + * `catalog.schema.object`; a metastore uses its metastore ID. + */ @JsonIgnore private String fullName; /** - * Optional, default false. Specifies whether all the permissions should be returned in the - * response. + * Whether to omit the privilege assignments from the response. When false, the response lists all + * direct privilege assignments on the securable after the update. */ @JsonProperty("omit_permissions_in_response") private Boolean omitPermissionsInResponse; - /** Type of securable. */ + /** + * Type of the securable, such as `catalog`, `schema`, `table` or `volume`. The value is + * case-insensitive. + */ @JsonIgnore private String securableType; public UpdatePermissions setChanges(Collection changes) { diff --git a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/catalog/UpdateSkillRequest.java b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/catalog/UpdateSkillRequest.java index 7cb03cf0a..751dcc4c6 100644 --- a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/catalog/UpdateSkillRequest.java +++ b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/catalog/UpdateSkillRequest.java @@ -23,8 +23,8 @@ public class UpdateSkillRequest { /** * Resource name of the skill. Format: `skills/{catalog}.{schema}.{skill}`. Each `{...}` component - * is capped at 255 characters individually. Server-derived on Create from `parent` + `skill_id`; - * required and immutable on Update/Get/Delete. + * is capped at 255 characters individually. The server derives the name on Create from `parent` + * and `skill_id`; it is required and immutable on Update, Get, and Delete. */ @JsonIgnore private String name; @@ -36,8 +36,8 @@ public class UpdateSkillRequest { private Skill skill; /** - * Fields to update; validated against `skill`. REQUIRED, matching the sibling Update RPCs. - * `comment` is the only mutable field. + * Comma-separated list of `skill` fields to update. `comment` is the only field that can be + * updated. */ @JsonIgnore @QueryParam("update_mask") diff --git a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/catalog/UpdateWorkspaceBindings.java b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/catalog/UpdateWorkspaceBindings.java index c9530e9b6..d7be3dc84 100644 --- a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/catalog/UpdateWorkspaceBindings.java +++ b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/catalog/UpdateWorkspaceBindings.java @@ -11,14 +11,14 @@ @Generated public class UpdateWorkspaceBindings { - /** A list of workspace IDs. */ + /** The IDs of the workspaces to bind to the catalog. */ @JsonProperty("assign_workspaces") private Collection assignWorkspaces; /** The name of the catalog. */ @JsonIgnore private String name; - /** A list of workspace IDs. */ + /** The IDs of the workspaces to unbind from the catalog. */ @JsonProperty("unassign_workspaces") private Collection unassignWorkspaces; diff --git a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/catalog/UrlConfiguration.java b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/catalog/UrlConfiguration.java new file mode 100644 index 000000000..9322a5fe1 --- /dev/null +++ b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/catalog/UrlConfiguration.java @@ -0,0 +1,99 @@ +// Code generated from OpenAPI specs by Databricks SDK Generator. DO NOT EDIT. + +package com.databricks.sdk.service.catalog; + +import com.databricks.sdk.support.Generated; +import com.databricks.sdk.support.ToStringer; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Objects; + +/** Access request URLs shared by every workspace in a metastore. */ +@Generated +public class UrlConfiguration { + /** + * The URL template for access requests on catalogs and the securables inside them, such as + * schemas, tables, volumes, functions, and registered models. Placeholders are replaced with + * percent-encoded values from the requested securable: `{catalog}` with the catalog name + * (`main`), `{catalog.schema}` with the catalog and schema names (`main.sales`), + * `{catalog.schema.object}` with the full name (`main.sales.orders`), `{securable_type}` with the + * securable type (`TABLE`), and `{securable_id}` with the securable ID. Name placeholders leave + * out levels the securable does not have, so `{catalog.schema.object}` is `main.sales` for a + * schema. When the deepest name placeholder stops above the requested securable, such as + * `{catalog.schema}` for a table, `{securable_type}` and `{securable_id}` describe that parent. + * If the filled-in URL is longer than 4,096 characters, the **redirect_url** is used instead. + * + *

Must start with `http://` or `https://`, contain only printable ASCII characters without + * spaces or backslashes, and be at most 2,048 characters. Braces are only allowed around a + * placeholder. + */ + @JsonProperty("dynamic_url") + private String dynamicUrl; + + /** + * The URL for access requests on the metastore and on securables outside catalogs, such as + * external locations, connections, and credentials. Also used for catalogs and the securables + * inside them when **dynamic_url** is not set or cannot produce a valid URL. Must start with + * `http://` or `https://`, contain only printable ASCII characters without spaces or backslashes, + * and be at most 2,048 characters. + */ + @JsonProperty("redirect_url") + private String redirectUrl; + + /** + * The version of the placeholder syntax used in **dynamic_url**. The only supported version is + * `1`. + */ + @JsonProperty("syntax_version") + private Long syntaxVersion; + + public UrlConfiguration setDynamicUrl(String dynamicUrl) { + this.dynamicUrl = dynamicUrl; + return this; + } + + public String getDynamicUrl() { + return dynamicUrl; + } + + public UrlConfiguration setRedirectUrl(String redirectUrl) { + this.redirectUrl = redirectUrl; + return this; + } + + public String getRedirectUrl() { + return redirectUrl; + } + + public UrlConfiguration setSyntaxVersion(Long syntaxVersion) { + this.syntaxVersion = syntaxVersion; + return this; + } + + public Long getSyntaxVersion() { + return syntaxVersion; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + UrlConfiguration that = (UrlConfiguration) o; + return Objects.equals(dynamicUrl, that.dynamicUrl) + && Objects.equals(redirectUrl, that.redirectUrl) + && Objects.equals(syntaxVersion, that.syntaxVersion); + } + + @Override + public int hashCode() { + return Objects.hash(dynamicUrl, redirectUrl, syntaxVersion); + } + + @Override + public String toString() { + return new ToStringer(UrlConfiguration.class) + .add("dynamicUrl", dynamicUrl) + .add("redirectUrl", redirectUrl) + .add("syntaxVersion", syntaxVersion) + .toString(); + } +} diff --git a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/catalog/WorkspaceBinding.java b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/catalog/WorkspaceBinding.java index 0d0c8653a..ea7a48b15 100644 --- a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/catalog/WorkspaceBinding.java +++ b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/catalog/WorkspaceBinding.java @@ -7,13 +7,20 @@ import com.fasterxml.jackson.annotation.JsonProperty; import java.util.Objects; +/** + * A binding between a workspace and a securable. When the isolation mode of the securable is + * `ISOLATED`, only bound workspaces can access it. + */ @Generated public class WorkspaceBinding { - /** One of READ_WRITE/READ_ONLY. Default is READ_WRITE. */ + /** + * One of READ_WRITE/READ_ONLY. Default is READ_WRITE. Only catalogs support + * `BINDING_TYPE_READ_ONLY`; other securable types accept only `BINDING_TYPE_READ_WRITE`. + */ @JsonProperty("binding_type") private WorkspaceBindingBindingType bindingType; - /** Required */ + /** The ID of the workspace that the binding applies to. */ @JsonProperty("workspace_id") private Long workspaceId; diff --git a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/compute/CreateComputePolicyRequest.java b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/compute/CreateComputePolicyRequest.java new file mode 100644 index 000000000..c666865c7 --- /dev/null +++ b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/compute/CreateComputePolicyRequest.java @@ -0,0 +1,44 @@ +// Code generated from OpenAPI specs by Databricks SDK Generator. DO NOT EDIT. + +package com.databricks.sdk.service.compute; + +import com.databricks.sdk.support.Generated; +import com.databricks.sdk.support.ToStringer; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Objects; + +@Generated +public class CreateComputePolicyRequest { + /** The compute policy to create. */ + @JsonProperty("compute_policy") + private ComputePolicy computePolicy; + + public CreateComputePolicyRequest setComputePolicy(ComputePolicy computePolicy) { + this.computePolicy = computePolicy; + return this; + } + + public ComputePolicy getComputePolicy() { + return computePolicy; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + CreateComputePolicyRequest that = (CreateComputePolicyRequest) o; + return Objects.equals(computePolicy, that.computePolicy); + } + + @Override + public int hashCode() { + return Objects.hash(computePolicy); + } + + @Override + public String toString() { + return new ToStringer(CreateComputePolicyRequest.class) + .add("computePolicy", computePolicy) + .toString(); + } +} diff --git a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/compute/DeleteComputePolicyRequest.java b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/compute/DeleteComputePolicyRequest.java new file mode 100644 index 000000000..15f5c426c --- /dev/null +++ b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/compute/DeleteComputePolicyRequest.java @@ -0,0 +1,43 @@ +// Code generated from OpenAPI specs by Databricks SDK Generator. DO NOT EDIT. + +package com.databricks.sdk.service.compute; + +import com.databricks.sdk.support.Generated; +import com.databricks.sdk.support.ToStringer; +import com.fasterxml.jackson.annotation.JsonIgnore; +import java.util.Objects; + +@Generated +public class DeleteComputePolicyRequest { + /** The ID of the compute policy to delete. */ + @JsonIgnore private String computePolicyId; + + public DeleteComputePolicyRequest setComputePolicyId(String computePolicyId) { + this.computePolicyId = computePolicyId; + return this; + } + + public String getComputePolicyId() { + return computePolicyId; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + DeleteComputePolicyRequest that = (DeleteComputePolicyRequest) o; + return Objects.equals(computePolicyId, that.computePolicyId); + } + + @Override + public int hashCode() { + return Objects.hash(computePolicyId); + } + + @Override + public String toString() { + return new ToStringer(DeleteComputePolicyRequest.class) + .add("computePolicyId", computePolicyId) + .toString(); + } +} diff --git a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/compute/GetComputePolicyRequest.java b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/compute/GetComputePolicyRequest.java new file mode 100644 index 000000000..0b59d5a4a --- /dev/null +++ b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/compute/GetComputePolicyRequest.java @@ -0,0 +1,43 @@ +// Code generated from OpenAPI specs by Databricks SDK Generator. DO NOT EDIT. + +package com.databricks.sdk.service.compute; + +import com.databricks.sdk.support.Generated; +import com.databricks.sdk.support.ToStringer; +import com.fasterxml.jackson.annotation.JsonIgnore; +import java.util.Objects; + +@Generated +public class GetComputePolicyRequest { + /** The ID of the compute policy to retrieve. */ + @JsonIgnore private String computePolicyId; + + public GetComputePolicyRequest setComputePolicyId(String computePolicyId) { + this.computePolicyId = computePolicyId; + return this; + } + + public String getComputePolicyId() { + return computePolicyId; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + GetComputePolicyRequest that = (GetComputePolicyRequest) o; + return Objects.equals(computePolicyId, that.computePolicyId); + } + + @Override + public int hashCode() { + return Objects.hash(computePolicyId); + } + + @Override + public String toString() { + return new ToStringer(GetComputePolicyRequest.class) + .add("computePolicyId", computePolicyId) + .toString(); + } +} diff --git a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/compute/NodeType.java b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/compute/NodeType.java index 04178573b..a5d77dcf4 100644 --- a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/compute/NodeType.java +++ b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/compute/NodeType.java @@ -40,8 +40,8 @@ public class NodeType { private Boolean isDeprecated; /** - * AWS specific, whether this instance supports encryption in transit, used for hipaa and pci - * workloads. + * Whether this node type supports encryption in transit, which matters for workloads that need + * it, such as hipaa and pci. Always true on GCP; on AWS and Azure it depends on the node type. */ @JsonProperty("is_encrypted_in_transit") private Boolean isEncryptedInTransit; diff --git a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/compute/ServerlessComputeServiceAPI.java b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/compute/ServerlessComputeServiceAPI.java index b9a09d92a..780313277 100644 --- a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/compute/ServerlessComputeServiceAPI.java +++ b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/compute/ServerlessComputeServiceAPI.java @@ -24,6 +24,32 @@ public ServerlessComputeServiceAPI(ServerlessComputeServiceService mock) { impl = mock; } + /** Creates a custom compute policy in the workspace. */ + public ComputePolicy createComputePolicy(CreateComputePolicyRequest request) { + return impl.createComputePolicy(request); + } + + public void deleteComputePolicy(String computePolicyId) { + deleteComputePolicy(new DeleteComputePolicyRequest().setComputePolicyId(computePolicyId)); + } + + /** + * Deletes a custom compute policy in the workspace. Default (system-provisioned) policies cannot + * be deleted. + */ + public void deleteComputePolicy(DeleteComputePolicyRequest request) { + impl.deleteComputePolicy(request); + } + + public ComputePolicy getComputePolicy(String computePolicyId) { + return getComputePolicy(new GetComputePolicyRequest().setComputePolicyId(computePolicyId)); + } + + /** Retrieves a compute policy by its ID. */ + public ComputePolicy getComputePolicy(GetComputePolicyRequest request) { + return impl.getComputePolicy(request); + } + /** * Lists Interactive serverless computes that the caller can use or manage. Results are returned * in an unspecified order. @@ -60,6 +86,15 @@ public Iterable listComputePolicies(ListComputePoliciesRequest re }); } + /** + * Updates a custom compute policy in the workspace. The display_name and allowed_compute_products + * are mutable; use update_mask to control which fields change. Default (system-provisioned) + * policies cannot be updated. + */ + public ComputePolicy updateComputePolicy(UpdateComputePolicyRequest request) { + return impl.updateComputePolicy(request); + } + public ServerlessComputeServiceService impl() { return impl; } diff --git a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/compute/ServerlessComputeServiceImpl.java b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/compute/ServerlessComputeServiceImpl.java index c056b67ab..f01223fe9 100644 --- a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/compute/ServerlessComputeServiceImpl.java +++ b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/compute/ServerlessComputeServiceImpl.java @@ -16,6 +16,58 @@ public ServerlessComputeServiceImpl(ApiClient apiClient) { this.apiClient = apiClient; } + @Override + public ComputePolicy createComputePolicy(CreateComputePolicyRequest request) { + String path = "/api/2.0/policies/compute"; + try { + Request req = new Request("POST", path, apiClient.serialize(request.getComputePolicy())); + + 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, ComputePolicy.class); + } catch (IOException e) { + throw new DatabricksException("IO error: " + e.getMessage(), e); + } + } + + @Override + public void deleteComputePolicy(DeleteComputePolicyRequest request) { + String path = String.format("/api/2.0/policies/compute/%s", request.getComputePolicyId()); + try { + Request req = new Request("DELETE", path); + + ApiClient.setQuery(req, request); + req.withHeader("Accept", "application/json"); + if (apiClient.workspaceId() != null) { + req.withHeader("X-Databricks-Workspace-Id", apiClient.workspaceId()); + } + apiClient.execute(req, Void.class); + } catch (IOException e) { + throw new DatabricksException("IO error: " + e.getMessage(), e); + } + } + + @Override + public ComputePolicy getComputePolicy(GetComputePolicyRequest request) { + String path = String.format("/api/2.0/policies/compute/%s", request.getComputePolicyId()); + try { + Request req = new Request("GET", path); + + ApiClient.setQuery(req, request); + req.withHeader("Accept", "application/json"); + if (apiClient.workspaceId() != null) { + req.withHeader("X-Databricks-Workspace-Id", apiClient.workspaceId()); + } + return apiClient.execute(req, ComputePolicy.class); + } catch (IOException e) { + throw new DatabricksException("IO error: " + e.getMessage(), e); + } + } + @Override public ListServerlessComputesResponse list(ListServerlessComputesRequest request) { String path = "/api/2.0/serverless-compute"; @@ -49,4 +101,22 @@ public ListComputePoliciesResponse listComputePolicies(ListComputePoliciesReques throw new DatabricksException("IO error: " + e.getMessage(), e); } } + + @Override + public ComputePolicy updateComputePolicy(UpdateComputePolicyRequest request) { + String path = String.format("/api/2.0/policies/compute/%s", request.getComputePolicyId()); + try { + Request req = new Request("PATCH", path, apiClient.serialize(request.getComputePolicy())); + + 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, ComputePolicy.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/compute/ServerlessComputeServiceService.java b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/compute/ServerlessComputeServiceService.java index 38f98adda..362a490ee 100644 --- a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/compute/ServerlessComputeServiceService.java +++ b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/compute/ServerlessComputeServiceService.java @@ -12,6 +12,18 @@ */ @Generated public interface ServerlessComputeServiceService { + /** Creates a custom compute policy in the workspace. */ + ComputePolicy createComputePolicy(CreateComputePolicyRequest createComputePolicyRequest); + + /** + * Deletes a custom compute policy in the workspace. Default (system-provisioned) policies cannot + * be deleted. + */ + void deleteComputePolicy(DeleteComputePolicyRequest deleteComputePolicyRequest); + + /** Retrieves a compute policy by its ID. */ + ComputePolicy getComputePolicy(GetComputePolicyRequest getComputePolicyRequest); + /** * Lists Interactive serverless computes that the caller can use or manage. Results are returned * in an unspecified order. @@ -24,4 +36,11 @@ public interface ServerlessComputeServiceService { */ ListComputePoliciesResponse listComputePolicies( ListComputePoliciesRequest listComputePoliciesRequest); + + /** + * Updates a custom compute policy in the workspace. The display_name and allowed_compute_products + * are mutable; use update_mask to control which fields change. Default (system-provisioned) + * policies cannot be updated. + */ + ComputePolicy updateComputePolicy(UpdateComputePolicyRequest updateComputePolicyRequest); } diff --git a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/compute/UpdateComputePolicyRequest.java b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/compute/UpdateComputePolicyRequest.java new file mode 100644 index 000000000..13756b74e --- /dev/null +++ b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/compute/UpdateComputePolicyRequest.java @@ -0,0 +1,87 @@ +// Code generated from OpenAPI specs by Databricks SDK Generator. DO NOT EDIT. + +package com.databricks.sdk.service.compute; + +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 com.google.protobuf.FieldMask; +import java.util.Objects; + +@Generated +public class UpdateComputePolicyRequest { + /** + * The compute policy to update. `compute_policy.compute_policy_id` identifies which policy to + * update; only the fields named in `update_mask` are applied. + */ + @JsonProperty("compute_policy") + private ComputePolicy computePolicy; + + /** The unique identifier of the compute policy (UUID). Server-assigned on create. */ + @JsonIgnore private String computePolicyId; + + /** + * Fields to update, relative to `compute_policy`. Must contain at least one path; the supported + * paths are `display_name` and `allowed_compute_products`. Supplied product arms replace their + * constraints and omitted products remain unchanged. An empty arm clears that product's limits; + * an absent or empty products object is invalid. Removing a product requires its delete API. + * Nested masks and wildcards are unsupported. `display_name` cannot be cleared: if it is in the + * mask it must be non-empty. + */ + @JsonIgnore + @QueryParam("update_mask") + private FieldMask updateMask; + + public UpdateComputePolicyRequest setComputePolicy(ComputePolicy computePolicy) { + this.computePolicy = computePolicy; + return this; + } + + public ComputePolicy getComputePolicy() { + return computePolicy; + } + + public UpdateComputePolicyRequest setComputePolicyId(String computePolicyId) { + this.computePolicyId = computePolicyId; + return this; + } + + public String getComputePolicyId() { + return computePolicyId; + } + + public UpdateComputePolicyRequest setUpdateMask(FieldMask updateMask) { + this.updateMask = updateMask; + return this; + } + + public FieldMask getUpdateMask() { + return updateMask; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + UpdateComputePolicyRequest that = (UpdateComputePolicyRequest) o; + return Objects.equals(computePolicy, that.computePolicy) + && Objects.equals(computePolicyId, that.computePolicyId) + && Objects.equals(updateMask, that.updateMask); + } + + @Override + public int hashCode() { + return Objects.hash(computePolicy, computePolicyId, updateMask); + } + + @Override + public String toString() { + return new ToStringer(UpdateComputePolicyRequest.class) + .add("computePolicy", computePolicy) + .add("computePolicyId", computePolicyId) + .add("updateMask", updateMask) + .toString(); + } +} diff --git a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/dataclassification/DataClassificationAPI.java b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/dataclassification/DataClassificationAPI.java index 23126ee4f..958d57327 100644 --- a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/dataclassification/DataClassificationAPI.java +++ b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/dataclassification/DataClassificationAPI.java @@ -62,6 +62,20 @@ public CatalogConfig getCatalogConfig(GetCatalogConfigRequest request) { return impl.getCatalogConfig(request); } + /** + * Rescan the tables in a catalog's Data Classification scope that changed since their last scan. + * + *

The rescan uses the catalog's current classifiers and follows its config (schema selection) + * and SKIP tags. Tables with no commits since their last scan are skipped. Views and tables + * without a Delta commit history keep their regular rescan schedule. The call returns once the + * rescan is scheduled; scanning runs in the background. If a scan of the catalog is running, the + * call cancels it and starts a new run. - Data Classification must be enabled for the catalog. - + * The call must come from the workspace where Data Classification was enabled. + */ + public RescanCatalogResponse rescanCatalog(RescanCatalogRequest request) { + return impl.rescanCatalog(request); + } + /** * Update the Data Classification configuration for a catalog. * diff --git a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/dataclassification/DataClassificationImpl.java b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/dataclassification/DataClassificationImpl.java index 37039f7c4..c948eb6ef 100644 --- a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/dataclassification/DataClassificationImpl.java +++ b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/dataclassification/DataClassificationImpl.java @@ -68,6 +68,24 @@ public CatalogConfig getCatalogConfig(GetCatalogConfigRequest request) { } } + @Override + public RescanCatalogResponse rescanCatalog(RescanCatalogRequest request) { + String path = String.format("/api/data-classification/v1/%s/rescan", request.getName()); + try { + Request req = new Request("POST", path, apiClient.serialize(request)); + + 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, RescanCatalogResponse.class); + } catch (IOException e) { + throw new DatabricksException("IO error: " + e.getMessage(), e); + } + } + @Override public CatalogConfig updateCatalogConfig(UpdateCatalogConfigRequest request) { String path = String.format("/api/data-classification/v1/%s", request.getName()); diff --git a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/dataclassification/DataClassificationService.java b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/dataclassification/DataClassificationService.java index 43b0b95bb..32ec08317 100644 --- a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/dataclassification/DataClassificationService.java +++ b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/dataclassification/DataClassificationService.java @@ -35,6 +35,18 @@ public interface DataClassificationService { /** Get the Data Classification configuration for a catalog. */ CatalogConfig getCatalogConfig(GetCatalogConfigRequest getCatalogConfigRequest); + /** + * Rescan the tables in a catalog's Data Classification scope that changed since their last scan. + * + *

The rescan uses the catalog's current classifiers and follows its config (schema selection) + * and SKIP tags. Tables with no commits since their last scan are skipped. Views and tables + * without a Delta commit history keep their regular rescan schedule. The call returns once the + * rescan is scheduled; scanning runs in the background. If a scan of the catalog is running, the + * call cancels it and starts a new run. - Data Classification must be enabled for the catalog. - + * The call must come from the workspace where Data Classification was enabled. + */ + RescanCatalogResponse rescanCatalog(RescanCatalogRequest rescanCatalogRequest); + /** * Update the Data Classification configuration for a catalog. * diff --git a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/dataclassification/RescanCatalogRequest.java b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/dataclassification/RescanCatalogRequest.java new file mode 100644 index 000000000..e742f5b36 --- /dev/null +++ b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/dataclassification/RescanCatalogRequest.java @@ -0,0 +1,42 @@ +// Code generated from OpenAPI specs by Databricks SDK Generator. DO NOT EDIT. + +package com.databricks.sdk.service.dataclassification; + +import com.databricks.sdk.support.Generated; +import com.databricks.sdk.support.ToStringer; +import com.fasterxml.jackson.annotation.JsonIgnore; +import java.util.Objects; + +/** Request to rescan a catalog that has Data Classification enabled. */ +@Generated +public class RescanCatalogRequest { + /** Resource name of the catalog, in the format: catalogs/{catalog_name}. */ + @JsonIgnore private String name; + + public RescanCatalogRequest setName(String name) { + this.name = name; + return this; + } + + public String getName() { + return name; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + RescanCatalogRequest that = (RescanCatalogRequest) o; + return Objects.equals(name, that.name); + } + + @Override + public int hashCode() { + return Objects.hash(name); + } + + @Override + public String toString() { + return new ToStringer(RescanCatalogRequest.class).add("name", name).toString(); + } +} diff --git a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/dataclassification/RescanCatalogResponse.java b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/dataclassification/RescanCatalogResponse.java new file mode 100644 index 000000000..ab5722e74 --- /dev/null +++ b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/dataclassification/RescanCatalogResponse.java @@ -0,0 +1,29 @@ +// Code generated from OpenAPI specs by Databricks SDK Generator. DO NOT EDIT. + +package com.databricks.sdk.service.dataclassification; + +import com.databricks.sdk.support.Generated; +import com.databricks.sdk.support.ToStringer; +import java.util.Objects; + +/** Response for RescanCatalog. Empty for now; a named message lets later versions add fields. */ +@Generated +public class RescanCatalogResponse { + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + return true; + } + + @Override + public int hashCode() { + return Objects.hash(); + } + + @Override + public String toString() { + return new ToStringer(RescanCatalogResponse.class).toString(); + } +} diff --git a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/environments/DefaultWorkspaceBaseEnvironment.java b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/environments/DefaultWorkspaceBaseEnvironment.java index 1f3dfe7be..b42ec3a32 100644 --- a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/environments/DefaultWorkspaceBaseEnvironment.java +++ b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/environments/DefaultWorkspaceBaseEnvironment.java @@ -10,7 +10,8 @@ /** * A singleton resource representing the default workspace base environment configuration. This * resource contains the workspace base environments that are used as defaults for serverless - * notebooks and jobs in the workspace, for both CPU and GPU compute types. + * notebooks and jobs in the workspace, for both CPU and GPU compute types. Each default can + * reference a Databricks-provided base environment or a base environment created in the workspace. * *

When cpu_workspace_base_environment or gpu_workspace_base_environment is unset, new serverless * notebooks for that compute type use the Databricks Standard base environment: the latest stable diff --git a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/genieagents/UpdateGenieAgentRequest.java b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/genieagents/UpdateGenieAgentRequest.java index 6572254b2..dc299f85e 100644 --- a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/genieagents/UpdateGenieAgentRequest.java +++ b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/genieagents/UpdateGenieAgentRequest.java @@ -40,7 +40,11 @@ public class UpdateGenieAgentRequest { *

A field named in the mask takes the value from `genie_agent`, even when it is unset there: * an unset `description` is cleared; an unset `display_name`, `warehouse_id`, or `definition` is * rejected with INVALID_PARAMETER_VALUE; an unset `parent_path` is cleared without moving the - * Genie Agent. `definition` is replaced as a whole; paths within it are not supported. + * Genie Agent. `definition` is replaced as a whole. + * + *

The one supported path inside `definition` is `definition.data_sources.sub_agents`, and only + * alongside `definition`. Naming it makes the sub-agent list exact, so an empty list detaches + * every sub-agent. Without it, including with `*`, an empty list keeps them. * *

The special value `*` replaces the whole Genie Agent, as if every updatable field were * named. It must be the only path in the mask. Prefer naming fields explicitly: with `*`, any diff --git a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/iamv2/AccountIamV2API.java b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/iamv2/AccountIamV2API.java index d5745383d..2271d4ffe 100644 --- a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/iamv2/AccountIamV2API.java +++ b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/iamv2/AccountIamV2API.java @@ -209,6 +209,17 @@ public ExternalGroup getExternalGroup(String name) { * Gets a group by its ID in your identity provider (IdP) and syncs its name and parent groups * from your IdP. If the group isn't in your account yet, it's added. Requires automatic identity * management. If your account has group visibility filters, the group must match them. + * + *

To control how fresh the synced data is, send a `Cache-Control` request header: + * + *

- `no-cache` syncs from your IdP before the call returns. - `max-age=, max-stale=0` syncs + * from your IdP before the call returns if the last sync is more than `` seconds old. + * + *

Without the header, the call skips the sync if the last sync is within the default freshness + * window. Databricks might sync more often than you request. If you send `max-age` without + * `max-stale=0`, the call can return the data from the last sync and sync in the background. + * Databricks ignores other `Cache-Control` directives. A forced sync makes the call wait for your + * IdP. A forced sync on every call adds load on your IdP and can hit rate limits. */ public ExternalGroup getExternalGroup(GetExternalGroupRequest request) { return impl.getExternalGroup(request); @@ -222,6 +233,17 @@ public ExternalServicePrincipal getExternalServicePrincipal(String name) { * Gets a service principal by its ID in your identity provider (IdP) and syncs its details and * group memberships from your IdP. If the service principal isn't in your account yet, it's * added. Requires automatic identity management with Microsoft Entra ID as your IdP. + * + *

To control how fresh the synced data is, send a `Cache-Control` request header: + * + *

- `no-cache` syncs from your IdP before the call returns. - `max-age=, max-stale=0` syncs + * from your IdP before the call returns if the last sync is more than `` seconds old. + * + *

Without the header, the call skips the sync if the last sync is within the default freshness + * window. Databricks might sync more often than you request. If you send `max-age` without + * `max-stale=0`, the call can return the data from the last sync and sync in the background. + * Databricks ignores other `Cache-Control` directives. A forced sync makes the call wait for your + * IdP. A forced sync on every call adds load on your IdP and can hit rate limits. */ public ExternalServicePrincipal getExternalServicePrincipal( GetExternalServicePrincipalRequest request) { @@ -236,6 +258,17 @@ public ExternalUser getExternalUser(String name) { * Gets a user by their ID in your identity provider (IdP) and syncs their details and group * memberships from your IdP. If the user isn't in your account yet, they're added. Requires * automatic identity management. + * + *

To control how fresh the synced data is, send a `Cache-Control` request header: + * + *

- `no-cache` syncs from your IdP before the call returns. - `max-age=, max-stale=0` syncs + * from your IdP before the call returns if the last sync is more than `` seconds old. + * + *

Without the header, the call skips the sync if the last sync is within the default freshness + * window. Databricks might sync more often than you request. If you send `max-age` without + * `max-stale=0`, the call can return the data from the last sync and sync in the background. + * Databricks ignores other `Cache-Control` directives. A forced sync makes the call wait for your + * IdP. A forced sync on every call adds load on your IdP and can hit rate limits. */ public ExternalUser getExternalUser(GetExternalUserRequest request) { return impl.getExternalUser(request); @@ -325,7 +358,12 @@ public Iterable listDirectGroupMembers(String parent) { /** * Lists the direct members of a group, sorted by display name, with where each membership comes - * from. Members in your identity provider who haven't been added to Databricks aren't included. + * from. Results combine memberships added in Databricks (in the UI, through the API, or through + * SCIM provisioning) with, if automatic identity management is on and the group has an + * `external_id`, memberships from your identity provider (IdP). Only members in your Databricks + * account are returned: an IdP member of the group appears only if that user, service principal, + * or group has been added to Databricks. Nested groups aren't expanded. To get the full + * membership, list the direct members of each member group. */ public Iterable listDirectGroupMembers(ListDirectGroupMembersRequest request) { return Paginator.newTokenPagination( @@ -415,8 +453,12 @@ public ListTransitiveParentGroupsResponse listTransitiveParentGroups(String pare /** * Lists every group that a user, service principal, or group belongs to, directly or through - * other groups, sorted by Databricks ID. If automatic identity management is on, the principal's - * group memberships are synced from your identity provider first. + * other groups, sorted by Databricks ID. Results combine memberships from every source: added in + * the UI, through the API, through SCIM provisioning, or synced from your identity provider (IdP) + * by automatic identity management. Only groups that exist in your Databricks account are + * returned, not every group that the principal belongs to in your IdP. If automatic identity + * management is on, only the principal's own group memberships are refreshed from your IdP before + * the list is read. */ public ListTransitiveParentGroupsResponse listTransitiveParentGroups( ListTransitiveParentGroupsRequest request) { @@ -497,6 +539,17 @@ public Iterable listWorkspaceAssignments( * Gets a group by its ID in your identity provider (IdP) and syncs its name and parent groups * from your IdP. If the group isn't in your account yet, it's added. Requires automatic identity * management. If your account has group visibility filters, the group must match them. + * + *

To control how fresh the synced data is, send a `Cache-Control` request header: + * + *

- `no-cache` syncs from your IdP before the call returns. - `max-age=, max-stale=0` syncs + * from your IdP before the call returns if the last sync is more than `` seconds old. + * + *

Without the header, the call skips the sync if the last sync is within the default freshness + * window. Databricks might sync more often than you request. If you send `max-age` without + * `max-stale=0`, the call can return the data from the last sync and sync in the background. + * Databricks ignores other `Cache-Control` directives. A forced sync makes the call wait for your + * IdP. A forced sync on every call adds load on your IdP and can hit rate limits. */ public ResolveGroupResponse resolveGroup(ResolveGroupRequest request) { return impl.resolveGroup(request); @@ -506,6 +559,17 @@ public ResolveGroupResponse resolveGroup(ResolveGroupRequest request) { * Gets a service principal by its ID in your identity provider (IdP) and syncs its details and * group memberships from your IdP. If the service principal isn't in your account yet, it's * added. Requires automatic identity management with Microsoft Entra ID as your IdP. + * + *

To control how fresh the synced data is, send a `Cache-Control` request header: + * + *

- `no-cache` syncs from your IdP before the call returns. - `max-age=, max-stale=0` syncs + * from your IdP before the call returns if the last sync is more than `` seconds old. + * + *

Without the header, the call skips the sync if the last sync is within the default freshness + * window. Databricks might sync more often than you request. If you send `max-age` without + * `max-stale=0`, the call can return the data from the last sync and sync in the background. + * Databricks ignores other `Cache-Control` directives. A forced sync makes the call wait for your + * IdP. A forced sync on every call adds load on your IdP and can hit rate limits. */ public ResolveServicePrincipalResponse resolveServicePrincipal( ResolveServicePrincipalRequest request) { @@ -516,6 +580,17 @@ public ResolveServicePrincipalResponse resolveServicePrincipal( * Gets a user by their ID in your identity provider (IdP) and syncs their details and group * memberships from your IdP. If the user isn't in your account yet, they're added. Requires * automatic identity management. + * + *

To control how fresh the synced data is, send a `Cache-Control` request header: + * + *

- `no-cache` syncs from your IdP before the call returns. - `max-age=, max-stale=0` syncs + * from your IdP before the call returns if the last sync is more than `` seconds old. + * + *

Without the header, the call skips the sync if the last sync is within the default freshness + * window. Databricks might sync more often than you request. If you send `max-age` without + * `max-stale=0`, the call can return the data from the last sync and sync in the background. + * Databricks ignores other `Cache-Control` directives. A forced sync makes the call wait for your + * IdP. A forced sync on every call adds load on your IdP and can hit rate limits. */ public ResolveUserResponse resolveUser(ResolveUserRequest request) { return impl.resolveUser(request); diff --git a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/iamv2/AccountIamV2Service.java b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/iamv2/AccountIamV2Service.java index dec796c59..6f91d2a00 100644 --- a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/iamv2/AccountIamV2Service.java +++ b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/iamv2/AccountIamV2Service.java @@ -131,6 +131,17 @@ void deleteWorkspaceAssignmentDetail( * Gets a group by its ID in your identity provider (IdP) and syncs its name and parent groups * from your IdP. If the group isn't in your account yet, it's added. Requires automatic identity * management. If your account has group visibility filters, the group must match them. + * + *

To control how fresh the synced data is, send a `Cache-Control` request header: + * + *

- `no-cache` syncs from your IdP before the call returns. - `max-age=, max-stale=0` syncs + * from your IdP before the call returns if the last sync is more than `` seconds old. + * + *

Without the header, the call skips the sync if the last sync is within the default freshness + * window. Databricks might sync more often than you request. If you send `max-age` without + * `max-stale=0`, the call can return the data from the last sync and sync in the background. + * Databricks ignores other `Cache-Control` directives. A forced sync makes the call wait for your + * IdP. A forced sync on every call adds load on your IdP and can hit rate limits. */ ExternalGroup getExternalGroup(GetExternalGroupRequest getExternalGroupRequest); @@ -138,6 +149,17 @@ void deleteWorkspaceAssignmentDetail( * Gets a service principal by its ID in your identity provider (IdP) and syncs its details and * group memberships from your IdP. If the service principal isn't in your account yet, it's * added. Requires automatic identity management with Microsoft Entra ID as your IdP. + * + *

To control how fresh the synced data is, send a `Cache-Control` request header: + * + *

- `no-cache` syncs from your IdP before the call returns. - `max-age=, max-stale=0` syncs + * from your IdP before the call returns if the last sync is more than `` seconds old. + * + *

Without the header, the call skips the sync if the last sync is within the default freshness + * window. Databricks might sync more often than you request. If you send `max-age` without + * `max-stale=0`, the call can return the data from the last sync and sync in the background. + * Databricks ignores other `Cache-Control` directives. A forced sync makes the call wait for your + * IdP. A forced sync on every call adds load on your IdP and can hit rate limits. */ ExternalServicePrincipal getExternalServicePrincipal( GetExternalServicePrincipalRequest getExternalServicePrincipalRequest); @@ -146,6 +168,17 @@ ExternalServicePrincipal getExternalServicePrincipal( * Gets a user by their ID in your identity provider (IdP) and syncs their details and group * memberships from your IdP. If the user isn't in your account yet, they're added. Requires * automatic identity management. + * + *

To control how fresh the synced data is, send a `Cache-Control` request header: + * + *

- `no-cache` syncs from your IdP before the call returns. - `max-age=, max-stale=0` syncs + * from your IdP before the call returns if the last sync is more than `` seconds old. + * + *

Without the header, the call skips the sync if the last sync is within the default freshness + * window. Databricks might sync more often than you request. If you send `max-age` without + * `max-stale=0`, the call can return the data from the last sync and sync in the background. + * Databricks ignores other `Cache-Control` directives. A forced sync makes the call wait for your + * IdP. A forced sync on every call adds load on your IdP and can hit rate limits. */ ExternalUser getExternalUser(GetExternalUserRequest getExternalUserRequest); @@ -185,7 +218,12 @@ WorkspaceAssignmentDetail getWorkspaceAssignmentDetail( /** * Lists the direct members of a group, sorted by display name, with where each membership comes - * from. Members in your identity provider who haven't been added to Databricks aren't included. + * from. Results combine memberships added in Databricks (in the UI, through the API, or through + * SCIM provisioning) with, if automatic identity management is on and the group has an + * `external_id`, memberships from your identity provider (IdP). Only members in your Databricks + * account are returned: an IdP member of the group appears only if that user, service principal, + * or group has been added to Databricks. Nested groups aren't expanded. To get the full + * membership, list the direct members of each member group. */ ListDirectGroupMembersResponse listDirectGroupMembers( ListDirectGroupMembersRequest listDirectGroupMembersRequest); @@ -212,8 +250,12 @@ ListServicePrincipalsResponse listServicePrincipals( /** * Lists every group that a user, service principal, or group belongs to, directly or through - * other groups, sorted by Databricks ID. If automatic identity management is on, the principal's - * group memberships are synced from your identity provider first. + * other groups, sorted by Databricks ID. Results combine memberships from every source: added in + * the UI, through the API, through SCIM provisioning, or synced from your identity provider (IdP) + * by automatic identity management. Only groups that exist in your Databricks account are + * returned, not every group that the principal belongs to in your IdP. If automatic identity + * management is on, only the principal's own group memberships are refreshed from your IdP before + * the list is read. */ ListTransitiveParentGroupsResponse listTransitiveParentGroups( ListTransitiveParentGroupsRequest listTransitiveParentGroupsRequest); @@ -243,6 +285,17 @@ ListWorkspaceAssignmentsResponse listWorkspaceAssignments( * Gets a group by its ID in your identity provider (IdP) and syncs its name and parent groups * from your IdP. If the group isn't in your account yet, it's added. Requires automatic identity * management. If your account has group visibility filters, the group must match them. + * + *

To control how fresh the synced data is, send a `Cache-Control` request header: + * + *

- `no-cache` syncs from your IdP before the call returns. - `max-age=, max-stale=0` syncs + * from your IdP before the call returns if the last sync is more than `` seconds old. + * + *

Without the header, the call skips the sync if the last sync is within the default freshness + * window. Databricks might sync more often than you request. If you send `max-age` without + * `max-stale=0`, the call can return the data from the last sync and sync in the background. + * Databricks ignores other `Cache-Control` directives. A forced sync makes the call wait for your + * IdP. A forced sync on every call adds load on your IdP and can hit rate limits. */ ResolveGroupResponse resolveGroup(ResolveGroupRequest resolveGroupRequest); @@ -250,6 +303,17 @@ ListWorkspaceAssignmentsResponse listWorkspaceAssignments( * Gets a service principal by its ID in your identity provider (IdP) and syncs its details and * group memberships from your IdP. If the service principal isn't in your account yet, it's * added. Requires automatic identity management with Microsoft Entra ID as your IdP. + * + *

To control how fresh the synced data is, send a `Cache-Control` request header: + * + *

- `no-cache` syncs from your IdP before the call returns. - `max-age=, max-stale=0` syncs + * from your IdP before the call returns if the last sync is more than `` seconds old. + * + *

Without the header, the call skips the sync if the last sync is within the default freshness + * window. Databricks might sync more often than you request. If you send `max-age` without + * `max-stale=0`, the call can return the data from the last sync and sync in the background. + * Databricks ignores other `Cache-Control` directives. A forced sync makes the call wait for your + * IdP. A forced sync on every call adds load on your IdP and can hit rate limits. */ ResolveServicePrincipalResponse resolveServicePrincipal( ResolveServicePrincipalRequest resolveServicePrincipalRequest); @@ -258,6 +322,17 @@ ResolveServicePrincipalResponse resolveServicePrincipal( * Gets a user by their ID in your identity provider (IdP) and syncs their details and group * memberships from your IdP. If the user isn't in your account yet, they're added. Requires * automatic identity management. + * + *

To control how fresh the synced data is, send a `Cache-Control` request header: + * + *

- `no-cache` syncs from your IdP before the call returns. - `max-age=, max-stale=0` syncs + * from your IdP before the call returns if the last sync is more than `` seconds old. + * + *

Without the header, the call skips the sync if the last sync is within the default freshness + * window. Databricks might sync more often than you request. If you send `max-age` without + * `max-stale=0`, the call can return the data from the last sync and sync in the background. + * Databricks ignores other `Cache-Control` directives. A forced sync makes the call wait for your + * IdP. A forced sync on every call adds load on your IdP and can hit rate limits. */ ResolveUserResponse resolveUser(ResolveUserRequest resolveUserRequest); diff --git a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/iamv2/DirectGroupMember.java b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/iamv2/DirectGroupMember.java index 6e7787550..21e64c935 100644 --- a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/iamv2/DirectGroupMember.java +++ b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/iamv2/DirectGroupMember.java @@ -8,8 +8,8 @@ import java.util.Objects; /** - * A user, service principal, or group that's a direct member of a group. To address a membership, - * put its resource name in the URL: `GET + * A user, service principal, or group in your Databricks account that's a direct member of a group. + * To address a membership, put its resource name in the URL: `GET * /api/2.0/identity/accounts/{account_id}/groups/{group_id}/direct-members/{principal_id}` in * account APIs, or `GET /api/2.0/identity/groups/{group_id}/direct-members/{principal_id}` in * workspace APIs. @@ -28,7 +28,10 @@ public class DirectGroupMember { @JsonProperty("group_id") private Long groupId; - /** Where the membership comes from. */ + /** + * Where the membership comes from: added in Databricks (in the UI, through the API, or through + * SCIM provisioning), or synced from your IdP by automatic identity management. + */ @JsonProperty("membership_source") private GroupMembershipSource membershipSource; diff --git a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/iamv2/TransitiveParentGroup.java b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/iamv2/TransitiveParentGroup.java index 4fccb24df..653530baf 100644 --- a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/iamv2/TransitiveParentGroup.java +++ b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/iamv2/TransitiveParentGroup.java @@ -8,10 +8,10 @@ import java.util.Objects; /** - * A group that a principal belongs to, either directly or through another group. To list a - * principal's parent groups, put the principal's resource name in the URL: `GET - * /api/2.0/identity/accounts/{account_id}/principals/{principal_id}/transitive-parent-groups` in - * account APIs, or `GET /api/2.0/identity/principals/{principal_id}/transitive-parent-groups` in + * A group in your Databricks account that a principal belongs to, either directly or through + * another group. To list a principal's parent groups, put the principal's resource name in the URL: + * `GET /api/2.0/identity/accounts/{account_id}/principals/{principal_id}/transitive-parent-groups` + * in account APIs, or `GET /api/2.0/identity/principals/{principal_id}/transitive-parent-groups` in * workspace APIs. */ @Generated diff --git a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/iamv2/WorkspaceIamV2API.java b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/iamv2/WorkspaceIamV2API.java index 9334546c5..2b7bba87d 100644 --- a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/iamv2/WorkspaceIamV2API.java +++ b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/iamv2/WorkspaceIamV2API.java @@ -193,6 +193,17 @@ public ExternalGroup getExternalGroupProxy(String name) { * from your IdP. If the group isn't in the account that contains this workspace yet, it's added. * Requires automatic identity management. If your account has group visibility filters, the group * must match them. + * + *

To control how fresh the synced data is, send a `Cache-Control` request header: + * + *

- `no-cache` syncs from your IdP before the call returns. - `max-age=, max-stale=0` syncs + * from your IdP before the call returns if the last sync is more than `` seconds old. + * + *

Without the header, the call skips the sync if the last sync is within the default freshness + * window. Databricks might sync more often than you request. If you send `max-age` without + * `max-stale=0`, the call can return the data from the last sync and sync in the background. + * Databricks ignores other `Cache-Control` directives. A forced sync makes the call wait for your + * IdP. A forced sync on every call adds load on your IdP and can hit rate limits. */ public ExternalGroup getExternalGroupProxy(GetExternalGroupProxyRequest request) { return impl.getExternalGroupProxy(request); @@ -208,6 +219,17 @@ public ExternalServicePrincipal getExternalServicePrincipalProxy(String name) { * group memberships from your IdP. If the service principal isn't in the account that contains * this workspace yet, it's added. Requires automatic identity management with Microsoft Entra ID * as your IdP. + * + *

To control how fresh the synced data is, send a `Cache-Control` request header: + * + *

- `no-cache` syncs from your IdP before the call returns. - `max-age=, max-stale=0` syncs + * from your IdP before the call returns if the last sync is more than `` seconds old. + * + *

Without the header, the call skips the sync if the last sync is within the default freshness + * window. Databricks might sync more often than you request. If you send `max-age` without + * `max-stale=0`, the call can return the data from the last sync and sync in the background. + * Databricks ignores other `Cache-Control` directives. A forced sync makes the call wait for your + * IdP. A forced sync on every call adds load on your IdP and can hit rate limits. */ public ExternalServicePrincipal getExternalServicePrincipalProxy( GetExternalServicePrincipalProxyRequest request) { @@ -222,6 +244,17 @@ public ExternalUser getExternalUserProxy(String name) { * Gets a user by their ID in your identity provider (IdP) and syncs their details and group * memberships from your IdP. If the user isn't in the account that contains this workspace yet, * they're added. Requires automatic identity management. + * + *

To control how fresh the synced data is, send a `Cache-Control` request header: + * + *

- `no-cache` syncs from your IdP before the call returns. - `max-age=, max-stale=0` syncs + * from your IdP before the call returns if the last sync is more than `` seconds old. + * + *

Without the header, the call skips the sync if the last sync is within the default freshness + * window. Databricks might sync more often than you request. If you send `max-age` without + * `max-stale=0`, the call can return the data from the last sync and sync in the background. + * Databricks ignores other `Cache-Control` directives. A forced sync makes the call wait for your + * IdP. A forced sync on every call adds load on your IdP and can hit rate limits. */ public ExternalUser getExternalUserProxy(GetExternalUserProxyRequest request) { return impl.getExternalUserProxy(request); @@ -313,8 +346,13 @@ public Iterable listDirectGroupMembersProxy(String parent) { /** * Lists the direct members of a group in the account that contains this workspace, sorted by - * display name, with where each membership comes from. Members in your identity provider who - * haven't been added to Databricks aren't included. + * display name, with where each membership comes from. Results combine memberships added in + * Databricks (in the UI, through the API, or through SCIM provisioning) with, if automatic + * identity management is on and the group has an `external_id`, memberships from your identity + * provider (IdP). Only members in your Databricks account are returned: an IdP member of the + * group appears only if that user, service principal, or group has been added to Databricks. + * Nested groups aren't expanded. To get the full membership, list the direct members of each + * member group. */ public Iterable listDirectGroupMembersProxy( ListDirectGroupMembersProxyRequest request) { @@ -376,9 +414,12 @@ public ListTransitiveParentGroupsResponse listTransitiveParentGroupsProxy(String /** * Lists every group that a user, service principal, or group belongs to, directly or through - * other groups, in the account that contains this workspace. Results are sorted by Databricks ID. - * If automatic identity management is on, the principal's group memberships are synced from your - * identity provider first. + * other groups, in the account that contains this workspace. Results are sorted by Databricks ID + * and combine memberships from every source: added in the UI, through the API, through SCIM + * provisioning, or synced from your identity provider (IdP) by automatic identity management. + * Only groups that exist in your Databricks account are returned, not every group that the + * principal belongs to in your IdP. If automatic identity management is on, only the principal's + * own group memberships are refreshed from your IdP before the list is read. */ public ListTransitiveParentGroupsResponse listTransitiveParentGroupsProxy( ListTransitiveParentGroupsProxyRequest request) { @@ -447,6 +488,17 @@ public Iterable listWorkspaceAssignmentsProxy( * from your IdP. If the group isn't in the account that contains this workspace yet, it's added. * Requires automatic identity management. If your account has group visibility filters, the group * must match them. + * + *

To control how fresh the synced data is, send a `Cache-Control` request header: + * + *

- `no-cache` syncs from your IdP before the call returns. - `max-age=, max-stale=0` syncs + * from your IdP before the call returns if the last sync is more than `` seconds old. + * + *

Without the header, the call skips the sync if the last sync is within the default freshness + * window. Databricks might sync more often than you request. If you send `max-age` without + * `max-stale=0`, the call can return the data from the last sync and sync in the background. + * Databricks ignores other `Cache-Control` directives. A forced sync makes the call wait for your + * IdP. A forced sync on every call adds load on your IdP and can hit rate limits. */ public ResolveGroupResponse resolveGroupProxy(ResolveGroupProxyRequest request) { return impl.resolveGroupProxy(request); @@ -457,6 +509,17 @@ public ResolveGroupResponse resolveGroupProxy(ResolveGroupProxyRequest request) * group memberships from your IdP. If the service principal isn't in the account that contains * this workspace yet, it's added. Requires automatic identity management with Microsoft Entra ID * as your IdP. + * + *

To control how fresh the synced data is, send a `Cache-Control` request header: + * + *

- `no-cache` syncs from your IdP before the call returns. - `max-age=, max-stale=0` syncs + * from your IdP before the call returns if the last sync is more than `` seconds old. + * + *

Without the header, the call skips the sync if the last sync is within the default freshness + * window. Databricks might sync more often than you request. If you send `max-age` without + * `max-stale=0`, the call can return the data from the last sync and sync in the background. + * Databricks ignores other `Cache-Control` directives. A forced sync makes the call wait for your + * IdP. A forced sync on every call adds load on your IdP and can hit rate limits. */ public ResolveServicePrincipalResponse resolveServicePrincipalProxy( ResolveServicePrincipalProxyRequest request) { @@ -467,6 +530,17 @@ public ResolveServicePrincipalResponse resolveServicePrincipalProxy( * Gets a user by their ID in your identity provider (IdP) and syncs their details and group * memberships from your IdP. If the user isn't in the account that contains this workspace yet, * they're added. Requires automatic identity management. + * + *

To control how fresh the synced data is, send a `Cache-Control` request header: + * + *

- `no-cache` syncs from your IdP before the call returns. - `max-age=, max-stale=0` syncs + * from your IdP before the call returns if the last sync is more than `` seconds old. + * + *

Without the header, the call skips the sync if the last sync is within the default freshness + * window. Databricks might sync more often than you request. If you send `max-age` without + * `max-stale=0`, the call can return the data from the last sync and sync in the background. + * Databricks ignores other `Cache-Control` directives. A forced sync makes the call wait for your + * IdP. A forced sync on every call adds load on your IdP and can hit rate limits. */ public ResolveUserResponse resolveUserProxy(ResolveUserProxyRequest request) { return impl.resolveUserProxy(request); diff --git a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/iamv2/WorkspaceIamV2Service.java b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/iamv2/WorkspaceIamV2Service.java index c613fd90a..36c87d664 100644 --- a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/iamv2/WorkspaceIamV2Service.java +++ b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/iamv2/WorkspaceIamV2Service.java @@ -125,6 +125,17 @@ DirectGroupMember getDirectGroupMemberProxy( * from your IdP. If the group isn't in the account that contains this workspace yet, it's added. * Requires automatic identity management. If your account has group visibility filters, the group * must match them. + * + *

To control how fresh the synced data is, send a `Cache-Control` request header: + * + *

- `no-cache` syncs from your IdP before the call returns. - `max-age=, max-stale=0` syncs + * from your IdP before the call returns if the last sync is more than `` seconds old. + * + *

Without the header, the call skips the sync if the last sync is within the default freshness + * window. Databricks might sync more often than you request. If you send `max-age` without + * `max-stale=0`, the call can return the data from the last sync and sync in the background. + * Databricks ignores other `Cache-Control` directives. A forced sync makes the call wait for your + * IdP. A forced sync on every call adds load on your IdP and can hit rate limits. */ ExternalGroup getExternalGroupProxy(GetExternalGroupProxyRequest getExternalGroupProxyRequest); @@ -133,6 +144,17 @@ DirectGroupMember getDirectGroupMemberProxy( * group memberships from your IdP. If the service principal isn't in the account that contains * this workspace yet, it's added. Requires automatic identity management with Microsoft Entra ID * as your IdP. + * + *

To control how fresh the synced data is, send a `Cache-Control` request header: + * + *

- `no-cache` syncs from your IdP before the call returns. - `max-age=, max-stale=0` syncs + * from your IdP before the call returns if the last sync is more than `` seconds old. + * + *

Without the header, the call skips the sync if the last sync is within the default freshness + * window. Databricks might sync more often than you request. If you send `max-age` without + * `max-stale=0`, the call can return the data from the last sync and sync in the background. + * Databricks ignores other `Cache-Control` directives. A forced sync makes the call wait for your + * IdP. A forced sync on every call adds load on your IdP and can hit rate limits. */ ExternalServicePrincipal getExternalServicePrincipalProxy( GetExternalServicePrincipalProxyRequest getExternalServicePrincipalProxyRequest); @@ -141,6 +163,17 @@ ExternalServicePrincipal getExternalServicePrincipalProxy( * Gets a user by their ID in your identity provider (IdP) and syncs their details and group * memberships from your IdP. If the user isn't in the account that contains this workspace yet, * they're added. Requires automatic identity management. + * + *

To control how fresh the synced data is, send a `Cache-Control` request header: + * + *

- `no-cache` syncs from your IdP before the call returns. - `max-age=, max-stale=0` syncs + * from your IdP before the call returns if the last sync is more than `` seconds old. + * + *

Without the header, the call skips the sync if the last sync is within the default freshness + * window. Databricks might sync more often than you request. If you send `max-age` without + * `max-stale=0`, the call can return the data from the last sync and sync in the background. + * Databricks ignores other `Cache-Control` directives. A forced sync makes the call wait for your + * IdP. A forced sync on every call adds load on your IdP and can hit rate limits. */ ExternalUser getExternalUserProxy(GetExternalUserProxyRequest getExternalUserProxyRequest); @@ -184,8 +217,13 @@ WorkspaceIdentityDetail getWorkspaceIdentityDetail( /** * Lists the direct members of a group in the account that contains this workspace, sorted by - * display name, with where each membership comes from. Members in your identity provider who - * haven't been added to Databricks aren't included. + * display name, with where each membership comes from. Results combine memberships added in + * Databricks (in the UI, through the API, or through SCIM provisioning) with, if automatic + * identity management is on and the group has an `external_id`, memberships from your identity + * provider (IdP). Only members in your Databricks account are returned: an IdP member of the + * group appears only if that user, service principal, or group has been added to Databricks. + * Nested groups aren't expanded. To get the full membership, list the direct members of each + * member group. */ ListDirectGroupMembersResponse listDirectGroupMembersProxy( ListDirectGroupMembersProxyRequest listDirectGroupMembersProxyRequest); @@ -206,9 +244,12 @@ ListServicePrincipalsResponse listServicePrincipalsProxy( /** * Lists every group that a user, service principal, or group belongs to, directly or through - * other groups, in the account that contains this workspace. Results are sorted by Databricks ID. - * If automatic identity management is on, the principal's group memberships are synced from your - * identity provider first. + * other groups, in the account that contains this workspace. Results are sorted by Databricks ID + * and combine memberships from every source: added in the UI, through the API, through SCIM + * provisioning, or synced from your identity provider (IdP) by automatic identity management. + * Only groups that exist in your Databricks account are returned, not every group that the + * principal belongs to in your IdP. If automatic identity management is on, only the principal's + * own group memberships are refreshed from your IdP before the list is read. */ ListTransitiveParentGroupsResponse listTransitiveParentGroupsProxy( ListTransitiveParentGroupsProxyRequest listTransitiveParentGroupsProxyRequest); @@ -239,6 +280,17 @@ ListWorkspaceAssignmentsResponse listWorkspaceAssignmentsProxy( * from your IdP. If the group isn't in the account that contains this workspace yet, it's added. * Requires automatic identity management. If your account has group visibility filters, the group * must match them. + * + *

To control how fresh the synced data is, send a `Cache-Control` request header: + * + *

- `no-cache` syncs from your IdP before the call returns. - `max-age=, max-stale=0` syncs + * from your IdP before the call returns if the last sync is more than `` seconds old. + * + *

Without the header, the call skips the sync if the last sync is within the default freshness + * window. Databricks might sync more often than you request. If you send `max-age` without + * `max-stale=0`, the call can return the data from the last sync and sync in the background. + * Databricks ignores other `Cache-Control` directives. A forced sync makes the call wait for your + * IdP. A forced sync on every call adds load on your IdP and can hit rate limits. */ ResolveGroupResponse resolveGroupProxy(ResolveGroupProxyRequest resolveGroupProxyRequest); @@ -247,6 +299,17 @@ ListWorkspaceAssignmentsResponse listWorkspaceAssignmentsProxy( * group memberships from your IdP. If the service principal isn't in the account that contains * this workspace yet, it's added. Requires automatic identity management with Microsoft Entra ID * as your IdP. + * + *

To control how fresh the synced data is, send a `Cache-Control` request header: + * + *

- `no-cache` syncs from your IdP before the call returns. - `max-age=, max-stale=0` syncs + * from your IdP before the call returns if the last sync is more than `` seconds old. + * + *

Without the header, the call skips the sync if the last sync is within the default freshness + * window. Databricks might sync more often than you request. If you send `max-age` without + * `max-stale=0`, the call can return the data from the last sync and sync in the background. + * Databricks ignores other `Cache-Control` directives. A forced sync makes the call wait for your + * IdP. A forced sync on every call adds load on your IdP and can hit rate limits. */ ResolveServicePrincipalResponse resolveServicePrincipalProxy( ResolveServicePrincipalProxyRequest resolveServicePrincipalProxyRequest); @@ -255,6 +318,17 @@ ResolveServicePrincipalResponse resolveServicePrincipalProxy( * Gets a user by their ID in your identity provider (IdP) and syncs their details and group * memberships from your IdP. If the user isn't in the account that contains this workspace yet, * they're added. Requires automatic identity management. + * + *

To control how fresh the synced data is, send a `Cache-Control` request header: + * + *

- `no-cache` syncs from your IdP before the call returns. - `max-age=, max-stale=0` syncs + * from your IdP before the call returns if the last sync is more than `` seconds old. + * + *

Without the header, the call skips the sync if the last sync is within the default freshness + * window. Databricks might sync more often than you request. If you send `max-age` without + * `max-stale=0`, the call can return the data from the last sync and sync in the background. + * Databricks ignores other `Cache-Control` directives. A forced sync makes the call wait for your + * IdP. A forced sync on every call adds load on your IdP and can hit rate limits. */ ResolveUserResponse resolveUserProxy(ResolveUserProxyRequest resolveUserProxyRequest); diff --git a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/jobs/AiRuntimeTaskPriorityClass.java b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/jobs/AiRuntimeTaskPriorityClass.java index e48124f76..cd5518f52 100644 --- a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/jobs/AiRuntimeTaskPriorityClass.java +++ b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/jobs/AiRuntimeTaskPriorityClass.java @@ -12,4 +12,5 @@ public enum AiRuntimeTaskPriorityClass { HIGH, NORMAL, + PREEMPTABLE, } diff --git a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/jobs/PythonOperatorTask.java b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/jobs/PythonOperatorTask.java index 7ff96f0f8..6a31beb97 100644 --- a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/jobs/PythonOperatorTask.java +++ b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/jobs/PythonOperatorTask.java @@ -17,7 +17,7 @@ public class PythonOperatorTask { @JsonProperty("main") private String main; - /** An ordered list of task parameters. TODO(JOBS-30885): Add limits for parameters. */ + /** An ordered list of task parameters. */ @JsonProperty("parameters") private Collection parameters; diff --git a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/lakewatch/CloudWatchLogsEnvelope.java b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/lakewatch/CloudWatchLogsEnvelope.java index cfa4535f7..fae2cfb5f 100644 --- a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/lakewatch/CloudWatchLogsEnvelope.java +++ b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/lakewatch/CloudWatchLogsEnvelope.java @@ -15,7 +15,8 @@ public class CloudWatchLogsEnvelope { /** * Whether to keep the envelope's `owner`, `logGroup`, and `logStream` values in the - * `data.lw_header` field of each unwrapped row. Must be set explicitly to `true` or `false`. + * `data.lw_header` field of each unwrapped row whose message is a JSON object. A message that is + * any other JSON value is kept without the field. Must be set explicitly to `true` or `false`. */ @JsonProperty("header_retention") private Boolean headerRetention; diff --git a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/lakewatch/Rule.java b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/lakewatch/Rule.java index 8711e357d..94b174901 100644 --- a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/lakewatch/Rule.java +++ b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/lakewatch/Rule.java @@ -183,7 +183,10 @@ public class Rule { @JsonProperty("runbook") private String runbook; - /** When the rule executes. */ + /** + * When the rule executes. Required for scheduled rules. A streaming rule accepts only `enabled`, + * and an omitted schedule means enabled. + */ @JsonProperty("schedule") private RuleSchedule schedule; @@ -203,6 +206,13 @@ public class Rule { @JsonProperty("status") private ResourceStatus status; + /** + * Native streaming rule input: one source table filtered by one stateless row predicate. + * Permanent field number; must not be renumbered. + */ + @JsonProperty("streaming") + private RuleInputStreaming streaming; + /** If set, this rule's signals do not open new alerts until the given time. */ @JsonProperty("suppress_until_time") private Timestamp suppressUntilTime; @@ -516,6 +526,15 @@ public ResourceStatus getStatus() { return status; } + public Rule setStreaming(RuleInputStreaming streaming) { + this.streaming = streaming; + return this; + } + + public RuleInputStreaming getStreaming() { + return streaming; + } + public Rule setSuppressUntilTime(Timestamp suppressUntilTime) { this.suppressUntilTime = suppressUntilTime; return this; @@ -598,6 +617,7 @@ public boolean equals(Object o) { && Objects.equals(schemaName, that.schemaName) && Objects.equals(severity, that.severity) && Objects.equals(status, that.status) + && Objects.equals(streaming, that.streaming) && Objects.equals(suppressUntilTime, that.suppressUntilTime) && Objects.equals(timerange, that.timerange) && Objects.equals(updateTime, that.updateTime) @@ -640,6 +660,7 @@ public int hashCode() { schemaName, severity, status, + streaming, suppressUntilTime, timerange, updateTime, @@ -682,6 +703,7 @@ public String toString() { .add("schemaName", schemaName) .add("severity", severity) .add("status", status) + .add("streaming", streaming) .add("suppressUntilTime", suppressUntilTime) .add("timerange", timerange) .add("updateTime", updateTime) diff --git a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/lakewatch/RuleInputStreaming.java b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/lakewatch/RuleInputStreaming.java new file mode 100644 index 000000000..66524b5be --- /dev/null +++ b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/lakewatch/RuleInputStreaming.java @@ -0,0 +1,62 @@ +// Code generated from OpenAPI specs by Databricks SDK Generator. DO NOT EDIT. + +package com.databricks.sdk.service.lakewatch; + +import com.databricks.sdk.support.Generated; +import com.databricks.sdk.support.ToStringer; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Objects; + +/** + * Native V2 streaming input for a detection rule: one Delta table and one stateless row predicate. + * The complete source row is preserved as event context. + */ +@Generated +public class RuleInputStreaming { + /** Row predicate that selects matching rows. */ + @JsonProperty("predicate") + private StreamingPredicate predicate; + + /** Source table whose rows are evaluated. */ + @JsonProperty("source") + private StreamingSource source; + + public RuleInputStreaming setPredicate(StreamingPredicate predicate) { + this.predicate = predicate; + return this; + } + + public StreamingPredicate getPredicate() { + return predicate; + } + + public RuleInputStreaming setSource(StreamingSource source) { + this.source = source; + return this; + } + + public StreamingSource getSource() { + return source; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + RuleInputStreaming that = (RuleInputStreaming) o; + return Objects.equals(predicate, that.predicate) && Objects.equals(source, that.source); + } + + @Override + public int hashCode() { + return Objects.hash(predicate, source); + } + + @Override + public String toString() { + return new ToStringer(RuleInputStreaming.class) + .add("predicate", predicate) + .add("source", source) + .toString(); + } +} diff --git a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/lakewatch/StreamingPredicate.java b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/lakewatch/StreamingPredicate.java new file mode 100644 index 000000000..2ee0dc1a2 --- /dev/null +++ b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/lakewatch/StreamingPredicate.java @@ -0,0 +1,46 @@ +// Code generated from OpenAPI specs by Databricks SDK Generator. DO NOT EDIT. + +package com.databricks.sdk.service.lakewatch; + +import com.databricks.sdk.support.Generated; +import com.databricks.sdk.support.ToStringer; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Objects; + +/** Stateless row predicate for a streaming detection rule. */ +@Generated +public class StreamingPredicate { + /** + * A SQL expression suitable for a WHERE clause, not a SELECT query. Evaluated per input row; only + * stateless, row-local expressions are accepted. + */ + @JsonProperty("expression") + private String expression; + + public StreamingPredicate setExpression(String expression) { + this.expression = expression; + return this; + } + + public String getExpression() { + return expression; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + StreamingPredicate that = (StreamingPredicate) o; + return Objects.equals(expression, that.expression); + } + + @Override + public int hashCode() { + return Objects.hash(expression); + } + + @Override + public String toString() { + return new ToStringer(StreamingPredicate.class).add("expression", expression).toString(); + } +} diff --git a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/lakewatch/StreamingSource.java b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/lakewatch/StreamingSource.java new file mode 100644 index 000000000..3599c8e5e --- /dev/null +++ b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/lakewatch/StreamingSource.java @@ -0,0 +1,43 @@ +// Code generated from OpenAPI specs by Databricks SDK Generator. DO NOT EDIT. + +package com.databricks.sdk.service.lakewatch; + +import com.databricks.sdk.support.Generated; +import com.databricks.sdk.support.ToStringer; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Objects; + +/** Source Delta table for a streaming detection rule. */ +@Generated +public class StreamingSource { + /** Fully-qualified Unity Catalog table in `catalog.schema.table` form. */ + @JsonProperty("table") + private String table; + + public StreamingSource setTable(String table) { + this.table = table; + return this; + } + + public String getTable() { + return table; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + StreamingSource that = (StreamingSource) o; + return Objects.equals(table, that.table); + } + + @Override + public int hashCode() { + return Objects.hash(table); + } + + @Override + public String toString() { + return new ToStringer(StreamingSource.class).add("table", table).toString(); + } +} diff --git a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/ml/EntityBinding.java b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/ml/EntityBinding.java new file mode 100644 index 000000000..cb37aefca --- /dev/null +++ b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/ml/EntityBinding.java @@ -0,0 +1,56 @@ +// Code generated from OpenAPI specs by Databricks SDK Generator. DO NOT EDIT. + +package com.databricks.sdk.service.ml; + +import com.databricks.sdk.support.Generated; +import com.databricks.sdk.support.ToStringer; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Objects; + +/** Binds one entity column of a Lookup's upstream Feature to the input that supplies its values. */ +@Generated +public class EntityBinding { + /** Specifies the entity column of the upstream Feature. */ + @JsonProperty("entity") + private String entity; + + /** Specifies where the column's values come from. */ + @JsonProperty("input") + private InputReference input; + + public EntityBinding setEntity(String entity) { + this.entity = entity; + return this; + } + + public String getEntity() { + return entity; + } + + public EntityBinding setInput(InputReference input) { + this.input = input; + return this; + } + + public InputReference getInput() { + return input; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + EntityBinding that = (EntityBinding) o; + return Objects.equals(entity, that.entity) && Objects.equals(input, that.input); + } + + @Override + public int hashCode() { + return Objects.hash(entity, input); + } + + @Override + public String toString() { + return new ToStringer(EntityBinding.class).add("entity", entity).add("input", input).toString(); + } +} diff --git a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/ml/Function.java b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/ml/Function.java index 5c3d24691..6095d7c2e 100644 --- a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/ml/Function.java +++ b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/ml/Function.java @@ -30,6 +30,14 @@ public class Function { @JsonProperty("function_type") private FunctionFunctionType functionType; + /** Looks up an upstream Feature using entity values from other Features or the request. */ + @JsonProperty("lookup") + private Lookup lookup; + + /** Selects the secondary key values an upstream Feature has stored for the request's entity. */ + @JsonProperty("secondary_keys") + private SecondaryKeys secondaryKeys; + public Function setAggregationFunction(AggregationFunction aggregationFunction) { this.aggregationFunction = aggregationFunction; return this; @@ -75,6 +83,24 @@ public FunctionFunctionType getFunctionType() { return functionType; } + public Function setLookup(Lookup lookup) { + this.lookup = lookup; + return this; + } + + public Lookup getLookup() { + return lookup; + } + + public Function setSecondaryKeys(SecondaryKeys secondaryKeys) { + this.secondaryKeys = secondaryKeys; + return this; + } + + public SecondaryKeys getSecondaryKeys() { + return secondaryKeys; + } + @Override public boolean equals(Object o) { if (this == o) return true; @@ -84,13 +110,21 @@ public boolean equals(Object o) { && Objects.equals(columnSelection, that.columnSelection) && Objects.equals(customUdf, that.customUdf) && Objects.equals(extraParameters, that.extraParameters) - && Objects.equals(functionType, that.functionType); + && Objects.equals(functionType, that.functionType) + && Objects.equals(lookup, that.lookup) + && Objects.equals(secondaryKeys, that.secondaryKeys); } @Override public int hashCode() { return Objects.hash( - aggregationFunction, columnSelection, customUdf, extraParameters, functionType); + aggregationFunction, + columnSelection, + customUdf, + extraParameters, + functionType, + lookup, + secondaryKeys); } @Override @@ -101,6 +135,8 @@ public String toString() { .add("customUdf", customUdf) .add("extraParameters", extraParameters) .add("functionType", functionType) + .add("lookup", lookup) + .add("secondaryKeys", secondaryKeys) .toString(); } } diff --git a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/ml/InputReference.java b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/ml/InputReference.java new file mode 100644 index 000000000..3891d5ec6 --- /dev/null +++ b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/ml/InputReference.java @@ -0,0 +1,46 @@ +// Code generated from OpenAPI specs by Databricks SDK Generator. DO NOT EDIT. + +package com.databricks.sdk.service.ml; + +import com.databricks.sdk.support.Generated; +import com.databricks.sdk.support.ToStringer; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Objects; + +/** + * The input that supplies a value. A value from the request comes from a Feature whose source is a + * RequestSource. + */ +@Generated +public class InputReference { + /** Specifies another Feature whose output supplies the value. */ + @JsonProperty("feature") + private FeatureReference feature; + + public InputReference setFeature(FeatureReference feature) { + this.feature = feature; + return this; + } + + public FeatureReference getFeature() { + return feature; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + InputReference that = (InputReference) o; + return Objects.equals(feature, that.feature); + } + + @Override + public int hashCode() { + return Objects.hash(feature); + } + + @Override + public String toString() { + return new ToStringer(InputReference.class).add("feature", feature).toString(); + } +} diff --git a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/ml/Issue.java b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/ml/Issue.java index ad0b28168..b50aca71f 100644 --- a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/ml/Issue.java +++ b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/ml/Issue.java @@ -53,7 +53,8 @@ public class Issue { /** * Additional details about the Issue, such as how issue detection observed it. Not a stable * contract: keys and values can change without notice, so clients must tolerate unknown and - * missing keys. At most 20 entries, with keys of at most 64 UTF-8 bytes. + * missing keys. At most 20 entries, with keys of at most 64 UTF-8 bytes. Values are at most 256 + * UTF-8 bytes, except recent_affected_trace_ids (4 KiB) and suggested_fix (16 KiB). */ @JsonProperty("metadata") private Map metadata; diff --git a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/ml/Lookup.java b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/ml/Lookup.java new file mode 100644 index 000000000..1504973e6 --- /dev/null +++ b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/ml/Lookup.java @@ -0,0 +1,72 @@ +// Code generated from OpenAPI specs by Databricks SDK Generator. DO NOT EDIT. + +package com.databricks.sdk.service.ml; + +import com.databricks.sdk.support.Generated; +import com.databricks.sdk.support.ToStringer; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Collection; +import java.util.Objects; + +/** + * Looks up an upstream Feature using entity values bound from other Features or from the request. + * When a binding is an array, such as the output of a SecondaryKeys Feature, returns one value per + * position as an array aligned with that binding. The Feature's source must be a FeatureViewSource + * that includes `feature` and every Feature referenced in `entities`. Currently, exactly one entity + * must be bound to a Feature: a SecondaryKeys Feature whose key has the same name as that entity. + * Its target can be `feature` or another Feature. Every other entity must be bound to a request + * column of the same name. Names are compared without struct prefixes, so `user_id` matches + * `value.user_id`. A FeatureSpec can't also look up `feature` with all of its entities supplied. + */ +@Generated +public class Lookup { + /** + * One binding per entity column of the upstream Feature. Every entity column must be bound + * exactly once. + */ + @JsonProperty("entities") + private Collection entities; + + /** The upstream Feature to look up. */ + @JsonProperty("feature") + private FeatureReference feature; + + public Lookup setEntities(Collection entities) { + this.entities = entities; + return this; + } + + public Collection getEntities() { + return entities; + } + + public Lookup setFeature(FeatureReference feature) { + this.feature = feature; + return this; + } + + public FeatureReference getFeature() { + return feature; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + Lookup that = (Lookup) o; + return Objects.equals(entities, that.entities) && Objects.equals(feature, that.feature); + } + + @Override + public int hashCode() { + return Objects.hash(entities, feature); + } + + @Override + public String toString() { + return new ToStringer(Lookup.class) + .add("entities", entities) + .add("feature", feature) + .toString(); + } +} diff --git a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/ml/SecondaryKeys.java b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/ml/SecondaryKeys.java new file mode 100644 index 000000000..fa4c46589 --- /dev/null +++ b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/ml/SecondaryKeys.java @@ -0,0 +1,86 @@ +// Code generated from OpenAPI specs by Databricks SDK Generator. DO NOT EDIT. + +package com.databricks.sdk.service.ml; + +import com.databricks.sdk.support.Generated; +import com.databricks.sdk.support.ToStringer; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Objects; + +/** + * Returns the values of one entity column that an upstream Feature has stored for the request's + * other entity columns, as an array. For example, given a Feature with entities (user_id, ad_id), + * returns the ad_ids stored for the requested user_id. The Feature's source must be a + * FeatureViewSource that includes `feature`. + */ +@Generated +public class SecondaryKeys { + /** The upstream Feature whose stored keys are selected. */ + @JsonProperty("feature") + private FeatureReference feature; + + /** + * The entity column of the upstream Feature to return values for. It is not supplied by the + * request. + */ + @JsonProperty("key") + private String key; + + /** + * Maximum number of keys to return per entity, in primary key order. Must not exceed the + * workspace limit. + */ + @JsonProperty("max_keys") + private Long maxKeys; + + public SecondaryKeys setFeature(FeatureReference feature) { + this.feature = feature; + return this; + } + + public FeatureReference getFeature() { + return feature; + } + + public SecondaryKeys setKey(String key) { + this.key = key; + return this; + } + + public String getKey() { + return key; + } + + public SecondaryKeys setMaxKeys(Long maxKeys) { + this.maxKeys = maxKeys; + return this; + } + + public Long getMaxKeys() { + return maxKeys; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + SecondaryKeys that = (SecondaryKeys) o; + return Objects.equals(feature, that.feature) + && Objects.equals(key, that.key) + && Objects.equals(maxKeys, that.maxKeys); + } + + @Override + public int hashCode() { + return Objects.hash(feature, key, maxKeys); + } + + @Override + public String toString() { + return new ToStringer(SecondaryKeys.class) + .add("feature", feature) + .add("key", key) + .add("maxKeys", maxKeys) + .toString(); + } +} diff --git a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/pipelines/SchemaSpec.java b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/pipelines/SchemaSpec.java index d0d6eefbc..c78f756c0 100644 --- a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/pipelines/SchemaSpec.java +++ b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/pipelines/SchemaSpec.java @@ -19,7 +19,7 @@ public class SchemaSpec { /** * Required. Destination schema to store tables in. Tables with the same name as the source tables - * are created in this destination schema. The pipeline fails If a table with the same name + * are created in this destination schema. The pipeline fails if a table with the same name * already exists. */ @JsonProperty("destination_schema") diff --git a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/pipelines/Transformer.java b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/pipelines/Transformer.java index de9ceb7f3..4e729b56a 100644 --- a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/pipelines/Transformer.java +++ b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/pipelines/Transformer.java @@ -7,14 +7,17 @@ import com.fasterxml.jackson.annotation.JsonProperty; import java.util.Objects; -/** Specifies how to transform binary data into structured data. */ +/** + * One step that transforms a column: either decodes data into structured data (`format`) or + * reshapes an already-decoded column (`operation`). + */ @Generated public class Transformer { /** */ @JsonProperty("avro_options") private AvroTransformerOptions avroOptions; - /** Required: the wire format of the data. */ + /** The format to decode the input column from. */ @JsonProperty("format") private TransformerFormat format; diff --git a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/postgres/ProjectStatus.java b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/postgres/ProjectStatus.java index 04f9d55e1..87f247df2 100644 --- a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/postgres/ProjectStatus.java +++ b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/postgres/ProjectStatus.java @@ -24,6 +24,10 @@ public class ProjectStatus { @JsonProperty("compute_last_active_time") private Timestamp computeLastActiveTime; + /** The compute policy that is applied to the project. */ + @JsonProperty("compute_policy_id") + private String computePolicyId; + /** The effective custom tags associated with the project. */ @JsonProperty("custom_tags") private Collection customTags; @@ -91,6 +95,15 @@ public Timestamp getComputeLastActiveTime() { return computeLastActiveTime; } + public ProjectStatus setComputePolicyId(String computePolicyId) { + this.computePolicyId = computePolicyId; + return this; + } + + public String getComputePolicyId() { + return computePolicyId; + } + public ProjectStatus setCustomTags(Collection customTags) { this.customTags = customTags; return this; @@ -190,6 +203,7 @@ public boolean equals(Object o) { return Objects.equals(branchLogicalSizeLimitBytes, that.branchLogicalSizeLimitBytes) && Objects.equals(budgetPolicyId, that.budgetPolicyId) && Objects.equals(computeLastActiveTime, that.computeLastActiveTime) + && Objects.equals(computePolicyId, that.computePolicyId) && Objects.equals(customTags, that.customTags) && Objects.equals(defaultBranch, that.defaultBranch) && Objects.equals(defaultEndpointSettings, that.defaultEndpointSettings) @@ -208,6 +222,7 @@ public int hashCode() { branchLogicalSizeLimitBytes, budgetPolicyId, computeLastActiveTime, + computePolicyId, customTags, defaultBranch, defaultEndpointSettings, @@ -226,6 +241,7 @@ public String toString() { .add("branchLogicalSizeLimitBytes", branchLogicalSizeLimitBytes) .add("budgetPolicyId", budgetPolicyId) .add("computeLastActiveTime", computeLastActiveTime) + .add("computePolicyId", computePolicyId) .add("customTags", customTags) .add("defaultBranch", defaultBranch) .add("defaultEndpointSettings", defaultEndpointSettings) diff --git a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/sandbox/NetworkSpec.java b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/sandbox/NetworkSpec.java new file mode 100644 index 000000000..cc862aeff --- /dev/null +++ b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/sandbox/NetworkSpec.java @@ -0,0 +1,46 @@ +// Code generated from OpenAPI specs by Databricks SDK Generator. DO NOT EDIT. + +package com.databricks.sdk.service.sandbox; + +import com.databricks.sdk.support.Generated; +import com.databricks.sdk.support.ToStringer; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Objects; + +/** Network configuration for the sandbox. */ +@Generated +public class NetworkSpec { + /** + * Whether the sandbox can reach the public internet. Defaults to true. Control-plane, + * PrivateLink, and workspace/UC/Delta-shared storage stay reachable either way. + */ + @JsonProperty("internet_access") + private Boolean internetAccess; + + public NetworkSpec setInternetAccess(Boolean internetAccess) { + this.internetAccess = internetAccess; + return this; + } + + public Boolean getInternetAccess() { + return internetAccess; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + NetworkSpec that = (NetworkSpec) o; + return Objects.equals(internetAccess, that.internetAccess); + } + + @Override + public int hashCode() { + return Objects.hash(internetAccess); + } + + @Override + public String toString() { + return new ToStringer(NetworkSpec.class).add("internetAccess", internetAccess).toString(); + } +} diff --git a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/sandbox/SandboxSpec.java b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/sandbox/SandboxSpec.java index 761f428f3..b4e42f874 100644 --- a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/sandbox/SandboxSpec.java +++ b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/sandbox/SandboxSpec.java @@ -17,6 +17,10 @@ public class SandboxSpec { @JsonProperty("environment") private EnvironmentSpec environment; + /** Network configuration requested for the sandbox. */ + @JsonProperty("network") + private NetworkSpec network; + public SandboxSpec setCompute(ComputeSpec compute) { this.compute = compute; return this; @@ -35,17 +39,28 @@ public EnvironmentSpec getEnvironment() { return environment; } + public SandboxSpec setNetwork(NetworkSpec network) { + this.network = network; + return this; + } + + public NetworkSpec getNetwork() { + return network; + } + @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; SandboxSpec that = (SandboxSpec) o; - return Objects.equals(compute, that.compute) && Objects.equals(environment, that.environment); + return Objects.equals(compute, that.compute) + && Objects.equals(environment, that.environment) + && Objects.equals(network, that.network); } @Override public int hashCode() { - return Objects.hash(compute, environment); + return Objects.hash(compute, environment, network); } @Override @@ -53,6 +68,7 @@ public String toString() { return new ToStringer(SandboxSpec.class) .add("compute", compute) .add("environment", environment) + .add("network", network) .toString(); } } diff --git a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/settings/CreateOboTokenRequest.java b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/settings/CreateOboTokenRequest.java index c6b72946c..4362630f8 100644 --- a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/settings/CreateOboTokenRequest.java +++ b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/settings/CreateOboTokenRequest.java @@ -15,7 +15,10 @@ public class CreateOboTokenRequest { @JsonProperty("application_id") private String applicationId; - /** Whether to enable autoscoping for this token. */ + /** + * Whether to enable autoscoping for this token. `disable_autoscoping` supersedes this field and + * is the one read when both are set. + */ @JsonProperty("autoscope_enabled") private Boolean autoscopeEnabled; diff --git a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/settings/CreateTokenRequest.java b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/settings/CreateTokenRequest.java index d49184ce8..7450b0c9c 100644 --- a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/settings/CreateTokenRequest.java +++ b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/settings/CreateTokenRequest.java @@ -12,7 +12,8 @@ public class CreateTokenRequest { /** * Whether to enable autoscoping for this token. When true, the token will automatically collect - * inferred API path scopes as it is used. + * inferred API path scopes as it is used. `disable_autoscoping` supersedes this field and is the + * one read when both are set. */ @JsonProperty("autoscope_enabled") private Boolean autoscopeEnabled; diff --git a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/sharing/CreateShare.java b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/sharing/CreateShare.java index 012bc8f99..9f029b357 100644 --- a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/sharing/CreateShare.java +++ b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/sharing/CreateShare.java @@ -17,7 +17,11 @@ public class CreateShare { @JsonProperty("name") private String name; - /** Storage root URL for the share. */ + /** + * Cloud storage path, within an external location, under which the share stores the notebook + * files added to it. When unset, notebook files are stored under the metastore root storage + * location. + */ @JsonProperty("storage_root") private String storageRoot; diff --git a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/sharing/GetShareRequest.java b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/sharing/GetShareRequest.java index f60187aca..f451db5f3 100644 --- a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/sharing/GetShareRequest.java +++ b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/sharing/GetShareRequest.java @@ -10,7 +10,10 @@ @Generated public class GetShareRequest { - /** Query for data to include in the share. */ + /** + * Whether to include the share's data objects in the response. When false or omitted, the + * response omits `objects`. + */ @JsonIgnore @QueryParam("include_shared_data") private Boolean includeSharedData; diff --git a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/sharing/Partition.java b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/sharing/Partition.java index 20815ecc7..74ece2b23 100644 --- a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/sharing/Partition.java +++ b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/sharing/Partition.java @@ -10,7 +10,10 @@ @Generated public class Partition { - /** An array of partition values. */ + /** + * An array of partition values. A row belongs to the partition when it matches every value in the + * array, and each `name` must appear at most once in the array. + */ @JsonProperty("values") private Collection values; diff --git a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/sharing/PartitionValue.java b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/sharing/PartitionValue.java index ee7da25d1..7c7bb642b 100644 --- a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/sharing/PartitionValue.java +++ b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/sharing/PartitionValue.java @@ -13,7 +13,10 @@ public class PartitionValue { @JsonProperty("name") private String name; - /** The operator to apply for the value. */ + /** + * The operator to apply for the value. **EQUAL** matches the partition value exactly; **LIKE** + * matches it against a SQL `LIKE` pattern. + */ @JsonProperty("op") private PartitionValueOp op; diff --git a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/sharing/PermissionsChange.java b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/sharing/PermissionsChange.java index 4467ec7fd..d6e35637a 100644 --- a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/sharing/PermissionsChange.java +++ b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/sharing/PermissionsChange.java @@ -14,10 +14,7 @@ public class PermissionsChange { @JsonProperty("add") private Collection add; - /** - * The principal whose privileges we are changing. Only one of principal or principal_id should be - * specified, never both at the same time. - */ + /** The principal whose privileges we are changing. */ @JsonProperty("principal") private String principal; diff --git a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/sharing/PrivilegeAssignment.java b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/sharing/PrivilegeAssignment.java index c3e2fcfae..e6cd7395b 100644 --- a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/sharing/PrivilegeAssignment.java +++ b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/sharing/PrivilegeAssignment.java @@ -10,10 +10,7 @@ @Generated public class PrivilegeAssignment { - /** - * The principal (user email address or group name). For deleted principals, `principal` is empty - * while `principal_id` is populated. - */ + /** The principal (user email address or group name). */ @JsonProperty("principal") private String principal; diff --git a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/sharing/ShareInfo.java b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/sharing/ShareInfo.java index 36deca691..a4a8eacdf 100644 --- a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/sharing/ShareInfo.java +++ b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/sharing/ShareInfo.java @@ -8,6 +8,12 @@ import java.util.Collection; import java.util.Objects; +/** + * A share is a named collection of data and AI assets from a single Unity Catalog metastore that a + * provider makes available to recipients through Delta Sharing. A share is created empty; tables, + * views, volumes, models, notebook files, or whole schemas are added to it with **update**, and + * recipients are granted access to it through share permissions. + */ @Generated public class ShareInfo { /** User-provided free-form text description. */ @@ -34,11 +40,17 @@ public class ShareInfo { @JsonProperty("owner") private String owner; - /** Storage Location URL (full path) for the share. */ + /** + * Full storage path, derived from `storage_root`, where the share's notebook files are stored. + */ @JsonProperty("storage_location") private String storageLocation; - /** Storage root URL for the share. */ + /** + * Cloud storage path, within an external location, under which the share stores the notebook + * files added to it. When unset, notebook files are stored under the metastore root storage + * location. + */ @JsonProperty("storage_root") private String storageRoot; diff --git a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/sharing/SharedDataObject.java b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/sharing/SharedDataObject.java index 4d1d1452b..c4f86f501 100644 --- a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/sharing/SharedDataObject.java +++ b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/sharing/SharedDataObject.java @@ -18,7 +18,11 @@ public class SharedDataObject { @JsonProperty("added_by") private String addedBy; - /** Whether to enable cdf or indicate if cdf is enabled on the shared object. */ + /** + * Whether to share the table's change data feed (CDF) with recipients. Requires change data feed + * to be enabled on the source table, and implicitly enables history sharing. Only applies to + * tables. + */ @JsonProperty("cdf_enabled") private Boolean cdfEnabled; @@ -34,13 +38,18 @@ public class SharedDataObject { @JsonProperty("content") private String content; - /** The type of the data object. */ + /** + * The type of the data object. One of **TABLE**, **VIEW**, **MATERIALIZED_VIEW**, + * **STREAMING_TABLE**, **FOREIGN_TABLE**, **SCHEMA**, **VOLUME**, **MODEL**, **FUNCTION**, + * **FEATURE_SPEC**, or **NOTEBOOK_FILE**. Defaults to **TABLE** when omitted. + */ @JsonProperty("data_object_type") private SharedDataObjectDataObjectType dataObjectType; /** - * Whether to enable or disable sharing of data history. If not specified, the default is - * **DISABLED**. + * Whether to share the table's history, which lets recipients run time travel queries and + * streaming reads against it. When a **TABLE** is added without this field or `cdf_enabled`, + * history sharing is **ENABLED** by default; otherwise the default is **DISABLED**. */ @JsonProperty("history_data_sharing_status") private SharedDataObjectHistoryDataSharingStatus historyDataSharingStatus; @@ -48,12 +57,17 @@ public class SharedDataObject { /** * A fully qualified name that uniquely identifies a data object. For example, * a table's fully qualified name is in the format of - * `..`, + * `..
`, a schema's is `.`, a + * volume's, model's, or function's is `..`, and + * a notebook file's is its workspace path. */ @JsonProperty("name") private String name; - /** Array of partitions for the shared data. */ + /** + * Array of partitions for the shared data. Only rows that belong to at least one of the listed + * partitions are shared. Only applies to tables. + */ @JsonProperty("partitions") private Collection partitions; @@ -96,7 +110,11 @@ public class SharedDataObject { @JsonProperty("start_version") private Long startVersion; - /** One of: **ACTIVE**, **PERMISSION_DENIED**. */ + /** + * Sharing status of the data object. **ACTIVE** means the object is being shared with recipients + * without issues; **PERMISSION_DENIED** means the share owner has lost access to the object, so + * it is not being shared with recipients. + */ @JsonProperty("status") private SharedDataObjectStatus status; diff --git a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/sharing/SharedDataObjectUpdate.java b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/sharing/SharedDataObjectUpdate.java index 77e89e31c..50d767070 100644 --- a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/sharing/SharedDataObjectUpdate.java +++ b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/sharing/SharedDataObjectUpdate.java @@ -9,14 +9,15 @@ @Generated public class SharedDataObjectUpdate { - /** One of: **ADD**, **REMOVE**, **UPDATE**. */ + /** + * One of: **ADD**, **REMOVE**, **UPDATE**. **ADD** adds the data object to the share, **REMOVE** + * removes it, and **UPDATE** changes the properties of a data object that is already in the + * share. + */ @JsonProperty("action") private SharedDataObjectUpdateAction action; - /** - * The data object that is being added, removed, or updated. The maximum number update data - * objects allowed is a 100. - */ + /** The data object that is being added, removed, or updated. */ @JsonProperty("data_object") private SharedDataObject dataObject; diff --git a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/sharing/UpdateShare.java b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/sharing/UpdateShare.java index 088633347..eecc5f87d 100644 --- a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/sharing/UpdateShare.java +++ b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/sharing/UpdateShare.java @@ -26,11 +26,18 @@ public class UpdateShare { @JsonProperty("owner") private String owner; - /** Storage root URL for the share. */ + /** + * Cloud storage path, within an external location, under which the share stores the notebook + * files added to it. When unset, notebook files are stored under the metastore root storage + * location. + */ @JsonProperty("storage_root") private String storageRoot; - /** Array of shared data object updates. */ + /** + * Array of shared data object updates. The server limits how many updates a single request can + * contain. + */ @JsonProperty("updates") private Collection updates; diff --git a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/sql/Alert.java b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/sql/Alert.java index 7f916cf5f..5b48185a2 100644 --- a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/sql/Alert.java +++ b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/sql/Alert.java @@ -7,9 +7,18 @@ import com.fasterxml.jackson.annotation.JsonProperty; import java.util.Objects; +/** + * A legacy Databricks SQL alert. An alert runs a saved query, compares a column of the result + * against a threshold, and notifies its subscribers when the condition is met. See + * https://docs.databricks.com/aws/en/sql/user/alerts/legacy for details. + */ @Generated public class Alert { - /** Trigger conditions of the alert. */ + /** + * Condition that triggers the alert: a column of the query result, a comparison operator, and a + * threshold value. The value in the first row of the column is evaluated; aggregations are not + * supported through this API. + */ @JsonProperty("condition") private AlertCondition condition; @@ -18,23 +27,23 @@ public class Alert { private String createTime; /** - * Custom body of alert notification, if it exists. See [here] for custom templating instructions. - * - *

[here]: https://docs.databricks.com/sql/user/alerts/index.html + * Custom body of the alert notification. It can use the template variables and HTML described at + * https://docs.databricks.com/aws/en/sql/user/alerts/legacy. If omitted, the default notification + * body is used. */ @JsonProperty("custom_body") private String customBody; /** - * Custom subject of alert notification, if it exists. This can include email subject entries and - * Slack notification headers, for example. See [here] for custom templating instructions. - * - *

[here]: https://docs.databricks.com/sql/user/alerts/index.html + * Custom subject of the alert notification, used as the email subject or the Slack message + * header. It can use the template variables described at + * https://docs.databricks.com/aws/en/sql/user/alerts/legacy. If omitted, the default subject is + * used. */ @JsonProperty("custom_subject") private String customSubject; - /** The display name of the alert. */ + /** Display name of the alert, shown in list views and notifications. It must not be empty. */ @JsonProperty("display_name") private String displayName; @@ -42,11 +51,14 @@ public class Alert { @JsonProperty("id") private String id; - /** The workspace state of the alert. Used for tracking trashed status. */ + /** Lifecycle state of the alert: `ACTIVE`, or `TRASHED` after it has been moved to the trash. */ @JsonProperty("lifecycle_state") private LifecycleState lifecycleState; - /** Whether to notify alert subscribers when alert returns back to normal. */ + /** + * Whether to notify subscribers when the alert state changes from `TRIGGERED` back to `OK`. + * Defaults to true. + */ @JsonProperty("notify_on_ok") private Boolean notifyOnOk; @@ -54,24 +66,32 @@ public class Alert { @JsonProperty("owner_user_name") private String ownerUserName; - /** The workspace path of the folder containing the alert. */ + /** + * Workspace path of the folder containing the alert. Defaults to the creator's home folder when + * omitted on create. It cannot be changed after creation. + */ @JsonProperty("parent_path") private String parentPath; - /** UUID of the query attached to the alert. */ + /** + * UUID of the saved query whose result the alert evaluates. The caller must have permission to + * view the query. + */ @JsonProperty("query_id") private String queryId; /** - * Number of seconds an alert must wait after being triggered to rearm itself. After rearming, it - * can be triggered again. If 0 or not specified, the alert will not be triggered again. + * Number of seconds the alert waits after a notification before it can notify again while its + * state stays `TRIGGERED`. If 0 or not specified, the alert notifies once when its state changes + * to `TRIGGERED` and does not notify again until its state has changed. */ @JsonProperty("seconds_to_retrigger") private Long secondsToRetrigger; /** - * Current state of the alert's trigger status. This field is set to UNKNOWN if the alert has not - * yet been evaluated or ran into an error during the last evaluation. + * Current state of the alert's trigger status: `TRIGGERED` if the condition was met on the last + * evaluation, `OK` if it was not, and `UNKNOWN` if the alert has not yet been evaluated or ran + * into an error during the last evaluation. */ @JsonProperty("state") private AlertState state; diff --git a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/sql/AlertCondition.java b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/sql/AlertCondition.java index 2d3b45fde..0d314dd9a 100644 --- a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/sql/AlertCondition.java +++ b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/sql/AlertCondition.java @@ -9,19 +9,29 @@ @Generated public class AlertCondition { - /** Alert state if result is empty. */ + /** State the alert takes when the query returns no rows. Defaults to `UNKNOWN` when not set. */ @JsonProperty("empty_result_state") private AlertState emptyResultState; - /** Operator used for comparison in alert evaluation. */ + /** + * Comparison operator applied between the operand column value and the threshold. The alert is + * triggered when the comparison is true. `IS_NULL` triggers when the column value is null; a + * threshold must still be supplied but its value is ignored. + */ @JsonProperty("op") private AlertOperator op; - /** Name of the column from the query result to use for comparison in alert evaluation. */ + /** + * Left-hand side of the comparison. Through this API it must be a `column` naming a column of the + * query result; the value in the first row of that column is compared against the threshold. + */ @JsonProperty("operand") private AlertConditionOperand operand; - /** Threshold value used for comparison in alert evaluation. */ + /** + * Right-hand side of the comparison. Through this API it must be a fixed `value` whose type + * matches the operand column. + */ @JsonProperty("threshold") private AlertConditionThreshold threshold; diff --git a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/sql/AlertConditionOperand.java b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/sql/AlertConditionOperand.java index 904df5af4..bf23c2fbd 100644 --- a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/sql/AlertConditionOperand.java +++ b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/sql/AlertConditionOperand.java @@ -9,7 +9,7 @@ @Generated public class AlertConditionOperand { - /** */ + /** A column of the query result. Used for the `operand` of a condition. */ @JsonProperty("column") private AlertOperandColumn column; diff --git a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/sql/AlertConditionThreshold.java b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/sql/AlertConditionThreshold.java index bd487e3ae..20009a16b 100644 --- a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/sql/AlertConditionThreshold.java +++ b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/sql/AlertConditionThreshold.java @@ -9,7 +9,7 @@ @Generated public class AlertConditionThreshold { - /** */ + /** A fixed value. Used for the `threshold` of a condition. */ @JsonProperty("value") private AlertOperandValue value; diff --git a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/sql/AlertOperandColumn.java b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/sql/AlertOperandColumn.java index a39870d04..51ea1f74d 100644 --- a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/sql/AlertOperandColumn.java +++ b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/sql/AlertOperandColumn.java @@ -9,7 +9,7 @@ @Generated public class AlertOperandColumn { - /** */ + /** Name of the column in the query result. */ @JsonProperty("name") private String name; diff --git a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/sql/AlertOperandValue.java b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/sql/AlertOperandValue.java index 21ed4e435..8419b3c6d 100644 --- a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/sql/AlertOperandValue.java +++ b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/sql/AlertOperandValue.java @@ -9,15 +9,15 @@ @Generated public class AlertOperandValue { - /** */ + /** Boolean threshold, for boolean columns. */ @JsonProperty("bool_value") private Boolean boolValue; - /** */ + /** Numeric threshold, for numeric columns. */ @JsonProperty("double_value") private Double doubleValue; - /** */ + /** String threshold, for string or timestamp columns. */ @JsonProperty("string_value") private String stringValue; diff --git a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/sql/AlertsAPI.java b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/sql/AlertsAPI.java index a41e2c455..6f500401b 100644 --- a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/sql/AlertsAPI.java +++ b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/sql/AlertsAPI.java @@ -75,7 +75,11 @@ public Iterable list(ListAlertsRequest request) { }); } - /** Updates an alert. */ + /** + * Updates the fields of an alert named in `update_mask`. Changing `owner_user_name` requires + * workspace admin privileges; changing any other field requires CAN MANAGE permission on the + * alert. + */ public Alert update(UpdateAlertRequest request) { return impl.update(request); } diff --git a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/sql/AlertsService.java b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/sql/AlertsService.java index 0ff794d3e..d30f35874 100644 --- a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/sql/AlertsService.java +++ b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/sql/AlertsService.java @@ -35,6 +35,10 @@ public interface AlertsService { */ ListAlertsResponse list(ListAlertsRequest listAlertsRequest); - /** Updates an alert. */ + /** + * Updates the fields of an alert named in `update_mask`. Changing `owner_user_name` requires + * workspace admin privileges; changing any other field requires CAN MANAGE permission on the + * alert. + */ Alert update(UpdateAlertRequest updateAlertRequest); } diff --git a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/sql/CreateAlertRequest.java b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/sql/CreateAlertRequest.java index 3bed24fef..e34802abf 100644 --- a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/sql/CreateAlertRequest.java +++ b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/sql/CreateAlertRequest.java @@ -9,7 +9,7 @@ @Generated public class CreateAlertRequest { - /** */ + /** The alert to create. A display name, a `query_id`, and a `condition` are required. */ @JsonProperty("alert") private CreateAlertRequestAlert alert; diff --git a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/sql/CreateAlertRequestAlert.java b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/sql/CreateAlertRequestAlert.java index 80af13302..b24891776 100644 --- a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/sql/CreateAlertRequestAlert.java +++ b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/sql/CreateAlertRequestAlert.java @@ -7,48 +7,67 @@ import com.fasterxml.jackson.annotation.JsonProperty; import java.util.Objects; +/** + * A legacy Databricks SQL alert. An alert runs a saved query, compares a column of the result + * against a threshold, and notifies its subscribers when the condition is met. See + * https://docs.databricks.com/aws/en/sql/user/alerts/legacy for details. + */ @Generated public class CreateAlertRequestAlert { - /** Trigger conditions of the alert. */ + /** + * Condition that triggers the alert: a column of the query result, a comparison operator, and a + * threshold value. The value in the first row of the column is evaluated; aggregations are not + * supported through this API. + */ @JsonProperty("condition") private AlertCondition condition; /** - * Custom body of alert notification, if it exists. See [here] for custom templating instructions. - * - *

[here]: https://docs.databricks.com/sql/user/alerts/index.html + * Custom body of the alert notification. It can use the template variables and HTML described at + * https://docs.databricks.com/aws/en/sql/user/alerts/legacy. If omitted, the default notification + * body is used. */ @JsonProperty("custom_body") private String customBody; /** - * Custom subject of alert notification, if it exists. This can include email subject entries and - * Slack notification headers, for example. See [here] for custom templating instructions. - * - *

[here]: https://docs.databricks.com/sql/user/alerts/index.html + * Custom subject of the alert notification, used as the email subject or the Slack message + * header. It can use the template variables described at + * https://docs.databricks.com/aws/en/sql/user/alerts/legacy. If omitted, the default subject is + * used. */ @JsonProperty("custom_subject") private String customSubject; - /** The display name of the alert. */ + /** Display name of the alert, shown in list views and notifications. It must not be empty. */ @JsonProperty("display_name") private String displayName; - /** Whether to notify alert subscribers when alert returns back to normal. */ + /** + * Whether to notify subscribers when the alert state changes from `TRIGGERED` back to `OK`. + * Defaults to true. + */ @JsonProperty("notify_on_ok") private Boolean notifyOnOk; - /** The workspace path of the folder containing the alert. */ + /** + * Workspace path of the folder containing the alert. Defaults to the creator's home folder when + * omitted on create. It cannot be changed after creation. + */ @JsonProperty("parent_path") private String parentPath; - /** UUID of the query attached to the alert. */ + /** + * UUID of the saved query whose result the alert evaluates. The caller must have permission to + * view the query. + */ @JsonProperty("query_id") private String queryId; /** - * Number of seconds an alert must wait after being triggered to rearm itself. After rearming, it - * can be triggered again. If 0 or not specified, the alert will not be triggered again. + * Number of seconds the alert waits after a notification before it can notify again while its + * state stays `TRIGGERED`. If 0 or not specified, the alert notifies once when its state changes + * to `TRIGGERED` and does not notify again until its state has changed. */ @JsonProperty("seconds_to_retrigger") private Long secondsToRetrigger; diff --git a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/sql/GetAlertRequest.java b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/sql/GetAlertRequest.java index 6d0485738..165cd0d50 100644 --- a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/sql/GetAlertRequest.java +++ b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/sql/GetAlertRequest.java @@ -9,7 +9,7 @@ @Generated public class GetAlertRequest { - /** */ + /** UUID of the alert to fetch. */ @JsonIgnore private String id; public GetAlertRequest setId(String id) { diff --git a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/sql/ListAlertsRequest.java b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/sql/ListAlertsRequest.java index dd2623548..bce5fd715 100644 --- a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/sql/ListAlertsRequest.java +++ b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/sql/ListAlertsRequest.java @@ -10,12 +10,12 @@ @Generated public class ListAlertsRequest { - /** */ + /** Maximum number of alerts to return per page. */ @JsonIgnore @QueryParam("page_size") private Long pageSize; - /** */ + /** Token from the `next_page_token` of a previous response. Omit it to fetch the first page. */ @JsonIgnore @QueryParam("page_token") private String pageToken; diff --git a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/sql/ListAlertsResponse.java b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/sql/ListAlertsResponse.java index ef9cfa016..068e46308 100644 --- a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/sql/ListAlertsResponse.java +++ b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/sql/ListAlertsResponse.java @@ -10,11 +10,11 @@ @Generated public class ListAlertsResponse { - /** */ + /** Token to pass as `page_token` to fetch the next page. Omitted when there are no more pages. */ @JsonProperty("next_page_token") private String nextPageToken; - /** */ + /** Alerts on this page. */ @JsonProperty("results") private Collection results; diff --git a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/sql/ListAlertsResponseAlert.java b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/sql/ListAlertsResponseAlert.java index 9489f808c..b097c74b4 100644 --- a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/sql/ListAlertsResponseAlert.java +++ b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/sql/ListAlertsResponseAlert.java @@ -7,9 +7,18 @@ import com.fasterxml.jackson.annotation.JsonProperty; import java.util.Objects; +/** + * A legacy Databricks SQL alert. An alert runs a saved query, compares a column of the result + * against a threshold, and notifies its subscribers when the condition is met. See + * https://docs.databricks.com/aws/en/sql/user/alerts/legacy for details. + */ @Generated public class ListAlertsResponseAlert { - /** Trigger conditions of the alert. */ + /** + * Condition that triggers the alert: a column of the query result, a comparison operator, and a + * threshold value. The value in the first row of the column is evaluated; aggregations are not + * supported through this API. + */ @JsonProperty("condition") private AlertCondition condition; @@ -18,23 +27,23 @@ public class ListAlertsResponseAlert { private String createTime; /** - * Custom body of alert notification, if it exists. See [here] for custom templating instructions. - * - *

[here]: https://docs.databricks.com/sql/user/alerts/index.html + * Custom body of the alert notification. It can use the template variables and HTML described at + * https://docs.databricks.com/aws/en/sql/user/alerts/legacy. If omitted, the default notification + * body is used. */ @JsonProperty("custom_body") private String customBody; /** - * Custom subject of alert notification, if it exists. This can include email subject entries and - * Slack notification headers, for example. See [here] for custom templating instructions. - * - *

[here]: https://docs.databricks.com/sql/user/alerts/index.html + * Custom subject of the alert notification, used as the email subject or the Slack message + * header. It can use the template variables described at + * https://docs.databricks.com/aws/en/sql/user/alerts/legacy. If omitted, the default subject is + * used. */ @JsonProperty("custom_subject") private String customSubject; - /** The display name of the alert. */ + /** Display name of the alert, shown in list views and notifications. It must not be empty. */ @JsonProperty("display_name") private String displayName; @@ -42,11 +51,14 @@ public class ListAlertsResponseAlert { @JsonProperty("id") private String id; - /** The workspace state of the alert. Used for tracking trashed status. */ + /** Lifecycle state of the alert: `ACTIVE`, or `TRASHED` after it has been moved to the trash. */ @JsonProperty("lifecycle_state") private LifecycleState lifecycleState; - /** Whether to notify alert subscribers when alert returns back to normal. */ + /** + * Whether to notify subscribers when the alert state changes from `TRIGGERED` back to `OK`. + * Defaults to true. + */ @JsonProperty("notify_on_ok") private Boolean notifyOnOk; @@ -54,20 +66,25 @@ public class ListAlertsResponseAlert { @JsonProperty("owner_user_name") private String ownerUserName; - /** UUID of the query attached to the alert. */ + /** + * UUID of the saved query whose result the alert evaluates. The caller must have permission to + * view the query. + */ @JsonProperty("query_id") private String queryId; /** - * Number of seconds an alert must wait after being triggered to rearm itself. After rearming, it - * can be triggered again. If 0 or not specified, the alert will not be triggered again. + * Number of seconds the alert waits after a notification before it can notify again while its + * state stays `TRIGGERED`. If 0 or not specified, the alert notifies once when its state changes + * to `TRIGGERED` and does not notify again until its state has changed. */ @JsonProperty("seconds_to_retrigger") private Long secondsToRetrigger; /** - * Current state of the alert's trigger status. This field is set to UNKNOWN if the alert has not - * yet been evaluated or ran into an error during the last evaluation. + * Current state of the alert's trigger status: `TRIGGERED` if the condition was met on the last + * evaluation, `OK` if it was not, and `UNKNOWN` if the alert has not yet been evaluated or ran + * into an error during the last evaluation. */ @JsonProperty("state") private AlertState state; diff --git a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/sql/TrashAlertRequest.java b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/sql/TrashAlertRequest.java index ec2227434..a25689256 100644 --- a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/sql/TrashAlertRequest.java +++ b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/sql/TrashAlertRequest.java @@ -9,7 +9,7 @@ @Generated public class TrashAlertRequest { - /** */ + /** UUID of the alert to move to the trash. */ @JsonIgnore private String id; public TrashAlertRequest setId(String id) { diff --git a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/sql/UpdateAlertRequest.java b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/sql/UpdateAlertRequest.java index a0ed02ec2..6986d6e5c 100644 --- a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/sql/UpdateAlertRequest.java +++ b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/sql/UpdateAlertRequest.java @@ -10,7 +10,7 @@ @Generated public class UpdateAlertRequest { - /** */ + /** Alert fields to update. Only the fields named in `update_mask` are changed. */ @JsonProperty("alert") private UpdateAlertRequestAlert alert; @@ -21,15 +21,18 @@ public class UpdateAlertRequest { @JsonProperty("auto_resolve_display_name") private Boolean autoResolveDisplayName; - /** */ + /** UUID of the alert to update. */ @JsonIgnore private String id; /** - * The field mask must be a single string, with multiple fields separated by commas (no spaces). - * The field path is relative to the resource object, using a dot (`.`) to navigate sub-fields - * (e.g., `author.given_name`). Specification of elements in sequence or map fields is not - * allowed, as only the entire collection field can be specified. Field names must exactly match - * the resource field names. + * Comma-separated list of the alert fields to update, such as `display_name` or `condition`. + * Fields not listed keep their current values. + * + *

The field mask must be a single string, with multiple fields separated by commas (no + * spaces). The field path is relative to the resource object, using a dot (`.`) to navigate + * sub-fields (e.g., `author.given_name`). Specification of elements in sequence or map fields is + * not allowed, as only the entire collection field can be specified. Field names must exactly + * match the resource field names. * *

A field mask of `*` indicates full replacement. It’s recommended to always explicitly list * the fields being updated and avoid using `*` wildcards, as it can lead to unintended results if diff --git a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/sql/UpdateAlertRequestAlert.java b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/sql/UpdateAlertRequestAlert.java index cae7b393b..265b3650c 100644 --- a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/sql/UpdateAlertRequestAlert.java +++ b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/sql/UpdateAlertRequestAlert.java @@ -7,34 +7,46 @@ import com.fasterxml.jackson.annotation.JsonProperty; import java.util.Objects; +/** + * A legacy Databricks SQL alert. An alert runs a saved query, compares a column of the result + * against a threshold, and notifies its subscribers when the condition is met. See + * https://docs.databricks.com/aws/en/sql/user/alerts/legacy for details. + */ @Generated public class UpdateAlertRequestAlert { - /** Trigger conditions of the alert. */ + /** + * Condition that triggers the alert: a column of the query result, a comparison operator, and a + * threshold value. The value in the first row of the column is evaluated; aggregations are not + * supported through this API. + */ @JsonProperty("condition") private AlertCondition condition; /** - * Custom body of alert notification, if it exists. See [here] for custom templating instructions. - * - *

[here]: https://docs.databricks.com/sql/user/alerts/index.html + * Custom body of the alert notification. It can use the template variables and HTML described at + * https://docs.databricks.com/aws/en/sql/user/alerts/legacy. If omitted, the default notification + * body is used. */ @JsonProperty("custom_body") private String customBody; /** - * Custom subject of alert notification, if it exists. This can include email subject entries and - * Slack notification headers, for example. See [here] for custom templating instructions. - * - *

[here]: https://docs.databricks.com/sql/user/alerts/index.html + * Custom subject of the alert notification, used as the email subject or the Slack message + * header. It can use the template variables described at + * https://docs.databricks.com/aws/en/sql/user/alerts/legacy. If omitted, the default subject is + * used. */ @JsonProperty("custom_subject") private String customSubject; - /** The display name of the alert. */ + /** Display name of the alert, shown in list views and notifications. It must not be empty. */ @JsonProperty("display_name") private String displayName; - /** Whether to notify alert subscribers when alert returns back to normal. */ + /** + * Whether to notify subscribers when the alert state changes from `TRIGGERED` back to `OK`. + * Defaults to true. + */ @JsonProperty("notify_on_ok") private Boolean notifyOnOk; @@ -42,13 +54,17 @@ public class UpdateAlertRequestAlert { @JsonProperty("owner_user_name") private String ownerUserName; - /** UUID of the query attached to the alert. */ + /** + * UUID of the saved query whose result the alert evaluates. The caller must have permission to + * view the query. + */ @JsonProperty("query_id") private String queryId; /** - * Number of seconds an alert must wait after being triggered to rearm itself. After rearming, it - * can be triggered again. If 0 or not specified, the alert will not be triggered again. + * Number of seconds the alert waits after a notification before it can notify again while its + * state stays `TRIGGERED`. If 0 or not specified, the alert notifies once when its state changes + * to `TRIGGERED` and does not notify again until its state has changed. */ @JsonProperty("seconds_to_retrigger") private Long secondsToRetrigger; diff --git a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/supervisoragents/SupervisorAgent.java b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/supervisoragents/SupervisorAgent.java index f74cdb6a5..56bc9a767 100644 --- a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/supervisoragents/SupervisorAgent.java +++ b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/supervisoragents/SupervisorAgent.java @@ -8,45 +8,68 @@ import com.google.protobuf.Timestamp; import java.util.Objects; +/** + * A Supervisor Agent coordinates tools and subagents, such as Genie Agents, Knowledge Assistants, + * Unity Catalog functions, MCP servers and agent endpoints, to answer requests that span several + * domains. It is served through its own serving endpoint. Tools and subagents are managed through + * the Tool resource. See + * https://docs.databricks.com/aws/en/generative-ai/agent-bricks/multi-agent-supervisor for the + * product documentation. + */ @Generated public class SupervisorAgent { - /** Creation timestamp. */ + /** The time at which the Supervisor Agent was created, as an RFC 3339 timestamp. */ @JsonProperty("create_time") private Timestamp createTime; - /** The creator of the Supervisor Agent. */ + /** The email address of the user who created the Supervisor Agent. */ @JsonProperty("creator") private String creator; - /** Description of what this agent can do (user-facing). */ + /** A summary of what the agent does. It is shown to users of the agent. */ @JsonProperty("description") private String description; - /** The display name of the Supervisor Agent, unique at workspace level. */ + /** + * The display name of the Supervisor Agent. It must be unique among the agents in the workspace. + * Creating an agent with a display name that is already in use fails with ALREADY_EXISTS. + */ @JsonProperty("display_name") private String displayName; - /** The name of the supervisor agent's serving endpoint. */ + /** + * The name of the Model Serving endpoint that serves the Supervisor Agent. Query this endpoint to + * chat with the agent. + */ @JsonProperty("endpoint_name") private String endpointName; - /** The MLflow experiment ID. */ + /** The ID of the MLflow experiment that is created together with the Supervisor Agent. */ @JsonProperty("experiment_id") private String experimentId; - /** Deprecated: Use supervisor_agent_id instead. */ + /** Deprecated: Use supervisor_agent_id instead. This field is no longer populated. */ @JsonProperty("id") private String id; - /** Optional natural-language instructions for the supervisor agent. */ + /** + * Natural-language guidelines for how the supervisor should respond and how it should delegate + * requests to its tools and subagents. + */ @JsonProperty("instructions") private String instructions; - /** The resource name of the SupervisorAgent. Format: supervisor-agents/{supervisor_agent_id} */ + /** + * The resource name of the Supervisor Agent. Format: supervisor-agents/{supervisor_agent_id} The + * server assigns the name when the agent is created. + */ @JsonProperty("name") private String name; - /** The universally unique identifier (UUID) of the Supervisor Agent. */ + /** + * The universally unique identifier (UUID) of the Supervisor Agent. It is the last segment of + * `name`. + */ @JsonProperty("supervisor_agent_id") private String supervisorAgentId; diff --git a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/supervisoragents/SupervisorAgentsAPI.java b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/supervisoragents/SupervisorAgentsAPI.java index 3e7e6b981..cd661bc66 100644 --- a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/supervisoragents/SupervisorAgentsAPI.java +++ b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/supervisoragents/SupervisorAgentsAPI.java @@ -29,7 +29,10 @@ public Example createExample(CreateExampleRequest request) { return impl.createExample(request); } - /** Creates a new Supervisor Agent. */ + /** + * Creates a Supervisor Agent together with its serving endpoint and MLflow experiment. Tools and + * subagents are added to the agent afterwards with the Tool methods. + */ public SupervisorAgent createSupervisorAgent(CreateSupervisorAgentRequest request) { return impl.createSupervisorAgent(request); } @@ -59,7 +62,10 @@ public void deleteSupervisorAgent(String name) { deleteSupervisorAgent(new DeleteSupervisorAgentRequest().setName(name)); } - /** Deletes a Supervisor Agent. */ + /** + * Deletes a Supervisor Agent together with the resources created for it, including its tools, + * examples, serving endpoint and MLflow experiment. + */ public void deleteSupervisorAgent(DeleteSupervisorAgentRequest request) { impl.deleteSupervisorAgent(request); } @@ -143,7 +149,7 @@ public Iterable listExamples(ListExamplesRequest request) { }); } - /** Lists Supervisor Agents. */ + /** Lists the Supervisor Agents in the workspace that the caller has permission to view. */ public Iterable listSupervisorAgents(ListSupervisorAgentsRequest request) { return Paginator.newTokenPagination( request, @@ -199,8 +205,8 @@ public SupervisorAgentPermissions updatePermissions(SupervisorAgentPermissionsRe } /** - * Updates a Supervisor Agent. The fields that are required depend on the paths specified in - * `update_mask`. Only fields included in the mask will be updated. + * Updates a Supervisor Agent. Only the fields listed in `update_mask` are changed. All other + * fields keep their current values. */ public SupervisorAgent updateSupervisorAgent(UpdateSupervisorAgentRequest request) { return impl.updateSupervisorAgent(request); diff --git a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/supervisoragents/SupervisorAgentsService.java b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/supervisoragents/SupervisorAgentsService.java index 4c8b4f5c1..21614fee9 100644 --- a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/supervisoragents/SupervisorAgentsService.java +++ b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/supervisoragents/SupervisorAgentsService.java @@ -15,7 +15,10 @@ public interface SupervisorAgentsService { /** Creates an example for a Supervisor Agent. */ Example createExample(CreateExampleRequest createExampleRequest); - /** Creates a new Supervisor Agent. */ + /** + * Creates a Supervisor Agent together with its serving endpoint and MLflow experiment. Tools and + * subagents are added to the agent afterwards with the Tool methods. + */ SupervisorAgent createSupervisorAgent(CreateSupervisorAgentRequest createSupervisorAgentRequest); /** @@ -31,7 +34,10 @@ public interface SupervisorAgentsService { /** Deletes an example from a Supervisor Agent. */ void deleteExample(DeleteExampleRequest deleteExampleRequest); - /** Deletes a Supervisor Agent. */ + /** + * Deletes a Supervisor Agent together with the resources created for it, including its tools, + * examples, serving endpoint and MLflow experiment. + */ void deleteSupervisorAgent(DeleteSupervisorAgentRequest deleteSupervisorAgentRequest); /** Deletes a Tool. */ @@ -60,7 +66,7 @@ SupervisorAgentPermissions getPermissions( /** Lists examples under a Supervisor Agent. */ ListExamplesResponse listExamples(ListExamplesRequest listExamplesRequest); - /** Lists Supervisor Agents. */ + /** Lists the Supervisor Agents in the workspace that the caller has permission to view. */ ListSupervisorAgentsResponse listSupervisorAgents( ListSupervisorAgentsRequest listSupervisorAgentsRequest); @@ -85,8 +91,8 @@ SupervisorAgentPermissions updatePermissions( SupervisorAgentPermissionsRequest supervisorAgentPermissionsRequest); /** - * Updates a Supervisor Agent. The fields that are required depend on the paths specified in - * `update_mask`. Only fields included in the mask will be updated. + * Updates a Supervisor Agent. Only the fields listed in `update_mask` are changed. All other + * fields keep their current values. */ SupervisorAgent updateSupervisorAgent(UpdateSupervisorAgentRequest updateSupervisorAgentRequest); diff --git a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/supervisoragents/UpdateSupervisorAgentRequest.java b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/supervisoragents/UpdateSupervisorAgentRequest.java index 74290346d..f6d72065b 100644 --- a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/supervisoragents/UpdateSupervisorAgentRequest.java +++ b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/supervisoragents/UpdateSupervisorAgentRequest.java @@ -12,14 +12,24 @@ @Generated public class UpdateSupervisorAgentRequest { - /** The resource name of the SupervisorAgent. Format: supervisor-agents/{supervisor_agent_id} */ + /** + * The resource name of the Supervisor Agent. Format: supervisor-agents/{supervisor_agent_id} The + * server assigns the name when the agent is created. + */ @JsonIgnore private String name; - /** The SupervisorAgent to update. */ + /** + * The Supervisor Agent to update. `name` identifies the agent. The other fields carry the new + * values for the paths listed in `update_mask`. + */ @JsonProperty("supervisor_agent") private SupervisorAgent supervisorAgent; - /** Field mask for fields to be updated. */ + /** + * Comma-separated list of the fields to update. Supported values are `display_name`, + * `description` and `instructions`. The request fails if the mask is empty or names any other + * field. + */ @JsonIgnore @QueryParam("update_mask") private FieldMask updateMask; diff --git a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/vectorsearch/EndpointScalingInfoScalingPhase.java b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/vectorsearch/EndpointScalingInfoScalingPhase.java index c6daa2b1e..b3ce14c29 100644 --- a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/vectorsearch/EndpointScalingInfoScalingPhase.java +++ b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/vectorsearch/EndpointScalingInfoScalingPhase.java @@ -9,5 +9,6 @@ public enum EndpointScalingInfoScalingPhase { ADJUSTING_CAPACITY, ESTIMATING, + FINALIZING, INITIALIZING_INDEX, } diff --git a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/workspace/ReposAPI.java b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/workspace/ReposAPI.java index 9c6c94742..6aa0ef917 100644 --- a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/workspace/ReposAPI.java +++ b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/workspace/ReposAPI.java @@ -89,8 +89,11 @@ public RepoPermissions getPermissions(GetRepoPermissionsRequest request) { * through additional pages. * *

Deprecated: This operation does not return a complete list of the repos in the workspace, - * because repos with the Git CLI enabled are not included in its results. Instead, use the Repos - * and Workspace APIs to find repos and their associated metadata in the workspace. + * because repos with the Git CLI enabled are not included in its results. Instead, find Git + * folders with `GET /api/2.0/workspace/get-status` (for one path) or `GET + * /api/2.0/workspace/list` (keep objects with `object_type == "REPO"` or + * `directory_info.is_git_folder == true`), then call `GET /api/2.0/repos/{object_id}` for Git + * metadata. */ public Iterable list(ListReposRequest request) { return Paginator.newTokenPagination( diff --git a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/workspace/ReposService.java b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/workspace/ReposService.java index e9801e12c..35a5f5492 100644 --- a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/workspace/ReposService.java +++ b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/workspace/ReposService.java @@ -49,8 +49,11 @@ GetRepoPermissionLevelsResponse getPermissionLevels( * through additional pages. * *

Deprecated: This operation does not return a complete list of the repos in the workspace, - * because repos with the Git CLI enabled are not included in its results. Instead, use the Repos - * and Workspace APIs to find repos and their associated metadata in the workspace. + * because repos with the Git CLI enabled are not included in its results. Instead, find Git + * folders with `GET /api/2.0/workspace/get-status` (for one path) or `GET + * /api/2.0/workspace/list` (keep objects with `object_type == "REPO"` or + * `directory_info.is_git_folder == true`), then call `GET /api/2.0/repos/{object_id}` for Git + * metadata. */ ListReposResponse list(ListReposRequest listReposRequest); diff --git a/databricks-sdk-java/src/test/java/com/databricks/sdk/core/DatabricksConfigTest.java b/databricks-sdk-java/src/test/java/com/databricks/sdk/core/DatabricksConfigTest.java index aa093eec8..5028ea555 100644 --- a/databricks-sdk-java/src/test/java/com/databricks/sdk/core/DatabricksConfigTest.java +++ b/databricks-sdk-java/src/test/java/com/databricks/sdk/core/DatabricksConfigTest.java @@ -14,9 +14,13 @@ import com.databricks.sdk.core.utils.Environment; import com.databricks.sdk.core.utils.TestOSUtils; import java.io.IOException; +import java.lang.reflect.Method; +import java.nio.file.Files; +import java.nio.file.Path; import java.time.Duration; import java.util.ArrayList; import java.util.Arrays; +import java.util.Collections; import java.util.HashMap; import java.util.List; import java.util.Map; @@ -898,4 +902,126 @@ public void testDatabricksOidcEndpointsUsesDiscoveryUrl() throws IOException { assertEquals("https://ws.databricks.com/oidc/v1/token", endpoints.getTokenEndpoint()); } } + + // The hidden switches: read from the environment or a profile, with no setter, so that removing + // them later breaks no user code. + private static final class HiddenSwitch { + final String envVar; + final String profileKey; + final String getter; + final boolean unset; + + HiddenSwitch(String envVar, String profileKey, String getter, boolean unset) { + this.envVar = envVar; + this.profileKey = profileKey; + this.getter = getter; + this.unset = unset; + } + + boolean read(DatabricksConfig config) throws ReflectiveOperationException { + return (boolean) DatabricksConfig.class.getMethod(getter).invoke(config); + } + + @Override + public String toString() { + return envVar; + } + } + + static Stream hiddenSwitches() { + return Stream.of( + new HiddenSwitch( + "DATABRICKS_DISABLE_EXPERIMENTAL_FILES_API_CLIENT", + "disable_experimental_files_api_client", + "getDisableExperimentalFilesApiClient", + false), + new HiddenSwitch( + "DATABRICKS_EXPERIMENTAL_FILES_EXT_ENABLE_ENDPOINTS_API", + "experimental_files_ext_enable_endpoints_api", + "getExperimentalFilesExtEnableEndpointsApi", + false)); + } + + static Stream hiddenSwitchesFromTheEnvironment() { + return hiddenSwitches() + .flatMap( + hidden -> + Stream.of( + Arguments.of(hidden, "true", true), + Arguments.of(hidden, "false", false), + Arguments.of(hidden, null, hidden.unset))); + } + + @ParameterizedTest(name = "{0}={1}") + @MethodSource("hiddenSwitchesFromTheEnvironment") + public void testHiddenSwitchFromTheEnvironment(HiddenSwitch hidden, String value, boolean want) + throws ReflectiveOperationException { + Map env = new HashMap<>(); + if (value != null) { + env.put(hidden.envVar, value); + } + + assertEquals(want, hidden.read(offlineConfig().resolve(environment(env)))); + } + + static Stream hiddenSwitchesFromAProfile() { + return hiddenSwitches() + .flatMap(hidden -> Stream.of(Arguments.of(hidden, true), Arguments.of(hidden, false))); + } + + @ParameterizedTest(name = "{0} in a profile = {1}") + @MethodSource("hiddenSwitchesFromAProfile") + public void testHiddenSwitchFromAProfile(HiddenSwitch hidden, boolean value) + throws IOException, ReflectiveOperationException { + Path file = Files.createTempFile("databrickscfg", ""); + Files.write( + file, + Arrays.asList( + "[files]", + "host = https://ws.example.com", + "token = dapi-test", + hidden.profileKey + " = " + value)); + try { + DatabricksConfig config = + new DatabricksConfig() + .setConfigFile(file.toString()) + .setProfile("files") + .setHttpClient( + request -> { + throw new IOException("offline test"); + }); + + assertEquals(value, hidden.read(config.resolve(environment(new HashMap<>())))); + } finally { + Files.delete(file); + } + } + + @ParameterizedTest(name = "{0}") + @MethodSource("hiddenSwitches") + public void testHiddenSwitchHasNoSetter(HiddenSwitch hidden) { + String name = hidden.getter.substring("get".length()); + List methods = new ArrayList<>(); + for (Method method : DatabricksConfig.class.getMethods()) { + if (method.getName().contains(name)) { + methods.add(method.getName()); + } + } + + assertEquals(Collections.singletonList(hidden.getter), methods); + } + + private static DatabricksConfig offlineConfig() { + return new DatabricksConfig() + .setHost("https://ws.example.com") + .setToken("dapi-test") + .setHttpClient( + request -> { + throw new IOException("offline test"); + }); + } + + private static Environment environment(Map env) { + return new Environment(env, new ArrayList<>(), System.getProperty("os.name")); + } } diff --git a/databricks-sdk-java/src/test/java/com/databricks/sdk/mixin/FilesExtEndpointsTest.java b/databricks-sdk-java/src/test/java/com/databricks/sdk/mixin/FilesExtEndpointsTest.java new file mode 100644 index 000000000..3d6ec20e9 --- /dev/null +++ b/databricks-sdk-java/src/test/java/com/databricks/sdk/mixin/FilesExtEndpointsTest.java @@ -0,0 +1,1215 @@ +package com.databricks.sdk.mixin; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertTrue; + +import com.databricks.sdk.core.DatabricksConfig; +import com.databricks.sdk.core.DummyCredentialsProvider; +import com.databricks.sdk.core.HeaderFactory; +import com.databricks.sdk.core.UserAgent; +import com.databricks.sdk.core.commons.CommonsHttpClient; +import com.databricks.sdk.core.http.HttpClient; +import com.databricks.sdk.core.http.Request; +import com.databricks.sdk.core.http.Response; +import com.databricks.sdk.core.utils.TestClockSupplier; +import com.databricks.sdk.mixin.FilesExtEndpoint.Kind; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.sun.net.httpserver.HttpServer; +import java.io.IOException; +import java.io.InterruptedIOException; +import java.net.InetAddress; +import java.net.InetSocketAddress; +import java.nio.charset.StandardCharsets; +import java.time.Duration; +import java.time.Instant; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collections; +import java.util.HashSet; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Locale; +import java.util.Map; +import java.util.Random; +import java.util.Set; +import java.util.concurrent.ConcurrentHashMap; +import java.util.concurrent.CopyOnWriteArrayList; +import java.util.concurrent.CountDownLatch; +import java.util.concurrent.TimeUnit; +import java.util.concurrent.atomic.AtomicInteger; +import java.util.regex.Matcher; +import java.util.regex.Pattern; +import java.util.stream.Stream; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.Arguments; +import org.junit.jupiter.params.provider.MethodSource; +import org.junit.jupiter.params.provider.NullSource; +import org.junit.jupiter.params.provider.ValueSource; + +/** + * Endpoint discovery: what the server's list gives, the fallback to the built-in order, and when + * the list is asked for again. + */ +public class FilesExtEndpointsTest { + private static final ObjectMapper MAPPER = new ObjectMapper(); + private static final String HOST = "http://localhost"; + private static final Duration SHORT_TIMEOUT = Duration.ofMillis(200); + + private static final Map IO_OFFLOAD_WS = + entry("IO_OFFLOAD", null, "https", "ws.example.com", true); + private static final Map FILES_V2_WORKSPACE = + entry("FILES_API", "2.0", "https", "ws.example.com", false); + private static final Map FILES_V2_STORAGE_PROXY = + entry("FILES_API", "2.0", "http", "storage-proxy.example.com", true); + private static final Map FILES_V3 = + entry("FILES_API", "3.0", "https", "123.storage.us-west-2.example.com", true); + + private static final FilesExtEndpoint PARSED_IO_OFFLOAD_WS = + new FilesExtEndpoint(Kind.IO_OFFLOAD, "https://ws.example.com", true); + private static final FilesExtEndpoint PARSED_FILES_V2_WORKSPACE = + new FilesExtEndpoint(Kind.FILES_API_V2, "https://ws.example.com", false); + private static final FilesExtEndpoint PARSED_FILES_V2_STORAGE_PROXY = + new FilesExtEndpoint(Kind.FILES_API_V2, "http://storage-proxy.example.com", true); + private static final FilesExtEndpoint PARSED_FILES_V3 = + new FilesExtEndpoint(Kind.FILES_API_V3, "https://123.storage.us-west-2.example.com", true); + + private static final List DEFAULT_ENDPOINTS = + Arrays.asList( + new FilesExtEndpoint(Kind.IO_OFFLOAD, HOST, true), + new FilesExtEndpoint(Kind.FILES_API_V2, HOST, false)); + + private final FakeServer server = new FakeServer(); + private final TestClockSupplier clock = + new TestClockSupplier(Instant.parse("2026-11-11T00:00:00Z")); + + @AfterEach + void releaseBlockedRequests() { + server.release.countDown(); + } + + // ======================== the server's list ======================== + + @Test + void disabled_usesTheBuiltInOrderWithoutAskingTheServer() { + server.plan(FILES_V2_WORKSPACE); + + assertEquals(DEFAULT_ENDPOINTS, resolver(false).resolve()); + assertEquals(0, server.calls.get()); + } + + static Stream serverResponses() { + return Stream.of( + Arguments.of( + "the server's order is preserved", + body(Arrays.asList(FILES_V2_STORAGE_PROXY, IO_OFFLOAD_WS, FILES_V2_WORKSPACE)), + Arrays.asList( + PARSED_FILES_V2_STORAGE_PROXY, PARSED_IO_OFFLOAD_WS, PARSED_FILES_V2_WORKSPACE)), + Arguments.of( + "Files API 3.0 is recognized", + body(Arrays.asList(IO_OFFLOAD_WS, FILES_V3, FILES_V2_WORKSPACE)), + Arrays.asList(PARSED_IO_OFFLOAD_WS, PARSED_FILES_V3, PARSED_FILES_V2_WORKSPACE)), + Arguments.of( + // Presigned URLs are coordinated by the workspace; plain HTTP to another host would + // expose credentials. + "IO_OFFLOAD over plain HTTP to another host is skipped", + body(Arrays.asList(with(IO_OFFLOAD_WS, "scheme", "http"), FILES_V2_WORKSPACE)), + Collections.singletonList(PARSED_FILES_V2_WORKSPACE)), + Arguments.of( + // The SDK reaches this workspace over plain HTTP, so its own host may use it too. + "IO_OFFLOAD over plain HTTP to a plain-HTTP workspace's host is kept", + body( + Arrays.asList( + entry("IO_OFFLOAD", null, "http", "localhost", true), + entry("IO_OFFLOAD", null, "http", "LOCALHOST", true))), + Arrays.asList( + new FilesExtEndpoint(Kind.IO_OFFLOAD, HOST, true), + new FilesExtEndpoint(Kind.IO_OFFLOAD, "http://LOCALHOST", true))), + Arguments.of( + // Workspace credentials go to a Files API 3.0 host, so it must use TLS. + "Files API 3.0 over plain HTTP is skipped", + body(Arrays.asList(with(FILES_V3, "scheme", "http"), FILES_V2_WORKSPACE)), + Collections.singletonList(PARSED_FILES_V2_WORKSPACE)), + Arguments.of( + "unknown and unspecified api values are skipped", + body( + Arrays.asList( + with(IO_OFFLOAD_WS, "api", "SOMETHING_NEW"), + with(IO_OFFLOAD_WS, "api", "API_UNSPECIFIED"), + without(IO_OFFLOAD_WS, "api"), + FILES_V2_WORKSPACE)), + Collections.singletonList(PARSED_FILES_V2_WORKSPACE)), + Arguments.of( + "Files API without a known version is skipped", + body( + Arrays.asList( + without(FILES_V2_STORAGE_PROXY, "api_version"), + with(FILES_V2_STORAGE_PROXY, "api_version", "2.1"), + FILES_V2_WORKSPACE)), + Collections.singletonList(PARSED_FILES_V2_WORKSPACE)), + Arguments.of( + // The SDK only speaks the unversioned offload protocol; a versioned one is newer. + "versioned IO_OFFLOAD is skipped", + body( + Arrays.asList( + with(IO_OFFLOAD_WS, "api_version", "3.0"), + with(IO_OFFLOAD_WS, "api_version", ""), + FILES_V2_WORKSPACE)), + Collections.singletonList(PARSED_FILES_V2_WORKSPACE)), + Arguments.of( + "entries without a usable scheme or hostname are skipped", + body( + Arrays.asList( + with(FILES_V2_STORAGE_PROXY, "scheme", "ftp"), + without(FILES_V2_STORAGE_PROXY, "scheme"), + with(FILES_V2_STORAGE_PROXY, "hostname", ""), + without(FILES_V2_STORAGE_PROXY, "hostname"), + FILES_V2_WORKSPACE)), + Collections.singletonList(PARSED_FILES_V2_WORKSPACE)), + Arguments.of( + // Mirrors the proto getter: an unset optional bool reads as false. + "missing multipart_upload_supported reads as false", + body( + Collections.singletonList( + without(FILES_V2_STORAGE_PROXY, "multipart_upload_supported"))), + Collections.singletonList( + new FilesExtEndpoint( + Kind.FILES_API_V2, "http://storage-proxy.example.com", false))), + Arguments.of( + "unknown fields are ignored", + json( + map( + "endpoints", + Collections.singletonList(with(FILES_V2_WORKSPACE, "future_field", 1)), + "next_page_token", + "x")), + Collections.singletonList(PARSED_FILES_V2_WORKSPACE)), + Arguments.of( + "empty list falls back to the default", + body(Collections.emptyList()), + DEFAULT_ENDPOINTS), + Arguments.of("missing endpoints field falls back to the default", "{}", DEFAULT_ENDPOINTS), + Arguments.of( + "only unrecognized entries falls back to the default", + body( + Arrays.asList( + with(FILES_V2_WORKSPACE, "api_version", "9.9"), + with(IO_OFFLOAD_WS, "api", "SOMETHING_NEW"))), + DEFAULT_ENDPOINTS), + Arguments.of( + "malformed endpoints field falls back to the default", + "{\"endpoints\": \"not-a-list\"}", + DEFAULT_ENDPOINTS), + Arguments.of( + "malformed entry is skipped", + body(Arrays.asList("not-an-object", FILES_V2_WORKSPACE)), + Collections.singletonList(PARSED_FILES_V2_WORKSPACE))); + } + + @ParameterizedTest(name = "{0}") + @MethodSource("serverResponses") + void resolve_parsesTheServerResponse( + String name, String responseBody, List expected) { + server.body = responseBody; + + assertEquals(expected, resolver().resolve()); + assertEquals(1, server.calls.get()); + } + + static Stream failures() { + return Stream.of( + Fault.status(404), + Fault.status(403), + Fault.status(500), + // A single attempt, no retries: a 503 falls back immediately rather than stall a transfer. + Fault.status(503), + Fault.connectionError(), + Fault.text("not json"), + Fault.text("{\"endpoints\": \"not-a-list\"}"), + Fault.text(String.join("", Collections.nCopies(100_000, "[")))); + } + + @ParameterizedTest + @MethodSource("failures") + void failure_fallsBackToTheBuiltInOrder(Fault failure) { + server.plan(FILES_V2_WORKSPACE); + server.always = failure; + + assertEquals(DEFAULT_ENDPOINTS, resolver().resolve()); + } + + static Stream hostSetOnlyWhenAuthenticating() { + return Stream.of( + Arguments.of( + "the server's list", true, null, Collections.singletonList(PARSED_FILES_V2_WORKSPACE)), + Arguments.of("a failure: the built-in order", true, Fault.status(500), DEFAULT_ENDPOINTS), + Arguments.of("discovery off: the built-in order", false, null, DEFAULT_ENDPOINTS)); + } + + @ParameterizedTest(name = "{0}") + @MethodSource("hostSetOnlyWhenAuthenticating") + void aHostSetOnlyWhenAuthenticating_isTheWorkspaceHost( + String name, boolean enabled, Fault faultOrNull, List want) { + // A credentials provider that supplies the host only when it is configured, as one that reads + // the host from its runtime does. + DatabricksConfig config = + new DatabricksConfig() + .setCredentialsProvider( + new DummyCredentialsProvider() { + @Override + public HeaderFactory configure(DatabricksConfig c) { + c.setHost(HOST); + return super.configure(c); + } + }) + .setHttpClient(server); + server.plan(FILES_V2_WORKSPACE); + server.always = faultOrNull; + + List got = + new FilesExtEndpoints(config, enabled, clock, FilesExtEndpoints.RESOLVE_TIMEOUT).resolve(); + + assertEquals(want, got); + List urls = new ArrayList<>(); + for (Request r : server.requests) { + urls.add(r.getUrl()); + } + assertEquals( + enabled + ? Collections.singletonList(HOST + FilesExtEndpoints.ENDPOINTS_API_PATH) + : Collections.emptyList(), + urls); + } + + static Stream cachedResolutions() { + return Stream.of( + Arguments.of( + "a list", + FILES_V2_WORKSPACE, + null, + Collections.singletonList(PARSED_FILES_V2_WORKSPACE)), + // A failed resolution is not retried on every transfer; the client keeps the default order. + Arguments.of("a failure", null, Fault.status(500), DEFAULT_ENDPOINTS)); + } + + @ParameterizedTest(name = "{0}") + @MethodSource("cachedResolutions") + void resolution_isCached( + String name, + Map entryOrNull, + Fault faultOrNull, + List want) { + if (entryOrNull != null) { + server.plan(entryOrNull); + } + server.always = faultOrNull; + FilesExtEndpoints endpoints = resolver(); + + assertEquals(want, endpoints.resolve()); + assertEquals(want, endpoints.resolve()); + assertEquals(1, server.calls.get()); + } + + @Test + void concurrentCallers_shareOneRequest() throws Exception { + // Parallel transfer workers resolve concurrently; only one request may reach the server. + server.plan(FILES_V2_WORKSPACE); + server.faultOnCall(1, Fault.block()); + FilesExtEndpoints endpoints = resolver(true, FilesExtEndpoints.RESOLVE_TIMEOUT); + List> results = new CopyOnWriteArrayList<>(); + List threads = new ArrayList<>(); + for (int i = 0; i < 8; i++) { + threads.add(new Thread(() -> results.add(endpoints.resolve()))); + } + threads.forEach(Thread::start); + assertTrue(server.blocked.await(10, TimeUnit.SECONDS), "the server was never asked"); + server.release.countDown(); + for (Thread t : threads) { + t.join(10_000); + } + + assertEquals( + Collections.nCopies(8, Collections.singletonList(PARSED_FILES_V2_WORKSPACE)), results); + assertEquals(1, server.calls.get()); + } + + @Test + void resolve_returnsACopyCallersCannotCorrupt() { + server.plan(FILES_V2_STORAGE_PROXY, FILES_V2_WORKSPACE); + FilesExtEndpoints endpoints = resolver(); + + endpoints.resolve().remove(0); + + assertEquals( + Arrays.asList(PARSED_FILES_V2_STORAGE_PROXY, PARSED_FILES_V2_WORKSPACE), + endpoints.resolve()); + } + + @Test + void request_sendsCredentialsAndTheSdkUserAgent() { + server.plan(); + + resolver().resolve(); + + Request request = server.requests.get(0); + assertEquals("GET", request.getMethod()); + assertEquals(HOST + "/api/2.0/fs/endpoints", request.getUrl()); + assertEquals("Basic test", request.getHeaders().get("Authorization")); + assertEquals("application/json", request.getHeaders().get("Accept")); + assertEquals(UserAgent.asString(), request.getHeaders().get("User-Agent")); + assertTrue(request.getHeaders().get("User-Agent").contains("databricks-sdk-java/")); + } + + @ParameterizedTest(name = "workspace id {0}") + @NullSource + @ValueSource(strings = {"1234567890"}) + void request_sendsTheConfiguredWorkspaceId(String workspaceIdOrNull) { + server.plan(); + + new FilesExtEndpoints( + config(HOST).setWorkspaceId(workspaceIdOrNull), + true, + clock, + FilesExtEndpoints.RESOLVE_TIMEOUT) + .resolve(); + + assertEquals( + workspaceIdOrNull, server.requests.get(0).getHeaders().get("X-Databricks-Workspace-Id")); + } + + @Test + void redirect_isNotFollowed() throws IOException { + HttpServer workspace = + HttpServer.create(new InetSocketAddress(InetAddress.getLoopbackAddress(), 0), 0); + AtomicInteger redirected = new AtomicInteger(); + String origin = "http://127.0.0.1:" + workspace.getAddress().getPort(); + workspace.createContext( + "/api/2.0/fs/endpoints", + exchange -> { + exchange.getResponseHeaders().add("Location", origin + "/elsewhere"); + exchange.sendResponseHeaders(302, -1); + exchange.close(); + }); + workspace.createContext( + "/elsewhere", + exchange -> { + redirected.incrementAndGet(); + byte[] answer = + body(Collections.singletonList(FILES_V3)).getBytes(StandardCharsets.UTF_8); + exchange.getResponseHeaders().add("Content-Type", "application/json"); + exchange.sendResponseHeaders(200, answer.length); + exchange.getResponseBody().write(answer); + exchange.close(); + }); + workspace.start(); + try { + DatabricksConfig config = + new DatabricksConfig() + .setHost(origin) + .setCredentialsProvider(new DummyCredentialsProvider()) + .setHttpClient(new CommonsHttpClient.Builder().withTimeoutSeconds(5).build()); + + List endpoints = + new FilesExtEndpoints(config, true, clock, FilesExtEndpoints.RESOLVE_TIMEOUT).resolve(); + + assertEquals(0, redirected.get()); + assertEquals( + Arrays.asList( + new FilesExtEndpoint(Kind.IO_OFFLOAD, origin, true), + new FilesExtEndpoint(Kind.FILES_API_V2, origin, false)), + endpoints); + } finally { + workspace.stop(0); + } + } + + @Test + void defaultEndpoints_areOffloadThenTheWorkspace() { + assertEquals(DEFAULT_ENDPOINTS, resolver().defaultEndpoints()); + } + + @Test + void plainHttpToATlsWorkspace_isSkipped() { + // Workspace credentials must not leave over plain HTTP when the SDK reaches the workspace + // over TLS. + server.plan( + with(FILES_V2_WORKSPACE, "scheme", "http"), + with(IO_OFFLOAD_WS, "scheme", "http"), + FILES_V2_WORKSPACE); + FilesExtEndpoints endpoints = + new FilesExtEndpoints( + config("https://ws.example.com"), true, clock, FilesExtEndpoints.RESOLVE_TIMEOUT); + + assertEquals(Collections.singletonList(PARSED_FILES_V2_WORKSPACE), endpoints.resolve()); + } + + static Stream malformedAddresses() { + List hostnames = + Arrays.asList( + "storage-proxy.example.com:abc", + "storage-proxy.example.com:70000", + "[::1", + "*.example.com", + ".example.com", + "localhost?x", + "localhost#x", + "localhost/x", + "storage-proxy.example.com@localhost", + "%6cocalhost", + "localhost\\", + // Non-ASCII: an HTTP client sends an encoded form of these, not the name as written. + "b\u00fccher.example.com", + "\uff45\uff58\uff41\uff4d\uff50\uff4c\uff45.com", + "exa mple.com", + "exa\u00a0mple.com", + // java.net.URI cannot parse these as a server host, which is what the HTTP stack sends + // to, so they are skipped rather than fail the transfer on them. + "foo.1bar", + "a_b.example.com", + "-a.example.com", + "a..b"); + return Stream.of("http", "https") + .flatMap(scheme -> hostnames.stream().map(hostname -> Arguments.of(scheme, hostname))); + } + + @ParameterizedTest + @MethodSource("malformedAddresses") + void malformedAddress_isSkipped(String scheme, String hostname) { + // Transfers route by each endpoint's parsed host, so an address that does not parse, or that + // names more than a host and port, must not reach them. + server.plan( + with(with(FILES_V2_STORAGE_PROXY, "scheme", scheme), "hostname", hostname), + FILES_V2_WORKSPACE); + + assertEquals(Collections.singletonList(PARSED_FILES_V2_WORKSPACE), resolver().resolve()); + } + + @ParameterizedTest + @ValueSource( + strings = { + "storage-proxy.example.com:8443", + "[::1]", + "[::1]:8443", + "[::1]:65535", + "10.0.0.1", + "xn--bcher-kva.example.com", + "example.com." + }) + void hostWithPort_isAccepted(String hostname) { + server.plan(with(with(FILES_V2_STORAGE_PROXY, "scheme", "https"), "hostname", hostname)); + + assertEquals( + Collections.singletonList( + new FilesExtEndpoint(Kind.FILES_API_V2, "https://" + hostname, true)), + resolver().resolve()); + } + + /** + * The address shapes the server lists: the storage proxy, a Files API 3.0 host and workspace + * hostnames. Pinned so that tightening the address check cannot drop a real endpoint. + */ + static Stream realEndpointShapes() { + return Stream.of( + Arguments.of( + HOST, + entry("FILES_API", "2.0", "http", "storage-proxy.databricks.com", true), + new FilesExtEndpoint(Kind.FILES_API_V2, "http://storage-proxy.databricks.com", true)), + Arguments.of( + HOST, + entry( + "FILES_API", + "3.0", + "https", + "1234567890123456.storage.us-east-1.cloud.databricks.com", + true), + new FilesExtEndpoint( + Kind.FILES_API_V3, + "https://1234567890123456.storage.us-east-1.cloud.databricks.com", + true)), + Arguments.of( + "https://adb-1234567890123456.7.azuredatabricks.net", + entry("IO_OFFLOAD", null, "https", "adb-1234567890123456.7.azuredatabricks.net", true), + new FilesExtEndpoint( + Kind.IO_OFFLOAD, "https://adb-1234567890123456.7.azuredatabricks.net", true)), + Arguments.of( + "https://adb-1234567890123456.7.azuredatabricks.net", + entry("FILES_API", "2.0", "https", "adb-1234567890123456.7.azuredatabricks.net", false), + new FilesExtEndpoint( + Kind.FILES_API_V2, "https://adb-1234567890123456.7.azuredatabricks.net", false)), + Arguments.of( + "https://1234567890123456.7.gcp.databricks.com", + entry("IO_OFFLOAD", null, "https", "1234567890123456.7.gcp.databricks.com", true), + new FilesExtEndpoint( + Kind.IO_OFFLOAD, "https://1234567890123456.7.gcp.databricks.com", true)), + Arguments.of( + "https://1234567890123456.7.gcp.databricks.com", + entry("FILES_API", "2.0", "https", "1234567890123456.7.gcp.databricks.com", false), + new FilesExtEndpoint( + Kind.FILES_API_V2, "https://1234567890123456.7.gcp.databricks.com", false))); + } + + @ParameterizedTest + @MethodSource("realEndpointShapes") + void realEndpointShape_isAccepted( + String workspaceHost, Map listed, FilesExtEndpoint expected) { + server.plan(listed); + FilesExtEndpoints endpoints = + new FilesExtEndpoints( + config(workspaceHost), true, clock, FilesExtEndpoints.RESOLVE_TIMEOUT); + + assertEquals(Collections.singletonList(expected), endpoints.resolve()); + } + + @Test + void randomHostnames_giveOnlyBareOriginsAndNeverPlainHttpToAnotherHost() { + // A property test over random addresses. The seed is fixed so a failure reproduces. + Random random = new Random(20261112); + String alphabet = "abcz019.-:[]@/?#%\\_* \u00fc\uff45\u00a0"; + String[] kinds = {"IO_OFFLOAD", "FILES_API 2.0", "FILES_API 3.0"}; + Pattern bareOrigin = + Pattern.compile("^https?://(\\[[0-9a-fA-F:.%]+\\]|[A-Za-z0-9.-]+)(:[0-9]{0,5})?$"); + int checked = 0; + for (int batch = 0; batch < 100; batch++) { + List entries = new ArrayList<>(); + for (int i = 0; i < 200; i++) { + StringBuilder hostname = new StringBuilder(); + int length = 1 + random.nextInt(20); + for (int j = 0; j < length; j++) { + hostname.append(alphabet.charAt(random.nextInt(alphabet.length()))); + } + String[] kind = kinds[random.nextInt(kinds.length)].split(" "); + entries.add( + entry( + kind[0], + kind.length > 1 ? kind[1] : null, + random.nextBoolean() ? "http" : "https", + hostname.toString(), + true)); + } + server.body = body(entries); + + List resolved = resolver().resolve(); + + if (resolved.equals(DEFAULT_ENDPOINTS)) { + continue; + } + for (FilesExtEndpoint endpoint : resolved) { + checked++; + String url = endpoint.baseUrl(); + assertTrue(bareOrigin.matcher(url).matches(), "not a bare origin: " + url); + Matcher port = Pattern.compile(":([0-9]+)$").matcher(url); + if (port.find() && !url.endsWith("]")) { + assertTrue(Integer.parseInt(port.group(1)) <= 65535, "port out of range: " + url); + } + if (url.startsWith("http://")) { + boolean workspace = + url.equals(HOST) || url.toLowerCase(Locale.ROOT).startsWith(HOST + ":"); + assertTrue( + workspace || endpoint.kind() == Kind.FILES_API_V2, + "plain http to a non-workspace host for " + endpoint); + } + if (endpoint.kind() == Kind.FILES_API_V3) { + assertTrue(url.startsWith("https://"), "Files API 3.0 without TLS: " + endpoint); + } + } + } + // Otherwise the properties above were never checked. + assertTrue(checked > 200, "only " + checked + " random addresses were accepted"); + System.out.println("random addresses accepted and checked: " + checked); + } + + // ======================== the TTL and refreshes ======================== + + @Test + void endpoints_areAskedAgainOnceTheTtlPasses() { + server.plan(FILES_V2_STORAGE_PROXY); + FilesExtEndpoints endpoints = resolver(); + + endpoints.resolve(); + server.plan(FILES_V3); + clock.advanceTime(FilesExtEndpoints.CACHE_TTL.minusSeconds(1)); + assertEquals(Collections.singletonList(PARSED_FILES_V2_STORAGE_PROXY), endpoints.resolve()); + assertEquals(1, server.calls.get()); + + clock.advanceTime(Duration.ofSeconds(1)); + + assertEquals(Collections.singletonList(PARSED_FILES_V3), endpoints.resolve()); + assertEquals(2, server.calls.get()); + } + + @Test + void failedAnswer_isKeptForTheFailureTtl() { + // The workspace does not serve the endpoints API yet, so the client uses the built-in order. + server.always = Fault.status(404); + FilesExtEndpoints endpoints = resolver(); + + assertEquals(DEFAULT_ENDPOINTS, endpoints.resolve()); + server.always = null; + server.plan(FILES_V3); + clock.advanceTime(FilesExtEndpoints.FAILURE_CACHE_TTL.minusSeconds(1)); + assertEquals(DEFAULT_ENDPOINTS, endpoints.resolve()); + assertEquals(1, server.calls.get()); + + clock.advanceTime(Duration.ofSeconds(1)); + + assertEquals(Collections.singletonList(PARSED_FILES_V3), endpoints.resolve()); + assertEquals(2, server.calls.get()); + } + + static Stream transientFailures() { + return Stream.of( + Fault.status(503), + Fault.status(429), + Fault.connectionError(), + // Java only: the caller stops waiting after the resolve timeout. + Fault.block()); + } + + @ParameterizedTest + @MethodSource("transientFailures") + void transientRefreshFailure_keepsTheServersList(Fault failure) { + server.plan(FILES_V3); + FilesExtEndpoints endpoints = resolver(true, SHORT_TIMEOUT); + + endpoints.resolve(); + server.faultOnCall(2, failure); + clock.advanceTime(FilesExtEndpoints.CACHE_TTL); + // The blip did not move the client off Files API 3.0. + assertEquals(Collections.singletonList(PARSED_FILES_V3), endpoints.resolve()); + assertEquals(2, server.calls.get()); + + // It asks again after the failure TTL, not the full TTL. + server.plan(FILES_V2_STORAGE_PROXY); + clock.advanceTime(FilesExtEndpoints.FAILURE_CACHE_TTL); + + assertEquals(Collections.singletonList(PARSED_FILES_V2_STORAGE_PROXY), endpoints.resolve()); + assertEquals(3, server.calls.get()); + } + + @Test + void listKeptThroughFailingRefreshes_expiresAtTheStaleLimit() { + server.plan(FILES_V3); + FilesExtEndpoints endpoints = resolver(); + Instant start = clock.getClock().instant(); + + endpoints.resolve(); + // Discovery breaks for good with an error that looks transient. + server.always = Fault.status(503); + clock.advanceTime(FilesExtEndpoints.CACHE_TTL); + while (clock + .getClock() + .instant() + .plus(FilesExtEndpoints.FAILURE_CACHE_TTL) + .isBefore(start.plus(FilesExtEndpoints.MAX_STALE))) { + assertEquals(Collections.singletonList(PARSED_FILES_V3), endpoints.resolve()); + clock.advanceTime(FilesExtEndpoints.FAILURE_CACHE_TTL); + } + clock.advanceTime(FilesExtEndpoints.FAILURE_CACHE_TTL); + + assertEquals(DEFAULT_ENDPOINTS, endpoints.resolve()); + } + + @Test + void failingRefreshJustBeforeTheStaleLimit_keepsTheListOnlyUntilTheLimit() { + server.plan(FILES_V3); + FilesExtEndpoints endpoints = resolver(); + + endpoints.resolve(); + server.always = Fault.status(503); + // A refresh one minute before the limit fails and keeps the list, but only until the limit. + clock.advanceTime(FilesExtEndpoints.MAX_STALE.minusSeconds(60)); + assertEquals(Collections.singletonList(PARSED_FILES_V3), endpoints.resolve()); + clock.advanceTime(Duration.ofSeconds(60)); + + assertEquals(DEFAULT_ENDPOINTS, endpoints.resolve()); + } + + @Test + void callers_dropAListPastTheStaleLimitWhileAnotherCallerAsks() throws Exception { + server.plan(FILES_V3); + FilesExtEndpoints endpoints = resolver(true, FilesExtEndpoints.RESOLVE_TIMEOUT); + endpoints.resolve(); + clock.advanceTime(FilesExtEndpoints.MAX_STALE); + // Holds the second ask, standing in for a refresh stuck in authentication. + server.faultOnCall(2, Fault.block()); + List> asked = new CopyOnWriteArrayList<>(); + Thread asker = new Thread(() -> asked.add(endpoints.resolve())); + asker.start(); + assertTrue(server.blocked.await(10, TimeUnit.SECONDS), "the expired list was not asked again"); + + // The list is past the stale limit, so this caller gets the built-in order, not the stale one. + List during = endpoints.resolve(); + + server.release.countDown(); + asker.join(10_000); + assertEquals(DEFAULT_ENDPOINTS, during); + assertEquals(Collections.singletonList(Collections.singletonList(PARSED_FILES_V3)), asked); + } + + @Test + void callers_keepTheExpiredListWhileAnotherCallerAsks() throws Exception { + server.plan(FILES_V2_STORAGE_PROXY); + FilesExtEndpoints endpoints = resolver(true, FilesExtEndpoints.RESOLVE_TIMEOUT); + endpoints.resolve(); + clock.advanceTime(FilesExtEndpoints.CACHE_TTL); + server.plan(FILES_V3); + server.faultOnCall(2, Fault.block()); + List> asked = new CopyOnWriteArrayList<>(); + Thread asker = new Thread(() -> asked.add(endpoints.resolve())); + asker.start(); + assertTrue(server.blocked.await(10, TimeUnit.SECONDS), "the expired list was not asked again"); + + // The asking caller holds the refresh, so this one neither asks nor waits for it. + List during = endpoints.resolve(); + + server.release.countDown(); + asker.join(10_000); + assertEquals(Collections.singletonList(PARSED_FILES_V2_STORAGE_PROXY), during); + assertEquals(Collections.singletonList(Collections.singletonList(PARSED_FILES_V3)), asked); + assertEquals(2, server.calls.get()); + } + + @ParameterizedTest + @ValueSource(ints = {403, 404}) + void discoveryTurnedOff_movesTheClientToTheBuiltInOrder(int status) { + // How the server rolls discovery back: the endpoints API answers 403 (or 404 where not served). + server.plan(FILES_V3); + FilesExtEndpoints endpoints = resolver(); + + endpoints.resolve(); + server.always = Fault.status(status); + clock.advanceTime(FilesExtEndpoints.CACHE_TTL); + + assertEquals(DEFAULT_ENDPOINTS, endpoints.resolve()); + } + + // ======================== Java only: the caller's wait ======================== + + @Test + void constants_haveTheirSpecifiedValues() { + assertEquals(Duration.ofSeconds(10), FilesExtEndpoints.RESOLVE_TIMEOUT); + assertEquals(Duration.ofMinutes(30), FilesExtEndpoints.CACHE_TTL); + assertEquals(Duration.ofMinutes(30), FilesExtEndpoints.FAILURE_CACHE_TTL); + assertEquals(Duration.ofHours(2), FilesExtEndpoints.MAX_STALE); + } + + @Test + void clientThatNeverAnswers_givesTheBuiltInOrderWithinTheTimeout() { + // Stands in for a request queued forever behind transfers holding every pooled connection. + // Uses the real 10 s constant on purpose: it caps the caller's total wait for discovery. + server.always = Fault.block(); + FilesExtEndpoints endpoints = new FilesExtEndpoints(config(HOST), true); + long start = System.nanoTime(); + + List resolved = endpoints.resolve(); + + long elapsedMillis = TimeUnit.NANOSECONDS.toMillis(System.nanoTime() - start); + assertEquals(DEFAULT_ENDPOINTS, resolved); + // Wide, so that a loaded runner does not fail it: no wait, or a second one, falls outside. + assertTrue( + elapsedMillis >= 5_000 && elapsedMillis <= 15_000, "waited " + elapsedMillis + " ms"); + } + + @Test + void callerWithNoList_waitsOnlyForTheFirstCallersAsk() throws Exception { + // A client with no list yet waits for the first answer, so its wait is bounded by the first + // caller's timeout and it does not ask again. + server.always = Fault.block(); + FilesExtEndpoints endpoints = resolver(true, FilesExtEndpoints.RESOLVE_TIMEOUT); + Thread first = new Thread(endpoints::resolve); + first.start(); + assertTrue(server.blocked.await(10, TimeUnit.SECONDS), "the server was never asked"); + long start = System.nanoTime(); + + List resolved = endpoints.resolve(); + + long elapsedMillis = TimeUnit.NANOSECONDS.toMillis(System.nanoTime() - start); + first.join(15_000); + assertEquals(DEFAULT_ENDPOINTS, resolved); + // Waiting for an ask of its own would take another 10 s. + assertTrue( + elapsedMillis >= 5_000 && elapsedMillis <= 15_000, "waited " + elapsedMillis + " ms"); + assertEquals(1, server.calls.get()); + } + + @Test + void discovery_leavesNoNonDaemonThreadBehind() throws Exception { + Set nonDaemonBefore = nonDaemonThreads(); + server.plan(FILES_V3); + // The second refresh times out in an HttpClient that stops when interrupted, like Apache's + // pool; the third in one that ignores interrupts, like an opaque user client may. + server.faultOnCall(2, Fault.block()); + server.faultOnCall(3, Fault.blockIgnoringInterrupts()); + FilesExtEndpoints endpoints = resolver(true, SHORT_TIMEOUT); + endpoints.resolve(); + assertTrue(waitForNoDiscoveryThreads(), "the answered refresh left a thread behind"); + clock.advanceTime(FilesExtEndpoints.CACHE_TTL); + endpoints.resolve(); + assertTrue( + waitForNoDiscoveryThreads(), "cancelling the timed-out refresh left a thread behind"); + clock.advanceTime(FilesExtEndpoints.FAILURE_CACHE_TTL); + + endpoints.resolve(); + + Set created = new HashSet<>(nonDaemonThreads()); + created.removeAll(nonDaemonBefore); + assertEquals(Collections.emptySet(), created); + List lingering = discoveryThreads(); + // Only the refresh whose client ignores interrupts is still running, and it is a daemon thread. + assertEquals(1, lingering.size(), "discovery threads: " + lingering); + assertTrue(lingering.get(0).isDaemon(), lingering.get(0).getName() + " is not a daemon thread"); + } + + @Test + void aRefreshThatOutlivesItsTimeout_isTheOnlyRequestInFlight() throws Exception { + server.plan(FILES_V3); + server.faultOnCall(1, Fault.blockIgnoringInterrupts()); + FilesExtEndpoints endpoints = resolver(true, SHORT_TIMEOUT); + assertEquals(DEFAULT_ENDPOINTS, endpoints.resolve()); + clock.advanceTime(FilesExtEndpoints.FAILURE_CACHE_TTL); + + // The first request is still running: the refresh waits for it and does not send another. + assertEquals(DEFAULT_ENDPOINTS, endpoints.resolve()); + assertEquals(1, server.calls.get()); + + server.release.countDown(); + assertTrue(waitForNoDiscoveryThreads(), "the released request did not end"); + clock.advanceTime(FilesExtEndpoints.FAILURE_CACHE_TTL); + + assertEquals(Collections.singletonList(PARSED_FILES_V3), endpoints.resolve()); + assertEquals(2, server.calls.get()); + } + + @Test + void aRefreshAfterAnInterruptedCaller_waitsForItsRequest() throws Exception { + server.plan(FILES_V3); + server.faultOnCall(1, Fault.blockIgnoringInterrupts()); + FilesExtEndpoints endpoints = resolver(true, Duration.ofSeconds(5)); + // Interrupts this caller once its request is running. + Thread caller = Thread.currentThread(); + Thread interrupter = + new Thread( + () -> { + try { + if (server.blocked.await(10, TimeUnit.SECONDS)) { + caller.interrupt(); + } + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + } + }); + interrupter.start(); + assertEquals(DEFAULT_ENDPOINTS, endpoints.resolve()); + // Read, and so cleared, before joining: a join on an interrupted thread throws. + assertTrue(Thread.interrupted(), "the caller was not interrupted, or its status was cleared"); + interrupter.join(10_000); + + // Ends the first request while the next caller waits for it, noting whether it asked again. + AtomicInteger callsBeforeTheRelease = new AtomicInteger(); + Thread releaser = + new Thread( + () -> { + try { + Thread.sleep(200); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + } + callsBeforeTheRelease.set(server.calls.get()); + server.release.countDown(); + }); + releaser.start(); + List resolved = endpoints.resolve(); + releaser.join(10_000); + + assertEquals(1, callsBeforeTheRelease.get(), "a second request was sent while one was running"); + assertEquals(Collections.singletonList(PARSED_FILES_V3), resolved); + assertEquals(2, server.calls.get()); + } + + private static List discoveryThreads() { + List threads = new ArrayList<>(); + for (Thread t : Thread.getAllStackTraces().keySet()) { + if (t.isAlive() && t.getName().equals(FilesExtEndpoints.DISCOVERY_THREAD_NAME)) { + threads.add(t); + } + } + return threads; + } + + /** Waits up to 5 s for every discovery thread to end; the test fails if one does not. */ + private static boolean waitForNoDiscoveryThreads() throws InterruptedException { + for (Thread t : discoveryThreads()) { + t.join(5_000); + } + return discoveryThreads().isEmpty(); + } + + private static Set nonDaemonThreads() { + Set threads = new HashSet<>(); + for (Thread t : Thread.getAllStackTraces().keySet()) { + if (!t.isDaemon() && t.isAlive()) { + threads.add(t); + } + } + return threads; + } + + @Test + void blockedRefresh_doesNotStallCallersThatHaveAList() throws Exception { + server.plan(FILES_V3); + // A caller that waited for the refresh would wait 30 s, well past the 15 s bound below. + FilesExtEndpoints endpoints = resolver(true, Duration.ofSeconds(30)); + endpoints.resolve(); + clock.advanceTime(FilesExtEndpoints.CACHE_TTL); + server.always = Fault.block(); + List> asked = new CopyOnWriteArrayList<>(); + Thread asker = new Thread(() -> asked.add(endpoints.resolve())); + asker.start(); + assertTrue(server.blocked.await(10, TimeUnit.SECONDS), "the expired list was not asked again"); + long start = System.nanoTime(); + + List during = endpoints.resolve(); + + long elapsedMillis = TimeUnit.NANOSECONDS.toMillis(System.nanoTime() - start); + server.release.countDown(); + asker.join(15_000); + assertEquals(Collections.singletonList(PARSED_FILES_V3), during); + assertTrue(elapsedMillis < 15_000, "waited " + elapsedMillis + " ms"); + // Released, the asker gets the server's answer. + assertEquals(Collections.singletonList(Collections.singletonList(PARSED_FILES_V3)), asked); + } + + @Test + void interruptedCaller_getsTheBuiltInOrderAndKeepsItsInterruptStatus() { + server.always = Fault.block(); + FilesExtEndpoints endpoints = resolver(true, FilesExtEndpoints.RESOLVE_TIMEOUT); + Thread.currentThread().interrupt(); + + List resolved = endpoints.resolve(); + + assertTrue(Thread.interrupted(), "the interrupt status was cleared"); + assertEquals(DEFAULT_ENDPOINTS, resolved); + } + + @Test + void interruptedCallerWithNoList_doesNotCacheTheBuiltInOrder() { + // An interrupt says nothing about the server, so the next caller asks again. + server.plan(FILES_V3); + server.always = Fault.block(); + FilesExtEndpoints endpoints = resolver(true, FilesExtEndpoints.RESOLVE_TIMEOUT); + Thread.currentThread().interrupt(); + assertEquals(DEFAULT_ENDPOINTS, endpoints.resolve()); + assertTrue(Thread.interrupted(), "the interrupt status was cleared"); + server.always = null; + + assertEquals(Collections.singletonList(PARSED_FILES_V3), endpoints.resolve()); + } + + @Test + void interruptedCallerWithAnExpiredList_getsItAndLeavesTheCacheExpired() { + server.plan(FILES_V3); + FilesExtEndpoints endpoints = resolver(true, FilesExtEndpoints.RESOLVE_TIMEOUT); + endpoints.resolve(); + clock.advanceTime(FilesExtEndpoints.CACHE_TTL); + server.always = Fault.block(); + Thread.currentThread().interrupt(); + assertEquals(Collections.singletonList(PARSED_FILES_V3), endpoints.resolve()); + assertTrue(Thread.interrupted(), "the interrupt status was cleared"); + server.always = null; + server.plan(FILES_V2_STORAGE_PROXY); + + // Still expired, so this caller asks and gets the new list. + assertEquals(Collections.singletonList(PARSED_FILES_V2_STORAGE_PROXY), endpoints.resolve()); + } + + // ======================== helpers ======================== + + // The real timeout, so that a test expecting an answer does not time out on a loaded machine. + // Tests of the timeout pass their own. + private FilesExtEndpoints resolver() { + return resolver(true, FilesExtEndpoints.RESOLVE_TIMEOUT); + } + + private FilesExtEndpoints resolver(boolean enabled) { + return resolver(enabled, FilesExtEndpoints.RESOLVE_TIMEOUT); + } + + private FilesExtEndpoints resolver(boolean enabled, Duration timeout) { + return new FilesExtEndpoints(config(HOST), enabled, clock, timeout); + } + + private DatabricksConfig config(String host) { + return new DatabricksConfig() + .setHost(host) + .setCredentialsProvider(new DummyCredentialsProvider()) + .setHttpClient(server); + } + + private static Map entry( + String api, String apiVersion, String scheme, String hostname, boolean multipart) { + Map e = new LinkedHashMap<>(); + e.put("api", api); + if (apiVersion != null) { + e.put("api_version", apiVersion); + } + e.put("scheme", scheme); + e.put("hostname", hostname); + e.put("multipart_upload_supported", multipart); + return Collections.unmodifiableMap(e); + } + + private static Map with(Map base, String key, Object value) { + Map e = new LinkedHashMap<>(base); + e.put(key, value); + return e; + } + + private static Map without(Map base, String key) { + Map e = new LinkedHashMap<>(base); + e.remove(key); + return e; + } + + private static Map map(Object... keysAndValues) { + Map m = new LinkedHashMap<>(); + for (int i = 0; i < keysAndValues.length; i += 2) { + m.put((String) keysAndValues[i], keysAndValues[i + 1]); + } + return m; + } + + private static String body(List entries) { + return json(map("endpoints", entries)); + } + + private static String json(Object value) { + try { + return MAPPER.writeValueAsString(value); + } catch (JsonProcessingException e) { + throw new IllegalStateException(e); + } + } + + /** How one request to the fake endpoints API fails. */ + static final class Fault { + final int status; + final boolean connectionError; + final boolean block; + final boolean ignoreInterrupts; + final String text; + + private Fault( + int status, boolean connectionError, boolean block, boolean ignoreInterrupts, String text) { + this.status = status; + this.connectionError = connectionError; + this.block = block; + this.ignoreInterrupts = ignoreInterrupts; + this.text = text; + } + + static Fault status(int status) { + return new Fault(status, false, false, false, null); + } + + static Fault connectionError() { + return new Fault(0, true, false, false, null); + } + + /** Holds the request until the test releases it, then answers normally. */ + static Fault block() { + return new Fault(0, false, true, false, null); + } + + /** Like {@link #block()}, for a user's HttpClient that does not stop when interrupted. */ + static Fault blockIgnoringInterrupts() { + return new Fault(0, false, true, true, null); + } + + /** Answers 200 with this body. */ + static Fault text(String text) { + return new Fault(0, false, false, false, text); + } + + @Override + public String toString() { + if (connectionError) { + return "connection error"; + } + if (block) { + return "no answer"; + } + if (text != null) { + return "body " + (text.length() > 30 ? text.substring(0, 30) + "..." : text); + } + return "status " + status; + } + } + + /** A fake of the workspace's endpoints API. */ + static final class FakeServer implements HttpClient { + /** The 200 answer. */ + volatile String body = body(Collections.emptyList()); + + /** The fault of every call that has none of its own. */ + volatile Fault always; + + final Map faultsByCall = new ConcurrentHashMap<>(); + final AtomicInteger calls = new AtomicInteger(); + final List requests = new CopyOnWriteArrayList<>(); + + /** Counted down when a request starts to wait for {@link #release}. */ + final CountDownLatch blocked = new CountDownLatch(1); + + final CountDownLatch release = new CountDownLatch(1); + + void plan(Map... entries) { + body = body(Arrays.asList(entries)); + } + + void faultOnCall(int call, Fault fault) { + faultsByCall.put(call, fault); + } + + @Override + public Response execute(Request in) throws IOException { + int call = calls.incrementAndGet(); + requests.add(in); + Fault fault = faultsByCall.getOrDefault(call, always); + if (fault != null && fault.block) { + blocked.countDown(); + boolean interrupted = false; + while (true) { + try { + release.await(); + break; + } catch (InterruptedException e) { + if (!fault.ignoreInterrupts) { + Thread.currentThread().interrupt(); + throw new InterruptedIOException("interrupted waiting for the test to release"); + } + interrupted = true; + } + } + if (interrupted) { + Thread.currentThread().interrupt(); + } + fault = null; + } + if (fault != null && fault.connectionError) { + throw new IOException("simulated connection error"); + } + if (fault != null && fault.status != 0) { + return new Response( + in, + fault.status, + "error", + Collections.>emptyMap(), + "{\"error_code\": \"ERROR\", \"message\": \"no\"}"); + } + String answer = fault != null && fault.text != null ? fault.text : body; + return new Response(in, 200, "OK", Collections.>emptyMap(), answer); + } + } +} diff --git a/examples/docs/pom.xml b/examples/docs/pom.xml index efd805640..6b7434704 100644 --- a/examples/docs/pom.xml +++ b/examples/docs/pom.xml @@ -24,7 +24,7 @@ com.databricks databricks-sdk-java - 0.184.0 + 0.185.0 diff --git a/examples/spring-boot-oauth-u2m-demo/pom.xml b/examples/spring-boot-oauth-u2m-demo/pom.xml index 332ae409c..252aeed17 100644 --- a/examples/spring-boot-oauth-u2m-demo/pom.xml +++ b/examples/spring-boot-oauth-u2m-demo/pom.xml @@ -40,7 +40,7 @@ com.databricks databricks-sdk-java - 0.184.0 + 0.185.0 diff --git a/lockfile.json b/lockfile.json index ae2d29333..16efe799c 100644 --- a/lockfile.json +++ b/lockfile.json @@ -1,7 +1,7 @@ { "artifactId": "databricks-sdk-parent", "groupId": "com.databricks", - "version": "0.184.0", + "version": "0.185.0", "lockFileVersion": 1, "dependencies": [], "mavenPlugins": [], diff --git a/pom.xml b/pom.xml index 100473623..a2350223d 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ 4.0.0 com.databricks databricks-sdk-parent - 0.184.0 + 0.185.0 pom Databricks SDK for Java The Databricks SDK for Java includes functionality to accelerate development with Java for diff --git a/shaded/pom.xml b/shaded/pom.xml index 78ad300e6..d4304bacd 100644 --- a/shaded/pom.xml +++ b/shaded/pom.xml @@ -4,7 +4,7 @@ 4.0.0 - 0.184.0 + 0.185.0 com.databricks