diff --git a/NEXT_CHANGELOG.md b/NEXT_CHANGELOG.md index 2319a5a25..f68c7cca0 100644 --- a/NEXT_CHANGELOG.md +++ b/NEXT_CHANGELOG.md @@ -14,4 +14,6 @@ ### 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 diff --git a/databricks/sdk/config.py b/databricks/sdk/config.py index f1bb02e42..f3fd45949 100644 --- a/databricks/sdk/config.py +++ b/databricks/sdk/config.py @@ -91,6 +91,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 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 205b86bf0..a85f5e7a0 100644 --- a/databricks/sdk/mixins/workspace.py +++ b/databricks/sdk/mixins/workspace.py @@ -87,7 +87,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", @@ -120,6 +120,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/databricks/sdk/service/agentbricks.py b/databricks/sdk/service/agentbricks.py index cb4befa60..67465299f 100755 --- a/databricks/sdk/service/agentbricks.py +++ b/databricks/sdk/service/agentbricks.py @@ -215,7 +215,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) @@ -265,7 +265,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) @@ -285,7 +285,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) @@ -304,7 +304,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) @@ -325,7 +325,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) @@ -366,7 +366,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 5d21b3b80..068529e32 100755 --- a/databricks/sdk/service/apps.py +++ b/databricks/sdk/service/apps.py @@ -2955,7 +2955,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"]) @@ -2980,7 +2980,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) @@ -3020,7 +3020,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) @@ -3045,7 +3045,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) @@ -3065,7 +3065,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) @@ -3084,7 +3084,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) @@ -3112,7 +3112,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( @@ -3142,7 +3142,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) @@ -3164,7 +3164,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) @@ -3184,7 +3184,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) @@ -3204,7 +3204,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) @@ -3224,7 +3224,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) @@ -3244,7 +3244,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) @@ -3264,7 +3264,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) @@ -3297,7 +3297,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) @@ -3334,7 +3334,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) @@ -3367,7 +3367,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) @@ -3401,7 +3401,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) @@ -3424,7 +3424,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"]) @@ -3450,7 +3450,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"]) @@ -3478,7 +3478,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) @@ -3504,7 +3504,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) @@ -3531,7 +3531,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) @@ -3569,7 +3569,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) @@ -3828,7 +3828,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) @@ -3848,7 +3848,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) @@ -3868,7 +3868,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) @@ -3897,7 +3897,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) @@ -3928,7 +3928,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/bundle.py b/databricks/sdk/service/bundle.py index 2dec6ac38..2b90efda1 100755 --- a/databricks/sdk/service/bundle.py +++ b/databricks/sdk/service/bundle.py @@ -706,7 +706,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) @@ -737,7 +737,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) @@ -774,7 +774,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) @@ -808,7 +808,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) @@ -832,7 +832,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) @@ -851,7 +851,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) @@ -872,7 +872,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) @@ -892,7 +892,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) @@ -912,7 +912,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) @@ -937,7 +937,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) @@ -969,7 +969,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) @@ -1009,7 +1009,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) @@ -1049,7 +1049,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) @@ -1089,7 +1089,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/catalog.py b/databricks/sdk/service/catalog.py index 8b0619011..63a31e5a0 100755 --- a/databricks/sdk/service/catalog.py +++ b/databricks/sdk/service/catalog.py @@ -11513,7 +11513,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) @@ -11561,7 +11561,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 @@ -11646,7 +11646,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) @@ -11672,7 +11672,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) @@ -11698,7 +11698,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) @@ -11758,7 +11758,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 @@ -11833,7 +11833,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) @@ -11903,7 +11903,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) @@ -11923,7 +11923,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) @@ -11942,7 +11942,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) @@ -11979,7 +11979,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 @@ -12023,7 +12023,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) @@ -12110,7 +12110,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) @@ -12137,7 +12137,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) @@ -12173,7 +12173,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) @@ -12194,7 +12194,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) @@ -12248,7 +12248,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) @@ -12340,7 +12340,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) @@ -12414,7 +12414,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) @@ -12455,7 +12455,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) @@ -12488,7 +12488,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", @@ -12515,7 +12515,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", @@ -12556,7 +12556,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( @@ -12618,7 +12618,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", @@ -12661,7 +12661,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) @@ -12684,7 +12684,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) @@ -12729,7 +12729,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) @@ -12772,7 +12772,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 @@ -12881,7 +12881,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) @@ -12907,7 +12907,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) @@ -12933,7 +12933,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) @@ -12989,7 +12989,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 @@ -13105,7 +13105,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) @@ -13141,7 +13141,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) @@ -13161,7 +13161,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) @@ -13180,7 +13180,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) @@ -13213,7 +13213,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) @@ -13260,7 +13260,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 @@ -13303,7 +13303,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) @@ -13331,7 +13331,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) @@ -13362,7 +13362,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) @@ -13424,7 +13424,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 @@ -13464,7 +13464,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) @@ -13537,7 +13537,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 @@ -13600,7 +13600,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", @@ -13635,7 +13635,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 @@ -13687,7 +13687,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) @@ -13732,7 +13732,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) @@ -13750,7 +13750,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) @@ -13775,7 +13775,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) @@ -13795,7 +13795,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) @@ -13836,7 +13836,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 @@ -13863,7 +13863,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) @@ -13888,7 +13888,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 @@ -13959,7 +13959,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) @@ -13995,7 +13995,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) @@ -14031,7 +14031,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) @@ -14073,7 +14073,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 @@ -14106,7 +14106,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 @@ -14167,7 +14167,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( @@ -14297,7 +14297,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 @@ -14360,7 +14360,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( @@ -14387,7 +14387,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) @@ -14406,7 +14406,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) @@ -14441,7 +14441,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) @@ -14465,7 +14465,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", @@ -14493,7 +14493,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", @@ -14548,7 +14548,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( @@ -14606,7 +14606,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", @@ -14650,7 +14650,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 @@ -14765,7 +14765,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) @@ -14797,7 +14797,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) @@ -14828,7 +14828,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) @@ -14858,7 +14858,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 @@ -14889,7 +14889,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) @@ -14928,7 +14928,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 @@ -14960,7 +14960,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) @@ -15065,7 +15065,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) @@ -15197,7 +15197,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) @@ -15219,7 +15219,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) @@ -15242,7 +15242,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) @@ -15277,7 +15277,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) @@ -15352,7 +15352,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) @@ -15390,7 +15390,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 @@ -15495,7 +15495,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) @@ -15533,7 +15533,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", @@ -15571,7 +15571,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( @@ -15623,7 +15623,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) @@ -15650,7 +15650,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) @@ -15697,7 +15697,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) @@ -15756,7 +15756,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) @@ -15782,7 +15782,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) @@ -15808,7 +15808,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) @@ -15864,7 +15864,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 @@ -15926,7 +15926,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) @@ -15967,7 +15967,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) @@ -15990,7 +15990,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) @@ -16022,7 +16022,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) @@ -16084,7 +16084,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) @@ -16128,7 +16128,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 @@ -16219,7 +16219,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) @@ -16246,7 +16246,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) @@ -16266,7 +16266,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) @@ -16318,7 +16318,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 @@ -16416,7 +16416,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) @@ -16492,7 +16492,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) @@ -16523,7 +16523,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 @@ -16553,7 +16553,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", @@ -16599,7 +16599,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 @@ -16659,7 +16659,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) @@ -16696,7 +16696,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) @@ -16787,7 +16787,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) @@ -16810,7 +16810,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) @@ -16834,7 +16834,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) @@ -16879,7 +16879,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) @@ -16964,7 +16964,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 @@ -17041,7 +17041,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) @@ -17076,7 +17076,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) @@ -17143,7 +17143,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) @@ -17196,7 +17196,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) @@ -17249,7 +17249,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) @@ -17332,7 +17332,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) @@ -17354,7 +17354,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) @@ -17424,7 +17424,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) @@ -17460,7 +17460,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) @@ -17502,7 +17502,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) @@ -17543,7 +17543,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) @@ -17593,7 +17593,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 @@ -17643,7 +17643,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 @@ -17688,7 +17688,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 7d08b33a8..546bbc7c4 100755 --- a/databricks/sdk/service/cleanrooms.py +++ b/databricks/sdk/service/cleanrooms.py @@ -1418,7 +1418,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", @@ -1463,7 +1463,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( @@ -1510,7 +1510,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) @@ -1546,7 +1546,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", @@ -1575,7 +1575,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 @@ -1600,7 +1600,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 @@ -1627,7 +1627,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) @@ -1673,7 +1673,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", @@ -1711,7 +1711,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 @@ -1733,7 +1733,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) @@ -1752,7 +1752,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 @@ -1784,7 +1784,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) @@ -1940,7 +1940,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( @@ -1971,7 +1971,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 @@ -1995,7 +1995,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) @@ -2013,7 +2013,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) @@ -2041,7 +2041,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) @@ -2075,7 +2075,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 404520467..c81b7e57c 100755 --- a/databricks/sdk/service/compute.py +++ b/databricks/sdk/service/compute.py @@ -7976,7 +7976,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) @@ -8000,7 +8000,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) @@ -8078,7 +8078,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) @@ -8100,7 +8100,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) @@ -8120,7 +8120,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 @@ -8143,7 +8143,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) @@ -8174,7 +8174,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 @@ -8203,7 +8203,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 @@ -8233,7 +8233,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 @@ -8357,7 +8357,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) @@ -8632,7 +8632,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( @@ -8742,7 +8742,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) @@ -9018,7 +9018,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) @@ -9175,7 +9175,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) @@ -9205,7 +9205,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) @@ -9225,7 +9225,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) @@ -9245,7 +9245,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) @@ -9290,7 +9290,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) @@ -9314,7 +9314,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) @@ -9333,7 +9333,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) @@ -9361,7 +9361,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) @@ -9384,7 +9384,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) @@ -9428,7 +9428,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) @@ -9468,7 +9468,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) @@ -9501,7 +9501,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) @@ -9519,7 +9519,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) @@ -9549,7 +9549,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) @@ -9577,7 +9577,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) @@ -9630,7 +9630,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) @@ -9667,7 +9667,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) @@ -9819,7 +9819,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( @@ -9864,7 +9864,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) @@ -9889,7 +9889,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) @@ -9922,7 +9922,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( @@ -9958,7 +9958,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) @@ -10003,7 +10003,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( @@ -10081,7 +10081,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) @@ -10101,7 +10101,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) @@ -10120,7 +10120,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) @@ -10140,7 +10140,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 @@ -10190,7 +10190,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) @@ -10334,7 +10334,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) @@ -10358,7 +10358,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) @@ -10440,7 +10440,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) @@ -10462,7 +10462,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) @@ -10482,7 +10482,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 @@ -10505,7 +10505,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) @@ -10523,7 +10523,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 @@ -10552,7 +10552,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) @@ -10580,7 +10580,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 @@ -10652,7 +10652,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) @@ -10709,7 +10709,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) @@ -10728,7 +10728,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 @@ -10756,7 +10756,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) @@ -10793,7 +10793,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 @@ -10821,7 +10821,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 @@ -10851,7 +10851,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) @@ -10879,7 +10879,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) @@ -10933,7 +10933,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) @@ -10957,7 +10957,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) @@ -10993,7 +10993,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) @@ -11039,7 +11039,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) @@ -11067,7 +11067,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 e36168543..6ed0116fc 100755 --- a/databricks/sdk/service/dashboards.py +++ b/databricks/sdk/service/dashboards.py @@ -2586,7 +2586,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", @@ -2636,7 +2636,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", @@ -2692,7 +2692,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) @@ -2714,7 +2714,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) @@ -2737,7 +2737,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", @@ -2770,7 +2770,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", @@ -2802,7 +2802,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", @@ -2854,7 +2854,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", @@ -2887,7 +2887,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) @@ -2911,7 +2911,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 @@ -2934,7 +2934,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) @@ -2967,7 +2967,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 @@ -3000,7 +3000,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) @@ -3062,7 +3062,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", @@ -3091,7 +3091,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", @@ -3124,7 +3124,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", @@ -3155,7 +3155,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", @@ -3188,7 +3188,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", @@ -3218,7 +3218,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) @@ -3251,7 +3251,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", @@ -3289,7 +3289,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", @@ -3335,7 +3335,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) @@ -3376,7 +3376,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", @@ -3410,7 +3410,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) @@ -3452,7 +3452,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", @@ -3484,7 +3484,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 @@ -3515,7 +3515,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) @@ -3574,7 +3574,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) @@ -3618,7 +3618,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) @@ -3643,7 +3643,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) @@ -3670,7 +3670,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", @@ -3703,7 +3703,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", @@ -3739,7 +3739,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", @@ -3763,7 +3763,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) @@ -3783,7 +3783,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) @@ -3805,7 +3805,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 @@ -3831,7 +3831,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", @@ -3879,7 +3879,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) @@ -3917,7 +3917,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( @@ -3959,7 +3959,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( @@ -4014,7 +4014,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) @@ -4047,7 +4047,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) @@ -4075,7 +4075,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) @@ -4095,7 +4095,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) @@ -4114,7 +4114,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) @@ -4156,7 +4156,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 0cda03380..32d316bff 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) @@ -1634,7 +1634,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( @@ -1675,7 +1675,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 @@ -1700,7 +1700,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) @@ -1722,7 +1722,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) @@ -1741,7 +1741,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) @@ -1771,7 +1771,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) @@ -1805,7 +1805,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 @@ -1825,7 +1825,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) @@ -1848,7 +1848,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) @@ -1870,7 +1870,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) @@ -1913,7 +1913,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) @@ -1932,7 +1932,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) @@ -1952,7 +1952,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) @@ -1972,7 +1972,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) @@ -1991,7 +1991,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) @@ -2010,7 +2010,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) @@ -2041,7 +2041,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( @@ -2081,7 +2081,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( @@ -2118,7 +2118,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) @@ -2155,7 +2155,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( @@ -2194,7 +2194,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) @@ -2225,7 +2225,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) @@ -2256,7 +2256,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 78dcbd3e7..906b6b1c3 100755 --- a/databricks/sdk/service/dataclassification.py +++ b/databricks/sdk/service/dataclassification.py @@ -173,7 +173,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) @@ -193,7 +193,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) @@ -212,7 +212,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) @@ -244,7 +244,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 c84c47335..675d8e398 100644 --- a/databricks/sdk/service/dataquality.py +++ b/databricks/sdk/service/dataquality.py @@ -893,7 +893,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", @@ -934,7 +934,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) @@ -977,7 +977,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 @@ -1023,7 +1023,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) @@ -1056,7 +1056,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 @@ -1102,7 +1102,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) @@ -1146,7 +1146,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 @@ -1173,7 +1173,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) @@ -1230,7 +1230,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( @@ -1292,7 +1292,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 @@ -1339,7 +1339,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 578696f37..2afe4727a 100755 --- a/databricks/sdk/service/environments.py +++ b/databricks/sdk/service/environments.py @@ -511,7 +511,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 @@ -537,7 +537,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) @@ -558,7 +558,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) @@ -578,7 +578,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) @@ -599,7 +599,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) @@ -640,7 +640,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) @@ -671,7 +671,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) @@ -710,7 +710,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) @@ -740,7 +740,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 33c437798..2f0f6c967 100755 --- a/databricks/sdk/service/files.py +++ b/databricks/sdk/service/files.py @@ -477,7 +477,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) @@ -501,7 +501,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) @@ -535,7 +535,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) @@ -577,7 +577,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) @@ -600,7 +600,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) @@ -631,7 +631,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 @@ -659,7 +659,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) @@ -689,7 +689,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) @@ -729,7 +729,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) @@ -766,7 +766,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) @@ -807,7 +807,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 @@ -826,7 +826,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) @@ -846,7 +846,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 @@ -868,7 +868,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", @@ -903,7 +903,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 @@ -922,7 +922,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", @@ -977,7 +977,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( @@ -1018,7 +1018,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 dc03e780f..3942c3fda 100755 --- a/databricks/sdk/service/iam.py +++ b/databricks/sdk/service/iam.py @@ -2202,7 +2202,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) @@ -2356,7 +2356,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 @@ -2403,7 +2403,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) @@ -2431,7 +2431,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) @@ -3248,7 +3248,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) @@ -3328,7 +3328,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) @@ -3346,7 +3346,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) @@ -3365,7 +3365,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) @@ -3427,7 +3427,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: @@ -3465,7 +3465,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) @@ -3530,7 +3530,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) @@ -3579,7 +3579,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) @@ -3634,7 +3634,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) @@ -3659,7 +3659,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 @@ -3700,7 +3700,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 @@ -3740,7 +3740,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 @@ -3822,7 +3822,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) @@ -3840,7 +3840,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) @@ -3859,7 +3859,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) @@ -3921,7 +3921,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: @@ -3959,7 +3959,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) @@ -4027,7 +4027,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) @@ -4124,7 +4124,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) @@ -4143,7 +4143,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) @@ -4208,7 +4208,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) @@ -4226,7 +4226,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) @@ -4244,7 +4244,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) @@ -4307,7 +4307,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: @@ -4345,7 +4345,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) @@ -4370,7 +4370,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) @@ -4450,7 +4450,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) @@ -4474,7 +4474,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) @@ -5551,7 +5551,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) @@ -5568,7 +5568,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) @@ -5586,7 +5586,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) @@ -5647,7 +5647,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() @@ -5688,7 +5688,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) @@ -5750,7 +5750,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) @@ -5827,7 +5827,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) @@ -5844,7 +5844,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) @@ -5862,7 +5862,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) @@ -5923,7 +5923,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() @@ -5964,7 +5964,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) @@ -6029,7 +6029,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) @@ -6124,7 +6124,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) @@ -6142,7 +6142,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) @@ -6206,7 +6206,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) @@ -6223,7 +6223,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) @@ -6240,7 +6240,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) @@ -6302,7 +6302,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() @@ -6343,7 +6343,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) @@ -6366,7 +6366,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) @@ -6443,7 +6443,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) @@ -6465,7 +6465,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 2bbd8c1ff..18ab8fc3e 100755 --- a/databricks/sdk/service/iamv2.py +++ b/databricks/sdk/service/iamv2.py @@ -837,7 +837,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) @@ -860,7 +860,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) @@ -891,7 +891,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 @@ -914,7 +914,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) @@ -945,7 +945,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) @@ -971,7 +971,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) @@ -997,7 +997,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 @@ -1025,7 +1025,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) @@ -1059,7 +1059,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 0880526d4..eab19ae5d 100755 --- a/databricks/sdk/service/jobs.py +++ b/databricks/sdk/service/jobs.py @@ -8912,7 +8912,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) @@ -8937,7 +8937,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) @@ -9139,7 +9139,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) @@ -9162,7 +9162,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) @@ -9184,7 +9184,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) @@ -9210,7 +9210,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) @@ -9251,7 +9251,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) @@ -9271,7 +9271,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) @@ -9291,7 +9291,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) @@ -9341,7 +9341,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) @@ -9371,7 +9371,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) @@ -9422,7 +9422,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) @@ -9509,7 +9509,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) @@ -9682,7 +9682,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( @@ -9755,7 +9755,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) @@ -9925,7 +9925,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( @@ -9993,7 +9993,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) @@ -10121,7 +10121,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( @@ -10207,7 +10207,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) @@ -10233,7 +10233,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) @@ -10281,7 +10281,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) @@ -10306,7 +10306,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) @@ -10343,7 +10343,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 93d328a9b..417456921 100755 --- a/databricks/sdk/service/knowledgeassistants.py +++ b/databricks/sdk/service/knowledgeassistants.py @@ -822,7 +822,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) @@ -845,7 +845,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) @@ -870,7 +870,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) @@ -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) @@ -911,7 +911,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) @@ -931,7 +931,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) @@ -951,7 +951,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) @@ -971,7 +971,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) @@ -992,7 +992,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) @@ -1012,7 +1012,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", @@ -1037,7 +1037,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 @@ -1072,7 +1072,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) @@ -1109,7 +1109,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) @@ -1144,7 +1144,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) @@ -1181,7 +1181,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 @@ -1204,7 +1204,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) @@ -1233,7 +1233,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) @@ -1267,7 +1267,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) @@ -1302,7 +1302,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) @@ -1333,7 +1333,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 6396fcc77..64b270044 100755 --- a/databricks/sdk/service/marketplace.py +++ b/databricks/sdk/service/marketplace.py @@ -2949,7 +2949,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( @@ -2988,7 +2988,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( @@ -3049,7 +3049,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 @@ -3071,7 +3071,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", @@ -3101,7 +3101,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) @@ -3135,7 +3135,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( @@ -3184,7 +3184,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", @@ -3219,7 +3219,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) @@ -3238,7 +3238,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) @@ -3303,7 +3303,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) @@ -3368,7 +3368,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) @@ -3438,7 +3438,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", @@ -3463,7 +3463,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 @@ -3492,7 +3492,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( @@ -3529,7 +3529,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) @@ -3548,7 +3548,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) @@ -3578,7 +3578,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) @@ -3614,7 +3614,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) @@ -3633,7 +3633,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) @@ -3662,7 +3662,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) @@ -3692,7 +3692,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) @@ -3725,7 +3725,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) @@ -3748,7 +3748,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) @@ -3767,7 +3767,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) @@ -3785,7 +3785,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) @@ -3803,7 +3803,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) @@ -3828,7 +3828,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) @@ -3864,7 +3864,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( @@ -3902,7 +3902,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( @@ -3934,7 +3934,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) @@ -3980,7 +3980,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) @@ -3999,7 +3999,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) @@ -4017,7 +4017,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) @@ -4047,7 +4047,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) @@ -4084,7 +4084,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) @@ -4103,7 +4103,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) @@ -4121,7 +4121,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) @@ -4146,7 +4146,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) @@ -4176,7 +4176,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) @@ -4212,7 +4212,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( @@ -4259,7 +4259,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", @@ -4290,7 +4290,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) @@ -4308,7 +4308,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) @@ -4326,7 +4326,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) @@ -4353,7 +4353,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) @@ -4383,7 +4383,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) @@ -4402,7 +4402,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) @@ -4420,7 +4420,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) @@ -4445,7 +4445,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) @@ -4475,7 +4475,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 bec83e273..388676f10 100755 --- a/databricks/sdk/service/ml.py +++ b/databricks/sdk/service/ml.py @@ -7280,7 +7280,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) @@ -7333,7 +7333,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) @@ -7384,7 +7384,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) @@ -7409,7 +7409,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) @@ -7428,7 +7428,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) @@ -7449,7 +7449,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) @@ -7472,7 +7472,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) @@ -7509,7 +7509,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) @@ -7538,7 +7538,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) @@ -7564,7 +7564,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) @@ -7593,7 +7593,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) @@ -7616,7 +7616,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) @@ -7665,7 +7665,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) @@ -7691,7 +7691,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) @@ -7711,7 +7711,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) @@ -7731,7 +7731,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) @@ -7762,7 +7762,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) @@ -7813,7 +7813,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) @@ -7858,7 +7858,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) @@ -7949,7 +7949,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) @@ -7982,7 +7982,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) @@ -8009,7 +8009,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) @@ -8081,7 +8081,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) @@ -8111,7 +8111,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) @@ -8138,7 +8138,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) @@ -8176,7 +8176,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) @@ -8203,7 +8203,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) @@ -8228,7 +8228,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) @@ -8265,7 +8265,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) @@ -8315,7 +8315,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) @@ -8381,7 +8381,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) @@ -8449,7 +8449,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) @@ -8487,7 +8487,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) @@ -8512,7 +8512,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) @@ -8539,7 +8539,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) @@ -8576,7 +8576,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) @@ -8603,7 +8603,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) @@ -8629,7 +8629,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) @@ -8678,7 +8678,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) @@ -8711,7 +8711,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 @@ -8736,7 +8736,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) @@ -8759,7 +8759,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) @@ -8782,7 +8782,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) @@ -8802,7 +8802,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) @@ -8822,7 +8822,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) @@ -8841,7 +8841,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 @@ -8862,7 +8862,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) @@ -8883,7 +8883,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) @@ -8903,7 +8903,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 @@ -8942,7 +8942,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) @@ -8978,7 +8978,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( @@ -9021,7 +9021,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( @@ -9060,7 +9060,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 @@ -9094,7 +9094,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", @@ -9132,7 +9132,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", @@ -9173,7 +9173,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) @@ -9193,7 +9193,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) @@ -9212,7 +9212,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) @@ -9231,7 +9231,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) @@ -9260,7 +9260,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) @@ -9292,7 +9292,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 @@ -9323,7 +9323,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 @@ -9491,7 +9491,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( @@ -9557,7 +9557,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) @@ -9589,7 +9589,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", @@ -9618,7 +9618,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", @@ -9643,7 +9643,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", @@ -9668,7 +9668,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", @@ -9703,7 +9703,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( @@ -9751,7 +9751,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", @@ -9820,7 +9820,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) @@ -9853,7 +9853,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) @@ -9888,7 +9888,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) @@ -9943,7 +9943,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) @@ -9989,7 +9989,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) @@ -10076,7 +10076,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) @@ -10099,7 +10099,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) @@ -10121,7 +10121,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) @@ -10148,7 +10148,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) @@ -10174,7 +10174,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) @@ -10205,7 +10205,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) @@ -10254,7 +10254,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) @@ -10277,7 +10277,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) @@ -10304,7 +10304,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 @@ -10332,7 +10332,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) @@ -10359,7 +10359,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) @@ -10386,7 +10386,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) @@ -10406,7 +10406,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 @@ -10429,7 +10429,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) @@ -10456,7 +10456,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) @@ -10489,7 +10489,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 @@ -10562,7 +10562,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) @@ -10614,7 +10614,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) @@ -10642,7 +10642,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) @@ -10687,7 +10687,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) @@ -10739,7 +10739,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) @@ -10780,7 +10780,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) @@ -10818,7 +10818,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) @@ -10848,7 +10848,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 @@ -10881,7 +10881,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) @@ -10934,7 +10934,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 @@ -10964,7 +10964,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) @@ -10992,7 +10992,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) @@ -11026,7 +11026,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) @@ -11057,7 +11057,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 @@ -11136,7 +11136,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 3de94fc74..9829d8603 100755 --- a/databricks/sdk/service/oauth2.py +++ b/databricks/sdk/service/oauth2.py @@ -1839,7 +1839,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", @@ -1864,7 +1864,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", @@ -1903,7 +1903,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 3281820bd..6ad0b8b4d 100755 --- a/databricks/sdk/service/pipelines.py +++ b/databricks/sdk/service/pipelines.py @@ -4964,7 +4964,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) @@ -5156,7 +5156,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) @@ -5341,7 +5341,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) @@ -5372,7 +5372,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) @@ -5390,7 +5390,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) @@ -5410,7 +5410,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) @@ -5430,7 +5430,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) @@ -5452,7 +5452,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) @@ -5507,7 +5507,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) @@ -5565,7 +5565,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) @@ -5611,7 +5611,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) @@ -5639,7 +5639,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) @@ -5717,7 +5717,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) @@ -5739,7 +5739,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) @@ -5931,7 +5931,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) @@ -5957,7 +5957,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 579f56af4..2594c494d 100755 --- a/databricks/sdk/service/postgres.py +++ b/databricks/sdk/service/postgres.py @@ -2994,7 +2994,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) @@ -3022,7 +3022,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) @@ -3062,7 +3062,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) @@ -3101,7 +3101,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) @@ -3132,7 +3132,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) @@ -3168,7 +3168,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) @@ -3204,7 +3204,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) @@ -3230,7 +3230,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) @@ -3253,7 +3253,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) @@ -3275,7 +3275,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) @@ -3297,7 +3297,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) @@ -3323,7 +3323,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) @@ -3353,7 +3353,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) @@ -3375,7 +3375,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) @@ -3407,7 +3407,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) @@ -3427,7 +3427,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) @@ -3449,7 +3449,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) @@ -3470,7 +3470,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) @@ -3492,7 +3492,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) @@ -3512,7 +3512,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) @@ -3532,7 +3532,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) @@ -3554,7 +3554,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) @@ -3575,7 +3575,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) @@ -3616,7 +3616,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) @@ -3654,7 +3654,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) @@ -3692,7 +3692,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) @@ -3732,7 +3732,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) @@ -3769,7 +3769,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) @@ -3796,7 +3796,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) @@ -3818,7 +3818,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) @@ -3853,7 +3853,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) @@ -3887,7 +3887,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) @@ -3922,7 +3922,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) @@ -3954,7 +3954,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) @@ -3989,7 +3989,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 ad8d2395a..544c339d7 100755 --- a/databricks/sdk/service/qualitymonitorv2.py +++ b/databricks/sdk/service/qualitymonitorv2.py @@ -333,7 +333,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) @@ -356,7 +356,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) @@ -378,7 +378,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) @@ -406,7 +406,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) @@ -441,7 +441,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 94a2952e6..79917b1cf 100755 --- a/databricks/sdk/service/serving.py +++ b/databricks/sdk/service/serving.py @@ -4102,7 +4102,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 @@ -4177,7 +4177,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( @@ -4263,7 +4263,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( @@ -4304,7 +4304,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) @@ -4324,7 +4324,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) @@ -4344,7 +4344,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) @@ -4365,7 +4365,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) @@ -4385,7 +4385,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 @@ -4408,7 +4408,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) @@ -4470,7 +4470,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) @@ -4488,7 +4488,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 @@ -4511,7 +4511,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 @@ -4545,7 +4545,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) @@ -4571,7 +4571,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) @@ -4626,7 +4626,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) @@ -4743,7 +4743,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", @@ -4783,7 +4783,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 @@ -4838,7 +4838,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( @@ -4889,7 +4889,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) @@ -4920,7 +4920,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 @@ -4953,7 +4953,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( @@ -5120,7 +5120,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 182e5dc2d..1dc38301c 100755 --- a/databricks/sdk/service/settings.py +++ b/databricks/sdk/service/settings.py @@ -6543,7 +6543,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", @@ -6576,7 +6576,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 @@ -6619,7 +6619,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 @@ -6657,7 +6657,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", @@ -6689,7 +6689,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", @@ -6736,7 +6736,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", @@ -6776,7 +6776,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 @@ -6822,7 +6822,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 @@ -6861,7 +6861,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 @@ -6907,7 +6907,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 @@ -6961,7 +6961,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) @@ -7079,7 +7079,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", @@ -7111,7 +7111,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 @@ -7154,7 +7154,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 @@ -7202,7 +7202,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 @@ -7231,7 +7231,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 @@ -7277,7 +7277,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 @@ -7314,7 +7314,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 @@ -7343,7 +7343,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 @@ -7384,7 +7384,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 @@ -7424,7 +7424,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 @@ -7453,7 +7453,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 @@ -7494,7 +7494,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 @@ -7537,7 +7537,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 @@ -7566,7 +7566,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 @@ -7607,7 +7607,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 @@ -7742,7 +7742,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) @@ -7784,7 +7784,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 @@ -7916,7 +7916,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 @@ -7960,7 +7960,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 @@ -7987,7 +7987,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) @@ -8029,7 +8029,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 @@ -8070,7 +8070,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 @@ -8116,7 +8116,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 @@ -8265,7 +8265,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) @@ -8283,7 +8283,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) @@ -8302,7 +8302,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) @@ -8320,7 +8320,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 @@ -8373,7 +8373,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) @@ -8428,7 +8428,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) @@ -8616,7 +8616,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 @@ -8645,7 +8645,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 @@ -8688,7 +8688,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 @@ -9134,7 +9134,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) @@ -9153,7 +9153,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) @@ -9171,7 +9171,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) @@ -9198,7 +9198,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) @@ -9237,7 +9237,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) @@ -9391,7 +9391,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 @@ -9420,7 +9420,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 @@ -9466,7 +9466,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 @@ -9607,7 +9607,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 @@ -9636,7 +9636,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 @@ -9677,7 +9677,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 @@ -9729,7 +9729,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) @@ -9747,7 +9747,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) @@ -9766,7 +9766,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) @@ -9784,7 +9784,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) @@ -9802,7 +9802,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) @@ -9831,7 +9831,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 @@ -9858,7 +9858,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) @@ -9883,7 +9883,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) @@ -9933,7 +9933,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) @@ -9959,7 +9959,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) @@ -9976,7 +9976,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 @@ -10019,7 +10019,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) @@ -10048,7 +10048,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 @@ -10062,7 +10062,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 9ab7a346e..889f364cb 100755 --- a/databricks/sdk/service/settingsv2.py +++ b/databricks/sdk/service/settingsv2.py @@ -1204,7 +1204,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) @@ -1241,7 +1241,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) @@ -1276,7 +1276,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 64851c41c..262a0634b 100755 --- a/databricks/sdk/service/sharing.py +++ b/databricks/sdk/service/sharing.py @@ -2466,7 +2466,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) @@ -2485,7 +2485,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) @@ -2505,7 +2505,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) @@ -2552,7 +2552,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 @@ -2609,7 +2609,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 @@ -2650,7 +2650,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 @@ -2707,7 +2707,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) @@ -2740,7 +2740,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 @@ -2761,7 +2761,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 @@ -2833,7 +2833,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 @@ -2858,7 +2858,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 @@ -2882,7 +2882,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 @@ -2914,7 +2914,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( @@ -3022,7 +3022,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) @@ -3040,7 +3040,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) @@ -3060,7 +3060,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) @@ -3107,7 +3107,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 @@ -3144,7 +3144,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) @@ -3182,7 +3182,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 @@ -3249,7 +3249,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) @@ -3292,7 +3292,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) @@ -3310,7 +3310,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) @@ -3335,7 +3335,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) @@ -3372,7 +3372,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 @@ -3418,7 +3418,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) @@ -3483,7 +3483,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) @@ -3523,7 +3523,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 7ddfa6316..a9d30d59e 100755 --- a/databricks/sdk/service/sql.py +++ b/databricks/sdk/service/sql.py @@ -7557,7 +7557,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) @@ -7578,7 +7578,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) @@ -7596,7 +7596,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) @@ -7624,7 +7624,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) @@ -7678,7 +7678,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) @@ -7746,7 +7746,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) @@ -7770,7 +7770,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) @@ -7792,7 +7792,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) @@ -7814,7 +7814,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] @@ -7856,7 +7856,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) @@ -7884,7 +7884,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) @@ -7903,7 +7903,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) @@ -7928,7 +7928,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) @@ -7960,7 +7960,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) @@ -7995,7 +7995,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) @@ -8051,7 +8051,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) @@ -8071,7 +8071,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) @@ -8121,7 +8121,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) @@ -8160,7 +8160,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) @@ -8182,7 +8182,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) @@ -8231,7 +8231,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: @@ -8261,7 +8261,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) @@ -8307,7 +8307,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) @@ -8348,7 +8348,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] @@ -8395,7 +8395,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) @@ -8433,7 +8433,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 @@ -8470,7 +8470,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", @@ -8514,7 +8514,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) @@ -8535,7 +8535,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) @@ -8553,7 +8553,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) @@ -8581,7 +8581,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) @@ -8615,7 +8615,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) @@ -8669,7 +8669,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) @@ -8761,7 +8761,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) @@ -8785,7 +8785,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) @@ -8808,7 +8808,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) @@ -8869,7 +8869,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: @@ -8900,7 +8900,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) @@ -8970,7 +8970,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) @@ -9029,7 +9029,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) @@ -9060,7 +9060,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) @@ -9079,7 +9079,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) @@ -9116,7 +9116,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) @@ -9176,7 +9176,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) @@ -9201,7 +9201,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) @@ -9266,7 +9266,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) @@ -9291,7 +9291,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) @@ -9400,7 +9400,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) @@ -9635,7 +9635,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) @@ -9663,7 +9663,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) @@ -9691,7 +9691,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 @@ -9880,7 +9880,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( @@ -9949,7 +9949,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 @@ -9971,7 +9971,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) @@ -9993,7 +9993,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) @@ -10113,7 +10113,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) @@ -10169,7 +10169,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) @@ -10193,7 +10193,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) @@ -10213,7 +10213,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) @@ -10234,7 +10234,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) @@ -10252,7 +10252,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) @@ -10290,7 +10290,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) @@ -10332,7 +10332,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) @@ -10366,7 +10366,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) @@ -10444,7 +10444,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) @@ -10465,7 +10465,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) @@ -10490,7 +10490,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) @@ -10540,7 +10540,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) @@ -10568,7 +10568,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 39f081dd4..833c88769 100755 --- a/databricks/sdk/service/supervisoragents.py +++ b/databricks/sdk/service/supervisoragents.py @@ -821,7 +821,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) @@ -844,7 +844,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) @@ -876,7 +876,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) @@ -897,7 +897,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) @@ -916,7 +916,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) @@ -935,7 +935,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) @@ -955,7 +955,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) @@ -975,7 +975,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 @@ -998,7 +998,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) @@ -1018,7 +1018,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) @@ -1038,7 +1038,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) @@ -1071,7 +1071,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) @@ -1108,7 +1108,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) @@ -1143,7 +1143,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) @@ -1180,7 +1180,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 @@ -1212,7 +1212,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) @@ -1243,7 +1243,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 @@ -1277,7 +1277,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) @@ -1307,7 +1307,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 e07bd0c78..42a216e47 100755 --- a/databricks/sdk/service/tags.py +++ b/databricks/sdk/service/tags.py @@ -255,7 +255,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) @@ -277,7 +277,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) @@ -300,7 +300,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) @@ -336,7 +336,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) @@ -382,7 +382,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) @@ -411,7 +411,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) @@ -436,7 +436,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 @@ -462,7 +462,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 @@ -498,7 +498,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( @@ -549,7 +549,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 113af521c..54c2e8ef2 100755 --- a/databricks/sdk/service/vectorsearch.py +++ b/databricks/sdk/service/vectorsearch.py @@ -2038,7 +2038,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( @@ -2080,7 +2080,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) @@ -2099,7 +2099,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) @@ -2119,7 +2119,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 @@ -2142,7 +2142,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) @@ -2165,7 +2165,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) @@ -2197,7 +2197,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) @@ -2248,7 +2248,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) @@ -2276,7 +2276,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 @@ -2306,7 +2306,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 @@ -2336,7 +2336,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 @@ -2366,7 +2366,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 @@ -2438,7 +2438,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) @@ -2463,7 +2463,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 @@ -2485,7 +2485,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) @@ -2511,7 +2511,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) @@ -2538,7 +2538,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) @@ -2626,7 +2626,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) @@ -2659,7 +2659,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 @@ -2694,7 +2694,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) @@ -2714,7 +2714,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) @@ -2739,7 +2739,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 28c11f780..e265462c4 100755 --- a/databricks/sdk/service/workspace.py +++ b/databricks/sdk/service/workspace.py @@ -1792,7 +1792,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) @@ -1818,7 +1818,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) @@ -1843,7 +1843,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) @@ -1867,7 +1867,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 @@ -1943,7 +1943,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) @@ -2002,7 +2002,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) @@ -2022,7 +2022,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) @@ -2041,7 +2041,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) @@ -2061,7 +2061,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) @@ -2081,7 +2081,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) @@ -2112,7 +2112,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) @@ -2146,7 +2146,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) @@ -2191,7 +2191,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) @@ -2217,7 +2217,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) @@ -2305,7 +2305,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) @@ -2343,7 +2343,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) @@ -2375,7 +2375,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) @@ -2414,7 +2414,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) @@ -2452,7 +2452,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) @@ -2502,7 +2502,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) @@ -2537,7 +2537,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 @@ -2565,7 +2565,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 @@ -2602,7 +2602,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 @@ -2661,7 +2661,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) @@ -2719,7 +2719,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) @@ -2765,7 +2765,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) @@ -2806,7 +2806,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) @@ -2832,7 +2832,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", @@ -2861,7 +2861,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 @@ -2887,7 +2887,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) @@ -2953,7 +2953,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) @@ -2980,7 +2980,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 @@ -3011,7 +3011,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) @@ -3047,7 +3047,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 @@ -3085,7 +3085,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 56bb6a08e..a62413735 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", @@ -176,7 +176,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", @@ -247,7 +247,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 f0c064a54..33f0123a1 100755 --- a/tests/databricks/sdk/service/idempotencytesting.py +++ b/tests/databricks/sdk/service/idempotencytesting.py @@ -63,7 +63,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 06ef357e6..b568bf2ae 100755 --- a/tests/databricks/sdk/service/jsonmarshallv2.py +++ b/tests/databricks/sdk/service/jsonmarshallv2.py @@ -488,7 +488,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 c21d9dd4f..3fc335eea 100755 --- a/tests/databricks/sdk/service/lrotesting.py +++ b/tests/databricks/sdk/service/lrotesting.py @@ -302,7 +302,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) @@ -324,7 +324,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) @@ -337,7 +337,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) @@ -350,7 +350,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) @@ -370,7 +370,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) diff --git a/tests/integration/test_unified_profile.py b/tests/integration/test_unified_profile.py index 283120376..818be1b8c 100644 --- a/tests/integration/test_unified_profile.py +++ b/tests/integration/test_unified_profile.py @@ -1,4 +1,8 @@ +from urllib.parse import urlparse + import pytest +from requests.adapters import HTTPAdapter +from requests.structures import CaseInsensitiveDict from databricks.sdk import AccountClient, WorkspaceClient from databricks.sdk.environments import Cloud @@ -6,6 +10,29 @@ from .conftest import _is_cloud +class _CaptureHeadersAdapter(HTTPAdapter): + """Snapshots request and response headers for a single matching URL path. + + Used to verify wire-level header behavior in integration tests; the request + is otherwise let through to the real transport unchanged. Headers are kept + as CaseInsensitiveDict so assertions don't depend on wire casing (HTTP/2 + servers typically lowercase header names). + """ + + def __init__(self, path, *args, **kwargs): + super().__init__(*args, **kwargs) + self.path = path + self.req_headers = None + self.resp_headers = None + + def send(self, request, **kwargs): + response = super().send(request, **kwargs) + if urlparse(request.url).path == self.path: + self.req_headers = CaseInsensitiveDict(request.headers) + self.resp_headers = CaseInsensitiveDict(response.headers) + return response + + def test_workspace_operations(unified_config): # GCP google-credentials auth produces a workspace-local SP that is not # federated at the account level. Workspace APIs via the unified host @@ -163,3 +190,59 @@ def test_spog_account_google_credentials(isolated_env): ) sps = ac.service_principals.list() next(sps) + + +# Environment: azure-prod-ucws +def test_spog_unified_host_sends_workspace_id_header(isolated_env): + """Verify wire-level header behavior of the workspace-id migration on a real unified host. + + Mirrors the Go SDK's TestAccUnifiedHostSendsWorkspaceIdHeader in + internal/unified_host_test.go. Probes the SCIM Me endpoint and inspects the + actual headers that cross the wire: + 1. SDK sends the new X-Databricks-Workspace-Id routing header on + workspace-scoped requests + 2. SDK no longer sends the legacy X-Databricks-Org-Id request header + 3. Server still echoes the legacy X-Databricks-Org-Id on the response, + since the server-side migration has not yet happened (this is why + WorkspaceClient.get_workspace_id() still reads the legacy name). + """ + env = isolated_env("ucws") + host = env("UNIFIED_HOST") + client_id = env("TEST_DATABRICKS_CLIENT_ID") + client_secret = env("TEST_DATABRICKS_CLIENT_SECRET") + workspace_id = env("THIS_WORKSPACE_ID") + account_id = env("TEST_ACCOUNT_ID") + + me_path = "/api/2.0/preview/scim/v2/Me" + + ws = WorkspaceClient( + host=host, + client_id=client_id, + client_secret=client_secret, + workspace_id=workspace_id, + account_id=account_id, + auth_type="oauth-m2m", + ) + + # Mount a capture adapter on the SDK's session for wire-level header inspection. + transport = _CaptureHeadersAdapter(me_path) + ws._api_client._api_client._session.mount("https://", transport) + + # (1) Workspace-scoped probe against the unified host must succeed. + me = ws.current_user.me() + assert me.user_name, "Me should return a non-empty user_name" + + assert transport.req_headers is not None, f"transport did not observe a request to {me_path}" + + # (2) Request side: SDK must send the new header and not the legacy one. + assert ( + transport.req_headers.get("X-Databricks-Workspace-Id") == workspace_id + ), "SDK must send X-Databricks-Workspace-Id with Config.workspace_id" + assert ( + "X-Databricks-Org-Id" not in transport.req_headers + ), "SDK must no longer send the legacy X-Databricks-Org-Id request header" + + # (3) Response side: server still echoes the legacy header name during the migration. + assert ( + "X-Databricks-Org-Id" in transport.resp_headers + ), "server is expected to still echo the legacy X-Databricks-Org-Id response header during the migration" diff --git a/tests/test_config.py b/tests/test_config.py index 53dd313e1..e13aaa46a 100644 --- a/tests/test_config.py +++ b/tests/test_config.py @@ -450,8 +450,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"}) @@ -465,12 +465,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", @@ -487,23 +487,32 @@ 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.""" - from databricks.sdk.core import ApiClient +def test_get_workspace_id_reads_org_id_response_header_when_config_missing_workspace_id(requests_mock): + """When Config.workspace_id is empty, get_workspace_id() fetches the ID via SCIM /Me. - requests_mock.get("https://test.databricks.com/api/2.0/test", json={"result": "success"}) - - config = Config(host="https://test.databricks.com", token="test-token") + Verifies both directions of the migration on the workspace-id probe: + - request must NOT carry the new X-Databricks-Workspace-Id header (Config.workspace_id is empty) + - response is parsed from the legacy X-Databricks-Org-Id header (server-side hasn't migrated) + """ + requests_mock.get( + "https://unified.databricks.com/api/2.0/preview/scim/v2/Me", + json={}, + headers={"X-Databricks-Org-Id": "7474644166319138"}, + ) - api_client = ApiClient(config) - api_client.do("GET", "/api/2.0/test") + config = Config( + host="https://unified.databricks.com", + account_id="test-account", + token="test-token", + ) - # Verify the X-Databricks-Org-Id header was NOT added - assert "X-Databricks-Org-Id" not in requests_mock.last_request.headers + workspace_client = WorkspaceClient(config=config) + assert workspace_client.get_workspace_id() == 7474644166319138 + assert "X-Databricks-Workspace-Id" not in requests_mock.last_request.headers def test_disable_oauth_refresh_token_from_env(monkeypatch, mocker):