Skip to content

Commit 4f114dd

Browse files
authored
Use X-Databricks-Workspace-Id for workspace routing (#805)
## Summary Workspace-scoped API calls now identify the target workspace via the `X-Databricks-Workspace-Id` header instead of `X-Databricks-Org-Id`. The value source is unchanged: it still comes from `DatabricksConfig.setWorkspaceId()` (or the `DATABRICKS_WORKSPACE_ID` environment variable). ## Why On unified Databricks hosts that serve multiple workspaces, the SDK sends a routing header on every workspace-scoped HTTP request so the gateway can dispatch it to the correct workspace. Until now that header was `X-Databricks-Org-Id`. The Databricks platform is consolidating workspace addressing onto a single header, `X-Databricks-Workspace-Id`, which accepts a broader range of workspace identifier formats and replaces the older single-purpose channels going forward. The previous header continues to be accepted by the platform, so older SDK versions keep working, but new SDK versions should use the new name. This PR is the Java SDK's part of that migration. ## What changed ### Interface changes None. `DatabricksConfig#workspaceId` keeps the same field name, type (`String`), accessors, and environment variable (`DATABRICKS_WORKSPACE_ID`). The Javadoc is widened to note that the value may now be either a classic numeric workspace ID or another workspace identifier format that the server understands. ### Behavioral changes - Workspace-scoped requests no longer send `X-Databricks-Org-Id`. They now send `X-Databricks-Workspace-Id` (with the same value, gated on `apiClient.workspaceId()` being non-null). Account-scoped requests are unaffected. ### Internal changes - Regenerated every `*Impl.java` under `databricks-sdk-java/src/main/java/com/databricks/sdk/service/*/` and the test fixtures under `databricks-sdk-java/src/test/java/com/databricks/sdk/service/{httpcallv2,idempotencytesting,jsonmarshallv2,lrotesting}/` from the corresponding generator template change: 149 files, 961 line swaps — symmetric, no logic change. - Updated hand-written sites the generator does not cover: the deprecated SCIM v1 impls (`GroupsImpl`, `ServicePrincipalsImpl`, `UsersImpl`) and the `SharesExtImpl` extension for `/api/2.1/unity-catalog/shares`. - Updated the `X-Databricks-Org-Id` reference inside the `UnifiedHostWorkspaceIT` comment so the comment matches the new code. ## How is this tested? - `make fmt` and `mvn clean test` pass locally. Full unit suite is green (1376 passed, 0 failed). - Spot-checked the regenerated diff: every changed line is exclusively the header literal swap; no collateral changes. Mirrors [databricks/databricks-sdk-go#1688](databricks/databricks-sdk-go#1688). --------- Signed-off-by: Divyansh Vijayvergia <divyansh.vijayvergia@databricks.com>
1 parent 6ae1364 commit 4f114dd

156 files changed

Lines changed: 1028 additions & 985 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.

NEXT_CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,6 @@
1313
### Documentation
1414

1515
### Internal Changes
16+
* Switch workspace addressing header on workspace-scoped API calls from `X-Databricks-Org-Id` to `X-Databricks-Workspace-Id`. The value continues to come from the `DATABRICKS_WORKSPACE_ID` environment variable / `DatabricksConfig.setWorkspaceId()` setter, and now accepts either a classic numeric workspace ID or another workspace identifier format (server disambiguates). Mirrors [databricks/databricks-sdk-go#1688](https://github.com/databricks/databricks-sdk-go/pull/1688).
1617

1718
### API Changes

databricks-sdk-java/src/main/java/com/databricks/sdk/core/DatabricksConfig.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,11 @@ public class DatabricksConfig {
3333
@ConfigAttribute(env = "DATABRICKS_ACCOUNT_ID")
3434
private String accountId;
3535

36-
/** Workspace ID for unified host operations. */
36+
/**
37+
* Workspace identifier sent on workspace-scoped API calls to unified hosts. Accepts either a
38+
* classic numeric workspace ID or another workspace identifier format that the server understands
39+
* (server disambiguates).
40+
*/
3741
@ConfigAttribute(env = "DATABRICKS_WORKSPACE_ID")
3842
private String workspaceId;
3943

databricks-sdk-java/src/main/java/com/databricks/sdk/service/agentbricks/AgentBricksImpl.java

Lines changed: 6 additions & 6 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/apps/AppsImpl.java

Lines changed: 24 additions & 24 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/apps/AppsSettingsImpl.java

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

0 commit comments

Comments
 (0)