Commit 4f114dd
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
- databricks-sdk-java/src
- main/java/com/databricks/sdk
- core
- service
- agentbricks
- apps
- bundle
- catalog
- cleanrooms
- compute
- dashboards
- database
- dataclassification
- dataquality
- environments
- files
- iamv2
- iam
- jobs
- knowledgeassistants
- marketplace
- ml
- oauth2
- pipelines
- postgres
- qualitymonitorv2
- serving
- settingsv2
- settings
- sharing
- sql
- supervisoragents
- tags
- vectorsearch
- workspace
- test/java/com/databricks/sdk
- integration
- service
- apps
- httpcallv2
- idempotencytesting
- jsonmarshallv2
- lrotesting
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
| 16 | + | |
16 | 17 | | |
17 | 18 | | |
Lines changed: 5 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
36 | | - | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
37 | 41 | | |
38 | 42 | | |
39 | 43 | | |
| |||
Lines changed: 6 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 24 additions & 24 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
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