Skip to content

Commit 4f4db15

Browse files
Release databricks-sdk-java (#937)
Automated release of `databricks-sdk-java`: regenerated SDK plus the changelog, version bump, and release-ledger update. See CHANGELOG.md for the released version(s). Co-authored-by: databricks-ci-ghec-1[bot] <184311507+databricks-ci-ghec-1[bot]@users.noreply.github.com>
1 parent 39eda96 commit 4f4db15

42 files changed

Lines changed: 1896 additions & 13 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.codegen/_last_sha‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
880d3221a1560a48172008865530ea224f5905a4
1+
0f44212e3b048dba62be17565dfd55b4b69d7b9c

‎CHANGELOG.md‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# Version changelog
22

3+
## Release v0.160.0 (2026-10-03)
4+
5+
### API Changes
6+
* Add `accountClient.privateNetworkGateways()` service.
7+
* Add `projectEnvironment` field for `com.databricks.sdk.service.compute.Environment`.
8+
39
## Release v0.159.0 (2026-10-02)
410

511
### API Changes

‎databricks-sdk-java/lockfile.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"artifactId": "databricks-sdk-java",
33
"groupId": "com.databricks",
4-
"version": "0.159.0",
4+
"version": "0.160.0",
55
"lockFileVersion": 1,
66
"dependencies": [
77
{

‎databricks-sdk-java/pom.xml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<parent>
66
<groupId>com.databricks</groupId>
77
<artifactId>databricks-sdk-parent</artifactId>
8-
<version>0.159.0</version>
8+
<version>0.160.0</version>
99
</parent>
1010
<artifactId>databricks-sdk-java</artifactId>
1111
<name>Databricks SDK for Java</name>

‎databricks-sdk-java/src/main/java/com/databricks/sdk/AccountClient.java‎

Lines changed: 23 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎databricks-sdk-java/src/main/java/com/databricks/sdk/core/UserAgent.java‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ public String getValue() {
3636
// TODO: check if reading from
3737
// /META-INF/maven/com.databricks/databrics-sdk-java/pom.properties
3838
// or getClass().getPackage().getImplementationVersion() is enough.
39-
private static final String version = "0.159.0";
39+
private static final String version = "0.160.0";
4040

4141
public static void withProduct(String product, String productVersion) {
4242
UserAgent.product = product;

‎databricks-sdk-java/src/main/java/com/databricks/sdk/service/compute/Environment.java‎

Lines changed: 22 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎databricks-sdk-java/src/main/java/com/databricks/sdk/service/database/DatabaseAPI.java‎

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎databricks-sdk-java/src/main/java/com/databricks/sdk/service/database/DatabaseService.java‎

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 167 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,167 @@
1+
// Code generated from OpenAPI specs by Databricks SDK Generator. DO NOT EDIT.
2+
package com.databricks.sdk.service.networking;
3+
4+
import com.databricks.sdk.core.DatabricksException;
5+
import com.databricks.sdk.core.logging.Logger;
6+
import com.databricks.sdk.core.logging.LoggerFactory;
7+
import com.databricks.sdk.core.utils.SerDeUtils;
8+
import com.databricks.sdk.service.common.lro.LroOptions;
9+
import com.databricks.sdk.support.Generated;
10+
import com.fasterxml.jackson.core.JsonProcessingException;
11+
import com.fasterxml.jackson.databind.JsonNode;
12+
import com.fasterxml.jackson.databind.ObjectMapper;
13+
import java.time.Duration;
14+
import java.util.Optional;
15+
import java.util.concurrent.TimeoutException;
16+
17+
/**
18+
* Wrapper for interacting with a long-running createPrivateNetworkGateway operation. Provides
19+
* methods to wait for completion, check status, cancel, and access metadata.
20+
*/
21+
@Generated
22+
public class CreatePrivateNetworkGatewayOperation {
23+
private static final Logger LOG =
24+
LoggerFactory.getLogger(CreatePrivateNetworkGatewayOperation.class);
25+
26+
private final PrivateNetworkGatewaysService impl;
27+
private Operation operation;
28+
private final ObjectMapper objectMapper;
29+
30+
public CreatePrivateNetworkGatewayOperation(
31+
PrivateNetworkGatewaysService impl, Operation operation) {
32+
this.impl = impl;
33+
this.operation = operation;
34+
this.objectMapper = SerDeUtils.createMapper();
35+
}
36+
37+
/**
38+
* Wait for the operation to complete and return the resulting PrivateNetworkGateway. Waits
39+
* indefinitely if no timeout is specified.
40+
*
41+
* @return the created PrivateNetworkGateway
42+
* @throws TimeoutException if the operation doesn't complete within the timeout
43+
* @throws DatabricksException if the operation fails
44+
*/
45+
public PrivateNetworkGateway waitForCompletion() throws TimeoutException {
46+
return waitForCompletion(Optional.empty());
47+
}
48+
49+
/**
50+
* Wait for the operation to complete and return the resulting PrivateNetworkGateway.
51+
*
52+
* @param options the options for configuring the wait behavior, can be empty for defaults
53+
* @return the created PrivateNetworkGateway
54+
* @throws TimeoutException if the operation doesn't complete within the timeout
55+
* @throws DatabricksException if the operation fails
56+
*/
57+
public PrivateNetworkGateway waitForCompletion(Optional<LroOptions> options)
58+
throws TimeoutException {
59+
Optional<Duration> timeout = options.flatMap(LroOptions::getTimeout);
60+
long deadline =
61+
timeout.isPresent()
62+
? System.currentTimeMillis() + timeout.get().toMillis()
63+
: Long.MAX_VALUE;
64+
String statusMessage = "polling operation...";
65+
int attempt = 1;
66+
67+
while (System.currentTimeMillis() < deadline) {
68+
// Refresh the operation state
69+
refreshOperation();
70+
71+
if (operation.getDone() != null && operation.getDone()) {
72+
// Operation completed, check for success or failure
73+
if (operation.getError() != null) {
74+
String errorMsg = "unknown error";
75+
if (operation.getError().getMessage() != null
76+
&& !operation.getError().getMessage().isEmpty()) {
77+
errorMsg = operation.getError().getMessage();
78+
}
79+
80+
if (operation.getError().getErrorCode() != null) {
81+
errorMsg = String.format("[%s] %s", operation.getError().getErrorCode(), errorMsg);
82+
}
83+
84+
throw new DatabricksException("Operation failed: " + errorMsg);
85+
}
86+
87+
// Operation completed successfully, unmarshal response
88+
if (operation.getResponse() == null) {
89+
throw new DatabricksException("Operation completed but no response available");
90+
}
91+
92+
try {
93+
JsonNode responseJson = objectMapper.valueToTree(operation.getResponse());
94+
return objectMapper.treeToValue(responseJson, PrivateNetworkGateway.class);
95+
} catch (JsonProcessingException e) {
96+
throw new DatabricksException(
97+
"Failed to unmarshal privateNetworkGateway response: " + e.getMessage(), e);
98+
}
99+
}
100+
101+
// Operation still in progress, wait before polling again
102+
String prefix = String.format("operation=%s", operation.getName());
103+
int sleep = Math.min(attempt, 10); // sleep 10s max per attempt
104+
LOG.info("{}: operation in progress (sleeping ~{}s)", prefix, sleep);
105+
106+
try {
107+
Thread.sleep((long) (sleep * 1000L + Math.random() * 1000));
108+
} catch (InterruptedException e) {
109+
Thread.currentThread().interrupt();
110+
throw new DatabricksException("Current thread was interrupted", e);
111+
}
112+
attempt++;
113+
}
114+
115+
String timeoutMessage =
116+
timeout.isPresent()
117+
? String.format("Operation timed out after %s: %s", timeout.get(), statusMessage)
118+
: String.format("Operation timed out: %s", statusMessage);
119+
throw new TimeoutException(timeoutMessage);
120+
}
121+
122+
/**
123+
* Get the operation name.
124+
*
125+
* @return the operation name
126+
*/
127+
public String getName() {
128+
return operation.getName();
129+
}
130+
131+
/**
132+
* Get the operation metadata.
133+
*
134+
* @return the operation metadata, or null if not available
135+
* @throws DatabricksException if the metadata cannot be deserialized
136+
*/
137+
public PrivateNetworkGatewayOperationMetadata getMetadata() {
138+
if (operation.getMetadata() == null) {
139+
return null;
140+
}
141+
142+
try {
143+
JsonNode metadataJson = objectMapper.valueToTree(operation.getMetadata());
144+
return objectMapper.treeToValue(metadataJson, PrivateNetworkGatewayOperationMetadata.class);
145+
} catch (JsonProcessingException e) {
146+
throw new DatabricksException("Failed to unmarshal operation metadata: " + e.getMessage(), e);
147+
}
148+
}
149+
150+
/**
151+
* Check if the operation is done. This method refreshes the operation state before checking.
152+
*
153+
* @return true if the operation is complete, false otherwise
154+
* @throws DatabricksException if the status check fails
155+
*/
156+
public boolean isDone() {
157+
refreshOperation();
158+
return operation.getDone() != null && operation.getDone();
159+
}
160+
161+
/** Refresh the operation state by polling the server. */
162+
private void refreshOperation() {
163+
operation =
164+
impl.getPrivateNetworkGatewayOperation(
165+
new GetOperationRequest().setName(operation.getName()));
166+
}
167+
}

0 commit comments

Comments
 (0)