From de6a609ecad8d04722262a4930e70edb95de3e25 Mon Sep 17 00:00:00 2001 From: Divyansh Vijayvergia Date: Tue, 19 May 2026 13:37:21 +0000 Subject: [PATCH 1/3] Migrate generated code to X-Databricks-Workspace-Id header Mechanical literal swap matching the updated pysdkv0/pysdkv1 generator templates that emit the workspace routing header on workspace-scoped operations. 35 generated files, 969 occurrences (symmetric +/-): - 30 generated service modules under databricks/sdk/service/ - databricks/sdk/__init__.py (WorkspaceClient.get_workspace_id()) - 4 generated test fixtures under tests/databricks/sdk/service/ No behavioral change beyond the header name; emission remains gated on the existing `cfg.workspace_id` check. Signed-off-by: Divyansh Vijayvergia --- databricks/sdk/__init__.py | 6 +- databricks/sdk/service/agentbricks.py | 12 +- databricks/sdk/service/apps.py | 58 ++-- databricks/sdk/service/catalog.py | 260 +++++++++--------- databricks/sdk/service/cleanrooms.py | 40 +-- databricks/sdk/service/compute.py | 126 ++++----- databricks/sdk/service/dashboards.py | 94 +++---- databricks/sdk/service/database.py | 48 ++-- databricks/sdk/service/dataclassification.py | 8 +- databricks/sdk/service/dataquality.py | 22 +- databricks/sdk/service/environments.py | 18 +- databricks/sdk/service/files.py | 36 +-- databricks/sdk/service/iam.py | 108 ++++---- databricks/sdk/service/iamv2.py | 18 +- databricks/sdk/service/jobs.py | 46 ++-- databricks/sdk/service/knowledgeassistants.py | 40 +-- databricks/sdk/service/marketplace.py | 100 +++---- databricks/sdk/service/ml.py | 212 +++++++------- databricks/sdk/service/oauth2.py | 6 +- databricks/sdk/service/pipelines.py | 32 +-- databricks/sdk/service/postgres.py | 68 ++--- databricks/sdk/service/qualitymonitorv2.py | 10 +- databricks/sdk/service/serving.py | 44 +-- databricks/sdk/service/settings.py | 136 ++++----- databricks/sdk/service/settingsv2.py | 6 +- databricks/sdk/service/sharing.py | 54 ++-- databricks/sdk/service/sql.py | 138 +++++----- databricks/sdk/service/supervisoragents.py | 38 +-- databricks/sdk/service/tags.py | 20 +- databricks/sdk/service/vectorsearch.py | 44 +-- databricks/sdk/service/workspace.py | 70 ++--- tests/databricks/sdk/service/httpcallv2.py | 6 +- .../sdk/service/idempotencytesting.py | 2 +- .../databricks/sdk/service/jsonmarshallv2.py | 2 +- tests/databricks/sdk/service/lrotesting.py | 10 +- 35 files changed, 969 insertions(+), 969 deletions(-) diff --git a/databricks/sdk/__init__.py b/databricks/sdk/__init__.py index ce6fffaa4..a6655e290 100755 --- a/databricks/sdk/__init__.py +++ b/databricks/sdk/__init__.py @@ -1103,13 +1103,13 @@ def get_workspace_id(self) -> int: If ``Config.workspace_id`` is already set (from the databrickscfg profile, the ``DATABRICKS_WORKSPACE_ID`` env var, host metadata, or a ``?o=`` query param), it is returned without an API round-trip. Otherwise the ID is - fetched from the ``X-Databricks-Org-Id`` response header on + fetched from the ``X-Databricks-Workspace-Id`` response header on ``/api/2.0/preview/scim/v2/Me``. """ if self._config.workspace_id: return int(self._config.workspace_id) - response = self._api_client.do("GET", "/api/2.0/preview/scim/v2/Me", response_headers=["X-Databricks-Org-Id"]) - return int(response["X-Databricks-Org-Id"]) + response = self._api_client.do("GET", "/api/2.0/preview/scim/v2/Me", response_headers=["X-Databricks-Workspace-Id"]) + return int(response["X-Databricks-Workspace-Id"]) def __repr__(self): return f"WorkspaceClient(host='{self._config.host}', auth_type='{self._config.auth_type}', ...)" diff --git a/databricks/sdk/service/agentbricks.py b/databricks/sdk/service/agentbricks.py index 74dfa5d8c..5b7fc90f0 100755 --- a/databricks/sdk/service/agentbricks.py +++ b/databricks/sdk/service/agentbricks.py @@ -211,7 +211,7 @@ def cancel_optimize(self, id: str): cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id self._api.do("POST", f"/api/2.0/custom-llms/{id}/optimize/cancel", headers=headers) @@ -261,7 +261,7 @@ def create_custom_llm( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("POST", "/api/2.0/custom-llms", body=body, headers=headers) return CustomLlm.from_dict(res) @@ -281,7 +281,7 @@ def delete_custom_llm(self, id: str): cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id self._api.do("DELETE", f"/api/2.0/custom-llms/{id}", headers=headers) @@ -300,7 +300,7 @@ def get_custom_llm(self, id: str) -> CustomLlm: cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("GET", f"/api/2.0/custom-llms/{id}", headers=headers) return CustomLlm.from_dict(res) @@ -321,7 +321,7 @@ def start_optimize(self, id: str) -> CustomLlm: cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("POST", f"/api/2.0/custom-llms/{id}/optimize", headers=headers) return CustomLlm.from_dict(res) @@ -362,7 +362,7 @@ def update_custom_llm(self, id: str, custom_llm: CustomLlm, update_mask: str) -> cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("PATCH", f"/api/2.0/custom-llms/{id}", body=body, headers=headers) return CustomLlm.from_dict(res) diff --git a/databricks/sdk/service/apps.py b/databricks/sdk/service/apps.py index d7ddcfcb0..24e337ccd 100755 --- a/databricks/sdk/service/apps.py +++ b/databricks/sdk/service/apps.py @@ -2942,7 +2942,7 @@ def create(self, app: App, *, no_compute: Optional[bool] = None) -> Wait[App]: cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id op_response = self._api.do("POST", "/api/2.0/apps", query=query, body=body, headers=headers) return Wait(self.wait_get_app_active, response=App.from_dict(op_response), name=op_response["name"]) @@ -2966,7 +2966,7 @@ def create_space(self, space: Space) -> CreateSpaceOperation: cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("POST", "/api/2.0/app-spaces", body=body, headers=headers) operation = Operation.from_dict(res) @@ -3006,7 +3006,7 @@ def create_update(self, app_name: str, update_mask: str, *, app: Optional[App] = cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id op_response = self._api.do("POST", f"/api/2.0/apps/{app_name}/update", body=body, headers=headers) return Wait(self.wait_get_update_app_succeeded, response=AppUpdate.from_dict(op_response), app_name=app_name) @@ -3031,7 +3031,7 @@ def delete(self, name: str) -> App: cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("DELETE", f"/api/2.0/apps/{name}", headers=headers) return App.from_dict(res) @@ -3051,7 +3051,7 @@ def delete_app_thumbnail(self, name: str): cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id self._api.do("DELETE", f"/api/2.0/apps/{name}/thumbnail", headers=headers) @@ -3070,7 +3070,7 @@ def delete_space(self, name: str) -> DeleteSpaceOperation: cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("DELETE", f"/api/2.0/app-spaces/{name}", headers=headers) operation = Operation.from_dict(res) @@ -3097,7 +3097,7 @@ def deploy(self, app_name: str, app_deployment: AppDeployment) -> Wait[AppDeploy cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id op_response = self._api.do("POST", f"/api/2.0/apps/{app_name}/deployments", body=body, headers=headers) return Wait( @@ -3127,7 +3127,7 @@ def get(self, name: str) -> App: cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("GET", f"/api/2.0/apps/{name}", headers=headers) return App.from_dict(res) @@ -3149,7 +3149,7 @@ def get_deployment(self, app_name: str, deployment_id: str) -> AppDeployment: cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("GET", f"/api/2.0/apps/{app_name}/deployments/{deployment_id}", headers=headers) return AppDeployment.from_dict(res) @@ -3169,7 +3169,7 @@ def get_permission_levels(self, app_name: str) -> GetAppPermissionLevelsResponse cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("GET", f"/api/2.0/permissions/apps/{app_name}/permissionLevels", headers=headers) return GetAppPermissionLevelsResponse.from_dict(res) @@ -3189,7 +3189,7 @@ def get_permissions(self, app_name: str) -> AppPermissions: cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("GET", f"/api/2.0/permissions/apps/{app_name}", headers=headers) return AppPermissions.from_dict(res) @@ -3209,7 +3209,7 @@ def get_space(self, name: str) -> Space: cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("GET", f"/api/2.0/app-spaces/{name}", headers=headers) return Space.from_dict(res) @@ -3229,7 +3229,7 @@ def get_space_operation(self, name: str) -> Operation: cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("GET", f"/api/2.0/app-spaces/{name}/operation", headers=headers) return Operation.from_dict(res) @@ -3249,7 +3249,7 @@ def get_update(self, app_name: str) -> AppUpdate: cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("GET", f"/api/2.0/apps/{app_name}/update", headers=headers) return AppUpdate.from_dict(res) @@ -3282,7 +3282,7 @@ def list( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id while True: json = self._api.do("GET", "/api/2.0/apps", query=query, headers=headers) @@ -3319,7 +3319,7 @@ def list_deployments( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id while True: json = self._api.do("GET", f"/api/2.0/apps/{app_name}/deployments", query=query, headers=headers) @@ -3352,7 +3352,7 @@ def list_spaces(self, *, page_size: Optional[int] = None, page_token: Optional[s cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id while True: json = self._api.do("GET", "/api/2.0/app-spaces", query=query, headers=headers) @@ -3386,7 +3386,7 @@ def set_permissions( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("PUT", f"/api/2.0/permissions/apps/{app_name}", body=body, headers=headers) return AppPermissions.from_dict(res) @@ -3409,7 +3409,7 @@ def start(self, name: str) -> Wait[App]: cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id op_response = self._api.do("POST", f"/api/2.0/apps/{name}/start", headers=headers) return Wait(self.wait_get_app_active, response=App.from_dict(op_response), name=op_response["name"]) @@ -3435,7 +3435,7 @@ def stop(self, name: str) -> Wait[App]: cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id op_response = self._api.do("POST", f"/api/2.0/apps/{name}/stop", headers=headers) return Wait(self.wait_get_app_stopped, response=App.from_dict(op_response), name=op_response["name"]) @@ -3462,7 +3462,7 @@ def update(self, name: str, app: App) -> App: cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("PATCH", f"/api/2.0/apps/{name}", body=body, headers=headers) return App.from_dict(res) @@ -3488,7 +3488,7 @@ def update_app_thumbnail(self, name: str, *, app_thumbnail: Optional[AppThumbnai cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("PATCH", f"/api/2.0/apps/{name}/thumbnail", body=body, headers=headers) return AppThumbnail.from_dict(res) @@ -3515,7 +3515,7 @@ def update_permissions( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("PATCH", f"/api/2.0/permissions/apps/{app_name}", body=body, headers=headers) return AppPermissions.from_dict(res) @@ -3553,7 +3553,7 @@ def update_space(self, name: str, space: Space, update_mask: FieldMask) -> Updat cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("PATCH", f"/api/2.0/app-spaces/{name}", query=query, body=body, headers=headers) operation = Operation.from_dict(res) @@ -3811,7 +3811,7 @@ def create_custom_template(self, template: CustomTemplate) -> CustomTemplate: cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("POST", "/api/2.0/apps-settings/templates", body=body, headers=headers) return CustomTemplate.from_dict(res) @@ -3831,7 +3831,7 @@ def delete_custom_template(self, name: str) -> CustomTemplate: cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("DELETE", f"/api/2.0/apps-settings/templates/{name}", headers=headers) return CustomTemplate.from_dict(res) @@ -3851,7 +3851,7 @@ def get_custom_template(self, name: str) -> CustomTemplate: cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("GET", f"/api/2.0/apps-settings/templates/{name}", headers=headers) return CustomTemplate.from_dict(res) @@ -3880,7 +3880,7 @@ def list_custom_templates( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id while True: json = self._api.do("GET", "/api/2.0/apps-settings/templates", query=query, headers=headers) @@ -3910,7 +3910,7 @@ def update_custom_template(self, name: str, template: CustomTemplate) -> CustomT cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("PUT", f"/api/2.0/apps-settings/templates/{name}", body=body, headers=headers) return CustomTemplate.from_dict(res) diff --git a/databricks/sdk/service/catalog.py b/databricks/sdk/service/catalog.py index b67a23db3..6606bc47a 100755 --- a/databricks/sdk/service/catalog.py +++ b/databricks/sdk/service/catalog.py @@ -11543,7 +11543,7 @@ def get(self, artifact_type: ArtifactType) -> ArtifactAllowlistInfo: cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("GET", f"/api/2.1/unity-catalog/artifact-allowlists/{artifact_type.value}", headers=headers) return ArtifactAllowlistInfo.from_dict(res) @@ -11591,7 +11591,7 @@ def update( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do( "PUT", f"/api/2.1/unity-catalog/artifact-allowlists/{artifact_type.value}", body=body, headers=headers @@ -11676,7 +11676,7 @@ def create( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("POST", "/api/2.1/unity-catalog/catalogs", body=body, headers=headers) return CatalogInfo.from_dict(res) @@ -11702,7 +11702,7 @@ def delete(self, name: str, *, force: Optional[bool] = None): cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id self._api.do("DELETE", f"/api/2.1/unity-catalog/catalogs/{name}", query=query, headers=headers) @@ -11728,7 +11728,7 @@ def get(self, name: str, *, include_browse: Optional[bool] = None) -> CatalogInf cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("GET", f"/api/2.1/unity-catalog/catalogs/{name}", query=query, headers=headers) return CatalogInfo.from_dict(res) @@ -11788,7 +11788,7 @@ def list( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id if "max_results" not in query: query["max_results"] = 0 @@ -11863,7 +11863,7 @@ def update( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("PATCH", f"/api/2.1/unity-catalog/catalogs/{name}", body=body, headers=headers) return CatalogInfo.from_dict(res) @@ -11933,7 +11933,7 @@ def create( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("POST", "/api/2.1/unity-catalog/connections", body=body, headers=headers) return ConnectionInfo.from_dict(res) @@ -11953,7 +11953,7 @@ def delete(self, name: str): cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id self._api.do("DELETE", f"/api/2.1/unity-catalog/connections/{name}", headers=headers) @@ -11972,7 +11972,7 @@ def get(self, name: str) -> ConnectionInfo: cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("GET", f"/api/2.1/unity-catalog/connections/{name}", headers=headers) return ConnectionInfo.from_dict(res) @@ -12009,7 +12009,7 @@ def list(self, *, max_results: Optional[int] = None, page_token: Optional[str] = cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id if "max_results" not in query: query["max_results"] = 0 @@ -12053,7 +12053,7 @@ def update( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("PATCH", f"/api/2.1/unity-catalog/connections/{name}", body=body, headers=headers) return ConnectionInfo.from_dict(res) @@ -12140,7 +12140,7 @@ def create_credential( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("POST", "/api/2.1/unity-catalog/credentials", body=body, headers=headers) return CredentialInfo.from_dict(res) @@ -12167,7 +12167,7 @@ def delete_credential(self, name_arg: str, *, force: Optional[bool] = None): cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id self._api.do("DELETE", f"/api/2.1/unity-catalog/credentials/{name_arg}", query=query, headers=headers) @@ -12203,7 +12203,7 @@ def generate_temporary_service_credential( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("POST", "/api/2.1/unity-catalog/temporary-service-credentials", body=body, headers=headers) return TemporaryCredentials.from_dict(res) @@ -12224,7 +12224,7 @@ def get_credential(self, name_arg: str) -> CredentialInfo: cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("GET", f"/api/2.1/unity-catalog/credentials/{name_arg}", headers=headers) return CredentialInfo.from_dict(res) @@ -12278,7 +12278,7 @@ def list_credentials( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id while True: json = self._api.do("GET", "/api/2.1/unity-catalog/credentials", query=query, headers=headers) @@ -12370,7 +12370,7 @@ def update_credential( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("PATCH", f"/api/2.1/unity-catalog/credentials/{name_arg}", body=body, headers=headers) return CredentialInfo.from_dict(res) @@ -12444,7 +12444,7 @@ def validate_credential( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("POST", "/api/2.1/unity-catalog/validate-credentials", body=body, headers=headers) return ValidateCredentialResponse.from_dict(res) @@ -12484,7 +12484,7 @@ def create(self, tag_assignment: EntityTagAssignment) -> EntityTagAssignment: cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("POST", "/api/2.1/unity-catalog/entity-tag-assignments", body=body, headers=headers) return EntityTagAssignment.from_dict(res) @@ -12517,7 +12517,7 @@ def delete(self, entity_type: str, entity_name: str, tag_key: str): cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id self._api.do( "DELETE", @@ -12544,7 +12544,7 @@ def get(self, entity_type: str, entity_name: str, tag_key: str) -> EntityTagAssi cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do( "GET", @@ -12585,7 +12585,7 @@ def list( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id while True: json = self._api.do( @@ -12647,7 +12647,7 @@ def update( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do( "PATCH", @@ -12689,7 +12689,7 @@ def create_external_lineage_relationship( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("POST", "/api/2.0/lineage-tracking/external-lineage", body=body, headers=headers) return ExternalLineageRelationship.from_dict(res) @@ -12712,7 +12712,7 @@ def delete_external_lineage_relationship(self, external_lineage_relationship: De cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id self._api.do("DELETE", "/api/2.0/lineage-tracking/external-lineage", query=query, headers=headers) @@ -12757,7 +12757,7 @@ def list_external_lineage_relationships( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id while True: json = self._api.do("GET", "/api/2.0/lineage-tracking/external-lineage", query=query, headers=headers) @@ -12800,7 +12800,7 @@ def update_external_lineage_relationship( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do( "PATCH", "/api/2.0/lineage-tracking/external-lineage", query=query, body=body, headers=headers @@ -12909,7 +12909,7 @@ def create( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("POST", "/api/2.1/unity-catalog/external-locations", body=body, headers=headers) return ExternalLocationInfo.from_dict(res) @@ -12935,7 +12935,7 @@ def delete(self, name: str, *, force: Optional[bool] = None): cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id self._api.do("DELETE", f"/api/2.1/unity-catalog/external-locations/{name}", query=query, headers=headers) @@ -12961,7 +12961,7 @@ def get(self, name: str, *, include_browse: Optional[bool] = None) -> ExternalLo cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("GET", f"/api/2.1/unity-catalog/external-locations/{name}", query=query, headers=headers) return ExternalLocationInfo.from_dict(res) @@ -13017,7 +13017,7 @@ def list( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id if "max_results" not in query: query["max_results"] = 0 @@ -13133,7 +13133,7 @@ def update( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("PATCH", f"/api/2.1/unity-catalog/external-locations/{name}", body=body, headers=headers) return ExternalLocationInfo.from_dict(res) @@ -13168,7 +13168,7 @@ def create_external_metadata(self, external_metadata: ExternalMetadata) -> Exter cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("POST", "/api/2.0/lineage-tracking/external-metadata", body=body, headers=headers) return ExternalMetadata.from_dict(res) @@ -13188,7 +13188,7 @@ def delete_external_metadata(self, name: str): cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id self._api.do("DELETE", f"/api/2.0/lineage-tracking/external-metadata/{name}", headers=headers) @@ -13207,7 +13207,7 @@ def get_external_metadata(self, name: str) -> ExternalMetadata: cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("GET", f"/api/2.0/lineage-tracking/external-metadata/{name}", headers=headers) return ExternalMetadata.from_dict(res) @@ -13240,7 +13240,7 @@ def list_external_metadata( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id while True: json = self._api.do("GET", "/api/2.0/lineage-tracking/external-metadata", query=query, headers=headers) @@ -13287,7 +13287,7 @@ def update_external_metadata( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do( "PATCH", f"/api/2.0/lineage-tracking/external-metadata/{name}", query=query, body=body, headers=headers @@ -13330,7 +13330,7 @@ def create(self, function_info: CreateFunction) -> FunctionInfo: cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("POST", "/api/2.1/unity-catalog/functions", body=body, headers=headers) return FunctionInfo.from_dict(res) @@ -13358,7 +13358,7 @@ def delete(self, name: str, *, force: Optional[bool] = None): cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id self._api.do("DELETE", f"/api/2.1/unity-catalog/functions/{name}", query=query, headers=headers) @@ -13389,7 +13389,7 @@ def get(self, name: str, *, include_browse: Optional[bool] = None) -> FunctionIn cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("GET", f"/api/2.1/unity-catalog/functions/{name}", query=query, headers=headers) return FunctionInfo.from_dict(res) @@ -13451,7 +13451,7 @@ def list( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id if "max_results" not in query: query["max_results"] = 0 @@ -13491,7 +13491,7 @@ def update(self, name: str, *, owner: Optional[str] = None) -> FunctionInfo: cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("PATCH", f"/api/2.1/unity-catalog/functions/{name}", body=body, headers=headers) return FunctionInfo.from_dict(res) @@ -13564,7 +13564,7 @@ def get( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do( "GET", f"/api/2.1/unity-catalog/permissions/{securable_type}/{full_name}", query=query, headers=headers @@ -13627,7 +13627,7 @@ def get_effective( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do( "GET", @@ -13662,7 +13662,7 @@ def update( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do( "PATCH", f"/api/2.1/unity-catalog/permissions/{securable_type}/{full_name}", body=body, headers=headers @@ -13714,7 +13714,7 @@ def assign(self, workspace_id: int, metastore_id: str, default_catalog_name: str cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id self._api.do("PUT", f"/api/2.1/unity-catalog/workspaces/{workspace_id}/metastore", body=body, headers=headers) @@ -13759,7 +13759,7 @@ def create( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("POST", "/api/2.1/unity-catalog/metastores", body=body, headers=headers) return MetastoreInfo.from_dict(res) @@ -13777,7 +13777,7 @@ def current(self) -> MetastoreAssignment: cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("GET", "/api/2.1/unity-catalog/current-metastore-assignment", headers=headers) return MetastoreAssignment.from_dict(res) @@ -13802,7 +13802,7 @@ def delete(self, id: str, *, force: Optional[bool] = None): cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id self._api.do("DELETE", f"/api/2.1/unity-catalog/metastores/{id}", query=query, headers=headers) @@ -13822,7 +13822,7 @@ def get(self, id: str) -> MetastoreInfo: cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("GET", f"/api/2.1/unity-catalog/metastores/{id}", headers=headers) return MetastoreInfo.from_dict(res) @@ -13863,7 +13863,7 @@ def list(self, *, max_results: Optional[int] = None, page_token: Optional[str] = cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id if "max_results" not in query: query["max_results"] = 0 @@ -13890,7 +13890,7 @@ def summary(self) -> GetMetastoreSummaryResponse: cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("GET", "/api/2.1/unity-catalog/metastore_summary", headers=headers) return GetMetastoreSummaryResponse.from_dict(res) @@ -13915,7 +13915,7 @@ def unassign(self, workspace_id: int, metastore_id: str): cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id self._api.do( "DELETE", f"/api/2.1/unity-catalog/workspaces/{workspace_id}/metastore", query=query, headers=headers @@ -13986,7 +13986,7 @@ def update( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("PATCH", f"/api/2.1/unity-catalog/metastores/{id}", body=body, headers=headers) return MetastoreInfo.from_dict(res) @@ -14022,7 +14022,7 @@ def update_assignment( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id self._api.do("PATCH", f"/api/2.1/unity-catalog/workspaces/{workspace_id}/metastore", body=body, headers=headers) @@ -14058,7 +14058,7 @@ def delete(self, full_name: str, version: int): cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id self._api.do("DELETE", f"/api/2.1/unity-catalog/models/{full_name}/versions/{version}", headers=headers) @@ -14100,7 +14100,7 @@ def get( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do( "GET", f"/api/2.1/unity-catalog/models/{full_name}/versions/{version}", query=query, headers=headers @@ -14133,7 +14133,7 @@ def get_by_alias(self, full_name: str, alias: str, *, include_aliases: Optional[ cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do( "GET", f"/api/2.1/unity-catalog/models/{full_name}/aliases/{alias}", query=query, headers=headers @@ -14194,7 +14194,7 @@ def list( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id while True: json = self._api.do( @@ -14324,7 +14324,7 @@ def update( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do( "PATCH", f"/api/2.1/unity-catalog/models/{full_name}/versions/{version}", body=body, headers=headers @@ -14386,7 +14386,7 @@ def create(self, table: OnlineTable) -> Wait[OnlineTable]: cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id op_response = self._api.do("POST", "/api/2.0/online-tables", body=body, headers=headers) return Wait( @@ -14413,7 +14413,7 @@ def delete(self, name: str): cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id self._api.do("DELETE", f"/api/2.0/online-tables/{name}", headers=headers) @@ -14432,7 +14432,7 @@ def get(self, name: str) -> OnlineTable: cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("GET", f"/api/2.0/online-tables/{name}", headers=headers) return OnlineTable.from_dict(res) @@ -14466,7 +14466,7 @@ def create_policy(self, policy_info: PolicyInfo) -> PolicyInfo: cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("POST", "/api/2.1/unity-catalog/policies", body=body, headers=headers) return PolicyInfo.from_dict(res) @@ -14490,7 +14490,7 @@ def delete_policy(self, on_securable_type: str, on_securable_fullname: str, name cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do( "DELETE", @@ -14518,7 +14518,7 @@ def get_policy(self, on_securable_type: str, on_securable_fullname: str, name: s cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do( "GET", @@ -14573,7 +14573,7 @@ def list_policies( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id while True: json = self._api.do( @@ -14631,7 +14631,7 @@ def update_policy( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do( "PATCH", @@ -14675,7 +14675,7 @@ def cancel_refresh(self, table_name: str, refresh_id: int): cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id self._api.do( "POST", f"/api/2.1/unity-catalog/tables/{table_name}/monitor/refreshes/{refresh_id}/cancel", headers=headers @@ -14790,7 +14790,7 @@ def create( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("POST", f"/api/2.1/unity-catalog/tables/{table_name}/monitor", body=body, headers=headers) return MonitorInfo.from_dict(res) @@ -14822,7 +14822,7 @@ def delete(self, table_name: str) -> DeleteMonitorResponse: cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("DELETE", f"/api/2.1/unity-catalog/tables/{table_name}/monitor", headers=headers) return DeleteMonitorResponse.from_dict(res) @@ -14853,7 +14853,7 @@ def get(self, table_name: str) -> MonitorInfo: cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("GET", f"/api/2.1/unity-catalog/tables/{table_name}/monitor", headers=headers) return MonitorInfo.from_dict(res) @@ -14883,7 +14883,7 @@ def get_refresh(self, table_name: str, refresh_id: int) -> MonitorRefreshInfo: cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do( "GET", f"/api/2.1/unity-catalog/tables/{table_name}/monitor/refreshes/{refresh_id}", headers=headers @@ -14914,7 +14914,7 @@ def list_refreshes(self, table_name: str) -> MonitorRefreshListResponse: cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("GET", f"/api/2.1/unity-catalog/tables/{table_name}/monitor/refreshes", headers=headers) return MonitorRefreshListResponse.from_dict(res) @@ -14953,7 +14953,7 @@ def regenerate_dashboard( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do( "POST", f"/api/2.1/quality-monitoring/tables/{table_name}/monitor/dashboard", body=body, headers=headers @@ -14985,7 +14985,7 @@ def run_refresh(self, table_name: str) -> MonitorRefreshInfo: cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("POST", f"/api/2.1/unity-catalog/tables/{table_name}/monitor/refreshes", headers=headers) return MonitorRefreshInfo.from_dict(res) @@ -15090,7 +15090,7 @@ def update( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("PUT", f"/api/2.1/unity-catalog/tables/{table_name}/monitor", body=body, headers=headers) return MonitorInfo.from_dict(res) @@ -15222,7 +15222,7 @@ def create( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("POST", "/api/2.1/unity-catalog/models", body=body, headers=headers) return RegisteredModelInfo.from_dict(res) @@ -15244,7 +15244,7 @@ def delete(self, full_name: str): cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id self._api.do("DELETE", f"/api/2.1/unity-catalog/models/{full_name}", headers=headers) @@ -15267,7 +15267,7 @@ def delete_alias(self, full_name: str, alias: str): cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id self._api.do("DELETE", f"/api/2.1/unity-catalog/models/{full_name}/aliases/{alias}", headers=headers) @@ -15302,7 +15302,7 @@ def get( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("GET", f"/api/2.1/unity-catalog/models/{full_name}", query=query, headers=headers) return RegisteredModelInfo.from_dict(res) @@ -15377,7 +15377,7 @@ def list( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id while True: json = self._api.do("GET", "/api/2.1/unity-catalog/models", query=query, headers=headers) @@ -15415,7 +15415,7 @@ def set_alias(self, full_name: str, alias: str, version_num: int) -> RegisteredM cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do( "PUT", f"/api/2.1/unity-catalog/models/{full_name}/aliases/{alias}", body=body, headers=headers @@ -15520,7 +15520,7 @@ def update( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("PATCH", f"/api/2.1/unity-catalog/models/{full_name}", body=body, headers=headers) return RegisteredModelInfo.from_dict(res) @@ -15559,7 +15559,7 @@ def get_quota(self, parent_securable_type: str, parent_full_name: str, quota_nam cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do( "GET", @@ -15597,7 +15597,7 @@ def list_quotas( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id while True: json = self._api.do( @@ -15649,7 +15649,7 @@ def batch_create_access_requests( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("POST", "/api/3.0/rfa/requests", body=body, headers=headers) return BatchCreateAccessRequestsResponse.from_dict(res) @@ -15676,7 +15676,7 @@ def get_access_request_destinations(self, securable_type: str, full_name: str) - cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("GET", f"/api/3.0/rfa/destinations/{securable_type}/{full_name}", headers=headers) return AccessRequestDestinations.from_dict(res) @@ -15723,7 +15723,7 @@ def update_access_request_destinations( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("PATCH", "/api/3.0/rfa/destinations", query=query, body=body, headers=headers) return AccessRequestDestinations.from_dict(res) @@ -15782,7 +15782,7 @@ def create( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("POST", "/api/2.1/unity-catalog/schemas", body=body, headers=headers) return SchemaInfo.from_dict(res) @@ -15808,7 +15808,7 @@ def delete(self, full_name: str, *, force: Optional[bool] = None): cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id self._api.do("DELETE", f"/api/2.1/unity-catalog/schemas/{full_name}", query=query, headers=headers) @@ -15834,7 +15834,7 @@ def get(self, full_name: str, *, include_browse: Optional[bool] = None) -> Schem cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("GET", f"/api/2.1/unity-catalog/schemas/{full_name}", query=query, headers=headers) return SchemaInfo.from_dict(res) @@ -15890,7 +15890,7 @@ def list( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id if "max_results" not in query: query["max_results"] = 0 @@ -15952,7 +15952,7 @@ def update( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("PATCH", f"/api/2.1/unity-catalog/schemas/{full_name}", body=body, headers=headers) return SchemaInfo.from_dict(res) @@ -15992,7 +15992,7 @@ def create_secret(self, secret: Secret) -> Secret: cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("POST", "/api/2.1/unity-catalog/secrets", body=body, headers=headers) return Secret.from_dict(res) @@ -16015,7 +16015,7 @@ def delete_secret(self, full_name: str): cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id self._api.do("DELETE", f"/api/2.1/unity-catalog/secrets/{full_name}", headers=headers) @@ -16047,7 +16047,7 @@ def get_secret(self, full_name: str, *, include_browse: Optional[bool] = None) - cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("GET", f"/api/2.1/unity-catalog/secrets/{full_name}", query=query, headers=headers) return Secret.from_dict(res) @@ -16109,7 +16109,7 @@ def list_secrets( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id while True: json = self._api.do("GET", "/api/2.1/unity-catalog/secrets", query=query, headers=headers) @@ -16153,7 +16153,7 @@ def update_secret(self, full_name: str, secret: Secret, update_mask: FieldMask) cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do( "PATCH", f"/api/2.1/unity-catalog/secrets/{full_name}", query=query, body=body, headers=headers @@ -16244,7 +16244,7 @@ def create( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("POST", "/api/2.1/unity-catalog/storage-credentials", body=body, headers=headers) return StorageCredentialInfo.from_dict(res) @@ -16271,7 +16271,7 @@ def delete(self, name: str, *, force: Optional[bool] = None): cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id self._api.do("DELETE", f"/api/2.1/unity-catalog/storage-credentials/{name}", query=query, headers=headers) @@ -16291,7 +16291,7 @@ def get(self, name: str) -> StorageCredentialInfo: cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("GET", f"/api/2.1/unity-catalog/storage-credentials/{name}", headers=headers) return StorageCredentialInfo.from_dict(res) @@ -16343,7 +16343,7 @@ def list( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id if "max_results" not in query: query["max_results"] = 0 @@ -16441,7 +16441,7 @@ def update( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("PATCH", f"/api/2.1/unity-catalog/storage-credentials/{name}", body=body, headers=headers) return StorageCredentialInfo.from_dict(res) @@ -16517,7 +16517,7 @@ def validate( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("POST", "/api/2.1/unity-catalog/validate-storage-credentials", body=body, headers=headers) return ValidateStorageCredentialResponse.from_dict(res) @@ -16548,7 +16548,7 @@ def disable(self, metastore_id: str, schema_name: str): cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id self._api.do( "DELETE", f"/api/2.1/unity-catalog/metastores/{metastore_id}/systemschemas/{schema_name}", headers=headers @@ -16578,7 +16578,7 @@ def enable(self, metastore_id: str, schema_name: str, *, catalog_name: Optional[ cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id self._api.do( "PUT", @@ -16624,7 +16624,7 @@ def list( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id if "max_results" not in query: query["max_results"] = 0 @@ -16684,7 +16684,7 @@ def create(self, full_name_arg: str, constraint: TableConstraint) -> TableConstr cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("POST", "/api/2.1/unity-catalog/constraints", body=body, headers=headers) return TableConstraint.from_dict(res) @@ -16721,7 +16721,7 @@ def delete(self, full_name: str, constraint_name: str, cascade: bool): cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id self._api.do("DELETE", f"/api/2.1/unity-catalog/constraints/{full_name}", query=query, headers=headers) @@ -16812,7 +16812,7 @@ def create( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("POST", "/api/2.1/unity-catalog/tables", body=body, headers=headers) return TableInfo.from_dict(res) @@ -16835,7 +16835,7 @@ def delete(self, full_name: str): cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id self._api.do("DELETE", f"/api/2.1/unity-catalog/tables/{full_name}", headers=headers) @@ -16859,7 +16859,7 @@ def exists(self, full_name: str) -> TableExistsResponse: cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("GET", f"/api/2.1/unity-catalog/tables/{full_name}/exists", headers=headers) return TableExistsResponse.from_dict(res) @@ -16904,7 +16904,7 @@ def get( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("GET", f"/api/2.1/unity-catalog/tables/{full_name}", query=query, headers=headers) return TableInfo.from_dict(res) @@ -16989,7 +16989,7 @@ def list( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id if "max_results" not in query: query["max_results"] = 0 @@ -17066,7 +17066,7 @@ def list_summaries( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id while True: json = self._api.do("GET", "/api/2.1/unity-catalog/table-summaries", query=query, headers=headers) @@ -17101,7 +17101,7 @@ def update(self, full_name: str, *, owner: Optional[str] = None): cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id self._api.do("PATCH", f"/api/2.1/unity-catalog/tables/{full_name}", body=body, headers=headers) @@ -17168,7 +17168,7 @@ def generate_temporary_path_credentials( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("POST", "/api/2.0/unity-catalog/temporary-path-credentials", body=body, headers=headers) return GenerateTemporaryPathCredentialResponse.from_dict(res) @@ -17221,7 +17221,7 @@ def generate_temporary_table_credentials( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("POST", "/api/2.0/unity-catalog/temporary-table-credentials", body=body, headers=headers) return GenerateTemporaryTableCredentialResponse.from_dict(res) @@ -17274,7 +17274,7 @@ def generate_temporary_volume_credentials( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("POST", "/api/2.0/unity-catalog/temporary-volume-credentials", body=body, headers=headers) return GenerateTemporaryVolumeCredentialResponse.from_dict(res) @@ -17357,7 +17357,7 @@ def create( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("POST", "/api/2.1/unity-catalog/volumes", body=body, headers=headers) return VolumeInfo.from_dict(res) @@ -17379,7 +17379,7 @@ def delete(self, name: str): cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id self._api.do("DELETE", f"/api/2.1/unity-catalog/volumes/{name}", headers=headers) @@ -17449,7 +17449,7 @@ def list( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id while True: json = self._api.do("GET", "/api/2.1/unity-catalog/volumes", query=query, headers=headers) @@ -17485,7 +17485,7 @@ def read(self, name: str, *, include_browse: Optional[bool] = None) -> VolumeInf cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("GET", f"/api/2.1/unity-catalog/volumes/{name}", query=query, headers=headers) return VolumeInfo.from_dict(res) @@ -17527,7 +17527,7 @@ def update( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("PATCH", f"/api/2.1/unity-catalog/volumes/{name}", body=body, headers=headers) return VolumeInfo.from_dict(res) @@ -17568,7 +17568,7 @@ def get(self, name: str) -> GetCatalogWorkspaceBindingsResponse: cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("GET", f"/api/2.1/unity-catalog/workspace-bindings/catalogs/{name}", headers=headers) return GetCatalogWorkspaceBindingsResponse.from_dict(res) @@ -17618,7 +17618,7 @@ def get_bindings( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id if "max_results" not in query: query["max_results"] = 0 @@ -17668,7 +17668,7 @@ def update( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do( "PATCH", f"/api/2.1/unity-catalog/workspace-bindings/catalogs/{name}", body=body, headers=headers @@ -17713,7 +17713,7 @@ def update_bindings( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do( "PATCH", f"/api/2.1/unity-catalog/bindings/{securable_type}/{securable_name}", body=body, headers=headers diff --git a/databricks/sdk/service/cleanrooms.py b/databricks/sdk/service/cleanrooms.py index b46099160..bbb254e27 100755 --- a/databricks/sdk/service/cleanrooms.py +++ b/databricks/sdk/service/cleanrooms.py @@ -1421,7 +1421,7 @@ def get(self, clean_room_name: str, asset_type: CleanRoomAssetAssetType, name: s cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do( "GET", @@ -1466,7 +1466,7 @@ def list( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id while True: json = self._api.do( @@ -1512,7 +1512,7 @@ def create(self, clean_room_name: str, asset: CleanRoomAsset) -> CleanRoomAsset: cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("POST", f"/api/2.0/clean-rooms/{clean_room_name}/assets", body=body, headers=headers) return CleanRoomAsset.from_dict(res) @@ -1548,7 +1548,7 @@ def create_clean_room_asset_review( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do( "POST", @@ -1577,7 +1577,7 @@ def delete(self, clean_room_name: str, asset_type: CleanRoomAssetAssetType, name cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id self._api.do( "DELETE", f"/api/2.0/clean-rooms/{clean_room_name}/assets/{asset_type.value}/{name}", headers=headers @@ -1602,7 +1602,7 @@ def get(self, clean_room_name: str, asset_type: CleanRoomAssetAssetType, name: s cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do( "GET", f"/api/2.0/clean-rooms/{clean_room_name}/assets/{asset_type.value}/{name}", headers=headers @@ -1629,7 +1629,7 @@ def list(self, clean_room_name: str, *, page_token: Optional[str] = None) -> Ite cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id while True: json = self._api.do("GET", f"/api/2.0/clean-rooms/{clean_room_name}/assets", query=query, headers=headers) @@ -1674,7 +1674,7 @@ def update( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do( "PATCH", @@ -1712,7 +1712,7 @@ def create(self, clean_room_name: str, auto_approval_rule: CleanRoomAutoApproval cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do( "POST", f"/api/2.0/clean-rooms/{clean_room_name}/auto-approval-rules", body=body, headers=headers @@ -1734,7 +1734,7 @@ def delete(self, clean_room_name: str, rule_id: str): cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id self._api.do("DELETE", f"/api/2.0/clean-rooms/{clean_room_name}/auto-approval-rules/{rule_id}", headers=headers) @@ -1753,7 +1753,7 @@ def get(self, clean_room_name: str, rule_id: str) -> CleanRoomAutoApprovalRule: cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do( "GET", f"/api/2.0/clean-rooms/{clean_room_name}/auto-approval-rules/{rule_id}", headers=headers @@ -1785,7 +1785,7 @@ def list( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id while True: json = self._api.do( @@ -1821,7 +1821,7 @@ def update( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do( "PATCH", f"/api/2.0/clean-rooms/{clean_room_name}/auto-approval-rules/{rule_id}", body=body, headers=headers @@ -1870,7 +1870,7 @@ def list( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id while True: json = self._api.do("GET", f"/api/2.0/clean-rooms/{clean_room_name}/runs", query=query, headers=headers) @@ -1939,7 +1939,7 @@ def create(self, clean_room: CleanRoom) -> Wait[CleanRoom]: cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id op_response = self._api.do("POST", "/api/2.0/clean-rooms", body=body, headers=headers) return Wait( @@ -1969,7 +1969,7 @@ def create_output_catalog( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do( "POST", f"/api/2.0/clean-rooms/{clean_room_name}/output-catalogs", body=body, headers=headers @@ -1993,7 +1993,7 @@ def delete(self, name: str): cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id self._api.do("DELETE", f"/api/2.0/clean-rooms/{name}", headers=headers) @@ -2011,7 +2011,7 @@ def get(self, name: str) -> CleanRoom: cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("GET", f"/api/2.0/clean-rooms/{name}", headers=headers) return CleanRoom.from_dict(res) @@ -2039,7 +2039,7 @@ def list(self, *, page_size: Optional[int] = None, page_token: Optional[str] = N cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id while True: json = self._api.do("GET", "/api/2.0/clean-rooms", query=query, headers=headers) @@ -2073,7 +2073,7 @@ def update(self, name: str, *, clean_room: Optional[CleanRoom] = None) -> CleanR cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("PATCH", f"/api/2.0/clean-rooms/{name}", body=body, headers=headers) return CleanRoom.from_dict(res) diff --git a/databricks/sdk/service/compute.py b/databricks/sdk/service/compute.py index 62a718809..69e690f94 100755 --- a/databricks/sdk/service/compute.py +++ b/databricks/sdk/service/compute.py @@ -7984,7 +7984,7 @@ def create( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("POST", "/api/2.0/policies/clusters/create", body=body, headers=headers) return CreatePolicyResponse.from_dict(res) @@ -8008,7 +8008,7 @@ def delete(self, policy_id: str): cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id self._api.do("POST", "/api/2.0/policies/clusters/delete", body=body, headers=headers) @@ -8086,7 +8086,7 @@ def edit( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id self._api.do("POST", "/api/2.0/policies/clusters/edit", body=body, headers=headers) @@ -8108,7 +8108,7 @@ def get(self, policy_id: str) -> Policy: cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("GET", "/api/2.0/policies/clusters/get", query=query, headers=headers) return Policy.from_dict(res) @@ -8128,7 +8128,7 @@ def get_permission_levels(self, cluster_policy_id: str) -> GetClusterPolicyPermi cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do( "GET", f"/api/2.0/permissions/cluster-policies/{cluster_policy_id}/permissionLevels", headers=headers @@ -8151,7 +8151,7 @@ def get_permissions(self, cluster_policy_id: str) -> ClusterPolicyPermissions: cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("GET", f"/api/2.0/permissions/cluster-policies/{cluster_policy_id}", headers=headers) return ClusterPolicyPermissions.from_dict(res) @@ -8182,7 +8182,7 @@ def list( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id json = self._api.do("GET", "/api/2.0/policies/clusters/list", query=query, headers=headers) parsed = ListPoliciesResponse.from_dict(json).policies @@ -8211,7 +8211,7 @@ def set_permissions( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do( "PUT", f"/api/2.0/permissions/cluster-policies/{cluster_policy_id}", body=body, headers=headers @@ -8241,7 +8241,7 @@ def update_permissions( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do( "PATCH", f"/api/2.0/permissions/cluster-policies/{cluster_policy_id}", body=body, headers=headers @@ -8365,7 +8365,7 @@ def change_owner(self, cluster_id: str, owner_username: str): cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id self._api.do("POST", "/api/2.1/clusters/change-owner", body=body, headers=headers) @@ -8640,7 +8640,7 @@ def create( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id op_response = self._api.do("POST", "/api/2.1/clusters/create", body=body, headers=headers) return Wait( @@ -8750,7 +8750,7 @@ def delete(self, cluster_id: str) -> Wait[ClusterDetails]: cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id op_response = self._api.do("POST", "/api/2.1/clusters/delete", body=body, headers=headers) return Wait(self.wait_get_cluster_terminated, cluster_id=cluster_id) @@ -9026,7 +9026,7 @@ def edit( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id op_response = self._api.do("POST", "/api/2.1/clusters/edit", body=body, headers=headers) return Wait(self.wait_get_cluster_running, cluster_id=cluster_id) @@ -9183,7 +9183,7 @@ def events( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id while True: json = self._api.do("POST", "/api/2.1/clusters/events", body=body, headers=headers) @@ -9213,7 +9213,7 @@ def get(self, cluster_id: str) -> ClusterDetails: cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("GET", "/api/2.1/clusters/get", query=query, headers=headers) return ClusterDetails.from_dict(res) @@ -9233,7 +9233,7 @@ def get_permission_levels(self, cluster_id: str) -> GetClusterPermissionLevelsRe cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("GET", f"/api/2.0/permissions/clusters/{cluster_id}/permissionLevels", headers=headers) return GetClusterPermissionLevelsResponse.from_dict(res) @@ -9253,7 +9253,7 @@ def get_permissions(self, cluster_id: str) -> ClusterPermissions: cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("GET", f"/api/2.0/permissions/clusters/{cluster_id}", headers=headers) return ClusterPermissions.from_dict(res) @@ -9298,7 +9298,7 @@ def list( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id while True: json = self._api.do("GET", "/api/2.1/clusters/list", query=query, headers=headers) @@ -9322,7 +9322,7 @@ def list_node_types(self) -> ListNodeTypesResponse: cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("GET", "/api/2.1/clusters/list-node-types", headers=headers) return ListNodeTypesResponse.from_dict(res) @@ -9341,7 +9341,7 @@ def list_zones(self) -> ListAvailableZonesResponse: cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("GET", "/api/2.1/clusters/list-zones", headers=headers) return ListAvailableZonesResponse.from_dict(res) @@ -9369,7 +9369,7 @@ def permanent_delete(self, cluster_id: str): cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id self._api.do("POST", "/api/2.1/clusters/permanent-delete", body=body, headers=headers) @@ -9392,7 +9392,7 @@ def pin(self, cluster_id: str): cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id self._api.do("POST", "/api/2.1/clusters/pin", body=body, headers=headers) @@ -9436,7 +9436,7 @@ def resize( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id op_response = self._api.do("POST", "/api/2.1/clusters/resize", body=body, headers=headers) return Wait(self.wait_get_cluster_running, cluster_id=cluster_id) @@ -9476,7 +9476,7 @@ def restart(self, cluster_id: str, *, restart_user: Optional[str] = None) -> Wai cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id op_response = self._api.do("POST", "/api/2.1/clusters/restart", body=body, headers=headers) return Wait(self.wait_get_cluster_running, cluster_id=cluster_id) @@ -9509,7 +9509,7 @@ def set_permissions( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("PUT", f"/api/2.0/permissions/clusters/{cluster_id}", body=body, headers=headers) return ClusterPermissions.from_dict(res) @@ -9527,7 +9527,7 @@ def spark_versions(self) -> GetSparkVersionsResponse: cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("GET", "/api/2.1/clusters/spark-versions", headers=headers) return GetSparkVersionsResponse.from_dict(res) @@ -9557,7 +9557,7 @@ def start(self, cluster_id: str) -> Wait[ClusterDetails]: cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id op_response = self._api.do("POST", "/api/2.1/clusters/start", body=body, headers=headers) return Wait(self.wait_get_cluster_running, cluster_id=cluster_id) @@ -9585,7 +9585,7 @@ def unpin(self, cluster_id: str): cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id self._api.do("POST", "/api/2.1/clusters/unpin", body=body, headers=headers) @@ -9638,7 +9638,7 @@ def update( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id op_response = self._api.do("POST", "/api/2.1/clusters/update", body=body, headers=headers) return Wait(self.wait_get_cluster_running, cluster_id=cluster_id) @@ -9675,7 +9675,7 @@ def update_permissions( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("PATCH", f"/api/2.0/permissions/clusters/{cluster_id}", body=body, headers=headers) return ClusterPermissions.from_dict(res) @@ -9827,7 +9827,7 @@ def cancel( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id op_response = self._api.do("POST", "/api/1.2/commands/cancel", body=body, headers=headers) return Wait( @@ -9872,7 +9872,7 @@ def command_status(self, cluster_id: str, context_id: str, command_id: str) -> C cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("GET", "/api/1.2/commands/status", query=query, headers=headers) return CommandStatusResponse.from_dict(res) @@ -9897,7 +9897,7 @@ def context_status(self, cluster_id: str, context_id: str) -> ContextStatusRespo cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("GET", "/api/1.2/contexts/status", query=query, headers=headers) return ContextStatusResponse.from_dict(res) @@ -9930,7 +9930,7 @@ def create( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id op_response = self._api.do("POST", "/api/1.2/contexts/create", body=body, headers=headers) return Wait( @@ -9966,7 +9966,7 @@ def destroy(self, cluster_id: str, context_id: str): cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id self._api.do("POST", "/api/1.2/contexts/destroy", body=body, headers=headers) @@ -10011,7 +10011,7 @@ def execute( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id op_response = self._api.do("POST", "/api/1.2/commands/execute", body=body, headers=headers) return Wait( @@ -10089,7 +10089,7 @@ def create( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("POST", "/api/2.0/global-init-scripts", body=body, headers=headers) return CreateResponse.from_dict(res) @@ -10109,7 +10109,7 @@ def delete(self, script_id: str): cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id self._api.do("DELETE", f"/api/2.0/global-init-scripts/{script_id}", headers=headers) @@ -10128,7 +10128,7 @@ def get(self, script_id: str) -> GlobalInitScriptDetailsWithContent: cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("GET", f"/api/2.0/global-init-scripts/{script_id}", headers=headers) return GlobalInitScriptDetailsWithContent.from_dict(res) @@ -10148,7 +10148,7 @@ def list(self) -> Iterator[GlobalInitScriptDetails]: cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id json = self._api.do("GET", "/api/2.0/global-init-scripts", headers=headers) parsed = ListGlobalInitScriptsResponse.from_dict(json).scripts @@ -10198,7 +10198,7 @@ def update( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id self._api.do("PATCH", f"/api/2.0/global-init-scripts/{script_id}", body=body, headers=headers) @@ -10342,7 +10342,7 @@ def create( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("POST", "/api/2.0/instance-pools/create", body=body, headers=headers) return CreateInstancePoolResponse.from_dict(res) @@ -10366,7 +10366,7 @@ def delete(self, instance_pool_id: str): cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id self._api.do("POST", "/api/2.0/instance-pools/delete", body=body, headers=headers) @@ -10448,7 +10448,7 @@ def edit( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id self._api.do("POST", "/api/2.0/instance-pools/edit", body=body, headers=headers) @@ -10470,7 +10470,7 @@ def get(self, instance_pool_id: str) -> GetInstancePool: cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("GET", "/api/2.0/instance-pools/get", query=query, headers=headers) return GetInstancePool.from_dict(res) @@ -10490,7 +10490,7 @@ def get_permission_levels(self, instance_pool_id: str) -> GetInstancePoolPermiss cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do( "GET", f"/api/2.0/permissions/instance-pools/{instance_pool_id}/permissionLevels", headers=headers @@ -10513,7 +10513,7 @@ def get_permissions(self, instance_pool_id: str) -> InstancePoolPermissions: cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("GET", f"/api/2.0/permissions/instance-pools/{instance_pool_id}", headers=headers) return InstancePoolPermissions.from_dict(res) @@ -10531,7 +10531,7 @@ def list(self) -> Iterator[InstancePoolAndStats]: cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id json = self._api.do("GET", "/api/2.0/instance-pools/list", headers=headers) parsed = ListInstancePools.from_dict(json).instance_pools @@ -10560,7 +10560,7 @@ def set_permissions( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("PUT", f"/api/2.0/permissions/instance-pools/{instance_pool_id}", body=body, headers=headers) return InstancePoolPermissions.from_dict(res) @@ -10588,7 +10588,7 @@ def update_permissions( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do( "PATCH", f"/api/2.0/permissions/instance-pools/{instance_pool_id}", body=body, headers=headers @@ -10661,7 +10661,7 @@ def add( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id self._api.do("POST", "/api/2.0/instance-profiles/add", body=body, headers=headers) @@ -10718,7 +10718,7 @@ def edit( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id self._api.do("POST", "/api/2.0/instance-profiles/edit", body=body, headers=headers) @@ -10737,7 +10737,7 @@ def list(self) -> Iterator[InstanceProfile]: cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id json = self._api.do("GET", "/api/2.0/instance-profiles/list", headers=headers) parsed = ListInstanceProfilesResponse.from_dict(json).instance_profiles @@ -10765,7 +10765,7 @@ def remove(self, instance_profile_arn: str): cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id self._api.do("POST", "/api/2.0/instance-profiles/remove", body=body, headers=headers) @@ -10802,7 +10802,7 @@ def all_cluster_statuses(self) -> Iterator[ClusterLibraryStatuses]: cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id json = self._api.do("GET", "/api/2.0/libraries/all-cluster-statuses", headers=headers) parsed = ListAllClusterLibraryStatusesResponse.from_dict(json).statuses @@ -10830,7 +10830,7 @@ def cluster_status(self, cluster_id: str) -> Iterator[LibraryFullStatus]: cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id json = self._api.do("GET", "/api/2.0/libraries/cluster-status", query=query, headers=headers) parsed = ClusterLibraryStatuses.from_dict(json).library_statuses @@ -10860,7 +10860,7 @@ def install(self, cluster_id: str, libraries: List[Library]): cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id self._api.do("POST", "/api/2.0/libraries/install", body=body, headers=headers) @@ -10888,7 +10888,7 @@ def uninstall(self, cluster_id: str, libraries: List[Library]): cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id self._api.do("POST", "/api/2.0/libraries/uninstall", body=body, headers=headers) @@ -10942,7 +10942,7 @@ def enforce_compliance( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("POST", "/api/2.0/policies/clusters/enforce-compliance", body=body, headers=headers) return EnforceClusterComplianceResponse.from_dict(res) @@ -10966,7 +10966,7 @@ def get_compliance(self, cluster_id: str) -> GetClusterComplianceResponse: cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("GET", "/api/2.0/policies/clusters/get-compliance", query=query, headers=headers) return GetClusterComplianceResponse.from_dict(res) @@ -11002,7 +11002,7 @@ def list_compliance( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id while True: json = self._api.do("GET", "/api/2.0/policies/clusters/list-compliance", query=query, headers=headers) @@ -11048,7 +11048,7 @@ def get(self, policy_family_id: str, *, version: Optional[int] = None) -> Policy cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("GET", f"/api/2.0/policy-families/{policy_family_id}", query=query, headers=headers) return PolicyFamily.from_dict(res) @@ -11076,7 +11076,7 @@ def list(self, *, max_results: Optional[int] = None, page_token: Optional[str] = cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id while True: json = self._api.do("GET", "/api/2.0/policy-families", query=query, headers=headers) diff --git a/databricks/sdk/service/dashboards.py b/databricks/sdk/service/dashboards.py index a15fa89b0..95742eebc 100755 --- a/databricks/sdk/service/dashboards.py +++ b/databricks/sdk/service/dashboards.py @@ -2589,7 +2589,7 @@ def create_message(self, space_id: str, conversation_id: str, content: str) -> W cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id op_response = self._api.do( "POST", @@ -2639,7 +2639,7 @@ def create_message_comment( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do( "POST", @@ -2695,7 +2695,7 @@ def create_space( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("POST", "/api/2.0/genie/spaces", body=body, headers=headers) return GenieSpace.from_dict(res) @@ -2717,7 +2717,7 @@ def delete_conversation(self, space_id: str, conversation_id: str): cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id self._api.do("DELETE", f"/api/2.0/genie/spaces/{space_id}/conversations/{conversation_id}", headers=headers) @@ -2740,7 +2740,7 @@ def delete_conversation_message(self, space_id: str, conversation_id: str, messa cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id self._api.do( "DELETE", @@ -2773,7 +2773,7 @@ def execute_message_attachment_query( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do( "POST", @@ -2805,7 +2805,7 @@ def execute_message_query( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do( "POST", @@ -2857,7 +2857,7 @@ def generate_download_full_query_result( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do( "POST", @@ -2890,7 +2890,7 @@ def genie_create_eval_run( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("POST", f"/api/2.0/genie/spaces/{space_id}/eval-runs", body=body, headers=headers) return GenieEvalRunResponse.from_dict(res) @@ -2914,7 +2914,7 @@ def genie_get_eval_result_details(self, space_id: str, eval_run_id: str, result_ cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do( "GET", f"/api/2.0/genie/spaces/{space_id}/eval-runs/{eval_run_id}/results/{result_id}", headers=headers @@ -2937,7 +2937,7 @@ def genie_get_eval_run(self, space_id: str, eval_run_id: str) -> GenieEvalRunRes cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("GET", f"/api/2.0/genie/spaces/{space_id}/eval-runs/{eval_run_id}", headers=headers) return GenieEvalRunResponse.from_dict(res) @@ -2970,7 +2970,7 @@ def genie_list_eval_results( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do( "GET", f"/api/2.0/genie/spaces/{space_id}/eval-runs/{eval_run_id}/results", query=query, headers=headers @@ -3003,7 +3003,7 @@ def genie_list_eval_runs( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("GET", f"/api/2.0/genie/spaces/{space_id}/eval-runs", query=query, headers=headers) return GenieListEvalRunsResponse.from_dict(res) @@ -3065,7 +3065,7 @@ def get_download_full_query_result( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do( "GET", @@ -3094,7 +3094,7 @@ def get_message(self, space_id: str, conversation_id: str, message_id: str) -> G cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do( "GET", @@ -3127,7 +3127,7 @@ def get_message_attachment_query_result( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do( "GET", @@ -3158,7 +3158,7 @@ def get_message_query_result( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do( "GET", @@ -3191,7 +3191,7 @@ def get_message_query_result_by_attachment( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do( "GET", @@ -3221,7 +3221,7 @@ def get_space(self, space_id: str, *, include_serialized_space: Optional[bool] = cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("GET", f"/api/2.0/genie/spaces/{space_id}", query=query, headers=headers) return GenieSpace.from_dict(res) @@ -3254,7 +3254,7 @@ def list_conversation_comments( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do( "GET", @@ -3292,7 +3292,7 @@ def list_conversation_messages( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do( "GET", @@ -3338,7 +3338,7 @@ def list_conversations( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("GET", f"/api/2.0/genie/spaces/{space_id}/conversations", query=query, headers=headers) return GenieListConversationsResponse.from_dict(res) @@ -3379,7 +3379,7 @@ def list_message_comments( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do( "GET", @@ -3413,7 +3413,7 @@ def list_spaces( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("GET", "/api/2.0/genie/spaces", query=query, headers=headers) return GenieListSpacesResponse.from_dict(res) @@ -3455,7 +3455,7 @@ def send_message_feedback( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id self._api.do( "POST", @@ -3487,7 +3487,7 @@ def start_conversation(self, space_id: str, content: str) -> Wait[GenieMessage]: cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id op_response = self._api.do( "POST", f"/api/2.0/genie/spaces/{space_id}/start-conversation", body=body, headers=headers @@ -3518,7 +3518,7 @@ def trash_space(self, space_id: str): cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id self._api.do("DELETE", f"/api/2.0/genie/spaces/{space_id}", headers=headers) @@ -3577,7 +3577,7 @@ def update_space( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("PATCH", f"/api/2.0/genie/spaces/{space_id}", body=body, headers=headers) return GenieSpace.from_dict(res) @@ -3621,7 +3621,7 @@ def create( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("POST", "/api/2.0/lakeview/dashboards", query=query, body=body, headers=headers) return Dashboard.from_dict(res) @@ -3645,7 +3645,7 @@ def create_schedule(self, dashboard_id: str, schedule: Schedule) -> Schedule: cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("POST", f"/api/2.0/lakeview/dashboards/{dashboard_id}/schedules", body=body, headers=headers) return Schedule.from_dict(res) @@ -3671,7 +3671,7 @@ def create_subscription(self, dashboard_id: str, schedule_id: str, subscription: cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do( "POST", @@ -3704,7 +3704,7 @@ def delete_schedule(self, dashboard_id: str, schedule_id: str, *, etag: Optional cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id self._api.do( "DELETE", @@ -3740,7 +3740,7 @@ def delete_subscription( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id self._api.do( "DELETE", @@ -3764,7 +3764,7 @@ def get(self, dashboard_id: str) -> Dashboard: cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("GET", f"/api/2.0/lakeview/dashboards/{dashboard_id}", headers=headers) return Dashboard.from_dict(res) @@ -3784,7 +3784,7 @@ def get_published(self, dashboard_id: str) -> PublishedDashboard: cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("GET", f"/api/2.0/lakeview/dashboards/{dashboard_id}/published", headers=headers) return PublishedDashboard.from_dict(res) @@ -3806,7 +3806,7 @@ def get_schedule(self, dashboard_id: str, schedule_id: str) -> Schedule: cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do( "GET", f"/api/2.0/lakeview/dashboards/{dashboard_id}/schedules/{schedule_id}", headers=headers @@ -3832,7 +3832,7 @@ def get_subscription(self, dashboard_id: str, schedule_id: str, subscription_id: cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do( "GET", @@ -3880,7 +3880,7 @@ def list( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id while True: json = self._api.do("GET", "/api/2.0/lakeview/dashboards", query=query, headers=headers) @@ -3918,7 +3918,7 @@ def list_schedules( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id while True: json = self._api.do( @@ -3960,7 +3960,7 @@ def list_subscriptions( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id while True: json = self._api.do( @@ -4015,7 +4015,7 @@ def migrate( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("POST", "/api/2.0/lakeview/dashboards/migrate", body=body, headers=headers) return Dashboard.from_dict(res) @@ -4048,7 +4048,7 @@ def publish( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("POST", f"/api/2.0/lakeview/dashboards/{dashboard_id}/published", body=body, headers=headers) return PublishedDashboard.from_dict(res) @@ -4096,7 +4096,7 @@ def trash(self, dashboard_id: str): cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id self._api.do("DELETE", f"/api/2.0/lakeview/dashboards/{dashboard_id}", headers=headers) @@ -4115,7 +4115,7 @@ def unpublish(self, dashboard_id: str): cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id self._api.do("DELETE", f"/api/2.0/lakeview/dashboards/{dashboard_id}/published", headers=headers) @@ -4157,7 +4157,7 @@ def update( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do( "PATCH", f"/api/2.0/lakeview/dashboards/{dashboard_id}", query=query, body=body, headers=headers @@ -4185,7 +4185,7 @@ def update_schedule(self, dashboard_id: str, schedule_id: str, schedule: Schedul cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do( "PUT", f"/api/2.0/lakeview/dashboards/{dashboard_id}/schedules/{schedule_id}", body=body, headers=headers @@ -4225,7 +4225,7 @@ def get_published_dashboard_token_info( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do( "GET", f"/api/2.0/lakeview/dashboards/{dashboard_id}/published/tokeninfo", query=query, headers=headers diff --git a/databricks/sdk/service/database.py b/databricks/sdk/service/database.py index 9a9e8cdea..b07dc1b22 100755 --- a/databricks/sdk/service/database.py +++ b/databricks/sdk/service/database.py @@ -1609,7 +1609,7 @@ def create_database_catalog(self, catalog: DatabaseCatalog) -> DatabaseCatalog: cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("POST", "/api/2.0/database/catalogs", body=body, headers=headers) return DatabaseCatalog.from_dict(res) @@ -1633,7 +1633,7 @@ def create_database_instance(self, database_instance: DatabaseInstance) -> Wait[ cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id op_response = self._api.do("POST", "/api/2.0/database/instances", body=body, headers=headers) return Wait( @@ -1674,7 +1674,7 @@ def create_database_instance_role( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do( "POST", f"/api/2.0/database/instances/{instance_name}/roles", query=query, body=body, headers=headers @@ -1698,7 +1698,7 @@ def create_database_table(self, table: DatabaseTable) -> DatabaseTable: cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("POST", "/api/2.0/database/tables", body=body, headers=headers) return DatabaseTable.from_dict(res) @@ -1719,7 +1719,7 @@ def create_synced_database_table(self, synced_table: SyncedDatabaseTable) -> Syn cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("POST", "/api/2.0/database/synced_tables", body=body, headers=headers) return SyncedDatabaseTable.from_dict(res) @@ -1738,7 +1738,7 @@ def delete_database_catalog(self, name: str): cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id self._api.do("DELETE", f"/api/2.0/database/catalogs/{name}", headers=headers) @@ -1768,7 +1768,7 @@ def delete_database_instance(self, name: str, *, force: Optional[bool] = None, p cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id self._api.do("DELETE", f"/api/2.0/database/instances/{name}", query=query, headers=headers) @@ -1802,7 +1802,7 @@ def delete_database_instance_role( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id self._api.do( "DELETE", f"/api/2.0/database/instances/{instance_name}/roles/{name}", query=query, headers=headers @@ -1822,7 +1822,7 @@ def delete_database_table(self, name: str): cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id self._api.do("DELETE", f"/api/2.0/database/tables/{name}", headers=headers) @@ -1845,7 +1845,7 @@ def delete_synced_database_table(self, name: str, *, purge_data: Optional[bool] cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id self._api.do("DELETE", f"/api/2.0/database/synced_tables/{name}", query=query, headers=headers) @@ -1867,7 +1867,7 @@ def find_database_instance_by_uid(self, *, uid: Optional[str] = None) -> Databas cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("GET", "/api/2.0/database/instances:findByUid", query=query, headers=headers) return DatabaseInstance.from_dict(res) @@ -1910,7 +1910,7 @@ def generate_database_credential( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("POST", "/api/2.0/database/credentials", body=body, headers=headers) return DatabaseCredential.from_dict(res) @@ -1929,7 +1929,7 @@ def get_database_catalog(self, name: str) -> DatabaseCatalog: cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("GET", f"/api/2.0/database/catalogs/{name}", headers=headers) return DatabaseCatalog.from_dict(res) @@ -1949,7 +1949,7 @@ def get_database_instance(self, name: str) -> DatabaseInstance: cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("GET", f"/api/2.0/database/instances/{name}", headers=headers) return DatabaseInstance.from_dict(res) @@ -1969,7 +1969,7 @@ def get_database_instance_role(self, instance_name: str, name: str) -> DatabaseI cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("GET", f"/api/2.0/database/instances/{instance_name}/roles/{name}", headers=headers) return DatabaseInstanceRole.from_dict(res) @@ -1988,7 +1988,7 @@ def get_database_table(self, name: str) -> DatabaseTable: cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("GET", f"/api/2.0/database/tables/{name}", headers=headers) return DatabaseTable.from_dict(res) @@ -2007,7 +2007,7 @@ def get_synced_database_table(self, name: str) -> SyncedDatabaseTable: cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("GET", f"/api/2.0/database/synced_tables/{name}", headers=headers) return SyncedDatabaseTable.from_dict(res) @@ -2038,7 +2038,7 @@ def list_database_catalogs( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id while True: json = self._api.do( @@ -2078,7 +2078,7 @@ def list_database_instance_roles( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id while True: json = self._api.do( @@ -2115,7 +2115,7 @@ def list_database_instances( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id while True: json = self._api.do("GET", "/api/2.0/database/instances", query=query, headers=headers) @@ -2152,7 +2152,7 @@ def list_synced_database_tables( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id while True: json = self._api.do( @@ -2191,7 +2191,7 @@ def update_database_catalog( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("PATCH", f"/api/2.0/database/catalogs/{name}", query=query, body=body, headers=headers) return DatabaseCatalog.from_dict(res) @@ -2222,7 +2222,7 @@ def update_database_instance( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("PATCH", f"/api/2.0/database/instances/{name}", query=query, body=body, headers=headers) return DatabaseInstance.from_dict(res) @@ -2253,7 +2253,7 @@ def update_synced_database_table( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("PATCH", f"/api/2.0/database/synced_tables/{name}", query=query, body=body, headers=headers) return SyncedDatabaseTable.from_dict(res) diff --git a/databricks/sdk/service/dataclassification.py b/databricks/sdk/service/dataclassification.py index d8ebf4ba1..7fff6848b 100755 --- a/databricks/sdk/service/dataclassification.py +++ b/databricks/sdk/service/dataclassification.py @@ -168,7 +168,7 @@ def create_catalog_config(self, parent: str, catalog_config: CatalogConfig) -> C cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("POST", f"/api/data-classification/v1/{parent}/config", body=body, headers=headers) return CatalogConfig.from_dict(res) @@ -188,7 +188,7 @@ def delete_catalog_config(self, name: str): cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id self._api.do("DELETE", f"/api/data-classification/v1/{name}", headers=headers) @@ -207,7 +207,7 @@ def get_catalog_config(self, name: str) -> CatalogConfig: cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("GET", f"/api/data-classification/v1/{name}", headers=headers) return CatalogConfig.from_dict(res) @@ -239,7 +239,7 @@ def update_catalog_config(self, name: str, catalog_config: CatalogConfig, update cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("PATCH", f"/api/data-classification/v1/{name}", query=query, body=body, headers=headers) return CatalogConfig.from_dict(res) diff --git a/databricks/sdk/service/dataquality.py b/databricks/sdk/service/dataquality.py index b915283fd..8b137cfe5 100644 --- a/databricks/sdk/service/dataquality.py +++ b/databricks/sdk/service/dataquality.py @@ -889,7 +889,7 @@ def cancel_refresh(self, object_type: str, object_id: str, refresh_id: int) -> C cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do( "POST", @@ -929,7 +929,7 @@ def create_monitor(self, monitor: Monitor) -> Monitor: cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("POST", "/api/data-quality/v1/monitors", body=body, headers=headers) return Monitor.from_dict(res) @@ -971,7 +971,7 @@ def create_refresh(self, object_type: str, object_id: str, refresh: Refresh) -> cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do( "POST", f"/api/data-quality/v1/monitors/{object_type}/{object_id}/refreshes", body=body, headers=headers @@ -1017,7 +1017,7 @@ def delete_monitor(self, object_type: str, object_id: str): cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id self._api.do("DELETE", f"/api/data-quality/v1/monitors/{object_type}/{object_id}", headers=headers) @@ -1050,7 +1050,7 @@ def delete_refresh(self, object_type: str, object_id: str, refresh_id: int): cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id self._api.do( "DELETE", f"/api/data-quality/v1/monitors/{object_type}/{object_id}/refreshes/{refresh_id}", headers=headers @@ -1096,7 +1096,7 @@ def get_monitor(self, object_type: str, object_id: str) -> Monitor: cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("GET", f"/api/data-quality/v1/monitors/{object_type}/{object_id}", headers=headers) return Monitor.from_dict(res) @@ -1140,7 +1140,7 @@ def get_refresh(self, object_type: str, object_id: str, refresh_id: int) -> Refr cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do( "GET", f"/api/data-quality/v1/monitors/{object_type}/{object_id}/refreshes/{refresh_id}", headers=headers @@ -1167,7 +1167,7 @@ def list_monitor(self, *, page_size: Optional[int] = None, page_token: Optional[ cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id while True: json = self._api.do("GET", "/api/data-quality/v1/monitors", query=query, headers=headers) @@ -1224,7 +1224,7 @@ def list_refresh( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id while True: json = self._api.do( @@ -1286,7 +1286,7 @@ def update_monitor(self, object_type: str, object_id: str, monitor: Monitor, upd cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do( "PATCH", f"/api/data-quality/v1/monitors/{object_type}/{object_id}", query=query, body=body, headers=headers @@ -1333,7 +1333,7 @@ def update_refresh( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do( "PATCH", diff --git a/databricks/sdk/service/environments.py b/databricks/sdk/service/environments.py index 77903343c..b7aedb4e2 100755 --- a/databricks/sdk/service/environments.py +++ b/databricks/sdk/service/environments.py @@ -507,7 +507,7 @@ def create_workspace_base_environment( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do( "POST", "/api/environments/v1/workspace-base-environments", query=query, body=body, headers=headers @@ -533,7 +533,7 @@ def delete_workspace_base_environment(self, name: str): cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id self._api.do("DELETE", f"/api/environments/v1/{name}", headers=headers) @@ -554,7 +554,7 @@ def get_default_workspace_base_environment(self, name: str) -> DefaultWorkspaceB cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("GET", f"/api/environments/v1/{name}", headers=headers) return DefaultWorkspaceBaseEnvironment.from_dict(res) @@ -574,7 +574,7 @@ def get_operation(self, name: str) -> Operation: cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("GET", f"/api/environments/v1/{name}", headers=headers) return Operation.from_dict(res) @@ -595,7 +595,7 @@ def get_workspace_base_environment(self, name: str) -> WorkspaceBaseEnvironment: cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("GET", f"/api/environments/v1/{name}", headers=headers) return WorkspaceBaseEnvironment.from_dict(res) @@ -636,7 +636,7 @@ def list_workspace_base_environments( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id while True: json = self._api.do("GET", "/api/environments/v1/workspace-base-environments", query=query, headers=headers) @@ -667,7 +667,7 @@ def refresh_workspace_base_environment(self, name: str) -> RefreshWorkspaceBaseE cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("POST", f"/api/environments/v1/{name}/refresh", headers=headers) operation = Operation.from_dict(res) @@ -706,7 +706,7 @@ def update_default_workspace_base_environment( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("PATCH", f"/api/environments/v1/{name}", query=query, body=body, headers=headers) return DefaultWorkspaceBaseEnvironment.from_dict(res) @@ -735,7 +735,7 @@ def update_workspace_base_environment( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("PATCH", f"/api/environments/v1/{name}", body=body, headers=headers) operation = Operation.from_dict(res) diff --git a/databricks/sdk/service/files.py b/databricks/sdk/service/files.py index ca65b52c8..b555b6889 100755 --- a/databricks/sdk/service/files.py +++ b/databricks/sdk/service/files.py @@ -475,7 +475,7 @@ def add_block(self, handle: int, data: str): cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id self._api.do("POST", "/api/2.0/dbfs/add-block", body=body, headers=headers) @@ -499,7 +499,7 @@ def close(self, handle: int): cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id self._api.do("POST", "/api/2.0/dbfs/close", body=body, headers=headers) @@ -533,7 +533,7 @@ def create(self, path: str, *, overwrite: Optional[bool] = None) -> CreateRespon cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("POST", "/api/2.0/dbfs/create", body=body, headers=headers) return CreateResponse.from_dict(res) @@ -575,7 +575,7 @@ def delete(self, path: str, *, recursive: Optional[bool] = None): cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id self._api.do("POST", "/api/2.0/dbfs/delete", body=body, headers=headers) @@ -598,7 +598,7 @@ def get_status(self, path: str) -> FileInfo: cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("GET", "/api/2.0/dbfs/get-status", query=query, headers=headers) return FileInfo.from_dict(res) @@ -629,7 +629,7 @@ def list(self, path: str) -> Iterator[FileInfo]: cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id json = self._api.do("GET", "/api/2.0/dbfs/list", query=query, headers=headers) parsed = ListStatusResponse.from_dict(json).files @@ -657,7 +657,7 @@ def mkdirs(self, path: str): cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id self._api.do("POST", "/api/2.0/dbfs/mkdirs", body=body, headers=headers) @@ -687,7 +687,7 @@ def move(self, source_path: str, destination_path: str): cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id self._api.do("POST", "/api/2.0/dbfs/move", body=body, headers=headers) @@ -727,7 +727,7 @@ def put(self, path: str, *, contents: Optional[str] = None, overwrite: Optional[ cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id self._api.do("POST", "/api/2.0/dbfs/put", body=body, headers=headers) @@ -764,7 +764,7 @@ def read(self, path: str, *, length: Optional[int] = None, offset: Optional[int] cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("GET", "/api/2.0/dbfs/read", query=query, headers=headers) return ReadResponse.from_dict(res) @@ -805,7 +805,7 @@ def create_directory(self, directory_path: str): cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id self._api.do( "PUT", f"/api/2.0/fs/directories{_escape_multi_segment_path_parameter(directory_path)}", headers=headers @@ -824,7 +824,7 @@ def delete(self, file_path: str): cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id self._api.do("DELETE", f"/api/2.0/fs/files{_escape_multi_segment_path_parameter(file_path)}", headers=headers) @@ -844,7 +844,7 @@ def delete_directory(self, directory_path: str): cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id self._api.do( "DELETE", f"/api/2.0/fs/directories{_escape_multi_segment_path_parameter(directory_path)}", headers=headers @@ -866,7 +866,7 @@ def download(self, file_path: str) -> DownloadResponse: cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id response_headers = [ "content-length", @@ -901,7 +901,7 @@ def get_directory_metadata(self, directory_path: str): cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id self._api.do( "HEAD", f"/api/2.0/fs/directories{_escape_multi_segment_path_parameter(directory_path)}", headers=headers @@ -920,7 +920,7 @@ def get_metadata(self, file_path: str) -> GetMetadataResponse: cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id response_headers = [ "content-length", @@ -975,7 +975,7 @@ def list_directory_contents( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id while True: json = self._api.do( @@ -1016,7 +1016,7 @@ def upload(self, file_path: str, contents: BinaryIO, *, overwrite: Optional[bool cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id self._api.do( "PUT", diff --git a/databricks/sdk/service/iam.py b/databricks/sdk/service/iam.py index 54bb4b6ae..7fc284d0c 100755 --- a/databricks/sdk/service/iam.py +++ b/databricks/sdk/service/iam.py @@ -2206,7 +2206,7 @@ def check_policy( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("GET", "/api/2.0/access-control/check-policy-v2", query=query, headers=headers) return CheckPolicyResponse.from_dict(res) @@ -2360,7 +2360,7 @@ def get_assignable_roles_for_resource(self, resource: str) -> GetAssignableRoles cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do( "GET", "/api/2.0/preview/accounts/access-control/assignable-roles", query=query, headers=headers @@ -2407,7 +2407,7 @@ def get_rule_set(self, name: str, etag: str) -> RuleSetResponse: cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("GET", "/api/2.0/preview/accounts/access-control/rule-sets", query=query, headers=headers) return RuleSetResponse.from_dict(res) @@ -2435,7 +2435,7 @@ def update_rule_set(self, name: str, rule_set: RuleSetUpdateRequest) -> RuleSetR cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("PUT", "/api/2.0/preview/accounts/access-control/rule-sets", body=body, headers=headers) return RuleSetResponse.from_dict(res) @@ -3252,7 +3252,7 @@ def me(self, *, attributes: Optional[str] = None, excluded_attributes: Optional[ cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("GET", "/api/2.0/preview/scim/v2/Me", query=query, headers=headers) return User.from_dict(res) @@ -3332,7 +3332,7 @@ def create( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("POST", "/api/2.0/preview/scim/v2/Groups", body=body, headers=headers) return Group.from_dict(res) @@ -3350,7 +3350,7 @@ def delete(self, id: str): cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id self._api.do("DELETE", f"/api/2.0/preview/scim/v2/Groups/{id}", headers=headers) @@ -3369,7 +3369,7 @@ def get(self, id: str) -> Group: cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("GET", f"/api/2.0/preview/scim/v2/Groups/{id}", headers=headers) return Group.from_dict(res) @@ -3431,7 +3431,7 @@ def list( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id query["startIndex"] = 1 if "count" not in query: @@ -3469,7 +3469,7 @@ def patch(self, id: str, *, operations: Optional[List[Patch]] = None, schemas: O cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id self._api.do("PATCH", f"/api/2.0/preview/scim/v2/Groups/{id}", body=body, headers=headers) @@ -3534,7 +3534,7 @@ def update( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id self._api.do("PUT", f"/api/2.0/preview/scim/v2/Groups/{id}", body=body, headers=headers) @@ -3583,7 +3583,7 @@ def migrate_permissions( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("POST", "/api/2.0/permissionmigration", body=body, headers=headers) return MigratePermissionsResponse.from_dict(res) @@ -3638,7 +3638,7 @@ def get(self, request_object_type: str, request_object_id: str) -> ObjectPermiss cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("GET", f"/api/2.0/permissions/{request_object_type}/{request_object_id}", headers=headers) return ObjectPermissions.from_dict(res) @@ -3663,7 +3663,7 @@ def get_permission_levels(self, request_object_type: str, request_object_id: str cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do( "GET", f"/api/2.0/permissions/{request_object_type}/{request_object_id}/permissionLevels", headers=headers @@ -3704,7 +3704,7 @@ def set( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do( "PUT", f"/api/2.0/permissions/{request_object_type}/{request_object_id}", body=body, headers=headers @@ -3744,7 +3744,7 @@ def update( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do( "PATCH", f"/api/2.0/permissions/{request_object_type}/{request_object_id}", body=body, headers=headers @@ -3826,7 +3826,7 @@ def create( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("POST", "/api/2.0/preview/scim/v2/ServicePrincipals", body=body, headers=headers) return ServicePrincipal.from_dict(res) @@ -3844,7 +3844,7 @@ def delete(self, id: str): cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id self._api.do("DELETE", f"/api/2.0/preview/scim/v2/ServicePrincipals/{id}", headers=headers) @@ -3863,7 +3863,7 @@ def get(self, id: str) -> ServicePrincipal: cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("GET", f"/api/2.0/preview/scim/v2/ServicePrincipals/{id}", headers=headers) return ServicePrincipal.from_dict(res) @@ -3925,7 +3925,7 @@ def list( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id query["startIndex"] = 1 if "count" not in query: @@ -3963,7 +3963,7 @@ def patch(self, id: str, *, operations: Optional[List[Patch]] = None, schemas: O cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id self._api.do("PATCH", f"/api/2.0/preview/scim/v2/ServicePrincipals/{id}", body=body, headers=headers) @@ -4031,7 +4031,7 @@ def update( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id self._api.do("PUT", f"/api/2.0/preview/scim/v2/ServicePrincipals/{id}", body=body, headers=headers) @@ -4128,7 +4128,7 @@ def create( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("POST", "/api/2.0/preview/scim/v2/Users", body=body, headers=headers) return User.from_dict(res) @@ -4147,7 +4147,7 @@ def delete(self, id: str): cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id self._api.do("DELETE", f"/api/2.0/preview/scim/v2/Users/{id}", headers=headers) @@ -4212,7 +4212,7 @@ def get( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("GET", f"/api/2.0/preview/scim/v2/Users/{id}", query=query, headers=headers) return User.from_dict(res) @@ -4230,7 +4230,7 @@ def get_permission_levels(self) -> GetPasswordPermissionLevelsResponse: cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("GET", "/api/2.0/permissions/authorization/passwords/permissionLevels", headers=headers) return GetPasswordPermissionLevelsResponse.from_dict(res) @@ -4248,7 +4248,7 @@ def get_permissions(self) -> PasswordPermissions: cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("GET", "/api/2.0/permissions/authorization/passwords", headers=headers) return PasswordPermissions.from_dict(res) @@ -4311,7 +4311,7 @@ def list( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id query["startIndex"] = 1 if "count" not in query: @@ -4349,7 +4349,7 @@ def patch(self, id: str, *, operations: Optional[List[Patch]] = None, schemas: O cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id self._api.do("PATCH", f"/api/2.0/preview/scim/v2/Users/{id}", body=body, headers=headers) @@ -4374,7 +4374,7 @@ def set_permissions( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("PUT", "/api/2.0/permissions/authorization/passwords", body=body, headers=headers) return PasswordPermissions.from_dict(res) @@ -4454,7 +4454,7 @@ def update( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id self._api.do("PUT", f"/api/2.0/preview/scim/v2/Users/{id}", body=body, headers=headers) @@ -4478,7 +4478,7 @@ def update_permissions( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("PATCH", "/api/2.0/permissions/authorization/passwords", body=body, headers=headers) return PasswordPermissions.from_dict(res) @@ -5555,7 +5555,7 @@ def create( } cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("POST", "/api/2.0/preview/scim/v2/Groups", body=body, headers=headers) return Group.from_dict(res) @@ -5572,7 +5572,7 @@ def delete(self, id: str): headers = {} cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id self._api.do("DELETE", f"/api/2.0/preview/scim/v2/Groups/{id}", headers=headers) @@ -5590,7 +5590,7 @@ def get(self, id: str) -> Group: } cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("GET", f"/api/2.0/preview/scim/v2/Groups/{id}", headers=headers) return Group.from_dict(res) @@ -5651,7 +5651,7 @@ def list( } cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id # deduplicate items that may have been added during iteration seen = set() @@ -5692,7 +5692,7 @@ def patch(self, id: str, *, operations: Optional[List[Patch]] = None, schemas: O } cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id self._api.do("PATCH", f"/api/2.0/preview/scim/v2/Groups/{id}", body=body, headers=headers) @@ -5754,7 +5754,7 @@ def update( } cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id self._api.do("PUT", f"/api/2.0/preview/scim/v2/Groups/{id}", body=body, headers=headers) @@ -5831,7 +5831,7 @@ def create( } cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("POST", "/api/2.0/preview/scim/v2/ServicePrincipals", body=body, headers=headers) return ServicePrincipal.from_dict(res) @@ -5848,7 +5848,7 @@ def delete(self, id: str): headers = {} cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id self._api.do("DELETE", f"/api/2.0/preview/scim/v2/ServicePrincipals/{id}", headers=headers) @@ -5866,7 +5866,7 @@ def get(self, id: str) -> ServicePrincipal: } cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("GET", f"/api/2.0/preview/scim/v2/ServicePrincipals/{id}", headers=headers) return ServicePrincipal.from_dict(res) @@ -5927,7 +5927,7 @@ def list( } cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id # deduplicate items that may have been added during iteration seen = set() @@ -5968,7 +5968,7 @@ def patch(self, id: str, *, operations: Optional[List[Patch]] = None, schemas: O } cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id self._api.do("PATCH", f"/api/2.0/preview/scim/v2/ServicePrincipals/{id}", body=body, headers=headers) @@ -6033,7 +6033,7 @@ def update( } cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id self._api.do("PUT", f"/api/2.0/preview/scim/v2/ServicePrincipals/{id}", body=body, headers=headers) @@ -6128,7 +6128,7 @@ def create( } cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("POST", "/api/2.0/preview/scim/v2/Users", body=body, headers=headers) return User.from_dict(res) @@ -6146,7 +6146,7 @@ def delete(self, id: str): headers = {} cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id self._api.do("DELETE", f"/api/2.0/preview/scim/v2/Users/{id}", headers=headers) @@ -6210,7 +6210,7 @@ def get( } cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("GET", f"/api/2.0/preview/scim/v2/Users/{id}", query=query, headers=headers) return User.from_dict(res) @@ -6227,7 +6227,7 @@ def get_permission_levels(self) -> GetPasswordPermissionLevelsResponse: } cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("GET", "/api/2.0/permissions/authorization/passwords/permissionLevels", headers=headers) return GetPasswordPermissionLevelsResponse.from_dict(res) @@ -6244,7 +6244,7 @@ def get_permissions(self) -> PasswordPermissions: } cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("GET", "/api/2.0/permissions/authorization/passwords", headers=headers) return PasswordPermissions.from_dict(res) @@ -6306,7 +6306,7 @@ def list( } cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id # deduplicate items that may have been added during iteration seen = set() @@ -6347,7 +6347,7 @@ def patch(self, id: str, *, operations: Optional[List[Patch]] = None, schemas: O } cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id self._api.do("PATCH", f"/api/2.0/preview/scim/v2/Users/{id}", body=body, headers=headers) @@ -6370,7 +6370,7 @@ def set_permissions( } cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("PUT", "/api/2.0/permissions/authorization/passwords", body=body, headers=headers) return PasswordPermissions.from_dict(res) @@ -6447,7 +6447,7 @@ def update( } cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id self._api.do("PUT", f"/api/2.0/preview/scim/v2/Users/{id}", body=body, headers=headers) @@ -6469,7 +6469,7 @@ def update_permissions( } cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("PATCH", "/api/2.0/permissions/authorization/passwords", body=body, headers=headers) return PasswordPermissions.from_dict(res) diff --git a/databricks/sdk/service/iamv2.py b/databricks/sdk/service/iamv2.py index d7f201336..3606ac2dc 100755 --- a/databricks/sdk/service/iamv2.py +++ b/databricks/sdk/service/iamv2.py @@ -832,7 +832,7 @@ def create_workspace_assignment_detail_proxy( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("POST", "/api/2.0/identity/workspaceAssignmentDetails", body=body, headers=headers) return WorkspaceAssignmentDetail.from_dict(res) @@ -855,7 +855,7 @@ def delete_workspace_assignment_detail_proxy(self, principal_id: int): cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id self._api.do("DELETE", f"/api/2.0/identity/workspaceAssignmentDetails/{principal_id}", headers=headers) @@ -886,7 +886,7 @@ def get_workspace_access_detail_local( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do( "GET", f"/api/2.0/identity/workspaceAccessDetails/{principal_id}", query=query, headers=headers @@ -909,7 +909,7 @@ def get_workspace_assignment_detail_proxy(self, principal_id: int) -> WorkspaceA cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("GET", f"/api/2.0/identity/workspaceAssignmentDetails/{principal_id}", headers=headers) return WorkspaceAssignmentDetail.from_dict(res) @@ -940,7 +940,7 @@ def list_workspace_assignment_details_proxy( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("GET", "/api/2.0/identity/workspaceAssignmentDetails", query=query, headers=headers) return ListWorkspaceAssignmentDetailsResponse.from_dict(res) @@ -966,7 +966,7 @@ def resolve_group_proxy(self, external_id: str) -> ResolveGroupResponse: cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("POST", "/api/2.0/identity/groups/resolveByExternalId", body=body, headers=headers) return ResolveGroupResponse.from_dict(res) @@ -992,7 +992,7 @@ def resolve_service_principal_proxy(self, external_id: str) -> ResolveServicePri cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do( "POST", "/api/2.0/identity/servicePrincipals/resolveByExternalId", body=body, headers=headers @@ -1020,7 +1020,7 @@ def resolve_user_proxy(self, external_id: str) -> ResolveUserResponse: cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("POST", "/api/2.0/identity/users/resolveByExternalId", body=body, headers=headers) return ResolveUserResponse.from_dict(res) @@ -1054,7 +1054,7 @@ def update_workspace_assignment_detail_proxy( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do( "PATCH", diff --git a/databricks/sdk/service/jobs.py b/databricks/sdk/service/jobs.py index eebab4af7..308f72199 100755 --- a/databricks/sdk/service/jobs.py +++ b/databricks/sdk/service/jobs.py @@ -8917,7 +8917,7 @@ def cancel_all_runs(self, *, all_queued_runs: Optional[bool] = None, job_id: Opt cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id self._api.do("POST", "/api/2.2/jobs/runs/cancel-all", body=body, headers=headers) @@ -8942,7 +8942,7 @@ def cancel_run(self, run_id: int) -> Wait[Run]: cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id op_response = self._api.do("POST", "/api/2.2/jobs/runs/cancel", body=body, headers=headers) return Wait(self.wait_get_run_job_terminated_or_skipped, run_id=run_id) @@ -9144,7 +9144,7 @@ def create( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("POST", "/api/2.2/jobs/create", body=body, headers=headers) return CreateResponse.from_dict(res) @@ -9167,7 +9167,7 @@ def delete(self, job_id: int): cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id self._api.do("POST", "/api/2.2/jobs/delete", body=body, headers=headers) @@ -9189,7 +9189,7 @@ def delete_run(self, run_id: int): cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id self._api.do("POST", "/api/2.2/jobs/runs/delete", body=body, headers=headers) @@ -9215,7 +9215,7 @@ def export_run(self, run_id: int, *, views_to_export: Optional[ViewsToExport] = cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("GET", "/api/2.2/jobs/runs/export", query=query, headers=headers) return ExportRunOutput.from_dict(res) @@ -9256,7 +9256,7 @@ def get( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("GET", "/api/2.2/jobs/get", query=query, headers=headers) return Job.from_dict(res) @@ -9276,7 +9276,7 @@ def get_permission_levels(self, job_id: str) -> GetJobPermissionLevelsResponse: cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("GET", f"/api/2.0/permissions/jobs/{job_id}/permissionLevels", headers=headers) return GetJobPermissionLevelsResponse.from_dict(res) @@ -9296,7 +9296,7 @@ def get_permissions(self, job_id: str) -> JobPermissions: cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("GET", f"/api/2.0/permissions/jobs/{job_id}", headers=headers) return JobPermissions.from_dict(res) @@ -9346,7 +9346,7 @@ def get_run( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("GET", "/api/2.2/jobs/runs/get", query=query, headers=headers) return Run.from_dict(res) @@ -9376,7 +9376,7 @@ def get_run_output(self, run_id: int) -> RunOutput: cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("GET", "/api/2.2/jobs/runs/get-output", query=query, headers=headers) return RunOutput.from_dict(res) @@ -9427,7 +9427,7 @@ def list( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id while True: json = self._api.do("GET", "/api/2.2/jobs/list", query=query, headers=headers) @@ -9514,7 +9514,7 @@ def list_runs( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id while True: json = self._api.do("GET", "/api/2.2/jobs/runs/list", query=query, headers=headers) @@ -9687,7 +9687,7 @@ def repair_run( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id op_response = self._api.do("POST", "/api/2.2/jobs/runs/repair", body=body, headers=headers) return Wait( @@ -9760,7 +9760,7 @@ def reset(self, job_id: int, new_settings: JobSettings): cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id self._api.do("POST", "/api/2.2/jobs/reset", body=body, headers=headers) @@ -9930,7 +9930,7 @@ def run_now( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id op_response = self._api.do("POST", "/api/2.2/jobs/run-now", body=body, headers=headers) return Wait( @@ -9998,7 +9998,7 @@ def set_permissions( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("PUT", f"/api/2.0/permissions/jobs/{job_id}", body=body, headers=headers) return JobPermissions.from_dict(res) @@ -10126,7 +10126,7 @@ def submit( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id op_response = self._api.do("POST", "/api/2.2/jobs/runs/submit", body=body, headers=headers) return Wait( @@ -10212,7 +10212,7 @@ def update( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id self._api.do("POST", "/api/2.2/jobs/update", body=body, headers=headers) @@ -10238,7 +10238,7 @@ def update_permissions( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("PATCH", f"/api/2.0/permissions/jobs/{job_id}", body=body, headers=headers) return JobPermissions.from_dict(res) @@ -10286,7 +10286,7 @@ def enforce_compliance( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("POST", "/api/2.0/policies/jobs/enforce-compliance", body=body, headers=headers) return EnforcePolicyComplianceResponse.from_dict(res) @@ -10311,7 +10311,7 @@ def get_compliance(self, job_id: int) -> GetPolicyComplianceResponse: cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("GET", "/api/2.0/policies/jobs/get-compliance", query=query, headers=headers) return GetPolicyComplianceResponse.from_dict(res) @@ -10348,7 +10348,7 @@ def list_compliance( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id while True: json = self._api.do("GET", "/api/2.0/policies/jobs/list-compliance", query=query, headers=headers) diff --git a/databricks/sdk/service/knowledgeassistants.py b/databricks/sdk/service/knowledgeassistants.py index aaabae4a3..fc3ddfdd7 100755 --- a/databricks/sdk/service/knowledgeassistants.py +++ b/databricks/sdk/service/knowledgeassistants.py @@ -819,7 +819,7 @@ def create_example(self, parent: str, example: Example) -> Example: cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("POST", f"/api/2.1/{parent}/examples", body=body, headers=headers) return Example.from_dict(res) @@ -841,7 +841,7 @@ def create_knowledge_assistant(self, knowledge_assistant: KnowledgeAssistant) -> cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("POST", "/api/2.1/knowledge-assistants", body=body, headers=headers) return KnowledgeAssistant.from_dict(res) @@ -865,7 +865,7 @@ def create_knowledge_source(self, parent: str, knowledge_source: KnowledgeSource cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("POST", f"/api/2.1/{parent}/knowledge-sources", body=body, headers=headers) return KnowledgeSource.from_dict(res) @@ -886,7 +886,7 @@ def delete_example(self, name: str): cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id self._api.do("DELETE", f"/api/2.1/{name}", headers=headers) @@ -906,7 +906,7 @@ def delete_knowledge_assistant(self, name: str): cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id self._api.do("DELETE", f"/api/2.1/{name}", headers=headers) @@ -926,7 +926,7 @@ def delete_knowledge_source(self, name: str): cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id self._api.do("DELETE", f"/api/2.1/{name}", headers=headers) @@ -946,7 +946,7 @@ def get_example(self, name: str) -> Example: cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("GET", f"/api/2.1/{name}", headers=headers) return Example.from_dict(res) @@ -966,7 +966,7 @@ def get_knowledge_assistant(self, name: str) -> KnowledgeAssistant: cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("GET", f"/api/2.1/{name}", headers=headers) return KnowledgeAssistant.from_dict(res) @@ -987,7 +987,7 @@ def get_knowledge_source(self, name: str) -> KnowledgeSource: cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("GET", f"/api/2.1/{name}", headers=headers) return KnowledgeSource.from_dict(res) @@ -1007,7 +1007,7 @@ def get_permission_levels(self, knowledge_assistant_id: str) -> GetKnowledgeAssi cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do( "GET", @@ -1032,7 +1032,7 @@ def get_permissions(self, knowledge_assistant_id: str) -> KnowledgeAssistantPerm cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do( "GET", f"/api/2.0/permissions/knowledge-assistants/{knowledge_assistant_id}", headers=headers @@ -1067,7 +1067,7 @@ def list_examples( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id while True: json = self._api.do("GET", f"/api/2.1/{parent}/examples", query=query, headers=headers) @@ -1104,7 +1104,7 @@ def list_knowledge_assistants( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id while True: json = self._api.do("GET", "/api/2.1/knowledge-assistants", query=query, headers=headers) @@ -1139,7 +1139,7 @@ def list_knowledge_sources( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id while True: json = self._api.do("GET", f"/api/2.1/{parent}/knowledge-sources", query=query, headers=headers) @@ -1176,7 +1176,7 @@ def set_permissions( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do( "PUT", f"/api/2.0/permissions/knowledge-assistants/{knowledge_assistant_id}", body=body, headers=headers @@ -1199,7 +1199,7 @@ def sync_knowledge_sources(self, name: str): cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id self._api.do("POST", f"/api/2.1/{name}/knowledge-sources:sync", headers=headers) @@ -1228,7 +1228,7 @@ def update_example(self, name: str, example: Example, update_mask: FieldMask) -> cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("PATCH", f"/api/2.1/{name}", query=query, body=body, headers=headers) return Example.from_dict(res) @@ -1262,7 +1262,7 @@ def update_knowledge_assistant( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("PATCH", f"/api/2.1/{name}", query=query, body=body, headers=headers) return KnowledgeAssistant.from_dict(res) @@ -1297,7 +1297,7 @@ def update_knowledge_source( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("PATCH", f"/api/2.1/{name}", query=query, body=body, headers=headers) return KnowledgeSource.from_dict(res) @@ -1328,7 +1328,7 @@ def update_permissions( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do( "PATCH", f"/api/2.0/permissions/knowledge-assistants/{knowledge_assistant_id}", body=body, headers=headers diff --git a/databricks/sdk/service/marketplace.py b/databricks/sdk/service/marketplace.py index b7fba4545..cb66eb5f0 100755 --- a/databricks/sdk/service/marketplace.py +++ b/databricks/sdk/service/marketplace.py @@ -2961,7 +2961,7 @@ def get( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id while True: json = self._api.do( @@ -3000,7 +3000,7 @@ def list( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id while True: json = self._api.do( @@ -3061,7 +3061,7 @@ def create( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do( "POST", f"/api/2.1/marketplace-consumer/listings/{listing_id}/installations", body=body, headers=headers @@ -3083,7 +3083,7 @@ def delete(self, listing_id: str, installation_id: str): cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id self._api.do( "DELETE", @@ -3113,7 +3113,7 @@ def list( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id while True: json = self._api.do("GET", "/api/2.1/marketplace-consumer/installations", query=query, headers=headers) @@ -3147,7 +3147,7 @@ def list_listing_installations( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id while True: json = self._api.do( @@ -3196,7 +3196,7 @@ def update( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do( "PUT", @@ -3231,7 +3231,7 @@ def batch_get(self, *, ids: Optional[List[str]] = None) -> BatchGetListingsRespo cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("GET", "/api/2.1/marketplace-consumer/listings:batchGet", query=query, headers=headers) return BatchGetListingsResponse.from_dict(res) @@ -3250,7 +3250,7 @@ def get(self, id: str) -> GetListingResponse: cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("GET", f"/api/2.1/marketplace-consumer/listings/{id}", headers=headers) return GetListingResponse.from_dict(res) @@ -3315,7 +3315,7 @@ def list( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id while True: json = self._api.do("GET", "/api/2.1/marketplace-consumer/listings", query=query, headers=headers) @@ -3380,7 +3380,7 @@ def search( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id while True: json = self._api.do("GET", "/api/2.1/marketplace-consumer/search-listings", query=query, headers=headers) @@ -3450,7 +3450,7 @@ def create( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do( "POST", @@ -3475,7 +3475,7 @@ def get(self, listing_id: str) -> GetPersonalizationRequestResponse: cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do( "GET", f"/api/2.1/marketplace-consumer/listings/{listing_id}/personalization-requests", headers=headers @@ -3504,7 +3504,7 @@ def list( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id while True: json = self._api.do( @@ -3541,7 +3541,7 @@ def batch_get(self, *, ids: Optional[List[str]] = None) -> BatchGetProvidersResp cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("GET", "/api/2.1/marketplace-consumer/providers:batchGet", query=query, headers=headers) return BatchGetProvidersResponse.from_dict(res) @@ -3560,7 +3560,7 @@ def get(self, id: str) -> GetProviderResponse: cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("GET", f"/api/2.1/marketplace-consumer/providers/{id}", headers=headers) return GetProviderResponse.from_dict(res) @@ -3590,7 +3590,7 @@ def list( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id while True: json = self._api.do("GET", "/api/2.1/marketplace-consumer/providers", query=query, headers=headers) @@ -3626,7 +3626,7 @@ def create(self, filter: ExchangeFilter) -> CreateExchangeFilterResponse: cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("POST", "/api/2.0/marketplace-exchange/filters", body=body, headers=headers) return CreateExchangeFilterResponse.from_dict(res) @@ -3645,7 +3645,7 @@ def delete(self, id: str): cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id self._api.do("DELETE", f"/api/2.0/marketplace-exchange/filters/{id}", headers=headers) @@ -3674,7 +3674,7 @@ def list( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id while True: json = self._api.do("GET", "/api/2.0/marketplace-exchange/filters", query=query, headers=headers) @@ -3704,7 +3704,7 @@ def update(self, id: str, filter: ExchangeFilter) -> UpdateExchangeFilterRespons cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("PUT", f"/api/2.0/marketplace-exchange/filters/{id}", body=body, headers=headers) return UpdateExchangeFilterResponse.from_dict(res) @@ -3737,7 +3737,7 @@ def add_listing_to_exchange(self, listing_id: str, exchange_id: str) -> AddExcha cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("POST", "/api/2.0/marketplace-exchange/exchanges-for-listing", body=body, headers=headers) return AddExchangeForListingResponse.from_dict(res) @@ -3760,7 +3760,7 @@ def create(self, exchange: Exchange) -> CreateExchangeResponse: cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("POST", "/api/2.0/marketplace-exchange/exchanges", body=body, headers=headers) return CreateExchangeResponse.from_dict(res) @@ -3779,7 +3779,7 @@ def delete(self, id: str): cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id self._api.do("DELETE", f"/api/2.0/marketplace-exchange/exchanges/{id}", headers=headers) @@ -3797,7 +3797,7 @@ def delete_listing_from_exchange(self, id: str): cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id self._api.do("DELETE", f"/api/2.0/marketplace-exchange/exchanges-for-listing/{id}", headers=headers) @@ -3815,7 +3815,7 @@ def get(self, id: str) -> GetExchangeResponse: cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("GET", f"/api/2.0/marketplace-exchange/exchanges/{id}", headers=headers) return GetExchangeResponse.from_dict(res) @@ -3840,7 +3840,7 @@ def list(self, *, page_size: Optional[int] = None, page_token: Optional[str] = N cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id while True: json = self._api.do("GET", "/api/2.0/marketplace-exchange/exchanges", query=query, headers=headers) @@ -3876,7 +3876,7 @@ def list_exchanges_for_listing( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id while True: json = self._api.do( @@ -3914,7 +3914,7 @@ def list_listings_for_exchange( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id while True: json = self._api.do( @@ -3946,7 +3946,7 @@ def update(self, id: str, exchange: Exchange) -> UpdateExchangeResponse: cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("PUT", f"/api/2.0/marketplace-exchange/exchanges/{id}", body=body, headers=headers) return UpdateExchangeResponse.from_dict(res) @@ -3992,7 +3992,7 @@ def create( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("POST", "/api/2.0/marketplace-provider/files", body=body, headers=headers) return CreateFileResponse.from_dict(res) @@ -4011,7 +4011,7 @@ def delete(self, file_id: str): cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id self._api.do("DELETE", f"/api/2.0/marketplace-provider/files/{file_id}", headers=headers) @@ -4029,7 +4029,7 @@ def get(self, file_id: str) -> GetFileResponse: cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("GET", f"/api/2.0/marketplace-provider/files/{file_id}", headers=headers) return GetFileResponse.from_dict(res) @@ -4059,7 +4059,7 @@ def list( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id while True: json = self._api.do("GET", "/api/2.0/marketplace-provider/files", query=query, headers=headers) @@ -4096,7 +4096,7 @@ def create(self, listing: Listing) -> CreateListingResponse: cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("POST", "/api/2.0/marketplace-provider/listing", body=body, headers=headers) return CreateListingResponse.from_dict(res) @@ -4115,7 +4115,7 @@ def delete(self, id: str): cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id self._api.do("DELETE", f"/api/2.0/marketplace-provider/listings/{id}", headers=headers) @@ -4133,7 +4133,7 @@ def get(self, id: str) -> GetListingResponse: cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("GET", f"/api/2.0/marketplace-provider/listings/{id}", headers=headers) return GetListingResponse.from_dict(res) @@ -4158,7 +4158,7 @@ def list(self, *, page_size: Optional[int] = None, page_token: Optional[str] = N cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id while True: json = self._api.do("GET", "/api/2.0/marketplace-provider/listings", query=query, headers=headers) @@ -4188,7 +4188,7 @@ def update(self, id: str, listing: Listing) -> UpdateListingResponse: cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("PUT", f"/api/2.0/marketplace-provider/listings/{id}", body=body, headers=headers) return UpdateListingResponse.from_dict(res) @@ -4224,7 +4224,7 @@ def list( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id while True: json = self._api.do( @@ -4271,7 +4271,7 @@ def update( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do( "PUT", @@ -4302,7 +4302,7 @@ def create(self) -> ProviderAnalyticsDashboard: cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("POST", "/api/2.0/marketplace-provider/analytics_dashboard", headers=headers) return ProviderAnalyticsDashboard.from_dict(res) @@ -4320,7 +4320,7 @@ def get(self) -> ListProviderAnalyticsDashboardResponse: cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("GET", "/api/2.0/marketplace-provider/analytics_dashboard", headers=headers) return ListProviderAnalyticsDashboardResponse.from_dict(res) @@ -4338,7 +4338,7 @@ def get_latest_version(self) -> GetLatestVersionProviderAnalyticsDashboardRespon cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("GET", "/api/2.0/marketplace-provider/analytics_dashboard/latest", headers=headers) return GetLatestVersionProviderAnalyticsDashboardResponse.from_dict(res) @@ -4365,7 +4365,7 @@ def update(self, id: str, *, version: Optional[int] = None) -> UpdateProviderAna cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("PUT", f"/api/2.0/marketplace-provider/analytics_dashboard/{id}", body=body, headers=headers) return UpdateProviderAnalyticsDashboardResponse.from_dict(res) @@ -4395,7 +4395,7 @@ def create(self, provider: ProviderInfo) -> CreateProviderResponse: cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("POST", "/api/2.0/marketplace-provider/provider", body=body, headers=headers) return CreateProviderResponse.from_dict(res) @@ -4414,7 +4414,7 @@ def delete(self, id: str): cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id self._api.do("DELETE", f"/api/2.0/marketplace-provider/providers/{id}", headers=headers) @@ -4432,7 +4432,7 @@ def get(self, id: str) -> GetProviderResponse: cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("GET", f"/api/2.0/marketplace-provider/providers/{id}", headers=headers) return GetProviderResponse.from_dict(res) @@ -4457,7 +4457,7 @@ def list(self, *, page_size: Optional[int] = None, page_token: Optional[str] = N cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id while True: json = self._api.do("GET", "/api/2.0/marketplace-provider/providers", query=query, headers=headers) @@ -4487,7 +4487,7 @@ def update(self, id: str, provider: ProviderInfo) -> UpdateProviderResponse: cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("PUT", f"/api/2.0/marketplace-provider/providers/{id}", body=body, headers=headers) return UpdateProviderResponse.from_dict(res) diff --git a/databricks/sdk/service/ml.py b/databricks/sdk/service/ml.py index 1125c8cce..496bf26f4 100755 --- a/databricks/sdk/service/ml.py +++ b/databricks/sdk/service/ml.py @@ -7174,7 +7174,7 @@ def create_experiment( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("POST", "/api/2.0/mlflow/experiments/create", body=body, headers=headers) return CreateExperimentResponse.from_dict(res) @@ -7227,7 +7227,7 @@ def create_logged_model( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("POST", "/api/2.0/mlflow/logged-models", body=body, headers=headers) return CreateLoggedModelResponse.from_dict(res) @@ -7278,7 +7278,7 @@ def create_run( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("POST", "/api/2.0/mlflow/runs/create", body=body, headers=headers) return CreateRunResponse.from_dict(res) @@ -7303,7 +7303,7 @@ def delete_experiment(self, experiment_id: str): cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id self._api.do("POST", "/api/2.0/mlflow/experiments/delete", body=body, headers=headers) @@ -7322,7 +7322,7 @@ def delete_logged_model(self, model_id: str): cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id self._api.do("DELETE", f"/api/2.0/mlflow/logged-models/{model_id}", headers=headers) @@ -7343,7 +7343,7 @@ def delete_logged_model_tag(self, model_id: str, tag_key: str): cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id self._api.do("DELETE", f"/api/2.0/mlflow/logged-models/{model_id}/tags/{tag_key}", headers=headers) @@ -7366,7 +7366,7 @@ def delete_run(self, run_id: str): cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id self._api.do("POST", "/api/2.0/mlflow/runs/delete", body=body, headers=headers) @@ -7403,7 +7403,7 @@ def delete_runs( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("POST", "/api/2.0/mlflow/databricks/runs/delete-runs", body=body, headers=headers) return DeleteRunsResponse.from_dict(res) @@ -7432,7 +7432,7 @@ def delete_tag(self, run_id: str, key: str): cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id self._api.do("POST", "/api/2.0/mlflow/runs/delete-tag", body=body, headers=headers) @@ -7458,7 +7458,7 @@ def finalize_logged_model(self, model_id: str, status: LoggedModelStatus) -> Fin cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("PATCH", f"/api/2.0/mlflow/logged-models/{model_id}", body=body, headers=headers) return FinalizeLoggedModelResponse.from_dict(res) @@ -7487,7 +7487,7 @@ def get_by_name(self, experiment_name: str) -> GetExperimentByNameResponse: cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("GET", "/api/2.0/mlflow/experiments/get-by-name", query=query, headers=headers) return GetExperimentByNameResponse.from_dict(res) @@ -7510,7 +7510,7 @@ def get_experiment(self, experiment_id: str) -> GetExperimentResponse: cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("GET", "/api/2.0/mlflow/experiments/get", query=query, headers=headers) return GetExperimentResponse.from_dict(res) @@ -7559,7 +7559,7 @@ def get_history( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id while True: json = self._api.do("GET", "/api/2.0/mlflow/metrics/get-history", query=query, headers=headers) @@ -7585,7 +7585,7 @@ def get_logged_model(self, model_id: str) -> GetLoggedModelResponse: cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("GET", f"/api/2.0/mlflow/logged-models/{model_id}", headers=headers) return GetLoggedModelResponse.from_dict(res) @@ -7605,7 +7605,7 @@ def get_permission_levels(self, experiment_id: str) -> GetExperimentPermissionLe cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("GET", f"/api/2.0/permissions/experiments/{experiment_id}/permissionLevels", headers=headers) return GetExperimentPermissionLevelsResponse.from_dict(res) @@ -7625,7 +7625,7 @@ def get_permissions(self, experiment_id: str) -> ExperimentPermissions: cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("GET", f"/api/2.0/permissions/experiments/{experiment_id}", headers=headers) return ExperimentPermissions.from_dict(res) @@ -7656,7 +7656,7 @@ def get_run(self, run_id: str, *, run_uuid: Optional[str] = None) -> GetRunRespo cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("GET", "/api/2.0/mlflow/runs/get", query=query, headers=headers) return GetRunResponse.from_dict(res) @@ -7707,7 +7707,7 @@ def list_artifacts( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id while True: json = self._api.do("GET", "/api/2.0/mlflow/artifacts/list", query=query, headers=headers) @@ -7752,7 +7752,7 @@ def list_experiments( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id while True: json = self._api.do("GET", "/api/2.0/mlflow/experiments/list", query=query, headers=headers) @@ -7843,7 +7843,7 @@ def log_batch( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id self._api.do("POST", "/api/2.0/mlflow/runs/log-batch", body=body, headers=headers) @@ -7876,7 +7876,7 @@ def log_inputs( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id self._api.do("POST", "/api/2.0/mlflow/runs/log-inputs", body=body, headers=headers) @@ -7903,7 +7903,7 @@ def log_logged_model_params(self, model_id: str, *, params: Optional[List[Logged cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id self._api.do("POST", f"/api/2.0/mlflow/logged-models/{model_id}/params", body=body, headers=headers) @@ -7975,7 +7975,7 @@ def log_metric( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id self._api.do("POST", "/api/2.0/mlflow/runs/log-metric", body=body, headers=headers) @@ -8005,7 +8005,7 @@ def log_model(self, *, model_json: Optional[str] = None, run_id: Optional[str] = cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id self._api.do("POST", "/api/2.0/mlflow/runs/log-model", body=body, headers=headers) @@ -8032,7 +8032,7 @@ def log_outputs(self, run_id: str, *, models: Optional[List[ModelOutput]] = None cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id self._api.do("POST", "/api/2.0/mlflow/runs/outputs", body=body, headers=headers) @@ -8070,7 +8070,7 @@ def log_param(self, key: str, value: str, *, run_id: Optional[str] = None, run_u cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id self._api.do("POST", "/api/2.0/mlflow/runs/log-parameter", body=body, headers=headers) @@ -8097,7 +8097,7 @@ def restore_experiment(self, experiment_id: str): cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id self._api.do("POST", "/api/2.0/mlflow/experiments/restore", body=body, headers=headers) @@ -8122,7 +8122,7 @@ def restore_run(self, run_id: str): cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id self._api.do("POST", "/api/2.0/mlflow/runs/restore", body=body, headers=headers) @@ -8159,7 +8159,7 @@ def restore_runs( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("POST", "/api/2.0/mlflow/databricks/runs/restore-runs", body=body, headers=headers) return RestoreRunsResponse.from_dict(res) @@ -8209,7 +8209,7 @@ def search_experiments( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id while True: json = self._api.do("POST", "/api/2.0/mlflow/experiments/search", body=body, headers=headers) @@ -8275,7 +8275,7 @@ def search_logged_models( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("POST", "/api/2.0/mlflow/logged-models/search", body=body, headers=headers) return SearchLoggedModelsResponse.from_dict(res) @@ -8343,7 +8343,7 @@ def search_runs( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id while True: json = self._api.do("POST", "/api/2.0/mlflow/runs/search", body=body, headers=headers) @@ -8381,7 +8381,7 @@ def set_experiment_tag(self, experiment_id: str, key: str, value: str): cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id self._api.do("POST", "/api/2.0/mlflow/experiments/set-experiment-tag", body=body, headers=headers) @@ -8406,7 +8406,7 @@ def set_logged_model_tags(self, model_id: str, *, tags: Optional[List[LoggedMode cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id self._api.do("PATCH", f"/api/2.0/mlflow/logged-models/{model_id}/tags", body=body, headers=headers) @@ -8433,7 +8433,7 @@ def set_permissions( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("PUT", f"/api/2.0/permissions/experiments/{experiment_id}", body=body, headers=headers) return ExperimentPermissions.from_dict(res) @@ -8470,7 +8470,7 @@ def set_tag(self, key: str, value: str, *, run_id: Optional[str] = None, run_uui cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id self._api.do("POST", "/api/2.0/mlflow/runs/set-tag", body=body, headers=headers) @@ -8497,7 +8497,7 @@ def update_experiment(self, experiment_id: str, *, new_name: Optional[str] = Non cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id self._api.do("POST", "/api/2.0/mlflow/experiments/update", body=body, headers=headers) @@ -8523,7 +8523,7 @@ def update_permissions( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("PATCH", f"/api/2.0/permissions/experiments/{experiment_id}", body=body, headers=headers) return ExperimentPermissions.from_dict(res) @@ -8572,7 +8572,7 @@ def update_run( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("POST", "/api/2.0/mlflow/runs/update", body=body, headers=headers) return UpdateRunResponse.from_dict(res) @@ -8605,7 +8605,7 @@ def batch_create_materialized_features( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do( "POST", "/api/2.0/feature-engineering/materialized-features:batchCreate", body=body, headers=headers @@ -8629,7 +8629,7 @@ def create_feature(self, feature: Feature) -> Feature: cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("POST", "/api/2.0/feature-engineering/features", body=body, headers=headers) return Feature.from_dict(res) @@ -8651,7 +8651,7 @@ def create_kafka_config(self, kafka_config: KafkaConfig) -> KafkaConfig: cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("POST", "/api/2.0/feature-engineering/features/kafka-configs", body=body, headers=headers) return KafkaConfig.from_dict(res) @@ -8673,7 +8673,7 @@ def create_materialized_feature(self, materialized_feature: MaterializedFeature) cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("POST", "/api/2.0/feature-engineering/materialized-features", body=body, headers=headers) return MaterializedFeature.from_dict(res) @@ -8693,7 +8693,7 @@ def delete_feature(self, full_name: str): cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id self._api.do("DELETE", f"/api/2.0/feature-engineering/features/{full_name}", headers=headers) @@ -8713,7 +8713,7 @@ def delete_kafka_config(self, name: str): cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id self._api.do("DELETE", f"/api/2.0/feature-engineering/features/kafka-configs/{name}", headers=headers) @@ -8732,7 +8732,7 @@ def delete_materialized_feature(self, materialized_feature_id: str): cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id self._api.do( "DELETE", f"/api/2.0/feature-engineering/materialized-features/{materialized_feature_id}", headers=headers @@ -8753,7 +8753,7 @@ def get_feature(self, full_name: str) -> Feature: cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("GET", f"/api/2.0/feature-engineering/features/{full_name}", headers=headers) return Feature.from_dict(res) @@ -8774,7 +8774,7 @@ def get_kafka_config(self, name: str) -> KafkaConfig: cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("GET", f"/api/2.0/feature-engineering/features/kafka-configs/{name}", headers=headers) return KafkaConfig.from_dict(res) @@ -8794,7 +8794,7 @@ def get_materialized_feature(self, materialized_feature_id: str) -> Materialized cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do( "GET", f"/api/2.0/feature-engineering/materialized-features/{materialized_feature_id}", headers=headers @@ -8833,7 +8833,7 @@ def list_features( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id while True: json = self._api.do("GET", "/api/2.0/feature-engineering/features", query=query, headers=headers) @@ -8869,7 +8869,7 @@ def list_kafka_configs( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id while True: json = self._api.do( @@ -8912,7 +8912,7 @@ def list_materialized_features( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id while True: json = self._api.do( @@ -8951,7 +8951,7 @@ def update_feature(self, full_name: str, feature: Feature, update_mask: str) -> cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do( "PATCH", f"/api/2.0/feature-engineering/features/{full_name}", query=query, body=body, headers=headers @@ -8985,7 +8985,7 @@ def update_kafka_config(self, name: str, kafka_config: KafkaConfig, update_mask: cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do( "PATCH", @@ -9023,7 +9023,7 @@ def update_materialized_feature( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do( "PATCH", @@ -9063,7 +9063,7 @@ def create_online_store(self, online_store: OnlineStore) -> OnlineStore: cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("POST", "/api/2.0/feature-store/online-stores", body=body, headers=headers) return OnlineStore.from_dict(res) @@ -9083,7 +9083,7 @@ def delete_online_store(self, name: str): cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id self._api.do("DELETE", f"/api/2.0/feature-store/online-stores/{name}", headers=headers) @@ -9102,7 +9102,7 @@ def delete_online_table(self, online_table_name: str): cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id self._api.do("DELETE", f"/api/2.0/feature-store/online-tables/{online_table_name}", headers=headers) @@ -9121,7 +9121,7 @@ def get_online_store(self, name: str) -> OnlineStore: cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("GET", f"/api/2.0/feature-store/online-stores/{name}", headers=headers) return OnlineStore.from_dict(res) @@ -9150,7 +9150,7 @@ def list_online_stores( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id while True: json = self._api.do("GET", "/api/2.0/feature-store/online-stores", query=query, headers=headers) @@ -9182,7 +9182,7 @@ def publish_table(self, source_table_name: str, publish_spec: PublishSpec) -> Pu cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do( "POST", f"/api/2.0/feature-store/tables/{source_table_name}/publish", body=body, headers=headers @@ -9213,7 +9213,7 @@ def update_online_store(self, name: str, online_store: OnlineStore, update_mask: cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do( "PATCH", f"/api/2.0/feature-store/online-stores/{name}", query=query, body=body, headers=headers @@ -9381,7 +9381,7 @@ def create_experiment( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id op_response = self._api.do("POST", "/api/2.0/automl/create-forecasting-experiment", body=body, headers=headers) return Wait( @@ -9447,7 +9447,7 @@ def get_experiment(self, experiment_id: str) -> ForecastingExperiment: cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("GET", f"/api/2.0/automl/get-forecasting-experiment/{experiment_id}", headers=headers) return ForecastingExperiment.from_dict(res) @@ -9478,7 +9478,7 @@ def create_feature_tag(self, table_name: str, feature_name: str, feature_tag: Fe cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do( "POST", @@ -9507,7 +9507,7 @@ def delete_feature_tag(self, table_name: str, feature_name: str, key: str): cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id self._api.do( "DELETE", @@ -9532,7 +9532,7 @@ def get_feature_lineage(self, table_name: str, feature_name: str) -> FeatureLine cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do( "GET", @@ -9557,7 +9557,7 @@ def get_feature_tag(self, table_name: str, feature_name: str, key: str) -> Featu cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do( "GET", @@ -9592,7 +9592,7 @@ def list_feature_tags( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id while True: json = self._api.do( @@ -9640,7 +9640,7 @@ def update_feature_tag( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do( "PATCH", @@ -9709,7 +9709,7 @@ def approve_transition_request( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("POST", "/api/2.0/mlflow/transition-requests/approve", body=body, headers=headers) return ApproveTransitionRequestResponse.from_dict(res) @@ -9742,7 +9742,7 @@ def create_comment(self, name: str, version: str, comment: str) -> CreateComment cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("POST", "/api/2.0/mlflow/comments/create", body=body, headers=headers) return CreateCommentResponse.from_dict(res) @@ -9777,7 +9777,7 @@ def create_model( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("POST", "/api/2.0/mlflow/registered-models/create", body=body, headers=headers) return CreateModelResponse.from_dict(res) @@ -9832,7 +9832,7 @@ def create_model_version( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("POST", "/api/2.0/mlflow/model-versions/create", body=body, headers=headers) return CreateModelVersionResponse.from_dict(res) @@ -9878,7 +9878,7 @@ def create_transition_request( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("POST", "/api/2.0/mlflow/transition-requests/create", body=body, headers=headers) return CreateTransitionRequestResponse.from_dict(res) @@ -9965,7 +9965,7 @@ def create_webhook( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("POST", "/api/2.0/mlflow/registry-webhooks/create", body=body, headers=headers) return CreateWebhookResponse.from_dict(res) @@ -9988,7 +9988,7 @@ def delete_comment(self, id: str): cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id self._api.do("DELETE", "/api/2.0/mlflow/comments/delete", query=query, headers=headers) @@ -10010,7 +10010,7 @@ def delete_model(self, name: str): cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id self._api.do("DELETE", "/api/2.0/mlflow/registered-models/delete", query=query, headers=headers) @@ -10037,7 +10037,7 @@ def delete_model_tag(self, name: str, key: str): cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id self._api.do("DELETE", "/api/2.0/mlflow/registered-models/delete-tag", query=query, headers=headers) @@ -10063,7 +10063,7 @@ def delete_model_version(self, name: str, version: str): cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id self._api.do("DELETE", "/api/2.0/mlflow/model-versions/delete", query=query, headers=headers) @@ -10094,7 +10094,7 @@ def delete_model_version_tag(self, name: str, version: str, key: str): cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id self._api.do("DELETE", "/api/2.0/mlflow/model-versions/delete-tag", query=query, headers=headers) @@ -10143,7 +10143,7 @@ def delete_transition_request( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("DELETE", "/api/2.0/mlflow/transition-requests/delete", query=query, headers=headers) return DeleteTransitionRequestResponse.from_dict(res) @@ -10166,7 +10166,7 @@ def delete_webhook(self, id: str): cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id self._api.do("DELETE", "/api/2.0/mlflow/registry-webhooks/delete", query=query, headers=headers) @@ -10193,7 +10193,7 @@ def get_latest_versions(self, name: str, *, stages: Optional[List[str]] = None) cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id json = self._api.do("POST", "/api/2.0/mlflow/registered-models/get-latest-versions", body=body, headers=headers) parsed = GetLatestVersionsResponse.from_dict(json).model_versions @@ -10221,7 +10221,7 @@ def get_model(self, name: str) -> GetModelResponse: cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("GET", "/api/2.0/mlflow/databricks/registered-models/get", query=query, headers=headers) return GetModelResponse.from_dict(res) @@ -10248,7 +10248,7 @@ def get_model_version(self, name: str, version: str) -> GetModelVersionResponse: cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("GET", "/api/2.0/mlflow/model-versions/get", query=query, headers=headers) return GetModelVersionResponse.from_dict(res) @@ -10275,7 +10275,7 @@ def get_model_version_download_uri(self, name: str, version: str) -> GetModelVer cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("GET", "/api/2.0/mlflow/model-versions/get-download-uri", query=query, headers=headers) return GetModelVersionDownloadUriResponse.from_dict(res) @@ -10295,7 +10295,7 @@ def get_permission_levels(self, registered_model_id: str) -> GetRegisteredModelP cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do( "GET", f"/api/2.0/permissions/registered-models/{registered_model_id}/permissionLevels", headers=headers @@ -10318,7 +10318,7 @@ def get_permissions(self, registered_model_id: str) -> RegisteredModelPermission cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("GET", f"/api/2.0/permissions/registered-models/{registered_model_id}", headers=headers) return RegisteredModelPermissions.from_dict(res) @@ -10345,7 +10345,7 @@ def list_models(self, *, max_results: Optional[int] = None, page_token: Optional cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id while True: json = self._api.do("GET", "/api/2.0/mlflow/registered-models/list", query=query, headers=headers) @@ -10378,7 +10378,7 @@ def list_transition_requests(self, name: str, version: str) -> Iterator[Activity cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id json = self._api.do("GET", "/api/2.0/mlflow/transition-requests/list", query=query, headers=headers) parsed = ListTransitionRequestsResponse.from_dict(json).requests @@ -10451,7 +10451,7 @@ def list_webhooks( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id while True: json = self._api.do("GET", "/api/2.0/mlflow/registry-webhooks/list", query=query, headers=headers) @@ -10503,7 +10503,7 @@ def reject_transition_request( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("POST", "/api/2.0/mlflow/transition-requests/reject", body=body, headers=headers) return RejectTransitionRequestResponse.from_dict(res) @@ -10531,7 +10531,7 @@ def rename_model(self, name: str, *, new_name: Optional[str] = None) -> RenameMo cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("POST", "/api/2.0/mlflow/registered-models/rename", body=body, headers=headers) return RenameModelResponse.from_dict(res) @@ -10576,7 +10576,7 @@ def search_model_versions( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id while True: json = self._api.do("GET", "/api/2.0/mlflow/model-versions/search", query=query, headers=headers) @@ -10628,7 +10628,7 @@ def search_models( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id while True: json = self._api.do("GET", "/api/2.0/mlflow/registered-models/search", query=query, headers=headers) @@ -10669,7 +10669,7 @@ def set_model_tag(self, name: str, key: str, value: str): cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id self._api.do("POST", "/api/2.0/mlflow/registered-models/set-tag", body=body, headers=headers) @@ -10707,7 +10707,7 @@ def set_model_version_tag(self, name: str, version: str, key: str, value: str): cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id self._api.do("POST", "/api/2.0/mlflow/model-versions/set-tag", body=body, headers=headers) @@ -10737,7 +10737,7 @@ def set_permissions( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do( "PUT", f"/api/2.0/permissions/registered-models/{registered_model_id}", body=body, headers=headers @@ -10770,7 +10770,7 @@ def test_registry_webhook( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("POST", "/api/2.0/mlflow/registry-webhooks/test", body=body, headers=headers) return TestRegistryWebhookResponse.from_dict(res) @@ -10823,7 +10823,7 @@ def transition_stage( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do( "POST", "/api/2.0/mlflow/databricks/model-versions/transition-stage", body=body, headers=headers @@ -10853,7 +10853,7 @@ def update_comment(self, id: str, comment: str) -> UpdateCommentResponse: cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("PATCH", "/api/2.0/mlflow/comments/update", body=body, headers=headers) return UpdateCommentResponse.from_dict(res) @@ -10881,7 +10881,7 @@ def update_model(self, name: str, *, description: Optional[str] = None) -> Updat cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("PATCH", "/api/2.0/mlflow/registered-models/update", body=body, headers=headers) return UpdateModelResponse.from_dict(res) @@ -10915,7 +10915,7 @@ def update_model_version( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("PATCH", "/api/2.0/mlflow/model-versions/update", body=body, headers=headers) return UpdateModelVersionResponse.from_dict(res) @@ -10946,7 +10946,7 @@ def update_permissions( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do( "PATCH", f"/api/2.0/permissions/registered-models/{registered_model_id}", body=body, headers=headers @@ -11025,7 +11025,7 @@ def update_webhook( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("PATCH", "/api/2.0/mlflow/registry-webhooks/update", body=body, headers=headers) return UpdateWebhookResponse.from_dict(res) diff --git a/databricks/sdk/service/oauth2.py b/databricks/sdk/service/oauth2.py index b47b17eaf..5ffa5e9b3 100755 --- a/databricks/sdk/service/oauth2.py +++ b/databricks/sdk/service/oauth2.py @@ -1838,7 +1838,7 @@ def create( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do( "POST", @@ -1863,7 +1863,7 @@ def delete(self, service_principal_id: str, secret_id: str): cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id self._api.do( "DELETE", @@ -1902,7 +1902,7 @@ def list( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id while True: json = self._api.do( diff --git a/databricks/sdk/service/pipelines.py b/databricks/sdk/service/pipelines.py index 1c2f23201..120d9d41f 100755 --- a/databricks/sdk/service/pipelines.py +++ b/databricks/sdk/service/pipelines.py @@ -4965,7 +4965,7 @@ def apply_environment(self, pipeline_id: str) -> ApplyEnvironmentRequestResponse cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("POST", f"/api/2.0/pipelines/{pipeline_id}/environment/apply", headers=headers) return ApplyEnvironmentRequestResponse.from_dict(res) @@ -5157,7 +5157,7 @@ def clone( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("POST", f"/api/2.0/pipelines/{pipeline_id}/clone", body=body, headers=headers) return ClonePipelineResponse.from_dict(res) @@ -5342,7 +5342,7 @@ def create( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("POST", "/api/2.0/pipelines", body=body, headers=headers) return CreatePipelineResponse.from_dict(res) @@ -5373,7 +5373,7 @@ def delete(self, pipeline_id: str, *, cascade: Optional[bool] = None, force: Opt cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id self._api.do("DELETE", f"/api/2.0/pipelines/{pipeline_id}", query=query, headers=headers) @@ -5391,7 +5391,7 @@ def get(self, pipeline_id: str) -> GetPipelineResponse: cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("GET", f"/api/2.0/pipelines/{pipeline_id}", headers=headers) return GetPipelineResponse.from_dict(res) @@ -5411,7 +5411,7 @@ def get_permission_levels(self, pipeline_id: str) -> GetPipelinePermissionLevels cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("GET", f"/api/2.0/permissions/pipelines/{pipeline_id}/permissionLevels", headers=headers) return GetPipelinePermissionLevelsResponse.from_dict(res) @@ -5431,7 +5431,7 @@ def get_permissions(self, pipeline_id: str) -> PipelinePermissions: cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("GET", f"/api/2.0/permissions/pipelines/{pipeline_id}", headers=headers) return PipelinePermissions.from_dict(res) @@ -5453,7 +5453,7 @@ def get_update(self, pipeline_id: str, update_id: str) -> GetUpdateResponse: cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("GET", f"/api/2.0/pipelines/{pipeline_id}/updates/{update_id}", headers=headers) return GetUpdateResponse.from_dict(res) @@ -5508,7 +5508,7 @@ def list_pipeline_events( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id while True: json = self._api.do("GET", f"/api/2.0/pipelines/{pipeline_id}/events", query=query, headers=headers) @@ -5566,7 +5566,7 @@ def list_pipelines( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id while True: json = self._api.do("GET", "/api/2.0/pipelines", query=query, headers=headers) @@ -5612,7 +5612,7 @@ def list_updates( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("GET", f"/api/2.0/pipelines/{pipeline_id}/updates", query=query, headers=headers) return ListUpdatesResponse.from_dict(res) @@ -5640,7 +5640,7 @@ def set_permissions( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("PUT", f"/api/2.0/permissions/pipelines/{pipeline_id}", body=body, headers=headers) return PipelinePermissions.from_dict(res) @@ -5718,7 +5718,7 @@ def start_update( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("POST", f"/api/2.0/pipelines/{pipeline_id}/updates", body=body, headers=headers) return StartUpdateResponse.from_dict(res) @@ -5740,7 +5740,7 @@ def stop(self, pipeline_id: str) -> Wait[GetPipelineResponse]: cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id op_response = self._api.do("POST", f"/api/2.0/pipelines/{pipeline_id}/stop", headers=headers) return Wait(self.wait_get_pipeline_idle, pipeline_id=pipeline_id) @@ -5932,7 +5932,7 @@ def update( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id self._api.do("PUT", f"/api/2.0/pipelines/{pipeline_id}", body=body, headers=headers) @@ -5958,7 +5958,7 @@ def update_permissions( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("PATCH", f"/api/2.0/permissions/pipelines/{pipeline_id}", body=body, headers=headers) return PipelinePermissions.from_dict(res) diff --git a/databricks/sdk/service/postgres.py b/databricks/sdk/service/postgres.py index 8166034cc..3c42a2b32 100755 --- a/databricks/sdk/service/postgres.py +++ b/databricks/sdk/service/postgres.py @@ -3017,7 +3017,7 @@ def create_branch( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("POST", f"/api/2.0/postgres/{parent}/branches", query=query, body=body, headers=headers) operation = Operation.from_dict(res) @@ -3045,7 +3045,7 @@ def create_catalog(self, catalog: Catalog, catalog_id: str) -> CreateCatalogOper cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("POST", "/api/2.0/postgres/catalogs", query=query, body=body, headers=headers) operation = Operation.from_dict(res) @@ -3085,7 +3085,7 @@ def create_database( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("POST", f"/api/2.0/postgres/{parent}/databases", query=query, body=body, headers=headers) operation = Operation.from_dict(res) @@ -3124,7 +3124,7 @@ def create_endpoint( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("POST", f"/api/2.0/postgres/{parent}/endpoints", query=query, body=body, headers=headers) operation = Operation.from_dict(res) @@ -3155,7 +3155,7 @@ def create_project(self, project: Project, project_id: str) -> CreateProjectOper cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("POST", "/api/2.0/postgres/projects", query=query, body=body, headers=headers) operation = Operation.from_dict(res) @@ -3191,7 +3191,7 @@ def create_role(self, parent: str, role: Role, *, role_id: Optional[str] = None) cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("POST", f"/api/2.0/postgres/{parent}/roles", query=query, body=body, headers=headers) operation = Operation.from_dict(res) @@ -3227,7 +3227,7 @@ def create_synced_table(self, synced_table: SyncedTable, synced_table_id: str) - cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("POST", "/api/2.0/postgres/synced_tables", query=query, body=body, headers=headers) operation = Operation.from_dict(res) @@ -3253,7 +3253,7 @@ def delete_branch(self, name: str, *, purge: Optional[bool] = None) -> DeleteBra cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("DELETE", f"/api/2.0/postgres/{name}", query=query, headers=headers) operation = Operation.from_dict(res) @@ -3276,7 +3276,7 @@ def delete_catalog(self, name: str) -> DeleteCatalogOperation: cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("DELETE", f"/api/2.0/postgres/{name}", headers=headers) operation = Operation.from_dict(res) @@ -3298,7 +3298,7 @@ def delete_database(self, name: str) -> DeleteDatabaseOperation: cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("DELETE", f"/api/2.0/postgres/{name}", headers=headers) operation = Operation.from_dict(res) @@ -3320,7 +3320,7 @@ def delete_endpoint(self, name: str) -> DeleteEndpointOperation: cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("DELETE", f"/api/2.0/postgres/{name}", headers=headers) operation = Operation.from_dict(res) @@ -3346,7 +3346,7 @@ def delete_project(self, name: str, *, purge: Optional[bool] = None) -> DeletePr cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("DELETE", f"/api/2.0/postgres/{name}", query=query, headers=headers) operation = Operation.from_dict(res) @@ -3376,7 +3376,7 @@ def delete_role(self, name: str, *, reassign_owned_to: Optional[str] = None) -> cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("DELETE", f"/api/2.0/postgres/{name}", query=query, headers=headers) operation = Operation.from_dict(res) @@ -3398,7 +3398,7 @@ def delete_synced_table(self, name: str) -> DeleteSyncedTableOperation: cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("DELETE", f"/api/2.0/postgres/{name}", headers=headers) operation = Operation.from_dict(res) @@ -3430,7 +3430,7 @@ def generate_database_credential( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("POST", "/api/2.0/postgres/credentials", body=body, headers=headers) return DatabaseCredential.from_dict(res) @@ -3450,7 +3450,7 @@ def get_branch(self, name: str) -> Branch: cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("GET", f"/api/2.0/postgres/{name}", headers=headers) return Branch.from_dict(res) @@ -3472,7 +3472,7 @@ def get_catalog(self, name: str) -> Catalog: cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("GET", f"/api/2.0/postgres/{name}", headers=headers) return Catalog.from_dict(res) @@ -3493,7 +3493,7 @@ def get_database(self, name: str) -> Database: cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("GET", f"/api/2.0/postgres/{name}", headers=headers) return Database.from_dict(res) @@ -3515,7 +3515,7 @@ def get_endpoint(self, name: str) -> Endpoint: cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("GET", f"/api/2.0/postgres/{name}", headers=headers) return Endpoint.from_dict(res) @@ -3535,7 +3535,7 @@ def get_operation(self, name: str) -> Operation: cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("GET", f"/api/2.0/postgres/{name}", headers=headers) return Operation.from_dict(res) @@ -3555,7 +3555,7 @@ def get_project(self, name: str) -> Project: cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("GET", f"/api/2.0/postgres/{name}", headers=headers) return Project.from_dict(res) @@ -3577,7 +3577,7 @@ def get_role(self, name: str) -> Role: cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("GET", f"/api/2.0/postgres/{name}", headers=headers) return Role.from_dict(res) @@ -3598,7 +3598,7 @@ def get_synced_table(self, name: str) -> SyncedTable: cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("GET", f"/api/2.0/postgres/{name}", headers=headers) return SyncedTable.from_dict(res) @@ -3639,7 +3639,7 @@ def list_branches( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id while True: json = self._api.do("GET", f"/api/2.0/postgres/{parent}/branches", query=query, headers=headers) @@ -3677,7 +3677,7 @@ def list_databases( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id while True: json = self._api.do("GET", f"/api/2.0/postgres/{parent}/databases", query=query, headers=headers) @@ -3715,7 +3715,7 @@ def list_endpoints( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id while True: json = self._api.do("GET", f"/api/2.0/postgres/{parent}/endpoints", query=query, headers=headers) @@ -3755,7 +3755,7 @@ def list_projects( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id while True: json = self._api.do("GET", "/api/2.0/postgres/projects", query=query, headers=headers) @@ -3792,7 +3792,7 @@ def list_roles( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id while True: json = self._api.do("GET", f"/api/2.0/postgres/{parent}/roles", query=query, headers=headers) @@ -3841,7 +3841,7 @@ def undelete_project(self, name: str) -> UndeleteProjectOperation: cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("POST", f"/api/2.0/postgres/{name}/undelete", headers=headers) operation = Operation.from_dict(res) @@ -3876,7 +3876,7 @@ def update_branch(self, name: str, branch: Branch, update_mask: FieldMask) -> Up cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("PATCH", f"/api/2.0/postgres/{name}", query=query, body=body, headers=headers) operation = Operation.from_dict(res) @@ -3910,7 +3910,7 @@ def update_database(self, name: str, database: Database, update_mask: FieldMask) cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("PATCH", f"/api/2.0/postgres/{name}", query=query, body=body, headers=headers) operation = Operation.from_dict(res) @@ -3945,7 +3945,7 @@ def update_endpoint(self, name: str, endpoint: Endpoint, update_mask: FieldMask) cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("PATCH", f"/api/2.0/postgres/{name}", query=query, body=body, headers=headers) operation = Operation.from_dict(res) @@ -3977,7 +3977,7 @@ def update_project(self, name: str, project: Project, update_mask: FieldMask) -> cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("PATCH", f"/api/2.0/postgres/{name}", query=query, body=body, headers=headers) operation = Operation.from_dict(res) @@ -4012,7 +4012,7 @@ def update_role(self, name: str, role: Role, update_mask: FieldMask) -> UpdateRo cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("PATCH", f"/api/2.0/postgres/{name}", query=query, body=body, headers=headers) operation = Operation.from_dict(res) diff --git a/databricks/sdk/service/qualitymonitorv2.py b/databricks/sdk/service/qualitymonitorv2.py index c217b009e..3a7f2b017 100755 --- a/databricks/sdk/service/qualitymonitorv2.py +++ b/databricks/sdk/service/qualitymonitorv2.py @@ -328,7 +328,7 @@ def create_quality_monitor(self, quality_monitor: QualityMonitor) -> QualityMoni cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("POST", "/api/2.0/quality-monitors", body=body, headers=headers) return QualityMonitor.from_dict(res) @@ -351,7 +351,7 @@ def delete_quality_monitor(self, object_type: str, object_id: str): cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id self._api.do("DELETE", f"/api/2.0/quality-monitors/{object_type}/{object_id}", headers=headers) @@ -373,7 +373,7 @@ def get_quality_monitor(self, object_type: str, object_id: str) -> QualityMonito cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("GET", f"/api/2.0/quality-monitors/{object_type}/{object_id}", headers=headers) return QualityMonitor.from_dict(res) @@ -401,7 +401,7 @@ def list_quality_monitor( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id while True: json = self._api.do("GET", "/api/2.0/quality-monitors", query=query, headers=headers) @@ -435,7 +435,7 @@ def update_quality_monitor( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("PUT", f"/api/2.0/quality-monitors/{object_type}/{object_id}", body=body, headers=headers) return QualityMonitor.from_dict(res) diff --git a/databricks/sdk/service/serving.py b/databricks/sdk/service/serving.py index 1c5bf92ff..597aa1bd1 100755 --- a/databricks/sdk/service/serving.py +++ b/databricks/sdk/service/serving.py @@ -4110,7 +4110,7 @@ def build_logs(self, name: str, served_model_name: str) -> BuildLogsResponse: cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do( "GET", f"/api/2.0/serving-endpoints/{name}/served-models/{served_model_name}/build-logs", headers=headers @@ -4185,7 +4185,7 @@ def create( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id op_response = self._api.do("POST", "/api/2.0/serving-endpoints", body=body, headers=headers) return Wait( @@ -4271,7 +4271,7 @@ def create_provisioned_throughput_endpoint( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id op_response = self._api.do("POST", "/api/2.0/serving-endpoints/pt", body=body, headers=headers) return Wait( @@ -4312,7 +4312,7 @@ def delete(self, name: str): cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id self._api.do("DELETE", f"/api/2.0/serving-endpoints/{name}", headers=headers) @@ -4332,7 +4332,7 @@ def export_metrics(self, name: str) -> ExportMetricsResponse: cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("GET", f"/api/2.0/serving-endpoints/{name}/metrics", headers=headers, raw=True) return ExportMetricsResponse.from_dict(res) @@ -4352,7 +4352,7 @@ def get(self, name: str) -> ServingEndpointDetailed: cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("GET", f"/api/2.0/serving-endpoints/{name}", headers=headers) return ServingEndpointDetailed.from_dict(res) @@ -4373,7 +4373,7 @@ def get_open_api(self, name: str) -> GetOpenApiResponse: cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("GET", f"/api/2.0/serving-endpoints/{name}/openapi", headers=headers, raw=True) return GetOpenApiResponse.from_dict(res) @@ -4393,7 +4393,7 @@ def get_permission_levels(self, serving_endpoint_id: str) -> GetServingEndpointP cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do( "GET", f"/api/2.0/permissions/serving-endpoints/{serving_endpoint_id}/permissionLevels", headers=headers @@ -4416,7 +4416,7 @@ def get_permissions(self, serving_endpoint_id: str) -> ServingEndpointPermission cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("GET", f"/api/2.0/permissions/serving-endpoints/{serving_endpoint_id}", headers=headers) return ServingEndpointPermissions.from_dict(res) @@ -4478,7 +4478,7 @@ def http_request( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("POST", "/api/2.0/external-function", body=body, headers=headers, raw=True) return HttpRequestResponse.from_dict(res) @@ -4496,7 +4496,7 @@ def list(self) -> Iterator[ServingEndpoint]: cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id json = self._api.do("GET", "/api/2.0/serving-endpoints", headers=headers) parsed = ListEndpointsResponse.from_dict(json).endpoints @@ -4519,7 +4519,7 @@ def logs(self, name: str, served_model_name: str) -> ServerLogsResponse: cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do( "GET", f"/api/2.0/serving-endpoints/{name}/served-models/{served_model_name}/logs", headers=headers @@ -4553,7 +4553,7 @@ def patch( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("PATCH", f"/api/2.0/serving-endpoints/{name}/tags", body=body, headers=headers) return EndpointTags.from_dict(res) @@ -4579,7 +4579,7 @@ def put(self, name: str, *, rate_limits: Optional[List[RateLimit]] = None) -> Pu cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("PUT", f"/api/2.0/serving-endpoints/{name}/rate-limits", body=body, headers=headers) return PutResponse.from_dict(res) @@ -4634,7 +4634,7 @@ def put_ai_gateway( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("PUT", f"/api/2.0/serving-endpoints/{name}/ai-gateway", body=body, headers=headers) return PutAiGatewayResponse.from_dict(res) @@ -4751,7 +4751,7 @@ def query( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id response_headers = [ "served-model-name", @@ -4791,7 +4791,7 @@ def set_permissions( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do( "PUT", f"/api/2.0/permissions/serving-endpoints/{serving_endpoint_id}", body=body, headers=headers @@ -4846,7 +4846,7 @@ def update_config( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id op_response = self._api.do("PUT", f"/api/2.0/serving-endpoints/{name}/config", body=body, headers=headers) return Wait( @@ -4897,7 +4897,7 @@ def update_notifications( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("PATCH", f"/api/2.0/serving-endpoints/{name}/notifications", body=body, headers=headers) return UpdateInferenceEndpointNotificationsResponse.from_dict(res) @@ -4928,7 +4928,7 @@ def update_permissions( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do( "PATCH", f"/api/2.0/permissions/serving-endpoints/{serving_endpoint_id}", body=body, headers=headers @@ -4961,7 +4961,7 @@ def update_provisioned_throughput_endpoint_config( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id op_response = self._api.do("PUT", f"/api/2.0/serving-endpoints/pt/{name}/config", body=body, headers=headers) return Wait( @@ -5128,7 +5128,7 @@ def auth(r: requests.PreparedRequest) -> requests.PreparedRequest: cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id response_headers = [ "served-model-name", diff --git a/databricks/sdk/service/settings.py b/databricks/sdk/service/settings.py index 9e2f5b69e..490bb4885 100755 --- a/databricks/sdk/service/settings.py +++ b/databricks/sdk/service/settings.py @@ -6558,7 +6558,7 @@ def delete(self, *, etag: Optional[str] = None) -> DeleteAibiDashboardEmbeddingA cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do( "DELETE", @@ -6591,7 +6591,7 @@ def get(self, *, etag: Optional[str] = None) -> AibiDashboardEmbeddingAccessPoli cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do( "GET", "/api/2.0/settings/types/aibi_dash_embed_ws_acc_policy/names/default", query=query, headers=headers @@ -6634,7 +6634,7 @@ def update( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do( "PATCH", "/api/2.0/settings/types/aibi_dash_embed_ws_acc_policy/names/default", body=body, headers=headers @@ -6672,7 +6672,7 @@ def delete(self, *, etag: Optional[str] = None) -> DeleteAibiDashboardEmbeddingA cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do( "DELETE", @@ -6704,7 +6704,7 @@ def get(self, *, etag: Optional[str] = None) -> AibiDashboardEmbeddingApprovedDo cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do( "GET", @@ -6751,7 +6751,7 @@ def update( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do( "PATCH", @@ -6791,7 +6791,7 @@ def get(self, *, etag: Optional[str] = None) -> AutomaticClusterUpdateSetting: cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do( "GET", "/api/2.0/settings/types/automatic_cluster_update/names/default", query=query, headers=headers @@ -6837,7 +6837,7 @@ def update( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do( "PATCH", "/api/2.0/settings/types/automatic_cluster_update/names/default", body=body, headers=headers @@ -6876,7 +6876,7 @@ def get(self, *, etag: Optional[str] = None) -> ComplianceSecurityProfileSetting cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do( "GET", "/api/2.0/settings/types/shield_csp_enablement_ws_db/names/default", query=query, headers=headers @@ -6922,7 +6922,7 @@ def update( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do( "PATCH", "/api/2.0/settings/types/shield_csp_enablement_ws_db/names/default", body=body, headers=headers @@ -6976,7 +6976,7 @@ def exchange_token( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("POST", "/api/2.0/credentials-manager/exchange-tokens/token", body=body, headers=headers) return ExchangeTokenResponse.from_dict(res) @@ -7094,7 +7094,7 @@ def delete(self, *, etag: Optional[str] = None) -> DeleteDashboardEmailSubscript cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do( "DELETE", @@ -7126,7 +7126,7 @@ def get(self, *, etag: Optional[str] = None) -> DashboardEmailSubscriptions: cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do( "GET", "/api/2.0/settings/types/dashboard_email_subscriptions/names/default", query=query, headers=headers @@ -7169,7 +7169,7 @@ def update( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do( "PATCH", "/api/2.0/settings/types/dashboard_email_subscriptions/names/default", body=body, headers=headers @@ -7217,7 +7217,7 @@ def delete(self, *, etag: Optional[str] = None) -> DeleteDefaultNamespaceSetting cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do( "DELETE", "/api/2.0/settings/types/default_namespace_ws/names/default", query=query, headers=headers @@ -7246,7 +7246,7 @@ def get(self, *, etag: Optional[str] = None) -> DefaultNamespaceSetting: cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do( "GET", "/api/2.0/settings/types/default_namespace_ws/names/default", query=query, headers=headers @@ -7292,7 +7292,7 @@ def update(self, allow_missing: bool, setting: DefaultNamespaceSetting, field_ma cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do( "PATCH", "/api/2.0/settings/types/default_namespace_ws/names/default", body=body, headers=headers @@ -7329,7 +7329,7 @@ def delete(self, *, etag: Optional[str] = None) -> DeleteDefaultWarehouseIdRespo cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do( "DELETE", "/api/2.0/settings/types/default_warehouse_id/names/default", query=query, headers=headers @@ -7358,7 +7358,7 @@ def get(self, *, etag: Optional[str] = None) -> DefaultWarehouseId: cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do( "GET", "/api/2.0/settings/types/default_warehouse_id/names/default", query=query, headers=headers @@ -7399,7 +7399,7 @@ def update(self, allow_missing: bool, setting: DefaultWarehouseId, field_mask: s cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do( "PATCH", "/api/2.0/settings/types/default_warehouse_id/names/default", body=body, headers=headers @@ -7439,7 +7439,7 @@ def delete(self, *, etag: Optional[str] = None) -> DeleteDisableLegacyAccessResp cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do( "DELETE", "/api/2.0/settings/types/disable_legacy_access/names/default", query=query, headers=headers @@ -7468,7 +7468,7 @@ def get(self, *, etag: Optional[str] = None) -> DisableLegacyAccess: cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do( "GET", "/api/2.0/settings/types/disable_legacy_access/names/default", query=query, headers=headers @@ -7509,7 +7509,7 @@ def update(self, allow_missing: bool, setting: DisableLegacyAccess, field_mask: cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do( "PATCH", "/api/2.0/settings/types/disable_legacy_access/names/default", body=body, headers=headers @@ -7552,7 +7552,7 @@ def delete(self, *, etag: Optional[str] = None) -> DeleteDisableLegacyDbfsRespon cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do( "DELETE", "/api/2.0/settings/types/disable_legacy_dbfs/names/default", query=query, headers=headers @@ -7581,7 +7581,7 @@ def get(self, *, etag: Optional[str] = None) -> DisableLegacyDbfs: cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do( "GET", "/api/2.0/settings/types/disable_legacy_dbfs/names/default", query=query, headers=headers @@ -7622,7 +7622,7 @@ def update(self, allow_missing: bool, setting: DisableLegacyDbfs, field_mask: st cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do( "PATCH", "/api/2.0/settings/types/disable_legacy_dbfs/names/default", body=body, headers=headers @@ -7757,7 +7757,7 @@ def get_enable_export_notebook(self) -> EnableExportNotebook: cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("GET", "/api/2.0/settings/types/enable-export-notebook/names/default", headers=headers) return EnableExportNotebook.from_dict(res) @@ -7799,7 +7799,7 @@ def patch_enable_export_notebook( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do( "PATCH", "/api/2.0/settings/types/enable-export-notebook/names/default", body=body, headers=headers @@ -7931,7 +7931,7 @@ def get_enable_notebook_table_clipboard(self) -> EnableNotebookTableClipboard: cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do( "GET", "/api/2.0/settings/types/enable-notebook-table-clipboard/names/default", headers=headers @@ -7975,7 +7975,7 @@ def patch_enable_notebook_table_clipboard( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do( "PATCH", "/api/2.0/settings/types/enable-notebook-table-clipboard/names/default", body=body, headers=headers @@ -8002,7 +8002,7 @@ def get_enable_results_downloading(self) -> EnableResultsDownloading: cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("GET", "/api/2.0/settings/types/enable-results-downloading/names/default", headers=headers) return EnableResultsDownloading.from_dict(res) @@ -8044,7 +8044,7 @@ def patch_enable_results_downloading( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do( "PATCH", "/api/2.0/settings/types/enable-results-downloading/names/default", body=body, headers=headers @@ -8085,7 +8085,7 @@ def get(self, *, etag: Optional[str] = None) -> EnhancedSecurityMonitoringSettin cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do( "GET", "/api/2.0/settings/types/shield_esm_enablement_ws_db/names/default", query=query, headers=headers @@ -8131,7 +8131,7 @@ def update( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do( "PATCH", "/api/2.0/settings/types/shield_esm_enablement_ws_db/names/default", body=body, headers=headers @@ -8280,7 +8280,7 @@ def create( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("POST", "/api/2.0/ip-access-lists", body=body, headers=headers) return CreateIpAccessListResponse.from_dict(res) @@ -8298,7 +8298,7 @@ def delete(self, ip_access_list_id: str): cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id self._api.do("DELETE", f"/api/2.0/ip-access-lists/{ip_access_list_id}", headers=headers) @@ -8317,7 +8317,7 @@ def get(self, ip_access_list_id: str) -> FetchIpAccessListResponse: cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("GET", f"/api/2.0/ip-access-lists/{ip_access_list_id}", headers=headers) return FetchIpAccessListResponse.from_dict(res) @@ -8335,7 +8335,7 @@ def list(self) -> Iterator[IpAccessListInfo]: cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id json = self._api.do("GET", "/api/2.0/ip-access-lists", headers=headers) parsed = ListIpAccessListResponse.from_dict(json).ip_access_lists @@ -8388,7 +8388,7 @@ def replace( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id self._api.do("PUT", f"/api/2.0/ip-access-lists/{ip_access_list_id}", body=body, headers=headers) @@ -8443,7 +8443,7 @@ def update( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id self._api.do("PATCH", f"/api/2.0/ip-access-lists/{ip_access_list_id}", body=body, headers=headers) @@ -8631,7 +8631,7 @@ def delete(self, *, etag: Optional[str] = None) -> DeleteLlmProxyPartnerPoweredW cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do( "DELETE", "/api/2.0/settings/types/llm_proxy_partner_powered/names/default", query=query, headers=headers @@ -8660,7 +8660,7 @@ def get(self, *, etag: Optional[str] = None) -> LlmProxyPartnerPoweredWorkspace: cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do( "GET", "/api/2.0/settings/types/llm_proxy_partner_powered/names/default", query=query, headers=headers @@ -8703,7 +8703,7 @@ def update( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do( "PATCH", "/api/2.0/settings/types/llm_proxy_partner_powered/names/default", body=body, headers=headers @@ -9146,7 +9146,7 @@ def create(self, *, config: Optional[Config] = None, display_name: Optional[str] cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("POST", "/api/2.0/notification-destinations", body=body, headers=headers) return NotificationDestination.from_dict(res) @@ -9165,7 +9165,7 @@ def delete(self, id: str): cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id self._api.do("DELETE", f"/api/2.0/notification-destinations/{id}", headers=headers) @@ -9183,7 +9183,7 @@ def get(self, id: str) -> NotificationDestination: cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("GET", f"/api/2.0/notification-destinations/{id}", headers=headers) return NotificationDestination.from_dict(res) @@ -9210,7 +9210,7 @@ def list( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id while True: json = self._api.do("GET", "/api/2.0/notification-destinations", query=query, headers=headers) @@ -9249,7 +9249,7 @@ def update( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("PATCH", f"/api/2.0/notification-destinations/{id}", body=body, headers=headers) return NotificationDestination.from_dict(res) @@ -9403,7 +9403,7 @@ def delete(self, *, etag: Optional[str] = None) -> DeleteRestrictWorkspaceAdmins cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do( "DELETE", "/api/2.0/settings/types/restrict_workspace_admins/names/default", query=query, headers=headers @@ -9432,7 +9432,7 @@ def get(self, *, etag: Optional[str] = None) -> RestrictWorkspaceAdminsSetting: cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do( "GET", "/api/2.0/settings/types/restrict_workspace_admins/names/default", query=query, headers=headers @@ -9478,7 +9478,7 @@ def update( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do( "PATCH", "/api/2.0/settings/types/restrict_workspace_admins/names/default", body=body, headers=headers @@ -9619,7 +9619,7 @@ def delete(self, *, etag: Optional[str] = None) -> DeleteSqlResultsDownloadRespo cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do( "DELETE", "/api/2.0/settings/types/sql_results_download/names/default", query=query, headers=headers @@ -9648,7 +9648,7 @@ def get(self, *, etag: Optional[str] = None) -> SqlResultsDownload: cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do( "GET", "/api/2.0/settings/types/sql_results_download/names/default", query=query, headers=headers @@ -9689,7 +9689,7 @@ def update(self, allow_missing: bool, setting: SqlResultsDownload, field_mask: s cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do( "PATCH", "/api/2.0/settings/types/sql_results_download/names/default", body=body, headers=headers @@ -9741,7 +9741,7 @@ def create_obo_token( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("POST", "/api/2.0/token-management/on-behalf-of/tokens", body=body, headers=headers) return CreateOboTokenResponse.from_dict(res) @@ -9759,7 +9759,7 @@ def delete(self, token_id: str): cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id self._api.do("DELETE", f"/api/2.0/token-management/tokens/{token_id}", headers=headers) @@ -9778,7 +9778,7 @@ def get(self, token_id: str) -> GetTokenResponse: cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("GET", f"/api/2.0/token-management/tokens/{token_id}", headers=headers) return GetTokenResponse.from_dict(res) @@ -9796,7 +9796,7 @@ def get_permission_levels(self) -> GetTokenPermissionLevelsResponse: cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("GET", "/api/2.0/permissions/authorization/tokens/permissionLevels", headers=headers) return GetTokenPermissionLevelsResponse.from_dict(res) @@ -9814,7 +9814,7 @@ def get_permissions(self) -> TokenPermissions: cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("GET", "/api/2.0/permissions/authorization/tokens", headers=headers) return TokenPermissions.from_dict(res) @@ -9843,7 +9843,7 @@ def list( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id json = self._api.do("GET", "/api/2.0/token-management/tokens", query=query, headers=headers) parsed = ListTokensResponse.from_dict(json).token_infos @@ -9870,7 +9870,7 @@ def set_permissions( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("PUT", "/api/2.0/permissions/authorization/tokens", body=body, headers=headers) return TokenPermissions.from_dict(res) @@ -9895,7 +9895,7 @@ def update_permissions( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("PATCH", "/api/2.0/permissions/authorization/tokens", body=body, headers=headers) return TokenPermissions.from_dict(res) @@ -9945,7 +9945,7 @@ def create( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("POST", "/api/2.0/token/create", body=body, headers=headers) return CreateTokenResponse.from_dict(res) @@ -9971,7 +9971,7 @@ def delete(self, token_id: str): cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id self._api.do("POST", "/api/2.0/token/delete", body=body, headers=headers) @@ -9988,7 +9988,7 @@ def list(self) -> Iterator[PublicTokenInfo]: cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id json = self._api.do("GET", "/api/2.0/token/list", headers=headers) parsed = ListPublicTokensResponse.from_dict(json).token_infos @@ -10031,7 +10031,7 @@ def update(self, token_id: str, token: PublicTokenInfo, update_mask: FieldMask) cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("PATCH", f"/api/2.0/token/{token_id}", body=body, headers=headers) return UpdateTokenResponse.from_dict(res) @@ -10060,7 +10060,7 @@ def get_status(self, keys: str) -> WorkspaceConf: cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("GET", "/api/2.0/workspace-conf", query=query, headers=headers) return res @@ -10074,7 +10074,7 @@ def set_status(self, contents: Dict[str, str]): cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id self._api.do("PATCH", "/api/2.0/workspace-conf", body=contents, headers=headers) diff --git a/databricks/sdk/service/settingsv2.py b/databricks/sdk/service/settingsv2.py index c43becdda..cc661f49e 100755 --- a/databricks/sdk/service/settingsv2.py +++ b/databricks/sdk/service/settingsv2.py @@ -1202,7 +1202,7 @@ def get_public_workspace_setting(self, name: str) -> Setting: cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("GET", f"/api/2.1/settings/{name}", headers=headers) return Setting.from_dict(res) @@ -1239,7 +1239,7 @@ def list_workspace_settings_metadata( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id while True: json = self._api.do("GET", "/api/2.1/settings-metadata", query=query, headers=headers) @@ -1273,7 +1273,7 @@ def patch_public_workspace_setting(self, name: str, setting: Setting) -> Setting cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("PATCH", f"/api/2.1/settings/{name}", body=body, headers=headers) return Setting.from_dict(res) diff --git a/databricks/sdk/service/sharing.py b/databricks/sdk/service/sharing.py index 13681c118..58f27fae5 100755 --- a/databricks/sdk/service/sharing.py +++ b/databricks/sdk/service/sharing.py @@ -2471,7 +2471,7 @@ def create( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("POST", "/api/2.1/unity-catalog/providers", body=body, headers=headers) return ProviderInfo.from_dict(res) @@ -2490,7 +2490,7 @@ def delete(self, name: str): cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id self._api.do("DELETE", f"/api/2.1/unity-catalog/providers/{name}", headers=headers) @@ -2510,7 +2510,7 @@ def get(self, name: str) -> ProviderInfo: cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("GET", f"/api/2.1/unity-catalog/providers/{name}", headers=headers) return ProviderInfo.from_dict(res) @@ -2557,7 +2557,7 @@ def list( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id if "max_results" not in query: query["max_results"] = 0 @@ -2614,7 +2614,7 @@ def list_provider_share_assets( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do( "GET", f"/api/2.1/data-sharing/providers/{provider_name}/shares/{share_name}", query=query, headers=headers @@ -2655,7 +2655,7 @@ def list_shares( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id if "max_results" not in query: query["max_results"] = 0 @@ -2712,7 +2712,7 @@ def update( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("PATCH", f"/api/2.1/unity-catalog/providers/{name}", body=body, headers=headers) return ProviderInfo.from_dict(res) @@ -2745,7 +2745,7 @@ def get_activation_url_info(self, activation_url: str): cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id self._api.do( "GET", f"/api/2.1/unity-catalog/public/data_sharing_activation_info/{activation_url}", headers=headers @@ -2766,7 +2766,7 @@ def retrieve_token(self, activation_url: str) -> RetrieveTokenResponse: cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do( "GET", f"/api/2.1/unity-catalog/public/data_sharing_activation/{activation_url}", headers=headers @@ -2837,7 +2837,7 @@ def create(self, recipient_name: str, policy: FederationPolicy) -> FederationPol cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do( "POST", f"/api/2.0/data-sharing/recipients/{recipient_name}/federation-policies", body=body, headers=headers @@ -2862,7 +2862,7 @@ def delete(self, recipient_name: str, name: str): cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id self._api.do( "DELETE", f"/api/2.0/data-sharing/recipients/{recipient_name}/federation-policies/{name}", headers=headers @@ -2886,7 +2886,7 @@ def get_federation_policy(self, recipient_name: str, name: str) -> FederationPol cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do( "GET", f"/api/2.0/data-sharing/recipients/{recipient_name}/federation-policies/{name}", headers=headers @@ -2918,7 +2918,7 @@ def list( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id while True: json = self._api.do( @@ -3026,7 +3026,7 @@ def create( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("POST", "/api/2.1/unity-catalog/recipients", body=body, headers=headers) return RecipientInfo.from_dict(res) @@ -3044,7 +3044,7 @@ def delete(self, name: str): cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id self._api.do("DELETE", f"/api/2.1/unity-catalog/recipients/{name}", headers=headers) @@ -3064,7 +3064,7 @@ def get(self, name: str) -> RecipientInfo: cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("GET", f"/api/2.1/unity-catalog/recipients/{name}", headers=headers) return RecipientInfo.from_dict(res) @@ -3111,7 +3111,7 @@ def list( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id if "max_results" not in query: query["max_results"] = 0 @@ -3148,7 +3148,7 @@ def rotate_token(self, name: str, existing_token_expire_in_seconds: int) -> Reci cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("POST", f"/api/2.1/unity-catalog/recipients/{name}/rotate-token", body=body, headers=headers) return RecipientInfo.from_dict(res) @@ -3186,7 +3186,7 @@ def share_permissions( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do( "GET", f"/api/2.1/unity-catalog/recipients/{name}/share-permissions", query=query, headers=headers @@ -3253,7 +3253,7 @@ def update( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("PATCH", f"/api/2.1/unity-catalog/recipients/{name}", body=body, headers=headers) return RecipientInfo.from_dict(res) @@ -3296,7 +3296,7 @@ def create(self, name: str, *, comment: Optional[str] = None, storage_root: Opti cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("POST", "/api/2.1/unity-catalog/shares", body=body, headers=headers) return ShareInfo.from_dict(res) @@ -3314,7 +3314,7 @@ def delete(self, name: str): cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id self._api.do("DELETE", f"/api/2.1/unity-catalog/shares/{name}", headers=headers) @@ -3339,7 +3339,7 @@ def get(self, name: str, *, include_shared_data: Optional[bool] = None) -> Share cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("GET", f"/api/2.1/unity-catalog/shares/{name}", query=query, headers=headers) return ShareInfo.from_dict(res) @@ -3376,7 +3376,7 @@ def list_shares( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id if "max_results" not in query: query["max_results"] = 0 @@ -3422,7 +3422,7 @@ def share_permissions( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("GET", f"/api/2.1/unity-catalog/shares/{name}/permissions", query=query, headers=headers) return GetSharePermissionsResponse.from_dict(res) @@ -3487,7 +3487,7 @@ def update( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("PATCH", f"/api/2.1/unity-catalog/shares/{name}", body=body, headers=headers) return ShareInfo.from_dict(res) @@ -3527,7 +3527,7 @@ def update_permissions( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("PATCH", f"/api/2.1/unity-catalog/shares/{name}/permissions", body=body, headers=headers) return UpdateSharePermissionsResponse.from_dict(res) diff --git a/databricks/sdk/service/sql.py b/databricks/sdk/service/sql.py index 5cfa69646..8f4330c1a 100755 --- a/databricks/sdk/service/sql.py +++ b/databricks/sdk/service/sql.py @@ -7581,7 +7581,7 @@ def create( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("POST", "/api/2.0/sql/alerts", body=body, headers=headers) return Alert.from_dict(res) @@ -7602,7 +7602,7 @@ def delete(self, id: str): cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id self._api.do("DELETE", f"/api/2.0/sql/alerts/{id}", headers=headers) @@ -7620,7 +7620,7 @@ def get(self, id: str) -> Alert: cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("GET", f"/api/2.0/sql/alerts/{id}", headers=headers) return Alert.from_dict(res) @@ -7648,7 +7648,7 @@ def list( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id while True: json = self._api.do("GET", "/api/2.0/sql/alerts", query=query, headers=headers) @@ -7702,7 +7702,7 @@ def update( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("PATCH", f"/api/2.0/sql/alerts/{id}", body=body, headers=headers) return Alert.from_dict(res) @@ -7770,7 +7770,7 @@ def create( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("POST", "/api/2.0/preview/sql/alerts", body=body, headers=headers) return LegacyAlert.from_dict(res) @@ -7794,7 +7794,7 @@ def delete(self, alert_id: str): cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id self._api.do("DELETE", f"/api/2.0/preview/sql/alerts/{alert_id}", headers=headers) @@ -7816,7 +7816,7 @@ def get(self, alert_id: str) -> LegacyAlert: cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("GET", f"/api/2.0/preview/sql/alerts/{alert_id}", headers=headers) return LegacyAlert.from_dict(res) @@ -7838,7 +7838,7 @@ def list(self) -> Iterator[LegacyAlert]: cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("GET", "/api/2.0/preview/sql/alerts", headers=headers) return [LegacyAlert.from_dict(v) for v in res] @@ -7880,7 +7880,7 @@ def update(self, alert_id: str, name: str, options: AlertOptions, query_id: str, cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id self._api.do("PUT", f"/api/2.0/preview/sql/alerts/{alert_id}", body=body, headers=headers) @@ -7907,7 +7907,7 @@ def create_alert(self, alert: AlertV2) -> AlertV2: cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("POST", "/api/2.0/alerts", body=body, headers=headers) return AlertV2.from_dict(res) @@ -7926,7 +7926,7 @@ def get_alert(self, id: str) -> AlertV2: cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("GET", f"/api/2.0/alerts/{id}", headers=headers) return AlertV2.from_dict(res) @@ -7951,7 +7951,7 @@ def list_alerts(self, *, page_size: Optional[int] = None, page_token: Optional[s cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id while True: json = self._api.do("GET", "/api/2.0/alerts", query=query, headers=headers) @@ -7983,7 +7983,7 @@ def trash_alert(self, id: str, *, purge: Optional[bool] = None): cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id self._api.do("DELETE", f"/api/2.0/alerts/{id}", query=query, headers=headers) @@ -8018,7 +8018,7 @@ def update_alert(self, id: str, alert: AlertV2, update_mask: str) -> AlertV2: cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("PATCH", f"/api/2.0/alerts/{id}", query=query, body=body, headers=headers) return AlertV2.from_dict(res) @@ -8074,7 +8074,7 @@ def create( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("POST", "/api/2.0/preview/sql/widgets", body=body, headers=headers) return Widget.from_dict(res) @@ -8094,7 +8094,7 @@ def delete(self, id: str): cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id self._api.do("DELETE", f"/api/2.0/preview/sql/widgets/{id}", headers=headers) @@ -8144,7 +8144,7 @@ def update( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("POST", f"/api/2.0/preview/sql/widgets/{id}", body=body, headers=headers) return Widget.from_dict(res) @@ -8183,7 +8183,7 @@ def delete(self, dashboard_id: str): cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id self._api.do("DELETE", f"/api/2.0/preview/sql/dashboards/{dashboard_id}", headers=headers) @@ -8205,7 +8205,7 @@ def get(self, dashboard_id: str) -> Dashboard: cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("GET", f"/api/2.0/preview/sql/dashboards/{dashboard_id}", headers=headers) return Dashboard.from_dict(res) @@ -8254,7 +8254,7 @@ def list( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id query["page"] = 1 while True: @@ -8284,7 +8284,7 @@ def restore(self, dashboard_id: str): cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id self._api.do("POST", f"/api/2.0/preview/sql/dashboards/trash/{dashboard_id}", headers=headers) @@ -8330,7 +8330,7 @@ def update( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("POST", f"/api/2.0/preview/sql/dashboards/{dashboard_id}", body=body, headers=headers) return Dashboard.from_dict(res) @@ -8371,7 +8371,7 @@ def list(self) -> Iterator[DataSource]: cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("GET", "/api/2.0/preview/sql/data_sources", headers=headers) return [DataSource.from_dict(v) for v in res] @@ -8418,7 +8418,7 @@ def get(self, object_type: ObjectTypePlural, object_id: str) -> GetResponse: cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("GET", f"/api/2.0/preview/sql/permissions/{object_type.value}/{object_id}", headers=headers) return GetResponse.from_dict(res) @@ -8456,7 +8456,7 @@ def set( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do( "POST", f"/api/2.0/preview/sql/permissions/{object_type.value}/{object_id}", body=body, headers=headers @@ -8493,7 +8493,7 @@ def transfer_ownership( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do( "POST", @@ -8537,7 +8537,7 @@ def create( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("POST", "/api/2.0/sql/queries", body=body, headers=headers) return Query.from_dict(res) @@ -8558,7 +8558,7 @@ def delete(self, id: str): cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id self._api.do("DELETE", f"/api/2.0/sql/queries/{id}", headers=headers) @@ -8576,7 +8576,7 @@ def get(self, id: str) -> Query: cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("GET", f"/api/2.0/sql/queries/{id}", headers=headers) return Query.from_dict(res) @@ -8604,7 +8604,7 @@ def list( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id while True: json = self._api.do("GET", "/api/2.0/sql/queries", query=query, headers=headers) @@ -8638,7 +8638,7 @@ def list_visualizations( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id while True: json = self._api.do("GET", f"/api/2.0/sql/queries/{id}/visualizations", query=query, headers=headers) @@ -8692,7 +8692,7 @@ def update( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("PATCH", f"/api/2.0/sql/queries/{id}", body=body, headers=headers) return Query.from_dict(res) @@ -8784,7 +8784,7 @@ def create( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("POST", "/api/2.0/preview/sql/queries", body=body, headers=headers) return LegacyQuery.from_dict(res) @@ -8808,7 +8808,7 @@ def delete(self, query_id: str): cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id self._api.do("DELETE", f"/api/2.0/preview/sql/queries/{query_id}", headers=headers) @@ -8831,7 +8831,7 @@ def get(self, query_id: str) -> LegacyQuery: cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("GET", f"/api/2.0/preview/sql/queries/{query_id}", headers=headers) return LegacyQuery.from_dict(res) @@ -8892,7 +8892,7 @@ def list( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id query["page"] = 1 while True: @@ -8923,7 +8923,7 @@ def restore(self, query_id: str): cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id self._api.do("POST", f"/api/2.0/preview/sql/queries/trash/{query_id}", headers=headers) @@ -8993,7 +8993,7 @@ def update( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("POST", f"/api/2.0/preview/sql/queries/{query_id}", body=body, headers=headers) return LegacyQuery.from_dict(res) @@ -9052,7 +9052,7 @@ def list( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("GET", "/api/2.0/sql/history/queries", query=query, headers=headers) return ListQueriesResponse.from_dict(res) @@ -9083,7 +9083,7 @@ def create(self, *, visualization: Optional[CreateVisualizationRequestVisualizat cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("POST", "/api/2.0/sql/visualizations", body=body, headers=headers) return Visualization.from_dict(res) @@ -9102,7 +9102,7 @@ def delete(self, id: str): cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id self._api.do("DELETE", f"/api/2.0/sql/visualizations/{id}", headers=headers) @@ -9139,7 +9139,7 @@ def update( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("PATCH", f"/api/2.0/sql/visualizations/{id}", body=body, headers=headers) return Visualization.from_dict(res) @@ -9199,7 +9199,7 @@ def create( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("POST", "/api/2.0/preview/sql/visualizations", body=body, headers=headers) return LegacyVisualization.from_dict(res) @@ -9224,7 +9224,7 @@ def delete(self, id: str): cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id self._api.do("DELETE", f"/api/2.0/preview/sql/visualizations/{id}", headers=headers) @@ -9289,7 +9289,7 @@ def update( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("POST", f"/api/2.0/preview/sql/visualizations/{id}", body=body, headers=headers) return LegacyVisualization.from_dict(res) @@ -9314,7 +9314,7 @@ def get_config(self) -> ClientConfig: cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("GET", "/api/2.0/redash-v2/config", headers=headers) return ClientConfig.from_dict(res) @@ -9424,7 +9424,7 @@ def cancel_execution(self, statement_id: str): cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id self._api.do("POST", f"/api/2.0/sql/statements/{statement_id}/cancel", headers=headers) @@ -9659,7 +9659,7 @@ def execute_statement( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("POST", "/api/2.0/sql/statements", body=body, headers=headers) return StatementResponse.from_dict(res) @@ -9687,7 +9687,7 @@ def get_statement(self, statement_id: str) -> StatementResponse: cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("GET", f"/api/2.0/sql/statements/{statement_id}", headers=headers) return StatementResponse.from_dict(res) @@ -9715,7 +9715,7 @@ def get_statement_result_chunk_n(self, statement_id: str, chunk_index: int) -> R cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do( "GET", f"/api/2.0/sql/statements/{statement_id}/result/chunks/{chunk_index}", headers=headers @@ -9904,7 +9904,7 @@ def create( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id op_response = self._api.do("POST", "/api/2.0/sql/warehouses", body=body, headers=headers) return Wait( @@ -9973,7 +9973,7 @@ def create_default_warehouse_override( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do( "POST", "/api/warehouses/v1/default-warehouse-overrides", query=query, body=body, headers=headers @@ -9995,7 +9995,7 @@ def delete(self, id: str): cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id self._api.do("DELETE", f"/api/2.0/sql/warehouses/{id}", headers=headers) @@ -10017,7 +10017,7 @@ def delete_default_warehouse_override(self, name: str): cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id self._api.do("DELETE", f"/api/warehouses/v1/{name}", headers=headers) @@ -10137,7 +10137,7 @@ def edit( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id op_response = self._api.do("POST", f"/api/2.0/sql/warehouses/{id}/edit", body=body, headers=headers) return Wait(self.wait_get_warehouse_running, id=id) @@ -10193,7 +10193,7 @@ def get(self, id: str) -> GetWarehouseResponse: cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("GET", f"/api/2.0/sql/warehouses/{id}", headers=headers) return GetWarehouseResponse.from_dict(res) @@ -10217,7 +10217,7 @@ def get_default_warehouse_override(self, name: str) -> DefaultWarehouseOverride: cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("GET", f"/api/warehouses/v1/{name}", headers=headers) return DefaultWarehouseOverride.from_dict(res) @@ -10237,7 +10237,7 @@ def get_permission_levels(self, warehouse_id: str) -> GetWarehousePermissionLeve cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("GET", f"/api/2.0/permissions/warehouses/{warehouse_id}/permissionLevels", headers=headers) return GetWarehousePermissionLevelsResponse.from_dict(res) @@ -10258,7 +10258,7 @@ def get_permissions(self, warehouse_id: str) -> WarehousePermissions: cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("GET", f"/api/2.0/permissions/warehouses/{warehouse_id}", headers=headers) return WarehousePermissions.from_dict(res) @@ -10276,7 +10276,7 @@ def get_workspace_warehouse_config(self) -> GetWorkspaceWarehouseConfigResponse: cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("GET", "/api/2.0/sql/config/warehouses", headers=headers) return GetWorkspaceWarehouseConfigResponse.from_dict(res) @@ -10314,7 +10314,7 @@ def list( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id while True: json = self._api.do("GET", "/api/2.0/sql/warehouses", query=query, headers=headers) @@ -10356,7 +10356,7 @@ def list_default_warehouse_overrides( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id while True: json = self._api.do("GET", "/api/warehouses/v1/default-warehouse-overrides", query=query, headers=headers) @@ -10390,7 +10390,7 @@ def set_permissions( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("PUT", f"/api/2.0/permissions/warehouses/{warehouse_id}", body=body, headers=headers) return WarehousePermissions.from_dict(res) @@ -10468,7 +10468,7 @@ def set_workspace_warehouse_config( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id self._api.do("PUT", "/api/2.0/sql/config/warehouses", body=body, headers=headers) @@ -10489,7 +10489,7 @@ def start(self, id: str) -> Wait[GetWarehouseResponse]: cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id op_response = self._api.do("POST", f"/api/2.0/sql/warehouses/{id}/start", headers=headers) return Wait(self.wait_get_warehouse_running, id=id) @@ -10514,7 +10514,7 @@ def stop(self, id: str) -> Wait[GetWarehouseResponse]: cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id op_response = self._api.do("POST", f"/api/2.0/sql/warehouses/{id}/stop", headers=headers) return Wait(self.wait_get_warehouse_stopped, id=id) @@ -10564,7 +10564,7 @@ def update_default_warehouse_override( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("PATCH", f"/api/warehouses/v1/{name}", query=query, body=body, headers=headers) return DefaultWarehouseOverride.from_dict(res) @@ -10592,7 +10592,7 @@ def update_permissions( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("PATCH", f"/api/2.0/permissions/warehouses/{warehouse_id}", body=body, headers=headers) return WarehousePermissions.from_dict(res) diff --git a/databricks/sdk/service/supervisoragents.py b/databricks/sdk/service/supervisoragents.py index 26a175394..0e880fd4c 100755 --- a/databricks/sdk/service/supervisoragents.py +++ b/databricks/sdk/service/supervisoragents.py @@ -816,7 +816,7 @@ def create_example(self, parent: str, example: Example) -> Example: cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("POST", f"/api/2.1/{parent}/examples", body=body, headers=headers) return Example.from_dict(res) @@ -838,7 +838,7 @@ def create_supervisor_agent(self, supervisor_agent: SupervisorAgent) -> Supervis cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("POST", "/api/2.1/supervisor-agents", body=body, headers=headers) return SupervisorAgent.from_dict(res) @@ -870,7 +870,7 @@ def create_tool(self, parent: str, tool: Tool, tool_id: str) -> Tool: cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("POST", f"/api/2.1/{parent}/tools", query=query, body=body, headers=headers) return Tool.from_dict(res) @@ -891,7 +891,7 @@ def delete_example(self, name: str): cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id self._api.do("DELETE", f"/api/2.1/{name}", headers=headers) @@ -910,7 +910,7 @@ def delete_supervisor_agent(self, name: str): cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id self._api.do("DELETE", f"/api/2.1/{name}", headers=headers) @@ -929,7 +929,7 @@ def delete_tool(self, name: str): cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id self._api.do("DELETE", f"/api/2.1/{name}", headers=headers) @@ -949,7 +949,7 @@ def get_example(self, name: str) -> Example: cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("GET", f"/api/2.1/{name}", headers=headers) return Example.from_dict(res) @@ -969,7 +969,7 @@ def get_permission_levels(self, supervisor_agent_id: str) -> GetSupervisorAgentP cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do( "GET", f"/api/2.0/permissions/supervisor-agents/{supervisor_agent_id}/permissionLevels", headers=headers @@ -992,7 +992,7 @@ def get_permissions(self, supervisor_agent_id: str) -> SupervisorAgentPermission cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("GET", f"/api/2.0/permissions/supervisor-agents/{supervisor_agent_id}", headers=headers) return SupervisorAgentPermissions.from_dict(res) @@ -1012,7 +1012,7 @@ def get_supervisor_agent(self, name: str) -> SupervisorAgent: cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("GET", f"/api/2.1/{name}", headers=headers) return SupervisorAgent.from_dict(res) @@ -1032,7 +1032,7 @@ def get_tool(self, name: str) -> Tool: cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("GET", f"/api/2.1/{name}", headers=headers) return Tool.from_dict(res) @@ -1065,7 +1065,7 @@ def list_examples( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id while True: json = self._api.do("GET", f"/api/2.1/{parent}/examples", query=query, headers=headers) @@ -1102,7 +1102,7 @@ def list_supervisor_agents( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id while True: json = self._api.do("GET", "/api/2.1/supervisor-agents", query=query, headers=headers) @@ -1137,7 +1137,7 @@ def list_tools( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id while True: json = self._api.do("GET", f"/api/2.1/{parent}/tools", query=query, headers=headers) @@ -1174,7 +1174,7 @@ def set_permissions( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do( "PUT", f"/api/2.0/permissions/supervisor-agents/{supervisor_agent_id}", body=body, headers=headers @@ -1206,7 +1206,7 @@ def update_example(self, name: str, example: Example, update_mask: FieldMask) -> cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("PATCH", f"/api/2.1/{name}", query=query, body=body, headers=headers) return Example.from_dict(res) @@ -1237,7 +1237,7 @@ def update_permissions( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do( "PATCH", f"/api/2.0/permissions/supervisor-agents/{supervisor_agent_id}", body=body, headers=headers @@ -1271,7 +1271,7 @@ def update_supervisor_agent( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("PATCH", f"/api/2.1/{name}", query=query, body=body, headers=headers) return SupervisorAgent.from_dict(res) @@ -1301,7 +1301,7 @@ def update_tool(self, name: str, tool: Tool, update_mask: FieldMask) -> Tool: cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("PATCH", f"/api/2.1/{name}", query=query, body=body, headers=headers) return Tool.from_dict(res) diff --git a/databricks/sdk/service/tags.py b/databricks/sdk/service/tags.py index 61345b9fe..2af7cb492 100755 --- a/databricks/sdk/service/tags.py +++ b/databricks/sdk/service/tags.py @@ -253,7 +253,7 @@ def create_tag_policy(self, tag_policy: TagPolicy) -> TagPolicy: cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("POST", "/api/2.1/tag-policies", body=body, headers=headers) return TagPolicy.from_dict(res) @@ -275,7 +275,7 @@ def delete_tag_policy(self, tag_key: str): cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id self._api.do("DELETE", f"/api/2.1/tag-policies/{tag_key}", headers=headers) @@ -298,7 +298,7 @@ def get_tag_policy(self, tag_key: str) -> TagPolicy: cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("GET", f"/api/2.1/tag-policies/{tag_key}", headers=headers) return TagPolicy.from_dict(res) @@ -334,7 +334,7 @@ def list_tag_policies( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id while True: json = self._api.do("GET", "/api/2.1/tag-policies", query=query, headers=headers) @@ -380,7 +380,7 @@ def update_tag_policy(self, tag_key: str, tag_policy: TagPolicy, update_mask: st cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("PATCH", f"/api/2.1/tag-policies/{tag_key}", query=query, body=body, headers=headers) return TagPolicy.from_dict(res) @@ -408,7 +408,7 @@ def create_tag_assignment(self, tag_assignment: TagAssignment) -> TagAssignment: cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("POST", "/api/2.0/entity-tag-assignments", body=body, headers=headers) return TagAssignment.from_dict(res) @@ -433,7 +433,7 @@ def delete_tag_assignment(self, entity_type: str, entity_id: str, tag_key: str): cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id self._api.do( "DELETE", f"/api/2.0/entity-tag-assignments/{entity_type}/{entity_id}/tags/{tag_key}", headers=headers @@ -459,7 +459,7 @@ def get_tag_assignment(self, entity_type: str, entity_id: str, tag_key: str) -> cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do( "GET", f"/api/2.0/entity-tag-assignments/{entity_type}/{entity_id}/tags/{tag_key}", headers=headers @@ -495,7 +495,7 @@ def list_tag_assignments( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id while True: json = self._api.do( @@ -546,7 +546,7 @@ def update_tag_assignment( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do( "PATCH", diff --git a/databricks/sdk/service/vectorsearch.py b/databricks/sdk/service/vectorsearch.py index e84c1516c..6b774afbc 100755 --- a/databricks/sdk/service/vectorsearch.py +++ b/databricks/sdk/service/vectorsearch.py @@ -2037,7 +2037,7 @@ def create_endpoint( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id op_response = self._api.do("POST", "/api/2.0/vector-search/endpoints", body=body, headers=headers) return Wait( @@ -2079,7 +2079,7 @@ def delete_endpoint(self, endpoint_name: str): cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id self._api.do("DELETE", f"/api/2.0/vector-search/endpoints/{endpoint_name}", headers=headers) @@ -2098,7 +2098,7 @@ def get_endpoint(self, endpoint_name: str) -> EndpointInfo: cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("GET", f"/api/2.0/vector-search/endpoints/{endpoint_name}", headers=headers) return EndpointInfo.from_dict(res) @@ -2118,7 +2118,7 @@ def get_permission_levels(self, endpoint_id: str) -> GetVectorSearchEndpointPerm cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do( "GET", f"/api/2.0/permissions/vector-search-endpoints/{endpoint_id}/permissionLevels", headers=headers @@ -2141,7 +2141,7 @@ def get_permissions(self, endpoint_id: str) -> VectorSearchEndpointPermissions: cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("GET", f"/api/2.0/permissions/vector-search-endpoints/{endpoint_id}", headers=headers) return VectorSearchEndpointPermissions.from_dict(res) @@ -2164,7 +2164,7 @@ def list_endpoints(self, *, page_token: Optional[str] = None) -> Iterator[Endpoi cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id while True: json = self._api.do("GET", "/api/2.0/vector-search/endpoints", query=query, headers=headers) @@ -2196,7 +2196,7 @@ def patch_endpoint(self, endpoint_name: str, *, target_qps: Optional[int] = None cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("PATCH", f"/api/2.0/vector-search/endpoints/{endpoint_name}", body=body, headers=headers) return EndpointInfo.from_dict(res) @@ -2247,7 +2247,7 @@ def retrieve_user_visible_metrics( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("POST", f"/api/2.0/vector-search/endpoints/{name}/metrics", body=body, headers=headers) return RetrieveUserVisibleMetricsResponse.from_dict(res) @@ -2275,7 +2275,7 @@ def set_permissions( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do( "PUT", f"/api/2.0/permissions/vector-search-endpoints/{endpoint_id}", body=body, headers=headers @@ -2305,7 +2305,7 @@ def update_endpoint_budget_policy( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do( "PATCH", f"/api/2.0/vector-search/endpoints/{endpoint_name}/budget-policy", body=body, headers=headers @@ -2335,7 +2335,7 @@ def update_endpoint_custom_tags( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do( "PATCH", f"/api/2.0/vector-search/endpoints/{endpoint_name}/tags", body=body, headers=headers @@ -2365,7 +2365,7 @@ def update_permissions( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do( "PATCH", f"/api/2.0/permissions/vector-search-endpoints/{endpoint_id}", body=body, headers=headers @@ -2437,7 +2437,7 @@ def create_index( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("POST", "/api/2.0/vector-search/indexes", body=body, headers=headers) return VectorIndex.from_dict(res) @@ -2462,7 +2462,7 @@ def delete_data_vector_index(self, index_name: str, primary_keys: List[str]) -> cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do( "DELETE", f"/api/2.0/vector-search/indexes/{index_name}/delete-data", query=query, headers=headers @@ -2484,7 +2484,7 @@ def delete_index(self, index_name: str): cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id self._api.do("DELETE", f"/api/2.0/vector-search/indexes/{index_name}", headers=headers) @@ -2510,7 +2510,7 @@ def get_index(self, index_name: str, *, ensure_reranker_compatible: Optional[boo cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("GET", f"/api/2.0/vector-search/indexes/{index_name}", query=query, headers=headers) return VectorIndex.from_dict(res) @@ -2537,7 +2537,7 @@ def list_indexes(self, endpoint_name: str, *, page_token: Optional[str] = None) cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id while True: json = self._api.do("GET", "/api/2.0/vector-search/indexes", query=query, headers=headers) @@ -2625,7 +2625,7 @@ def query_index( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("POST", f"/api/2.0/vector-search/indexes/{index_name}/query", body=body, headers=headers) return QueryVectorIndexResponse.from_dict(res) @@ -2658,7 +2658,7 @@ def query_next_page( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do( "POST", f"/api/2.0/vector-search/indexes/{index_name}/query-next-page", body=body, headers=headers @@ -2693,7 +2693,7 @@ def scan_index( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("POST", f"/api/2.0/vector-search/indexes/{index_name}/scan", body=body, headers=headers) return ScanVectorIndexResponse.from_dict(res) @@ -2713,7 +2713,7 @@ def sync_index(self, index_name: str): cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id self._api.do("POST", f"/api/2.0/vector-search/indexes/{index_name}/sync", headers=headers) @@ -2738,7 +2738,7 @@ def upsert_data_vector_index(self, index_name: str, inputs_json: str) -> UpsertD cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do( "POST", f"/api/2.0/vector-search/indexes/{index_name}/upsert-data", body=body, headers=headers diff --git a/databricks/sdk/service/workspace.py b/databricks/sdk/service/workspace.py index 9914787d0..d88c2bfa4 100755 --- a/databricks/sdk/service/workspace.py +++ b/databricks/sdk/service/workspace.py @@ -1788,7 +1788,7 @@ def create( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("POST", "/api/2.0/git-credentials", body=body, headers=headers) return CreateCredentialsResponse.from_dict(res) @@ -1814,7 +1814,7 @@ def delete(self, credential_id: int, *, principal_id: Optional[int] = None): cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id self._api.do("DELETE", f"/api/2.0/git-credentials/{credential_id}", query=query, headers=headers) @@ -1839,7 +1839,7 @@ def get(self, credential_id: int, *, principal_id: Optional[int] = None) -> GetC cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("GET", f"/api/2.0/git-credentials/{credential_id}", query=query, headers=headers) return GetCredentialsResponse.from_dict(res) @@ -1863,7 +1863,7 @@ def list(self, *, principal_id: Optional[int] = None) -> Iterator[CredentialInfo cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id json = self._api.do("GET", "/api/2.0/git-credentials", query=query, headers=headers) parsed = ListCredentialsResponse.from_dict(json).credentials @@ -1939,7 +1939,7 @@ def update( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id self._api.do("PATCH", f"/api/2.0/git-credentials/{credential_id}", body=body, headers=headers) @@ -1998,7 +1998,7 @@ def create( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("POST", "/api/2.0/repos", body=body, headers=headers) return CreateRepoResponse.from_dict(res) @@ -2018,7 +2018,7 @@ def delete(self, repo_id: int): cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id self._api.do("DELETE", f"/api/2.0/repos/{repo_id}", headers=headers) @@ -2037,7 +2037,7 @@ def get(self, repo_id: int) -> GetRepoResponse: cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("GET", f"/api/2.0/repos/{repo_id}", headers=headers) return GetRepoResponse.from_dict(res) @@ -2057,7 +2057,7 @@ def get_permission_levels(self, repo_id: str) -> GetRepoPermissionLevelsResponse cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("GET", f"/api/2.0/permissions/repos/{repo_id}/permissionLevels", headers=headers) return GetRepoPermissionLevelsResponse.from_dict(res) @@ -2077,7 +2077,7 @@ def get_permissions(self, repo_id: str) -> RepoPermissions: cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("GET", f"/api/2.0/permissions/repos/{repo_id}", headers=headers) return RepoPermissions.from_dict(res) @@ -2108,7 +2108,7 @@ def list(self, *, next_page_token: Optional[str] = None, path_prefix: Optional[s cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id while True: json = self._api.do("GET", "/api/2.0/repos", query=query, headers=headers) @@ -2142,7 +2142,7 @@ def set_permissions( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("PUT", f"/api/2.0/permissions/repos/{repo_id}", body=body, headers=headers) return RepoPermissions.from_dict(res) @@ -2187,7 +2187,7 @@ def update( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id self._api.do("PATCH", f"/api/2.0/repos/{repo_id}", body=body, headers=headers) @@ -2213,7 +2213,7 @@ def update_permissions( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("PATCH", f"/api/2.0/permissions/repos/{repo_id}", body=body, headers=headers) return RepoPermissions.from_dict(res) @@ -2301,7 +2301,7 @@ def create_scope( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id self._api.do("POST", "/api/2.0/secrets/scopes/create", body=body, headers=headers) @@ -2339,7 +2339,7 @@ def delete_acl(self, scope: str, principal: str): cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id self._api.do("POST", "/api/2.0/secrets/acls/delete", body=body, headers=headers) @@ -2371,7 +2371,7 @@ def delete_scope(self, scope: str): cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id self._api.do("POST", "/api/2.0/secrets/scopes/delete", body=body, headers=headers) @@ -2410,7 +2410,7 @@ def delete_secret(self, scope: str, key: str): cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id self._api.do("POST", "/api/2.0/secrets/delete", body=body, headers=headers) @@ -2448,7 +2448,7 @@ def get_acl(self, scope: str, principal: str) -> AclItem: cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("GET", "/api/2.0/secrets/acls/get", query=query, headers=headers) return AclItem.from_dict(res) @@ -2498,7 +2498,7 @@ def get_secret(self, scope: str, key: str) -> GetSecretResponse: cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("GET", "/api/2.0/secrets/get", query=query, headers=headers) return GetSecretResponse.from_dict(res) @@ -2533,7 +2533,7 @@ def list_acls(self, scope: str) -> Iterator[AclItem]: cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id json = self._api.do("GET", "/api/2.0/secrets/acls/list", query=query, headers=headers) parsed = ListAclsResponse.from_dict(json).items @@ -2561,7 +2561,7 @@ def list_scopes(self) -> Iterator[SecretScope]: cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id json = self._api.do("GET", "/api/2.0/secrets/scopes/list", headers=headers) parsed = ListScopesResponse.from_dict(json).scopes @@ -2598,7 +2598,7 @@ def list_secrets(self, scope: str) -> Iterator[SecretMetadata]: cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id json = self._api.do("GET", "/api/2.0/secrets/list", query=query, headers=headers) parsed = ListSecretsResponse.from_dict(json).secrets @@ -2657,7 +2657,7 @@ def put_acl(self, scope: str, principal: str, permission: AclPermission): cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id self._api.do("POST", "/api/2.0/secrets/acls/put", body=body, headers=headers) @@ -2715,7 +2715,7 @@ def put_secret( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id self._api.do("POST", "/api/2.0/secrets/put", body=body, headers=headers) @@ -2761,7 +2761,7 @@ def delete(self, path: str, *, recursive: Optional[bool] = None): cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id self._api.do("POST", "/api/2.0/workspace/delete", body=body, headers=headers) @@ -2802,7 +2802,7 @@ def export(self, path: str, *, format: Optional[ExportFormat] = None) -> ExportR cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("GET", "/api/2.0/workspace/export", query=query, headers=headers) return ExportResponse.from_dict(res) @@ -2828,7 +2828,7 @@ def get_permission_levels( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do( "GET", @@ -2857,7 +2857,7 @@ def get_permissions(self, workspace_object_type: str, workspace_object_id: str) cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do( "GET", f"/api/2.0/permissions/{workspace_object_type}/{workspace_object_id}", headers=headers @@ -2883,7 +2883,7 @@ def get_status(self, path: str) -> ObjectInfo: cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("GET", "/api/2.0/workspace/get-status", query=query, headers=headers) return ObjectInfo.from_dict(res) @@ -2949,7 +2949,7 @@ def import_( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id self._api.do("POST", "/api/2.0/workspace/import", body=body, headers=headers) @@ -2976,7 +2976,7 @@ def list(self, path: str, *, notebooks_modified_after: Optional[int] = None) -> cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id json = self._api.do("GET", "/api/2.0/workspace/list", query=query, headers=headers) parsed = ListResponse.from_dict(json).objects @@ -3007,7 +3007,7 @@ def mkdirs(self, path: str): cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id self._api.do("POST", "/api/2.0/workspace/mkdirs", body=body, headers=headers) @@ -3043,7 +3043,7 @@ def set_permissions( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do( "PUT", f"/api/2.0/permissions/{workspace_object_type}/{workspace_object_id}", body=body, headers=headers @@ -3081,7 +3081,7 @@ def update_permissions( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do( "PATCH", f"/api/2.0/permissions/{workspace_object_type}/{workspace_object_id}", body=body, headers=headers diff --git a/tests/databricks/sdk/service/httpcallv2.py b/tests/databricks/sdk/service/httpcallv2.py index 0f2cbfaea..3974e086d 100755 --- a/tests/databricks/sdk/service/httpcallv2.py +++ b/tests/databricks/sdk/service/httpcallv2.py @@ -131,7 +131,7 @@ def create_resource( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do( "POST", @@ -177,7 +177,7 @@ def get_resource( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do( "GET", @@ -248,7 +248,7 @@ def update_resource( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do( "PATCH", diff --git a/tests/databricks/sdk/service/idempotencytesting.py b/tests/databricks/sdk/service/idempotencytesting.py index cb03d56b0..778ceeedc 100755 --- a/tests/databricks/sdk/service/idempotencytesting.py +++ b/tests/databricks/sdk/service/idempotencytesting.py @@ -64,7 +64,7 @@ def create_test_resource(self, test_resource: TestResource, *, request_id: Optio cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("POST", "/api/2.0/idempotency-testing/resources", query=query, body=body, headers=headers) return TestResource.from_dict(res) diff --git a/tests/databricks/sdk/service/jsonmarshallv2.py b/tests/databricks/sdk/service/jsonmarshallv2.py index a3b381a91..eb540c43e 100755 --- a/tests/databricks/sdk/service/jsonmarshallv2.py +++ b/tests/databricks/sdk/service/jsonmarshallv2.py @@ -484,7 +484,7 @@ def get_resource(self, name: str, resource: Resource) -> Resource: cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("GET", f"/api/2.0/json-marshall/{name}", query=query, headers=headers) return Resource.from_dict(res) diff --git a/tests/databricks/sdk/service/lrotesting.py b/tests/databricks/sdk/service/lrotesting.py index fd175c381..843ac357b 100755 --- a/tests/databricks/sdk/service/lrotesting.py +++ b/tests/databricks/sdk/service/lrotesting.py @@ -300,7 +300,7 @@ def cancel_operation(self, name: str): cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id self._api.do("POST", f"/api/2.0/lro-testing/operations/{name}/cancel", headers=headers) @@ -321,7 +321,7 @@ def create_test_resource(self, resource: TestResource) -> CreateTestResourceOper cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("POST", "/api/2.0/lro-testing/resources", body=body, headers=headers) operation = Operation.from_dict(res) @@ -335,7 +335,7 @@ def delete_test_resource(self, resource_id: str) -> DeleteTestResourceOperation: cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("DELETE", f"/api/2.0/lro-testing/resources/{resource_id}", headers=headers) operation = Operation.from_dict(res) @@ -349,7 +349,7 @@ def get_operation(self, name: str) -> Operation: cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("GET", f"/api/2.0/lro-testing/operations/{name}", headers=headers) return Operation.from_dict(res) @@ -369,7 +369,7 @@ def get_test_resource(self, resource_id: str) -> TestResource: cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("GET", f"/api/2.0/lro-testing/resources/{resource_id}", headers=headers) return TestResource.from_dict(res) From f82538662420982efd4f4e8115bb94894053db57 Mon Sep 17 00:00:00 2001 From: Divyansh Vijayvergia Date: Tue, 19 May 2026 13:50:54 +0000 Subject: [PATCH 2/3] Update hand-written files for X-Databricks-Workspace-Id header Generator can't touch these (no DO NOT EDIT marker), or need post-generation reformatting because the new literal is longer: - config.py: SQL HTTP path resolver header read + widen workspace_id field comment (now accepts non-classic workspace identifier formats) - mixins/workspace.py: upload/download header injection (2 sites) - mixins/sharing.py: shares-list header injection - mixins/files.py: storage-proxy workspace probe (2 sites) - tests/test_config.py: renamed three header tests (test_workspace_org_id_header_* -> test_workspace_id_header_*, test_no_org_id_header_* -> test_no_workspace_id_header_*) and swapped asserted literals/docstrings - tests/test_files.py: updated mock response header fixtures - tests/integration/test_unified_profile.py: comment refresh - NEXT_CHANGELOG.md: internal-changes entry - __init__.py: black-wrap of the get_workspace_id() probe line that exceeded 120 chars after the longer literal substitution Signed-off-by: Divyansh Vijayvergia --- NEXT_CHANGELOG.md | 2 ++ databricks/sdk/__init__.py | 4 +++- databricks/sdk/config.py | 5 ++++- databricks/sdk/mixins/files.py | 6 ++++-- databricks/sdk/mixins/sharing.py | 2 +- databricks/sdk/mixins/workspace.py | 4 ++-- tests/integration/test_unified_profile.py | 2 +- tests/test_config.py | 24 +++++++++++------------ tests/test_files.py | 4 ++-- 9 files changed, 31 insertions(+), 22 deletions(-) diff --git a/NEXT_CHANGELOG.md b/NEXT_CHANGELOG.md index fe036557c..5283c836b 100755 --- a/NEXT_CHANGELOG.md +++ b/NEXT_CHANGELOG.md @@ -14,6 +14,8 @@ ### Internal Changes +* 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 `Config.workspace_id` (`DATABRICKS_WORKSPACE_ID`), and now accepts either a classic numeric workspace ID or another workspace identifier format (server disambiguates). + ### API Changes * Add `databricks.sdk.service.bundle` package. * Add [w.bundle](https://databricks-sdk-py.readthedocs.io/en/latest/workspace/bundle/bundle.html) workspace-level service. diff --git a/databricks/sdk/__init__.py b/databricks/sdk/__init__.py index a6655e290..bb0d68cb8 100755 --- a/databricks/sdk/__init__.py +++ b/databricks/sdk/__init__.py @@ -1108,7 +1108,9 @@ def get_workspace_id(self) -> int: """ if self._config.workspace_id: return int(self._config.workspace_id) - response = self._api_client.do("GET", "/api/2.0/preview/scim/v2/Me", response_headers=["X-Databricks-Workspace-Id"]) + response = self._api_client.do( + "GET", "/api/2.0/preview/scim/v2/Me", response_headers=["X-Databricks-Workspace-Id"] + ) return int(response["X-Databricks-Workspace-Id"]) def __repr__(self): diff --git a/databricks/sdk/config.py b/databricks/sdk/config.py index 0a6b8a56a..b2ca1f783 100644 --- a/databricks/sdk/config.py +++ b/databricks/sdk/config.py @@ -89,6 +89,9 @@ def with_user_agent_extra(key: str, value: str): class Config: host: str = ConfigAttribute(env="DATABRICKS_HOST") account_id: str = ConfigAttribute(env="DATABRICKS_ACCOUNT_ID") + # Workspace identifier sent on workspace-scoped API calls so unified hosts + # can route to the right workspace. Accepts a classic numeric workspace ID + # or another workspace identifier format that the server understands. workspace_id: str = ConfigAttribute(env="DATABRICKS_WORKSPACE_ID") # Cloud provider. When set, is_aws/is_azure/is_gcp use this value directly @@ -596,7 +599,7 @@ def sql_http_path(self) -> Optional[str]: if self.cluster_id: response = requests.get(f"{self.host}/api/2.0/preview/scim/v2/Me", headers=headers) # get workspace ID from the response header - workspace_id = response.headers.get("x-databricks-org-id") + workspace_id = response.headers.get("x-databricks-workspace-id") return f"sql/protocolv1/o/{workspace_id}/{self.cluster_id}" if self.warehouse_id: return f"/sql/1.0/warehouses/{self.warehouse_id}" diff --git a/databricks/sdk/mixins/files.py b/databricks/sdk/mixins/files.py index 06c3eb98e..996847bd2 100644 --- a/databricks/sdk/mixins/files.py +++ b/databricks/sdk/mixins/files.py @@ -996,8 +996,10 @@ def _create_request_builder(self): def _resolve_workspace_id(self) -> Optional[str]: """Resolves the workspace ID by querying the SCIM Me endpoint.""" try: - response = self._api.do("GET", "/api/2.0/preview/scim/v2/Me", response_headers=["X-Databricks-Org-Id"]) - workspace_id = response.get("X-Databricks-Org-Id") + response = self._api.do( + "GET", "/api/2.0/preview/scim/v2/Me", response_headers=["X-Databricks-Workspace-Id"] + ) + workspace_id = response.get("X-Databricks-Workspace-Id") if workspace_id: return str(workspace_id) except Exception: diff --git a/databricks/sdk/mixins/sharing.py b/databricks/sdk/mixins/sharing.py index be9ed9552..89b2bcdbb 100644 --- a/databricks/sdk/mixins/sharing.py +++ b/databricks/sdk/mixins/sharing.py @@ -33,7 +33,7 @@ def list(self, *, max_results: Optional[int] = None, page_token: Optional[str] = } cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id if "max_results" not in query: query["max_results"] = 0 diff --git a/databricks/sdk/mixins/workspace.py b/databricks/sdk/mixins/workspace.py index db9e44ea8..29cf8cb69 100644 --- a/databricks/sdk/mixins/workspace.py +++ b/databricks/sdk/mixins/workspace.py @@ -88,7 +88,7 @@ def upload( headers = {} cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id try: return self._api.do( "POST", @@ -121,6 +121,6 @@ def download(self, path: str, *, format: Optional[ExportFormat] = None) -> Binar headers = {} cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id response = self._api.do("GET", "/api/2.0/workspace/export", query=query, headers=headers, raw=True) return response["contents"] diff --git a/tests/integration/test_unified_profile.py b/tests/integration/test_unified_profile.py index 1163c4e61..a95ee4a22 100644 --- a/tests/integration/test_unified_profile.py +++ b/tests/integration/test_unified_profile.py @@ -90,7 +90,7 @@ def test_spog_workspace_google_credentials(isolated_env): # google-credentials uses a GCP ID token with target_audience=cfg.host. # On the unified host this produces the same token for both account and workspace # requests (identical OIDC exchange, identical audience). Account-level APIs accept - # this token, but workspace-level APIs return 401. The X-Databricks-Org-Id header + # this token, but workspace-level APIs return 401. The X-Databricks-Workspace-Id header # is set correctly. This appears to be a server-side limitation on unified hosts. pytest.skip("google-credentials ID token is rejected for workspace operations on unified hosts") env = isolated_env("ucacct") diff --git a/tests/test_config.py b/tests/test_config.py index db872c8a7..47fec6643 100644 --- a/tests/test_config.py +++ b/tests/test_config.py @@ -453,8 +453,8 @@ def test_oidc_endpoints_falls_back_to_databricks_when_no_azure_client_id(mocker, assert "https://adb-123.4.azuredatabricks.net/oidc/v1/token" == endpoints.token_endpoint -def test_workspace_org_id_header_on_unified_host(requests_mock): - """Test that X-Databricks-Org-Id header is added for workspace clients on unified hosts.""" +def test_workspace_id_header_on_unified_host(requests_mock): + """Test that X-Databricks-Workspace-Id header is added for workspace clients on unified hosts.""" requests_mock.get("https://unified.databricks.com/api/2.0/preview/scim/v2/Me", json={"result": "success"}) @@ -468,12 +468,12 @@ def test_workspace_org_id_header_on_unified_host(requests_mock): workspace_client = WorkspaceClient(config=config) workspace_client.current_user.me() - # Verify the request was made with the X-Databricks-Org-Id header - assert requests_mock.last_request.headers.get("X-Databricks-Org-Id") == "test-workspace-123" + # Verify the request was made with the X-Databricks-Workspace-Id header + assert requests_mock.last_request.headers.get("X-Databricks-Workspace-Id") == "test-workspace-123" -def test_not_workspace_org_id_header_on_unified_host_on_account_endpoint(requests_mock): - """Test that X-Databricks-Org-Id header is added for workspace clients on unified hosts.""" +def test_not_workspace_id_header_on_unified_host_on_account_endpoint(requests_mock): + """Test that X-Databricks-Workspace-Id header is added for workspace clients on unified hosts.""" requests_mock.get( "https://unified.databricks.com/api/2.0/accounts/test-account/scim/v2/Groups/test-group-123", @@ -490,12 +490,12 @@ def test_not_workspace_org_id_header_on_unified_host_on_account_endpoint(request account_client = AccountClient(config=config) account_client.groups.get("test-group-123") - # Verify the request was made without the X-Databricks-Org-Id header - assert "X-Databricks-Org-Id" not in requests_mock.last_request.headers + # Verify the request was made without the X-Databricks-Workspace-Id header + assert "X-Databricks-Workspace-Id" not in requests_mock.last_request.headers -def test_no_org_id_header_on_regular_workspace(requests_mock): - """Test that X-Databricks-Org-Id header is NOT added for regular workspace hosts.""" +def test_no_workspace_id_header_on_regular_workspace(requests_mock): + """Test that X-Databricks-Workspace-Id header is NOT added for regular workspace hosts.""" from databricks.sdk.core import ApiClient requests_mock.get("https://test.databricks.com/api/2.0/test", json={"result": "success"}) @@ -505,8 +505,8 @@ def test_no_org_id_header_on_regular_workspace(requests_mock): api_client = ApiClient(config) api_client.do("GET", "/api/2.0/test") - # Verify the X-Databricks-Org-Id header was NOT added - assert "X-Databricks-Org-Id" not in requests_mock.last_request.headers + # Verify the X-Databricks-Workspace-Id header was NOT added + assert "X-Databricks-Workspace-Id" not in requests_mock.last_request.headers def test_disable_oauth_refresh_token_from_env(monkeypatch, mocker): diff --git a/tests/test_files.py b/tests/test_files.py index 74986fde6..4b2a1ea97 100644 --- a/tests/test_files.py +++ b/tests/test_files.py @@ -926,7 +926,7 @@ def match_request_to_response( resp = requests.Response() resp.status_code = 200 resp._content = b"{}" - resp.headers["X-Databricks-Org-Id"] = "12345" + resp.headers["X-Databricks-Workspace-Id"] = "12345" resp.request = request resp.url = request.url return resp @@ -1478,7 +1478,7 @@ def custom_matcher(request: requests.Request) -> Optional[requests.Response]: resp = requests.Response() resp.status_code = 200 resp._content = b"{}" - resp.headers["X-Databricks-Org-Id"] = "12345" + resp.headers["X-Databricks-Workspace-Id"] = "12345" resp.request = request resp.url = request.url return resp From 370975af1c90c890c5f026a60ffad788d2a39af0 Mon Sep 17 00:00:00 2001 From: Divyansh Vijayvergia Date: Fri, 22 May 2026 14:16:28 +0000 Subject: [PATCH 3/3] Migrate newly-regenerated services to X-Databricks-Workspace-Id header Mechanical literal swap on services that picked up the old header literal after the most recent SDK regen (#1438): - new file: databricks/sdk/service/bundle.py (14 sites) - new methods in databricks/sdk/service/dashboards.py (1 site) - new methods in databricks/sdk/service/postgres.py (1 site) Symmetric 16/16 diff; no logic change. Signed-off-by: Divyansh Vijayvergia --- databricks/sdk/service/bundle.py | 28 ++++++++++++++-------------- databricks/sdk/service/dashboards.py | 2 +- databricks/sdk/service/postgres.py | 2 +- 3 files changed, 16 insertions(+), 16 deletions(-) diff --git a/databricks/sdk/service/bundle.py b/databricks/sdk/service/bundle.py index 734a793f6..f8f91edeb 100755 --- a/databricks/sdk/service/bundle.py +++ b/databricks/sdk/service/bundle.py @@ -702,7 +702,7 @@ def complete_version( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("POST", f"/api/2.0/bundle/{name}/complete", body=body, headers=headers) return Version.from_dict(res) @@ -733,7 +733,7 @@ def create_deployment(self, deployment: Deployment, deployment_id: str) -> Deplo cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("POST", "/api/2.0/bundle/deployments", query=query, body=body, headers=headers) return Deployment.from_dict(res) @@ -770,7 +770,7 @@ def create_operation(self, parent: str, operation: Operation, resource_key: str) cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("POST", f"/api/2.0/bundle/{parent}/operations", query=query, body=body, headers=headers) return Operation.from_dict(res) @@ -804,7 +804,7 @@ def create_version(self, parent: str, version: Version, version_id: str) -> Vers cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("POST", f"/api/2.0/bundle/{parent}/versions", query=query, body=body, headers=headers) return Version.from_dict(res) @@ -828,7 +828,7 @@ def delete_deployment(self, name: str): cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id self._api.do("DELETE", f"/api/2.0/bundle/{name}", headers=headers) @@ -847,7 +847,7 @@ def get_deployment(self, name: str) -> Deployment: cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("GET", f"/api/2.0/bundle/{name}", headers=headers) return Deployment.from_dict(res) @@ -868,7 +868,7 @@ def get_operation(self, name: str) -> Operation: cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("GET", f"/api/2.0/bundle/{name}", headers=headers) return Operation.from_dict(res) @@ -888,7 +888,7 @@ def get_resource(self, name: str) -> Resource: cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("GET", f"/api/2.0/bundle/{name}", headers=headers) return Resource.from_dict(res) @@ -908,7 +908,7 @@ def get_version(self, name: str) -> Version: cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("GET", f"/api/2.0/bundle/{name}", headers=headers) return Version.from_dict(res) @@ -933,7 +933,7 @@ def heartbeat(self, name: str) -> HeartbeatResponse: cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("POST", f"/api/2.0/bundle/{name}/heartbeat", headers=headers) return HeartbeatResponse.from_dict(res) @@ -965,7 +965,7 @@ def list_deployments( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id while True: json = self._api.do("GET", "/api/2.0/bundle/deployments", query=query, headers=headers) @@ -1005,7 +1005,7 @@ def list_operations( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id while True: json = self._api.do("GET", f"/api/2.0/bundle/{parent}/operations", query=query, headers=headers) @@ -1045,7 +1045,7 @@ def list_resources( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id while True: json = self._api.do("GET", f"/api/2.0/bundle/{parent}/resources", query=query, headers=headers) @@ -1085,7 +1085,7 @@ def list_versions( cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id while True: json = self._api.do("GET", f"/api/2.0/bundle/{parent}/versions", query=query, headers=headers) diff --git a/databricks/sdk/service/dashboards.py b/databricks/sdk/service/dashboards.py index 95742eebc..aba41a9b6 100755 --- a/databricks/sdk/service/dashboards.py +++ b/databricks/sdk/service/dashboards.py @@ -4076,7 +4076,7 @@ def revert(self, dashboard_id: str, *, etag: Optional[str] = None) -> RevertDash cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("POST", f"/api/2.0/lakeview/dashboards/{dashboard_id}/revert", body=body, headers=headers) return RevertDashboardResponse.from_dict(res) diff --git a/databricks/sdk/service/postgres.py b/databricks/sdk/service/postgres.py index 3c42a2b32..01b04847d 100755 --- a/databricks/sdk/service/postgres.py +++ b/databricks/sdk/service/postgres.py @@ -3819,7 +3819,7 @@ def undelete_branch(self, name: str) -> UndeleteBranchOperation: cfg = self._api._cfg if cfg.workspace_id: - headers["X-Databricks-Org-Id"] = cfg.workspace_id + headers["X-Databricks-Workspace-Id"] = cfg.workspace_id res = self._api.do("POST", f"/api/2.0/postgres/{name}/undelete", headers=headers) operation = Operation.from_dict(res)