diff --git a/.codegen/__init__.py.tmpl b/.codegen/__init__.py.tmpl index 146dc354e..c299475f3 100644 --- a/.codegen/__init__.py.tmpl +++ b/.codegen/__init__.py.tmpl @@ -153,7 +153,7 @@ class AccountClient: :param workspace: The workspace to construct a client for. :return: A ``WorkspaceClient`` for the given workspace. """ - config = self._config.copy() + config = self._config.deep_copy() config.host = config.environment.deployment_url(workspace.deployment_name) config.azure_workspace_resource_id = azure.get_azure_resource_id(workspace) config.account_id = None diff --git a/.codegen/service.py.tmpl b/.codegen/service.py.tmpl index 052116424..52e42b5ec 100644 --- a/.codegen/service.py.tmpl +++ b/.codegen/service.py.tmpl @@ -21,26 +21,26 @@ from databricks.sdk.service import {{.Package.Name}}{{end}} {{if .Fields -}}{{if not .IsRequest}}@dataclass class {{.PascalName}}{{if eq "List" .PascalName}}Request{{end}}:{{if .Description}} """{{.Comment " " 100}}""" - {{end}}{{- range .RequiredFields | alphanumOnly}} + {{end}}{{- range .RequiredFields}} {{template "safe-snake-name" .}}: {{template "type" .Entity}}{{if .Description}} """{{.Comment " " 100 | trimSuffix "\""}}"""{{end}} {{end}} - {{- range .NonRequiredFields | alphanumOnly}} + {{- range .NonRequiredFields}} {{template "safe-snake-name" .}}: Optional[{{template "type" .Entity}}] = None{{if .Description}} """{{.Comment " " 100 | trimSuffix "\""}}"""{{end}} {{end}} - {{if .HasJsonField -}} + {{if or .HasJsonField .HasHeaderField .HasByteStreamField -}} def as_dict(self) -> dict: """Serializes the {{.PascalName}}{{if eq "List" .PascalName}}Request{{end}} into a dictionary suitable for use as a JSON request body.""" body = {} - {{range .Fields | alphanumOnly}}if self.{{template "safe-snake-name" .}}{{with .Entity.IsPrimitive}} is not None{{end}}: body['{{.Name}}'] = {{template "as_request_type" .}} + {{range .Fields}}if self.{{template "safe-snake-name" .}}{{with .Entity.IsPrimitive}} is not None{{end}}: body['{{.Name}}'] = {{template "as_request_type" .}} {{end -}} return body @classmethod def from_dict(cls, d: Dict[str, any]) -> {{.PascalName}}{{if eq "List" .PascalName}}Request{{end}}: """Deserializes the {{.PascalName}}{{if eq "List" .PascalName}}Request{{end}} from a dictionary.""" - return cls({{range $i, $f := .Fields | alphanumOnly}}{{if $i}}, {{end}}{{template "safe-snake-name" $f}}={{template "from_dict_type" $f}}{{end}}) + return cls({{range $i, $f := .Fields}}{{if $i}}, {{end}}{{template "safe-snake-name" $f}}={{template "from_dict_type" $f}}{{end}}) {{end}} {{end}} {{else if .ArrayValue}}type {{.PascalName}} []{{template "type" .ArrayValue}} @@ -187,6 +187,9 @@ class {{.Name}}API:{{if .Description}} {{template "method-serialize" .}} {{- end}} {{template "method-headers" . }} + {{if and .Response .Response.HasHeaderField -}} + {{template "method-response-headers" . }} + {{- end}} {{template "method-call" .}} {{if and .Wait (and (not .IsCrudRead) (not (eq .SnakeName "get_run"))) }} @@ -211,7 +214,7 @@ class {{.Name}}API:{{if .Description}} {{if or .Request.HasJsonField .Request.HasQueryField -}} {{if .Request.HasJsonField}}body = {}{{end}}{{if .Request.HasQueryField}} query = {}{{end}} - {{- range .Request.Fields}}{{ if not .IsPath }} + {{- range .Request.Fields}}{{ if and (not .IsPath) (not .IsHeader) }} {{- if .IsQuery }} if {{template "safe-snake-name" .}} is not None: query['{{.Name}}'] = {{template "method-param-bind" .}}{{end}} {{- if .IsJson }} @@ -227,6 +230,12 @@ class {{.Name}}API:{{if .Description}} } {{- end }} +{{ define "method-response-headers" -}} + response_headers = [ + {{- range $h := .ResponseHeaders}}'{{ $h.Name }}',{{ end -}} + ] +{{- end }} + {{- define "method-param-bind" -}} {{- if not .Entity }}None # ERROR: No Type {{- else if .Entity.ArrayValue }}[ @@ -282,7 +291,7 @@ class {{.Name}}API:{{if .Description}} {{ if .Pagination.Token -}} if '{{.Pagination.Token.Bind.Name}}' not in json or not json['{{.Pagination.Token.Bind.Name}}']: return - {{if eq "GET" .Verb}}query{{else}}body{{end}}['{{.Pagination.Token.PollField.Name}}'] = json['{{.Pagination.Token.Bind.Name}}'] + {{if or (eq "GET" .Verb) (eq "HEAD" .Verb)}}query{{else}}body{{end}}['{{.Pagination.Token.PollField.Name}}'] = json['{{.Pagination.Token.Bind.Name}}'] {{- else if eq .Path "/api/2.0/clusters/events" -}} if 'next_page' not in json or not json['next_page']: return @@ -307,9 +316,7 @@ class {{.Name}}API:{{if .Description}} {{if .Response -}} res = {{end}}{{template "method-do" .}} {{if .Response -}} - {{- if .IsResponseByteStream -}} - return {{.Response.PascalName}}({{.ResponseBodyField.CamelName}}=res) - {{- else if .Response.ArrayValue -}} + {{- if .Response.ArrayValue -}} return [{{.Response.ArrayValue.PascalName}}.from_dict(v) for v in res] {{- else if .Response.MapValue -}} return res @@ -330,6 +337,9 @@ self._api.do('{{.Verb}}', {{- else if .Request.HasJsonField}}, body=body{{end}} {{end}} , headers=headers + {{if and .Response .Response.HasHeaderField -}} + , response_headers=response_headers + {{- end}} {{- if and .IsRequestByteStream .RequestBodyField }}, data={{template "safe-snake-name" .RequestBodyField}}{{ end }} {{- if .IsResponseByteStream }}, raw=True{{ end }}) {{- end}} diff --git a/.gitattributes b/.gitattributes index 8606d64c1..d36f22eeb 100755 --- a/.gitattributes +++ b/.gitattributes @@ -285,6 +285,7 @@ examples/workspace/list_workspace_integration.py linguist-generated=true examples/workspace_assignment/list_workspace_assignment_on_aws.py linguist-generated=true examples/workspace_assignment/update_workspace_assignment_on_aws.py linguist-generated=true examples/workspace_bindings/get_catalog_workspace_bindings.py linguist-generated=true +examples/workspace_bindings/update_catalog_workspace_bindings.py linguist-generated=true examples/workspace_conf/get_status_repos.py linguist-generated=true examples/workspaces/create_workspaces.py linguist-generated=true examples/workspaces/get_workspaces.py linguist-generated=true diff --git a/databricks/sdk/core.py b/databricks/sdk/core.py index 2ac6e2066..789200b27 100644 --- a/databricks/sdk/core.py +++ b/databricks/sdk/core.py @@ -135,11 +135,13 @@ def do(self, raw=raw, files=files, data=data) - if raw: - return StreamingResponse(response) + resp = dict() for header in response_headers if response_headers else []: resp[header] = response.headers.get(Casing.to_header_case(header)) + if raw: + resp["contents"] = StreamingResponse(response) + return resp if not len(response.content): return resp diff --git a/databricks/sdk/mixins/workspace.py b/databricks/sdk/mixins/workspace.py index b492521ca..8d51ef2bc 100644 --- a/databricks/sdk/mixins/workspace.py +++ b/databricks/sdk/mixins/workspace.py @@ -102,4 +102,5 @@ def download(self, path: str, *, format: Optional[ExportFormat] = None) -> Binar """ query = {'path': path, 'direct_download': 'true'} if format: query['format'] = format.value - return self._api.do('GET', '/api/2.0/workspace/export', query=query, raw=True) + response = self._api.do('GET', '/api/2.0/workspace/export', query=query, raw=True) + return response["contents"] diff --git a/databricks/sdk/service/billing.py b/databricks/sdk/service/billing.py index b91a55596..36a11d08b 100755 --- a/databricks/sdk/service/billing.py +++ b/databricks/sdk/service/billing.py @@ -335,6 +335,17 @@ class DeliveryStatus(Enum): class DownloadResponse: contents: Optional[BinaryIO] = None + def as_dict(self) -> dict: + """Serializes the DownloadResponse into a dictionary suitable for use as a JSON request body.""" + body = {} + if self.contents: body['contents'] = self.contents + return body + + @classmethod + def from_dict(cls, d: Dict[str, any]) -> DownloadResponse: + """Deserializes the DownloadResponse from a dictionary.""" + return cls(contents=d.get('contents', None)) + class LogDeliveryConfigStatus(Enum): """Status of log delivery configuration. Set to `ENABLED` (enabled) or `DISABLED` (disabled). @@ -704,12 +715,13 @@ def download(self, if personal_data is not None: query['personal_data'] = personal_data if start_month is not None: query['start_month'] = start_month headers = {'Accept': 'text/plain', } + res = self._api.do('GET', f'/api/2.0/accounts/{self._api.account_id}/usage/download', query=query, headers=headers, raw=True) - return DownloadResponse(contents=res) + return DownloadResponse.from_dict(res) class BudgetsAPI: @@ -732,6 +744,7 @@ def create(self, budget: Budget) -> WrappedBudgetWithStatus: body = {} if budget is not None: body['budget'] = budget.as_dict() headers = {'Accept': 'application/json', 'Content-Type': 'application/json', } + res = self._api.do('POST', f'/api/2.0/accounts/{self._api.account_id}/budget', body=body, @@ -750,6 +763,7 @@ def delete(self, budget_id: str): """ headers = {'Accept': 'application/json', } + self._api.do('DELETE', f'/api/2.0/accounts/{self._api.account_id}/budget/{budget_id}', headers=headers) @@ -767,6 +781,7 @@ def get(self, budget_id: str) -> WrappedBudgetWithStatus: """ headers = {'Accept': 'application/json', } + res = self._api.do('GET', f'/api/2.0/accounts/{self._api.account_id}/budget/{budget_id}', headers=headers) @@ -782,6 +797,7 @@ def list(self) -> Iterator[BudgetWithStatus]: """ headers = {'Accept': 'application/json', } + json = self._api.do('GET', f'/api/2.0/accounts/{self._api.account_id}/budget', headers=headers) parsed = BudgetList.from_dict(json).budgets return parsed if parsed is not None else [] @@ -801,6 +817,7 @@ def update(self, budget_id: str, budget: Budget): body = {} if budget is not None: body['budget'] = budget.as_dict() headers = {'Accept': 'application/json', 'Content-Type': 'application/json', } + self._api.do('PATCH', f'/api/2.0/accounts/{self._api.account_id}/budget/{budget_id}', body=body, @@ -894,6 +911,7 @@ def create( if log_delivery_configuration is not None: body['log_delivery_configuration'] = log_delivery_configuration.as_dict() headers = {'Accept': 'application/json', 'Content-Type': 'application/json', } + res = self._api.do('POST', f'/api/2.0/accounts/{self._api.account_id}/log-delivery', body=body, @@ -912,6 +930,7 @@ def get(self, log_delivery_configuration_id: str) -> WrappedLogDeliveryConfigura """ headers = {'Accept': 'application/json', } + res = self._api.do( 'GET', f'/api/2.0/accounts/{self._api.account_id}/log-delivery/{log_delivery_configuration_id}', @@ -942,6 +961,7 @@ def list(self, if status is not None: query['status'] = status.value if storage_configuration_id is not None: query['storage_configuration_id'] = storage_configuration_id headers = {'Accept': 'application/json', } + json = self._api.do('GET', f'/api/2.0/accounts/{self._api.account_id}/log-delivery', query=query, @@ -970,6 +990,7 @@ def patch_status(self, log_delivery_configuration_id: str, status: LogDeliveryCo body = {} if status is not None: body['status'] = status.value headers = {'Accept': 'application/json', 'Content-Type': 'application/json', } + self._api.do('PATCH', f'/api/2.0/accounts/{self._api.account_id}/log-delivery/{log_delivery_configuration_id}', body=body, diff --git a/databricks/sdk/service/catalog.py b/databricks/sdk/service/catalog.py index 578d0bbe6..2f1be049c 100755 --- a/databricks/sdk/service/catalog.py +++ b/databricks/sdk/service/catalog.py @@ -5037,6 +5037,7 @@ def create(self, body = {} if metastore_assignment is not None: body['metastore_assignment'] = metastore_assignment.as_dict() headers = {'Accept': 'application/json', 'Content-Type': 'application/json', } + self._api.do( 'POST', f'/api/2.0/accounts/{self._api.account_id}/workspaces/{workspace_id}/metastores/{metastore_id}', @@ -5057,6 +5058,7 @@ def delete(self, workspace_id: int, metastore_id: str): """ headers = {'Accept': 'application/json', } + self._api.do( 'DELETE', f'/api/2.0/accounts/{self._api.account_id}/workspaces/{workspace_id}/metastores/{metastore_id}', @@ -5076,6 +5078,7 @@ def get(self, workspace_id: int) -> AccountsMetastoreAssignment: """ headers = {'Accept': 'application/json', } + res = self._api.do('GET', f'/api/2.0/accounts/{self._api.account_id}/workspaces/{workspace_id}/metastore', headers=headers) @@ -5093,6 +5096,7 @@ def list(self, metastore_id: str) -> Iterator[int]: """ headers = {'Accept': 'application/json', } + json = self._api.do('GET', f'/api/2.0/accounts/{self._api.account_id}/metastores/{metastore_id}/workspaces', headers=headers) @@ -5120,6 +5124,7 @@ def update(self, body = {} if metastore_assignment is not None: body['metastore_assignment'] = metastore_assignment.as_dict() headers = {'Accept': 'application/json', 'Content-Type': 'application/json', } + self._api.do( 'PUT', f'/api/2.0/accounts/{self._api.account_id}/workspaces/{workspace_id}/metastores/{metastore_id}', @@ -5146,6 +5151,7 @@ def create(self, *, metastore_info: Optional[CreateMetastore] = None) -> Account body = {} if metastore_info is not None: body['metastore_info'] = metastore_info.as_dict() headers = {'Accept': 'application/json', 'Content-Type': 'application/json', } + res = self._api.do('POST', f'/api/2.0/accounts/{self._api.account_id}/metastores', body=body, @@ -5168,6 +5174,7 @@ def delete(self, metastore_id: str, *, force: Optional[bool] = None): query = {} if force is not None: query['force'] = force headers = {'Accept': 'application/json', } + self._api.do('DELETE', f'/api/2.0/accounts/{self._api.account_id}/metastores/{metastore_id}', query=query, @@ -5185,6 +5192,7 @@ def get(self, metastore_id: str) -> AccountsMetastoreInfo: """ headers = {'Accept': 'application/json', } + res = self._api.do('GET', f'/api/2.0/accounts/{self._api.account_id}/metastores/{metastore_id}', headers=headers) @@ -5199,6 +5207,7 @@ def list(self) -> Iterator[MetastoreInfo]: """ headers = {'Accept': 'application/json', } + json = self._api.do('GET', f'/api/2.0/accounts/{self._api.account_id}/metastores', headers=headers) parsed = ListMetastoresResponse.from_dict(json).metastores return parsed if parsed is not None else [] @@ -5220,6 +5229,7 @@ def update(self, body = {} if metastore_info is not None: body['metastore_info'] = metastore_info.as_dict() headers = {'Accept': 'application/json', 'Content-Type': 'application/json', } + res = self._api.do('PUT', f'/api/2.0/accounts/{self._api.account_id}/metastores/{metastore_id}', body=body, @@ -5256,6 +5266,7 @@ def create(self, body = {} if credential_info is not None: body['credential_info'] = credential_info.as_dict() headers = {'Accept': 'application/json', 'Content-Type': 'application/json', } + res = self._api.do( 'POST', f'/api/2.0/accounts/{self._api.account_id}/metastores/{metastore_id}/storage-credentials', @@ -5282,6 +5293,7 @@ def delete(self, metastore_id: str, storage_credential_name: str, *, force: Opti query = {} if force is not None: query['force'] = force headers = {'Accept': 'application/json', } + self._api.do( 'DELETE', f'/api/2.0/accounts/{self._api.account_id}/metastores/{metastore_id}/storage-credentials/{storage_credential_name}', @@ -5303,6 +5315,7 @@ def get(self, metastore_id: str, storage_credential_name: str) -> AccountsStorag """ headers = {'Accept': 'application/json', } + res = self._api.do( 'GET', f'/api/2.0/accounts/{self._api.account_id}/metastores/{metastore_id}/storage-credentials/{storage_credential_name}', @@ -5321,6 +5334,7 @@ def list(self, metastore_id: str) -> Iterator[StorageCredentialInfo]: """ headers = {'Accept': 'application/json', } + res = self._api.do( 'GET', f'/api/2.0/accounts/{self._api.account_id}/metastores/{metastore_id}/storage-credentials', @@ -5348,6 +5362,7 @@ def update(self, body = {} if credential_info is not None: body['credential_info'] = credential_info.as_dict() headers = {'Accept': 'application/json', 'Content-Type': 'application/json', } + res = self._api.do( 'PUT', f'/api/2.0/accounts/{self._api.account_id}/metastores/{metastore_id}/storage-credentials/{storage_credential_name}', @@ -5376,6 +5391,7 @@ def get(self, artifact_type: ArtifactType) -> ArtifactAllowlistInfo: """ headers = {'Accept': 'application/json', } + res = self._api.do('GET', f'/api/2.1/unity-catalog/artifact-allowlists/{artifact_type.value}', headers=headers) @@ -5399,6 +5415,7 @@ def update(self, artifact_type: ArtifactType, body = {} if artifact_matchers is not None: body['artifact_matchers'] = [v.as_dict() for v in artifact_matchers] headers = {'Accept': 'application/json', 'Content-Type': 'application/json', } + res = self._api.do('PUT', f'/api/2.1/unity-catalog/artifact-allowlists/{artifact_type.value}', body=body, @@ -5463,6 +5480,7 @@ def create(self, if share_name is not None: body['share_name'] = share_name if storage_root is not None: body['storage_root'] = storage_root headers = {'Accept': 'application/json', 'Content-Type': 'application/json', } + res = self._api.do('POST', '/api/2.1/unity-catalog/catalogs', body=body, headers=headers) return CatalogInfo.from_dict(res) @@ -5483,6 +5501,7 @@ def delete(self, name: str, *, force: Optional[bool] = None): query = {} if force is not None: query['force'] = force headers = {'Accept': 'application/json', } + self._api.do('DELETE', f'/api/2.1/unity-catalog/catalogs/{name}', query=query, headers=headers) def get(self, name: str) -> CatalogInfo: @@ -5498,6 +5517,7 @@ def get(self, name: str) -> CatalogInfo: """ headers = {'Accept': 'application/json', } + res = self._api.do('GET', f'/api/2.1/unity-catalog/catalogs/{name}', headers=headers) return CatalogInfo.from_dict(res) @@ -5513,6 +5533,7 @@ def list(self) -> Iterator[CatalogInfo]: """ headers = {'Accept': 'application/json', } + json = self._api.do('GET', '/api/2.1/unity-catalog/catalogs', headers=headers) parsed = ListCatalogsResponse.from_dict(json).catalogs return parsed if parsed is not None else [] @@ -5557,6 +5578,7 @@ def update(self, if owner is not None: body['owner'] = owner if properties is not None: body['properties'] = properties headers = {'Accept': 'application/json', 'Content-Type': 'application/json', } + res = self._api.do('PATCH', f'/api/2.1/unity-catalog/catalogs/{name}', body=body, headers=headers) return CatalogInfo.from_dict(res) @@ -5612,6 +5634,7 @@ def create(self, if properties is not None: body['properties'] = properties if read_only is not None: body['read_only'] = read_only headers = {'Accept': 'application/json', 'Content-Type': 'application/json', } + res = self._api.do('POST', '/api/2.1/unity-catalog/connections', body=body, headers=headers) return ConnectionInfo.from_dict(res) @@ -5627,6 +5650,7 @@ def delete(self, name_arg: str): """ headers = {'Accept': 'application/json', } + self._api.do('DELETE', f'/api/2.1/unity-catalog/connections/{name_arg}', headers=headers) def get(self, name_arg: str) -> ConnectionInfo: @@ -5641,6 +5665,7 @@ def get(self, name_arg: str) -> ConnectionInfo: """ headers = {'Accept': 'application/json', } + res = self._api.do('GET', f'/api/2.1/unity-catalog/connections/{name_arg}', headers=headers) return ConnectionInfo.from_dict(res) @@ -5653,6 +5678,7 @@ def list(self) -> Iterator[ConnectionInfo]: """ headers = {'Accept': 'application/json', } + json = self._api.do('GET', '/api/2.1/unity-catalog/connections', headers=headers) parsed = ListConnectionsResponse.from_dict(json).connections return parsed if parsed is not None else [] @@ -5683,6 +5709,7 @@ def update(self, if options is not None: body['options'] = options if owner is not None: body['owner'] = owner headers = {'Accept': 'application/json', 'Content-Type': 'application/json', } + res = self._api.do('PATCH', f'/api/2.1/unity-catalog/connections/{name_arg}', body=body, @@ -5750,6 +5777,7 @@ def create(self, if skip_validation is not None: body['skip_validation'] = skip_validation if url is not None: body['url'] = url headers = {'Accept': 'application/json', 'Content-Type': 'application/json', } + res = self._api.do('POST', '/api/2.1/unity-catalog/external-locations', body=body, headers=headers) return ExternalLocationInfo.from_dict(res) @@ -5770,6 +5798,7 @@ def delete(self, name: str, *, force: Optional[bool] = None): query = {} if force is not None: query['force'] = force headers = {'Accept': 'application/json', } + self._api.do('DELETE', f'/api/2.1/unity-catalog/external-locations/{name}', query=query, @@ -5788,6 +5817,7 @@ def get(self, name: str) -> ExternalLocationInfo: """ headers = {'Accept': 'application/json', } + res = self._api.do('GET', f'/api/2.1/unity-catalog/external-locations/{name}', headers=headers) return ExternalLocationInfo.from_dict(res) @@ -5886,6 +5916,7 @@ def update(self, if skip_validation is not None: body['skip_validation'] = skip_validation if url is not None: body['url'] = url headers = {'Accept': 'application/json', 'Content-Type': 'application/json', } + res = self._api.do('PATCH', f'/api/2.1/unity-catalog/external-locations/{name}', body=body, @@ -5920,6 +5951,7 @@ def create(self, function_info: CreateFunction) -> FunctionInfo: body = {} if function_info is not None: body['function_info'] = function_info.as_dict() headers = {'Accept': 'application/json', 'Content-Type': 'application/json', } + res = self._api.do('POST', '/api/2.1/unity-catalog/functions', body=body, headers=headers) return FunctionInfo.from_dict(res) @@ -5944,6 +5976,7 @@ def delete(self, name: str, *, force: Optional[bool] = None): query = {} if force is not None: query['force'] = force headers = {'Accept': 'application/json', } + self._api.do('DELETE', f'/api/2.1/unity-catalog/functions/{name}', query=query, headers=headers) def get(self, name: str) -> FunctionInfo: @@ -5964,6 +5997,7 @@ def get(self, name: str) -> FunctionInfo: """ headers = {'Accept': 'application/json', } + res = self._api.do('GET', f'/api/2.1/unity-catalog/functions/{name}', headers=headers) return FunctionInfo.from_dict(res) @@ -6034,6 +6068,7 @@ def update(self, name: str, *, owner: Optional[str] = None) -> FunctionInfo: body = {} if owner is not None: body['owner'] = owner headers = {'Accept': 'application/json', 'Content-Type': 'application/json', } + res = self._api.do('PATCH', f'/api/2.1/unity-catalog/functions/{name}', body=body, headers=headers) return FunctionInfo.from_dict(res) @@ -6074,6 +6109,7 @@ def get(self, query = {} if principal is not None: query['principal'] = principal headers = {'Accept': 'application/json', } + res = self._api.do('GET', f'/api/2.1/unity-catalog/permissions/{securable_type.value}/{full_name}', query=query, @@ -6103,6 +6139,7 @@ def get_effective(self, query = {} if principal is not None: query['principal'] = principal headers = {'Accept': 'application/json', } + res = self._api.do('GET', f'/api/2.1/unity-catalog/effective-permissions/{securable_type.value}/{full_name}', query=query, @@ -6130,6 +6167,7 @@ def update(self, body = {} if changes is not None: body['changes'] = [v.as_dict() for v in changes] headers = {'Accept': 'application/json', 'Content-Type': 'application/json', } + res = self._api.do('PATCH', f'/api/2.1/unity-catalog/permissions/{securable_type.value}/{full_name}', body=body, @@ -6169,6 +6207,7 @@ def cancel_refresh(self, full_name: str, refresh_id: str): """ headers = {} + self._api.do('POST', f'/api/2.1/unity-catalog/tables/{full_name}/monitor/refreshes/{refresh_id}/cancel', headers=headers) @@ -6253,6 +6292,7 @@ def create(self, if time_series is not None: body['time_series'] = time_series.as_dict() if warehouse_id is not None: body['warehouse_id'] = warehouse_id headers = {'Accept': 'application/json', 'Content-Type': 'application/json', } + res = self._api.do('POST', f'/api/2.1/unity-catalog/tables/{full_name}/monitor', body=body, @@ -6281,6 +6321,7 @@ def delete(self, full_name: str): """ headers = {} + self._api.do('DELETE', f'/api/2.1/unity-catalog/tables/{full_name}/monitor', headers=headers) def get(self, full_name: str) -> MonitorInfo: @@ -6304,6 +6345,7 @@ def get(self, full_name: str) -> MonitorInfo: """ headers = {'Accept': 'application/json', } + res = self._api.do('GET', f'/api/2.1/unity-catalog/tables/{full_name}/monitor', headers=headers) return MonitorInfo.from_dict(res) @@ -6328,6 +6370,7 @@ def get_refresh(self, full_name: str, refresh_id: str) -> MonitorRefreshInfo: """ headers = {'Accept': 'application/json', } + res = self._api.do('GET', f'/api/2.1/unity-catalog/tables/{full_name}/monitor/refreshes/{refresh_id}', headers=headers) @@ -6352,6 +6395,7 @@ def list_refreshes(self, full_name: str) -> Iterator[MonitorRefreshInfo]: """ headers = {'Accept': 'application/json', } + res = self._api.do('GET', f'/api/2.1/unity-catalog/tables/{full_name}/monitor/refreshes', headers=headers) @@ -6377,6 +6421,7 @@ def run_refresh(self, full_name: str) -> MonitorRefreshInfo: """ headers = {'Accept': 'application/json', } + res = self._api.do('POST', f'/api/2.1/unity-catalog/tables/{full_name}/monitor/refreshes', headers=headers) @@ -6455,6 +6500,7 @@ def update(self, if snapshot is not None: body['snapshot'] = snapshot if time_series is not None: body['time_series'] = time_series.as_dict() headers = {'Accept': 'application/json', 'Content-Type': 'application/json', } + res = self._api.do('PUT', f'/api/2.1/unity-catalog/tables/{full_name}/monitor', body=body, @@ -6498,6 +6544,7 @@ def assign(self, workspace_id: int, metastore_id: str, default_catalog_name: str if default_catalog_name is not None: body['default_catalog_name'] = default_catalog_name if metastore_id is not None: body['metastore_id'] = metastore_id headers = {'Accept': 'application/json', 'Content-Type': 'application/json', } + self._api.do('PUT', f'/api/2.1/unity-catalog/workspaces/{workspace_id}/metastore', body=body, @@ -6530,6 +6577,7 @@ def create(self, if region is not None: body['region'] = region if storage_root is not None: body['storage_root'] = storage_root headers = {'Accept': 'application/json', 'Content-Type': 'application/json', } + res = self._api.do('POST', '/api/2.1/unity-catalog/metastores', body=body, headers=headers) return MetastoreInfo.from_dict(res) @@ -6542,6 +6590,7 @@ def current(self) -> MetastoreAssignment: """ headers = {'Accept': 'application/json', } + res = self._api.do('GET', '/api/2.1/unity-catalog/current-metastore-assignment', headers=headers) return MetastoreAssignment.from_dict(res) @@ -6561,6 +6610,7 @@ def delete(self, id: str, *, force: Optional[bool] = None): query = {} if force is not None: query['force'] = force headers = {'Accept': 'application/json', } + self._api.do('DELETE', f'/api/2.1/unity-catalog/metastores/{id}', query=query, headers=headers) def get(self, id: str) -> MetastoreInfo: @@ -6576,6 +6626,7 @@ def get(self, id: str) -> MetastoreInfo: """ headers = {'Accept': 'application/json', } + res = self._api.do('GET', f'/api/2.1/unity-catalog/metastores/{id}', headers=headers) return MetastoreInfo.from_dict(res) @@ -6589,6 +6640,7 @@ def list(self) -> Iterator[MetastoreInfo]: """ headers = {'Accept': 'application/json', } + json = self._api.do('GET', '/api/2.1/unity-catalog/metastores', headers=headers) parsed = ListMetastoresResponse.from_dict(json).metastores return parsed if parsed is not None else [] @@ -6603,6 +6655,7 @@ def summary(self) -> GetMetastoreSummaryResponse: """ headers = {'Accept': 'application/json', } + res = self._api.do('GET', '/api/2.1/unity-catalog/metastore_summary', headers=headers) return GetMetastoreSummaryResponse.from_dict(res) @@ -6622,6 +6675,7 @@ def unassign(self, workspace_id: int, metastore_id: str): query = {} if metastore_id is not None: query['metastore_id'] = metastore_id headers = {'Accept': 'application/json', } + self._api.do('DELETE', f'/api/2.1/unity-catalog/workspaces/{workspace_id}/metastore', query=query, @@ -6675,6 +6729,7 @@ def update(self, if storage_root_credential_id is not None: body['storage_root_credential_id'] = storage_root_credential_id headers = {'Accept': 'application/json', 'Content-Type': 'application/json', } + res = self._api.do('PATCH', f'/api/2.1/unity-catalog/metastores/{id}', body=body, headers=headers) return MetastoreInfo.from_dict(res) @@ -6703,6 +6758,7 @@ def update_assignment(self, if default_catalog_name is not None: body['default_catalog_name'] = default_catalog_name if metastore_id is not None: body['metastore_id'] = metastore_id headers = {'Accept': 'application/json', 'Content-Type': 'application/json', } + self._api.do('PATCH', f'/api/2.1/unity-catalog/workspaces/{workspace_id}/metastore', body=body, @@ -6739,6 +6795,7 @@ def delete(self, full_name: str, version: int): """ headers = {} + self._api.do('DELETE', f'/api/2.1/unity-catalog/models/{full_name}/versions/{version}', headers=headers) @@ -6761,6 +6818,7 @@ def get(self, full_name: str, version: int) -> RegisteredModelInfo: """ headers = {'Accept': 'application/json', } + res = self._api.do('GET', f'/api/2.1/unity-catalog/models/{full_name}/versions/{version}', headers=headers) @@ -6784,6 +6842,7 @@ def get_by_alias(self, full_name: str, alias: str) -> ModelVersionInfo: """ headers = {'Accept': 'application/json', } + res = self._api.do('GET', f'/api/2.1/unity-catalog/models/{full_name}/aliases/{alias}', headers=headers) @@ -6861,6 +6920,7 @@ def update(self, full_name: str, version: int, *, comment: Optional[str] = None) body = {} if comment is not None: body['comment'] = comment headers = {'Accept': 'application/json', 'Content-Type': 'application/json', } + res = self._api.do('PATCH', f'/api/2.1/unity-catalog/models/{full_name}/versions/{version}', body=body, @@ -6936,6 +6996,7 @@ def create(self, if schema_name is not None: body['schema_name'] = schema_name if storage_location is not None: body['storage_location'] = storage_location headers = {'Accept': 'application/json', 'Content-Type': 'application/json', } + res = self._api.do('POST', '/api/2.1/unity-catalog/models', body=body, headers=headers) return RegisteredModelInfo.from_dict(res) @@ -6955,6 +7016,7 @@ def delete(self, full_name: str): """ headers = {} + self._api.do('DELETE', f'/api/2.1/unity-catalog/models/{full_name}', headers=headers) def delete_alias(self, full_name: str, alias: str): @@ -6975,6 +7037,7 @@ def delete_alias(self, full_name: str, alias: str): """ headers = {} + self._api.do('DELETE', f'/api/2.1/unity-catalog/models/{full_name}/aliases/{alias}', headers=headers) def get(self, full_name: str) -> RegisteredModelInfo: @@ -6993,6 +7056,7 @@ def get(self, full_name: str) -> RegisteredModelInfo: """ headers = {'Accept': 'application/json', } + res = self._api.do('GET', f'/api/2.1/unity-catalog/models/{full_name}', headers=headers) return RegisteredModelInfo.from_dict(res) @@ -7068,6 +7132,7 @@ def set_alias(self, full_name: str, alias: str, version_num: int) -> RegisteredM body = {} if version_num is not None: body['version_num'] = version_num headers = {'Accept': 'application/json', 'Content-Type': 'application/json', } + res = self._api.do('PUT', f'/api/2.1/unity-catalog/models/{full_name}/aliases/{alias}', body=body, @@ -7106,6 +7171,7 @@ def update(self, if new_name is not None: body['new_name'] = new_name if owner is not None: body['owner'] = owner headers = {'Accept': 'application/json', 'Content-Type': 'application/json', } + res = self._api.do('PATCH', f'/api/2.1/unity-catalog/models/{full_name}', body=body, headers=headers) return RegisteredModelInfo.from_dict(res) @@ -7151,6 +7217,7 @@ def create(self, if properties is not None: body['properties'] = properties if storage_root is not None: body['storage_root'] = storage_root headers = {'Accept': 'application/json', 'Content-Type': 'application/json', } + res = self._api.do('POST', '/api/2.1/unity-catalog/schemas', body=body, headers=headers) return SchemaInfo.from_dict(res) @@ -7167,6 +7234,7 @@ def delete(self, full_name: str): """ headers = {'Accept': 'application/json', } + self._api.do('DELETE', f'/api/2.1/unity-catalog/schemas/{full_name}', headers=headers) def get(self, full_name: str) -> SchemaInfo: @@ -7182,6 +7250,7 @@ def get(self, full_name: str) -> SchemaInfo: """ headers = {'Accept': 'application/json', } + res = self._api.do('GET', f'/api/2.1/unity-catalog/schemas/{full_name}', headers=headers) return SchemaInfo.from_dict(res) @@ -7264,6 +7333,7 @@ def update(self, if owner is not None: body['owner'] = owner if properties is not None: body['properties'] = properties headers = {'Accept': 'application/json', 'Content-Type': 'application/json', } + res = self._api.do('PATCH', f'/api/2.1/unity-catalog/schemas/{full_name}', body=body, headers=headers) return SchemaInfo.from_dict(res) @@ -7333,6 +7403,7 @@ def create(self, if read_only is not None: body['read_only'] = read_only if skip_validation is not None: body['skip_validation'] = skip_validation headers = {'Accept': 'application/json', 'Content-Type': 'application/json', } + res = self._api.do('POST', '/api/2.1/unity-catalog/storage-credentials', body=body, headers=headers) return StorageCredentialInfo.from_dict(res) @@ -7353,6 +7424,7 @@ def delete(self, name: str, *, force: Optional[bool] = None): query = {} if force is not None: query['force'] = force headers = {'Accept': 'application/json', } + self._api.do('DELETE', f'/api/2.1/unity-catalog/storage-credentials/{name}', query=query, @@ -7371,6 +7443,7 @@ def get(self, name: str) -> StorageCredentialInfo: """ headers = {'Accept': 'application/json', } + res = self._api.do('GET', f'/api/2.1/unity-catalog/storage-credentials/{name}', headers=headers) return StorageCredentialInfo.from_dict(res) @@ -7476,6 +7549,7 @@ def update(self, if read_only is not None: body['read_only'] = read_only if skip_validation is not None: body['skip_validation'] = skip_validation headers = {'Accept': 'application/json', 'Content-Type': 'application/json', } + res = self._api.do('PATCH', f'/api/2.1/unity-catalog/storage-credentials/{name}', body=body, @@ -7540,6 +7614,7 @@ def validate(self, if storage_credential_name is not None: body['storage_credential_name'] = storage_credential_name if url is not None: body['url'] = url headers = {'Accept': 'application/json', 'Content-Type': 'application/json', } + res = self._api.do('POST', '/api/2.1/unity-catalog/validate-storage-credentials', body=body, @@ -7569,6 +7644,7 @@ def disable(self, metastore_id: str, schema_name: DisableSchemaName): """ headers = {'Accept': 'application/json', } + self._api.do('DELETE', f'/api/2.1/unity-catalog/metastores/{metastore_id}/systemschemas/{schema_name.value}', headers=headers) @@ -7588,6 +7664,7 @@ def enable(self, metastore_id: str, schema_name: EnableSchemaName): """ headers = {'Accept': 'application/json', } + self._api.do('PUT', f'/api/2.1/unity-catalog/metastores/{metastore_id}/systemschemas/{schema_name.value}', headers=headers) @@ -7605,6 +7682,7 @@ def list(self, metastore_id: str) -> Iterator[SystemSchemaInfo]: """ headers = {'Accept': 'application/json', } + json = self._api.do('GET', f'/api/2.1/unity-catalog/metastores/{metastore_id}/systemschemas', headers=headers) @@ -7651,6 +7729,7 @@ def create(self, full_name_arg: str, constraint: TableConstraint) -> TableConstr if constraint is not None: body['constraint'] = constraint.as_dict() if full_name_arg is not None: body['full_name_arg'] = full_name_arg headers = {'Accept': 'application/json', 'Content-Type': 'application/json', } + res = self._api.do('POST', '/api/2.1/unity-catalog/constraints', body=body, headers=headers) return TableConstraint.from_dict(res) @@ -7681,6 +7760,7 @@ def delete(self, full_name: str, constraint_name: str, cascade: bool): if cascade is not None: query['cascade'] = cascade if constraint_name is not None: query['constraint_name'] = constraint_name headers = {'Accept': 'application/json', } + self._api.do('DELETE', f'/api/2.1/unity-catalog/constraints/{full_name}', query=query, @@ -7715,6 +7795,7 @@ def delete(self, full_name: str): """ headers = {'Accept': 'application/json', } + self._api.do('DELETE', f'/api/2.1/unity-catalog/tables/{full_name}', headers=headers) def exists(self, full_name: str) -> TableExistsResponse: @@ -7734,6 +7815,7 @@ def exists(self, full_name: str) -> TableExistsResponse: """ headers = {'Accept': 'application/json', } + res = self._api.do('GET', f'/api/2.1/unity-catalog/tables/{full_name}/exists', headers=headers) return TableExistsResponse.from_dict(res) @@ -7757,6 +7839,7 @@ def get(self, full_name: str, *, include_delta_metadata: Optional[bool] = None) query = {} if include_delta_metadata is not None: query['include_delta_metadata'] = include_delta_metadata headers = {'Accept': 'application/json', } + res = self._api.do('GET', f'/api/2.1/unity-catalog/tables/{full_name}', query=query, headers=headers) return TableInfo.from_dict(res) @@ -7889,6 +7972,7 @@ def update(self, full_name: str, *, owner: Optional[str] = None): body = {} if owner is not None: body['owner'] = owner headers = {'Accept': 'application/json', 'Content-Type': 'application/json', } + self._api.do('PATCH', f'/api/2.1/unity-catalog/tables/{full_name}', body=body, headers=headers) @@ -7951,6 +8035,7 @@ def create(self, if storage_location is not None: body['storage_location'] = storage_location if volume_type is not None: body['volume_type'] = volume_type.value headers = {'Accept': 'application/json', 'Content-Type': 'application/json', } + res = self._api.do('POST', '/api/2.1/unity-catalog/volumes', body=body, headers=headers) return VolumeInfo.from_dict(res) @@ -7970,6 +8055,7 @@ def delete(self, full_name_arg: str): """ headers = {} + self._api.do('DELETE', f'/api/2.1/unity-catalog/volumes/{full_name_arg}', headers=headers) def list(self, catalog_name: str, schema_name: str) -> Iterator[VolumeInfo]: @@ -7997,6 +8083,7 @@ def list(self, catalog_name: str, schema_name: str) -> Iterator[VolumeInfo]: if catalog_name is not None: query['catalog_name'] = catalog_name if schema_name is not None: query['schema_name'] = schema_name headers = {'Accept': 'application/json', } + json = self._api.do('GET', '/api/2.1/unity-catalog/volumes', query=query, headers=headers) parsed = ListVolumesResponseContent.from_dict(json).volumes return parsed if parsed is not None else [] @@ -8017,6 +8104,7 @@ def read(self, full_name_arg: str) -> VolumeInfo: """ headers = {'Accept': 'application/json', } + res = self._api.do('GET', f'/api/2.1/unity-catalog/volumes/{full_name_arg}', headers=headers) return VolumeInfo.from_dict(res) @@ -8052,6 +8140,7 @@ def update(self, if new_name is not None: body['new_name'] = new_name if owner is not None: body['owner'] = owner headers = {'Accept': 'application/json', 'Content-Type': 'application/json', } + res = self._api.do('PATCH', f'/api/2.1/unity-catalog/volumes/{full_name_arg}', body=body, @@ -8091,6 +8180,7 @@ def get(self, name: str) -> CurrentWorkspaceBindings: """ headers = {'Accept': 'application/json', } + res = self._api.do('GET', f'/api/2.1/unity-catalog/workspace-bindings/catalogs/{name}', headers=headers) @@ -8111,6 +8201,7 @@ def get_bindings(self, securable_type: str, securable_name: str) -> WorkspaceBin """ headers = {'Accept': 'application/json', } + res = self._api.do('GET', f'/api/2.1/unity-catalog/bindings/{securable_type}/{securable_name}', headers=headers) @@ -8139,6 +8230,7 @@ def update(self, if assign_workspaces is not None: body['assign_workspaces'] = [v for v in assign_workspaces] if unassign_workspaces is not None: body['unassign_workspaces'] = [v for v in unassign_workspaces] headers = {'Accept': 'application/json', 'Content-Type': 'application/json', } + res = self._api.do('PATCH', f'/api/2.1/unity-catalog/workspace-bindings/catalogs/{name}', body=body, @@ -8171,6 +8263,7 @@ def update_bindings(self, if add is not None: body['add'] = [v.as_dict() for v in add] if remove is not None: body['remove'] = [v.as_dict() for v in remove] headers = {'Accept': 'application/json', 'Content-Type': 'application/json', } + res = self._api.do('PATCH', f'/api/2.1/unity-catalog/bindings/{securable_type}/{securable_name}', body=body, diff --git a/databricks/sdk/service/compute.py b/databricks/sdk/service/compute.py index 91ff63a30..89b69e195 100755 --- a/databricks/sdk/service/compute.py +++ b/databricks/sdk/service/compute.py @@ -5560,6 +5560,7 @@ def create(self, body['policy_family_definition_overrides'] = policy_family_definition_overrides if policy_family_id is not None: body['policy_family_id'] = policy_family_id headers = {'Accept': 'application/json', 'Content-Type': 'application/json', } + res = self._api.do('POST', '/api/2.0/policies/clusters/create', body=body, headers=headers) return CreatePolicyResponse.from_dict(res) @@ -5576,6 +5577,7 @@ def delete(self, policy_id: str): body = {} if policy_id is not None: body['policy_id'] = policy_id headers = {'Accept': 'application/json', 'Content-Type': 'application/json', } + self._api.do('POST', '/api/2.0/policies/clusters/delete', body=body, headers=headers) def edit(self, @@ -5638,6 +5640,7 @@ def edit(self, if policy_family_id is not None: body['policy_family_id'] = policy_family_id if policy_id is not None: body['policy_id'] = policy_id headers = {'Accept': 'application/json', 'Content-Type': 'application/json', } + self._api.do('POST', '/api/2.0/policies/clusters/edit', body=body, headers=headers) def get(self, policy_id: str) -> Policy: @@ -5654,6 +5657,7 @@ def get(self, policy_id: str) -> Policy: query = {} if policy_id is not None: query['policy_id'] = policy_id headers = {'Accept': 'application/json', } + res = self._api.do('GET', '/api/2.0/policies/clusters/get', query=query, headers=headers) return Policy.from_dict(res) @@ -5669,6 +5673,7 @@ def get_permission_levels(self, cluster_policy_id: str) -> GetClusterPolicyPermi """ headers = {'Accept': 'application/json', } + res = self._api.do('GET', f'/api/2.0/permissions/cluster-policies/{cluster_policy_id}/permissionLevels', headers=headers) @@ -5687,6 +5692,7 @@ def get_permissions(self, cluster_policy_id: str) -> ClusterPolicyPermissions: """ headers = {'Accept': 'application/json', } + res = self._api.do('GET', f'/api/2.0/permissions/cluster-policies/{cluster_policy_id}', headers=headers) @@ -5714,6 +5720,7 @@ def list(self, if sort_column is not None: query['sort_column'] = sort_column.value if sort_order is not None: query['sort_order'] = sort_order.value headers = {'Accept': 'application/json', } + json = self._api.do('GET', '/api/2.0/policies/clusters/list', query=query, headers=headers) parsed = ListPoliciesResponse.from_dict(json).policies return parsed if parsed is not None else [] @@ -5738,6 +5745,7 @@ def set_permissions( if access_control_list is not None: body['access_control_list'] = [v.as_dict() for v in access_control_list] headers = {'Accept': 'application/json', 'Content-Type': 'application/json', } + res = self._api.do('PUT', f'/api/2.0/permissions/cluster-policies/{cluster_policy_id}', body=body, @@ -5765,6 +5773,7 @@ def update_permissions( if access_control_list is not None: body['access_control_list'] = [v.as_dict() for v in access_control_list] headers = {'Accept': 'application/json', 'Content-Type': 'application/json', } + res = self._api.do('PATCH', f'/api/2.0/permissions/cluster-policies/{cluster_policy_id}', body=body, @@ -5878,6 +5887,7 @@ def change_owner(self, cluster_id: str, owner_username: str): if cluster_id is not None: body['cluster_id'] = cluster_id if owner_username is not None: body['owner_username'] = owner_username headers = {'Accept': 'application/json', 'Content-Type': 'application/json', } + self._api.do('POST', '/api/2.0/clusters/change-owner', body=body, headers=headers) def create(self, @@ -6069,6 +6079,7 @@ def create(self, if ssh_public_keys is not None: body['ssh_public_keys'] = [v for v in ssh_public_keys] if workload_type is not None: body['workload_type'] = workload_type.as_dict() headers = {'Accept': 'application/json', 'Content-Type': 'application/json', } + op_response = self._api.do('POST', '/api/2.0/clusters/create', body=body, headers=headers) return Wait(self.wait_get_cluster_running, response=CreateClusterResponse.from_dict(op_response), @@ -6152,6 +6163,7 @@ def delete(self, cluster_id: str) -> Wait[ClusterDetails]: body = {} if cluster_id is not None: body['cluster_id'] = cluster_id headers = {'Accept': 'application/json', 'Content-Type': 'application/json', } + self._api.do('POST', '/api/2.0/clusters/delete', body=body, headers=headers) return Wait(self.wait_get_cluster_terminated, cluster_id=cluster_id) @@ -6356,6 +6368,7 @@ def edit(self, if ssh_public_keys is not None: body['ssh_public_keys'] = [v for v in ssh_public_keys] if workload_type is not None: body['workload_type'] = workload_type.as_dict() headers = {'Accept': 'application/json', 'Content-Type': 'application/json', } + self._api.do('POST', '/api/2.0/clusters/edit', body=body, headers=headers) return Wait(self.wait_get_cluster_running, cluster_id=cluster_id) @@ -6490,6 +6503,7 @@ def get(self, cluster_id: str) -> ClusterDetails: query = {} if cluster_id is not None: query['cluster_id'] = cluster_id headers = {'Accept': 'application/json', } + res = self._api.do('GET', '/api/2.0/clusters/get', query=query, headers=headers) return ClusterDetails.from_dict(res) @@ -6505,6 +6519,7 @@ def get_permission_levels(self, cluster_id: str) -> GetClusterPermissionLevelsRe """ headers = {'Accept': 'application/json', } + res = self._api.do('GET', f'/api/2.0/permissions/clusters/{cluster_id}/permissionLevels', headers=headers) @@ -6522,6 +6537,7 @@ def get_permissions(self, cluster_id: str) -> ClusterPermissions: """ headers = {'Accept': 'application/json', } + res = self._api.do('GET', f'/api/2.0/permissions/clusters/{cluster_id}', headers=headers) return ClusterPermissions.from_dict(res) @@ -6548,6 +6564,7 @@ def list(self, *, can_use_client: Optional[str] = None) -> Iterator[ClusterDetai query = {} if can_use_client is not None: query['can_use_client'] = can_use_client headers = {'Accept': 'application/json', } + json = self._api.do('GET', '/api/2.0/clusters/list', query=query, headers=headers) parsed = ListClustersResponse.from_dict(json).clusters return parsed if parsed is not None else [] @@ -6561,6 +6578,7 @@ def list_node_types(self) -> ListNodeTypesResponse: """ headers = {'Accept': 'application/json', } + res = self._api.do('GET', '/api/2.0/clusters/list-node-types', headers=headers) return ListNodeTypesResponse.from_dict(res) @@ -6574,6 +6592,7 @@ def list_zones(self) -> ListAvailableZonesResponse: """ headers = {'Accept': 'application/json', } + res = self._api.do('GET', '/api/2.0/clusters/list-zones', headers=headers) return ListAvailableZonesResponse.from_dict(res) @@ -6594,6 +6613,7 @@ def permanent_delete(self, cluster_id: str): body = {} if cluster_id is not None: body['cluster_id'] = cluster_id headers = {'Accept': 'application/json', 'Content-Type': 'application/json', } + self._api.do('POST', '/api/2.0/clusters/permanent-delete', body=body, headers=headers) def pin(self, cluster_id: str): @@ -6610,6 +6630,7 @@ def pin(self, cluster_id: str): body = {} if cluster_id is not None: body['cluster_id'] = cluster_id headers = {'Accept': 'application/json', 'Content-Type': 'application/json', } + self._api.do('POST', '/api/2.0/clusters/pin', body=body, headers=headers) def resize(self, @@ -6646,6 +6667,7 @@ def resize(self, if cluster_id is not None: body['cluster_id'] = cluster_id if num_workers is not None: body['num_workers'] = num_workers headers = {'Accept': 'application/json', 'Content-Type': 'application/json', } + self._api.do('POST', '/api/2.0/clusters/resize', body=body, headers=headers) return Wait(self.wait_get_cluster_running, cluster_id=cluster_id) @@ -6677,6 +6699,7 @@ def restart(self, cluster_id: str, *, restart_user: Optional[str] = None) -> Wai if cluster_id is not None: body['cluster_id'] = cluster_id if restart_user is not None: body['restart_user'] = restart_user headers = {'Accept': 'application/json', 'Content-Type': 'application/json', } + self._api.do('POST', '/api/2.0/clusters/restart', body=body, headers=headers) return Wait(self.wait_get_cluster_running, cluster_id=cluster_id) @@ -6706,6 +6729,7 @@ def set_permissions( if access_control_list is not None: body['access_control_list'] = [v.as_dict() for v in access_control_list] headers = {'Accept': 'application/json', 'Content-Type': 'application/json', } + res = self._api.do('PUT', f'/api/2.0/permissions/clusters/{cluster_id}', body=body, headers=headers) return ClusterPermissions.from_dict(res) @@ -6718,6 +6742,7 @@ def spark_versions(self) -> GetSparkVersionsResponse: """ headers = {'Accept': 'application/json', } + res = self._api.do('GET', '/api/2.0/clusters/spark-versions', headers=headers) return GetSparkVersionsResponse.from_dict(res) @@ -6741,6 +6766,7 @@ def start(self, cluster_id: str) -> Wait[ClusterDetails]: body = {} if cluster_id is not None: body['cluster_id'] = cluster_id headers = {'Accept': 'application/json', 'Content-Type': 'application/json', } + self._api.do('POST', '/api/2.0/clusters/start', body=body, headers=headers) return Wait(self.wait_get_cluster_running, cluster_id=cluster_id) @@ -6762,6 +6788,7 @@ def unpin(self, cluster_id: str): body = {} if cluster_id is not None: body['cluster_id'] = cluster_id headers = {'Accept': 'application/json', 'Content-Type': 'application/json', } + self._api.do('POST', '/api/2.0/clusters/unpin', body=body, headers=headers) def update_permissions( @@ -6783,6 +6810,7 @@ def update_permissions( if access_control_list is not None: body['access_control_list'] = [v.as_dict() for v in access_control_list] headers = {'Accept': 'application/json', 'Content-Type': 'application/json', } + res = self._api.do('PATCH', f'/api/2.0/permissions/clusters/{cluster_id}', body=body, headers=headers) return ClusterPermissions.from_dict(res) @@ -6917,6 +6945,7 @@ def cancel(self, if command_id is not None: body['commandId'] = command_id if context_id is not None: body['contextId'] = context_id headers = {'Accept': 'application/json', 'Content-Type': 'application/json', } + self._api.do('POST', '/api/1.2/commands/cancel', body=body, headers=headers) return Wait(self.wait_command_status_command_execution_cancelled, cluster_id=cluster_id, @@ -6952,6 +6981,7 @@ def command_status(self, cluster_id: str, context_id: str, command_id: str) -> C if command_id is not None: query['commandId'] = command_id if context_id is not None: query['contextId'] = context_id headers = {'Accept': 'application/json', } + res = self._api.do('GET', '/api/1.2/commands/status', query=query, headers=headers) return CommandStatusResponse.from_dict(res) @@ -6970,6 +7000,7 @@ def context_status(self, cluster_id: str, context_id: str) -> ContextStatusRespo if cluster_id is not None: query['clusterId'] = cluster_id if context_id is not None: query['contextId'] = context_id headers = {'Accept': 'application/json', } + res = self._api.do('GET', '/api/1.2/contexts/status', query=query, headers=headers) return ContextStatusResponse.from_dict(res) @@ -6995,6 +7026,7 @@ def create(self, if cluster_id is not None: body['clusterId'] = cluster_id if language is not None: body['language'] = language.value headers = {'Accept': 'application/json', 'Content-Type': 'application/json', } + op_response = self._api.do('POST', '/api/1.2/contexts/create', body=body, headers=headers) return Wait(self.wait_context_status_command_execution_running, response=Created.from_dict(op_response), @@ -7023,6 +7055,7 @@ def destroy(self, cluster_id: str, context_id: str): if cluster_id is not None: body['clusterId'] = cluster_id if context_id is not None: body['contextId'] = context_id headers = {'Accept': 'application/json', 'Content-Type': 'application/json', } + self._api.do('POST', '/api/1.2/contexts/destroy', body=body, headers=headers) def execute(self, @@ -7055,6 +7088,7 @@ def execute(self, if context_id is not None: body['contextId'] = context_id if language is not None: body['language'] = language.value headers = {'Accept': 'application/json', 'Content-Type': 'application/json', } + op_response = self._api.do('POST', '/api/1.2/commands/execute', body=body, headers=headers) return Wait(self.wait_command_status_command_execution_finished_or_error, response=Created.from_dict(op_response), @@ -7121,6 +7155,7 @@ def create(self, if position is not None: body['position'] = position if script is not None: body['script'] = script headers = {'Accept': 'application/json', 'Content-Type': 'application/json', } + res = self._api.do('POST', '/api/2.0/global-init-scripts', body=body, headers=headers) return CreateResponse.from_dict(res) @@ -7136,6 +7171,7 @@ def delete(self, script_id: str): """ headers = {} + self._api.do('DELETE', f'/api/2.0/global-init-scripts/{script_id}', headers=headers) def get(self, script_id: str) -> GlobalInitScriptDetailsWithContent: @@ -7150,6 +7186,7 @@ def get(self, script_id: str) -> GlobalInitScriptDetailsWithContent: """ headers = {'Accept': 'application/json', } + res = self._api.do('GET', f'/api/2.0/global-init-scripts/{script_id}', headers=headers) return GlobalInitScriptDetailsWithContent.from_dict(res) @@ -7164,6 +7201,7 @@ def list(self) -> Iterator[GlobalInitScriptDetails]: """ headers = {'Accept': 'application/json', } + json = self._api.do('GET', '/api/2.0/global-init-scripts', headers=headers) parsed = ListGlobalInitScriptsResponse.from_dict(json).scripts return parsed if parsed is not None else [] @@ -7207,6 +7245,7 @@ def update(self, if position is not None: body['position'] = position if script is not None: body['script'] = script headers = {'Content-Type': 'application/json', } + self._api.do('PATCH', f'/api/2.0/global-init-scripts/{script_id}', body=body, headers=headers) @@ -7315,6 +7354,7 @@ def create(self, if preloaded_spark_versions is not None: body['preloaded_spark_versions'] = [v for v in preloaded_spark_versions] headers = {'Accept': 'application/json', 'Content-Type': 'application/json', } + res = self._api.do('POST', '/api/2.0/instance-pools/create', body=body, headers=headers) return CreateInstancePoolResponse.from_dict(res) @@ -7331,6 +7371,7 @@ def delete(self, instance_pool_id: str): body = {} if instance_pool_id is not None: body['instance_pool_id'] = instance_pool_id headers = {'Accept': 'application/json', 'Content-Type': 'application/json', } + self._api.do('POST', '/api/2.0/instance-pools/delete', body=body, headers=headers) def edit(self, @@ -7386,6 +7427,7 @@ def edit(self, if min_idle_instances is not None: body['min_idle_instances'] = min_idle_instances if node_type_id is not None: body['node_type_id'] = node_type_id headers = {'Accept': 'application/json', 'Content-Type': 'application/json', } + self._api.do('POST', '/api/2.0/instance-pools/edit', body=body, headers=headers) def get(self, instance_pool_id: str) -> GetInstancePool: @@ -7402,6 +7444,7 @@ def get(self, instance_pool_id: str) -> GetInstancePool: query = {} if instance_pool_id is not None: query['instance_pool_id'] = instance_pool_id headers = {'Accept': 'application/json', } + res = self._api.do('GET', '/api/2.0/instance-pools/get', query=query, headers=headers) return GetInstancePool.from_dict(res) @@ -7417,6 +7460,7 @@ def get_permission_levels(self, instance_pool_id: str) -> GetInstancePoolPermiss """ headers = {'Accept': 'application/json', } + res = self._api.do('GET', f'/api/2.0/permissions/instance-pools/{instance_pool_id}/permissionLevels', headers=headers) @@ -7435,6 +7479,7 @@ def get_permissions(self, instance_pool_id: str) -> InstancePoolPermissions: """ headers = {'Accept': 'application/json', } + res = self._api.do('GET', f'/api/2.0/permissions/instance-pools/{instance_pool_id}', headers=headers) return InstancePoolPermissions.from_dict(res) @@ -7447,6 +7492,7 @@ def list(self) -> Iterator[InstancePoolAndStats]: """ headers = {'Accept': 'application/json', } + json = self._api.do('GET', '/api/2.0/instance-pools/list', headers=headers) parsed = ListInstancePools.from_dict(json).instance_pools return parsed if parsed is not None else [] @@ -7471,6 +7517,7 @@ def set_permissions( if access_control_list is not None: body['access_control_list'] = [v.as_dict() for v in access_control_list] headers = {'Accept': 'application/json', 'Content-Type': 'application/json', } + res = self._api.do('PUT', f'/api/2.0/permissions/instance-pools/{instance_pool_id}', body=body, @@ -7498,6 +7545,7 @@ def update_permissions( if access_control_list is not None: body['access_control_list'] = [v.as_dict() for v in access_control_list] headers = {'Accept': 'application/json', 'Content-Type': 'application/json', } + res = self._api.do('PATCH', f'/api/2.0/permissions/instance-pools/{instance_pool_id}', body=body, @@ -7556,6 +7604,7 @@ def add(self, if is_meta_instance_profile is not None: body['is_meta_instance_profile'] = is_meta_instance_profile if skip_validation is not None: body['skip_validation'] = skip_validation headers = {'Accept': 'application/json', 'Content-Type': 'application/json', } + self._api.do('POST', '/api/2.0/instance-profiles/add', body=body, headers=headers) def edit(self, @@ -7601,6 +7650,7 @@ def edit(self, if instance_profile_arn is not None: body['instance_profile_arn'] = instance_profile_arn if is_meta_instance_profile is not None: body['is_meta_instance_profile'] = is_meta_instance_profile headers = {'Accept': 'application/json', 'Content-Type': 'application/json', } + self._api.do('POST', '/api/2.0/instance-profiles/edit', body=body, headers=headers) def list(self) -> Iterator[InstanceProfile]: @@ -7614,6 +7664,7 @@ def list(self) -> Iterator[InstanceProfile]: """ headers = {'Accept': 'application/json', } + json = self._api.do('GET', '/api/2.0/instance-profiles/list', headers=headers) parsed = ListInstanceProfilesResponse.from_dict(json).instance_profiles return parsed if parsed is not None else [] @@ -7634,6 +7685,7 @@ def remove(self, instance_profile_arn: str): body = {} if instance_profile_arn is not None: body['instance_profile_arn'] = instance_profile_arn headers = {'Accept': 'application/json', 'Content-Type': 'application/json', } + self._api.do('POST', '/api/2.0/instance-profiles/remove', body=body, headers=headers) @@ -7669,6 +7721,7 @@ def all_cluster_statuses(self) -> ListAllClusterLibraryStatusesResponse: """ headers = {'Accept': 'application/json', } + res = self._api.do('GET', '/api/2.0/libraries/all-cluster-statuses', headers=headers) return ListAllClusterLibraryStatusesResponse.from_dict(res) @@ -7697,6 +7750,7 @@ def cluster_status(self, cluster_id: str) -> Iterator[LibraryFullStatus]: query = {} if cluster_id is not None: query['cluster_id'] = cluster_id headers = {'Accept': 'application/json', } + json = self._api.do('GET', '/api/2.0/libraries/cluster-status', query=query, headers=headers) parsed = ClusterLibraryStatuses.from_dict(json).library_statuses return parsed if parsed is not None else [] @@ -7721,6 +7775,7 @@ def install(self, cluster_id: str, libraries: List[Library]): if cluster_id is not None: body['cluster_id'] = cluster_id if libraries is not None: body['libraries'] = [v.as_dict() for v in libraries] headers = {'Accept': 'application/json', 'Content-Type': 'application/json', } + self._api.do('POST', '/api/2.0/libraries/install', body=body, headers=headers) def uninstall(self, cluster_id: str, libraries: List[Library]): @@ -7741,6 +7796,7 @@ def uninstall(self, cluster_id: str, libraries: List[Library]): if cluster_id is not None: body['cluster_id'] = cluster_id if libraries is not None: body['libraries'] = [v.as_dict() for v in libraries] headers = {'Accept': 'application/json', 'Content-Type': 'application/json', } + self._api.do('POST', '/api/2.0/libraries/uninstall', body=body, headers=headers) @@ -7769,6 +7825,7 @@ def get(self, policy_family_id: str) -> PolicyFamily: """ headers = {'Accept': 'application/json', } + res = self._api.do('GET', f'/api/2.0/policy-families/{policy_family_id}', headers=headers) return PolicyFamily.from_dict(res) diff --git a/databricks/sdk/service/dashboards.py b/databricks/sdk/service/dashboards.py index 51ae22e1e..49f281922 100755 --- a/databricks/sdk/service/dashboards.py +++ b/databricks/sdk/service/dashboards.py @@ -69,6 +69,7 @@ def publish(self, if embed_credentials is not None: body['embed_credentials'] = embed_credentials if warehouse_id is not None: body['warehouse_id'] = warehouse_id headers = {'Accept': 'application/json', 'Content-Type': 'application/json', } + self._api.do('POST', f'/api/2.0/lakeview/dashboards/{dashboard_id}/published', body=body, diff --git a/databricks/sdk/service/files.py b/databricks/sdk/service/files.py index 1878f748f..e08753daa 100755 --- a/databricks/sdk/service/files.py +++ b/databricks/sdk/service/files.py @@ -153,6 +153,17 @@ def from_dict(cls, d: Dict[str, any]) -> DirectoryEntry: class DownloadResponse: contents: Optional[BinaryIO] = None + def as_dict(self) -> dict: + """Serializes the DownloadResponse into a dictionary suitable for use as a JSON request body.""" + body = {} + if self.contents: body['contents'] = self.contents + return body + + @classmethod + def from_dict(cls, d: Dict[str, any]) -> DownloadResponse: + """Deserializes the DownloadResponse from a dictionary.""" + return cls(contents=d.get('contents', None)) + @dataclass class FileInfo: @@ -338,6 +349,7 @@ def add_block(self, handle: int, data: str): if data is not None: body['data'] = data if handle is not None: body['handle'] = handle headers = {'Accept': 'application/json', 'Content-Type': 'application/json', } + self._api.do('POST', '/api/2.0/dbfs/add-block', body=body, headers=headers) def close(self, handle: int): @@ -354,6 +366,7 @@ def close(self, handle: int): body = {} if handle is not None: body['handle'] = handle headers = {'Accept': 'application/json', 'Content-Type': 'application/json', } + self._api.do('POST', '/api/2.0/dbfs/close', body=body, headers=headers) def create(self, path: str, *, overwrite: Optional[bool] = None) -> CreateResponse: @@ -379,6 +392,7 @@ def create(self, path: str, *, overwrite: Optional[bool] = None) -> CreateRespon if overwrite is not None: body['overwrite'] = overwrite if path is not None: body['path'] = path headers = {'Accept': 'application/json', 'Content-Type': 'application/json', } + res = self._api.do('POST', '/api/2.0/dbfs/create', body=body, headers=headers) return CreateResponse.from_dict(res) @@ -412,6 +426,7 @@ def delete(self, path: str, *, recursive: Optional[bool] = None): if path is not None: body['path'] = path if recursive is not None: body['recursive'] = recursive headers = {'Accept': 'application/json', 'Content-Type': 'application/json', } + self._api.do('POST', '/api/2.0/dbfs/delete', body=body, headers=headers) def get_status(self, path: str) -> FileInfo: @@ -429,6 +444,7 @@ def get_status(self, path: str) -> FileInfo: query = {} if path is not None: query['path'] = path headers = {'Accept': 'application/json', } + res = self._api.do('GET', '/api/2.0/dbfs/get-status', query=query, headers=headers) return FileInfo.from_dict(res) @@ -454,6 +470,7 @@ def list(self, path: str) -> Iterator[FileInfo]: query = {} if path is not None: query['path'] = path headers = {'Accept': 'application/json', } + json = self._api.do('GET', '/api/2.0/dbfs/list', query=query, headers=headers) parsed = ListStatusResponse.from_dict(json).files return parsed if parsed is not None else [] @@ -474,6 +491,7 @@ def mkdirs(self, path: str): body = {} if path is not None: body['path'] = path headers = {'Accept': 'application/json', 'Content-Type': 'application/json', } + self._api.do('POST', '/api/2.0/dbfs/mkdirs', body=body, headers=headers) def move(self, source_path: str, destination_path: str): @@ -495,6 +513,7 @@ def move(self, source_path: str, destination_path: str): if destination_path is not None: body['destination_path'] = destination_path if source_path is not None: body['source_path'] = source_path headers = {'Accept': 'application/json', 'Content-Type': 'application/json', } + self._api.do('POST', '/api/2.0/dbfs/move', body=body, headers=headers) def put(self, path: str, *, contents: Optional[str] = None, overwrite: Optional[bool] = None): @@ -525,6 +544,7 @@ def put(self, path: str, *, contents: Optional[str] = None, overwrite: Optional[ if overwrite is not None: body['overwrite'] = overwrite if path is not None: body['path'] = path headers = {'Accept': 'application/json', 'Content-Type': 'application/json', } + self._api.do('POST', '/api/2.0/dbfs/put', body=body, headers=headers) def read(self, path: str, *, length: Optional[int] = None, offset: Optional[int] = None) -> ReadResponse: @@ -554,6 +574,7 @@ def read(self, path: str, *, length: Optional[int] = None, offset: Optional[int] if offset is not None: query['offset'] = offset if path is not None: query['path'] = path headers = {'Accept': 'application/json', } + res = self._api.do('GET', '/api/2.0/dbfs/read', query=query, headers=headers) return ReadResponse.from_dict(res) @@ -576,6 +597,7 @@ def create_directory(self, directory_path: str): """ headers = {} + self._api.do('PUT', f'/api/2.0/fs/directories{directory_path}', headers=headers) def delete(self, file_path: str): @@ -590,6 +612,7 @@ def delete(self, file_path: str): """ headers = {} + self._api.do('DELETE', f'/api/2.0/fs/files{file_path}', headers=headers) def delete_directory(self, directory_path: str): @@ -604,6 +627,7 @@ def delete_directory(self, directory_path: str): """ headers = {} + self._api.do('DELETE', f'/api/2.0/fs/directories{directory_path}', headers=headers) def download(self, file_path: str) -> DownloadResponse: @@ -618,8 +642,9 @@ def download(self, file_path: str) -> DownloadResponse: """ headers = {'Accept': 'application/octet-stream', } + res = self._api.do('GET', f'/api/2.0/fs/files{file_path}', headers=headers, raw=True) - return DownloadResponse(contents=res) + return DownloadResponse.from_dict(res) def list_directory_contents(self, directory_path: str, @@ -682,4 +707,5 @@ def upload(self, file_path: str, contents: BinaryIO, *, overwrite: Optional[bool query = {} if overwrite is not None: query['overwrite'] = overwrite headers = {'Content-Type': 'application/octet-stream', } + self._api.do('PUT', f'/api/2.0/fs/files{file_path}', query=query, headers=headers, data=contents) diff --git a/databricks/sdk/service/iam.py b/databricks/sdk/service/iam.py index 18d16d3fb..08bf3b914 100755 --- a/databricks/sdk/service/iam.py +++ b/databricks/sdk/service/iam.py @@ -91,6 +91,8 @@ class ComplexValue: primary: Optional[bool] = None + ref: Optional[str] = None + type: Optional[str] = None value: Optional[str] = None @@ -100,6 +102,7 @@ def as_dict(self) -> dict: body = {} if self.display is not None: body['display'] = self.display if self.primary is not None: body['primary'] = self.primary + if self.ref is not None: body['$ref'] = self.ref if self.type is not None: body['type'] = self.type if self.value is not None: body['value'] = self.value return body @@ -109,6 +112,7 @@ def from_dict(cls, d: Dict[str, any]) -> ComplexValue: """Deserializes the ComplexValue from a dictionary.""" return cls(display=d.get('display', None), primary=d.get('primary', None), + ref=d.get('$ref', None), type=d.get('type', None), value=d.get('value', None)) @@ -1173,6 +1177,7 @@ def get_assignable_roles_for_resource(self, resource: str) -> GetAssignableRoles query = {} if resource is not None: query['resource'] = resource headers = {'Accept': 'application/json', } + res = self._api.do( 'GET', f'/api/2.0/preview/accounts/{self._api.account_id}/access-control/assignable-roles', @@ -1203,6 +1208,7 @@ def get_rule_set(self, name: str, etag: str) -> RuleSetResponse: if etag is not None: query['etag'] = etag if name is not None: query['name'] = name headers = {'Accept': 'application/json', } + res = self._api.do('GET', f'/api/2.0/preview/accounts/{self._api.account_id}/access-control/rule-sets', query=query, @@ -1225,6 +1231,7 @@ def update_rule_set(self, name: str, rule_set: RuleSetUpdateRequest) -> RuleSetR if name is not None: body['name'] = name if rule_set is not None: body['rule_set'] = rule_set.as_dict() headers = {'Accept': 'application/json', 'Content-Type': 'application/json', } + res = self._api.do('PUT', f'/api/2.0/preview/accounts/{self._api.account_id}/access-control/rule-sets', body=body, @@ -1255,6 +1262,7 @@ def get_assignable_roles_for_resource(self, resource: str) -> GetAssignableRoles query = {} if resource is not None: query['resource'] = resource headers = {'Accept': 'application/json', } + res = self._api.do('GET', '/api/2.0/preview/accounts/access-control/assignable-roles', query=query, @@ -1284,6 +1292,7 @@ def get_rule_set(self, name: str, etag: str) -> RuleSetResponse: if etag is not None: query['etag'] = etag if name is not None: query['name'] = name headers = {'Accept': 'application/json', } + res = self._api.do('GET', '/api/2.0/preview/accounts/access-control/rule-sets', query=query, @@ -1306,6 +1315,7 @@ def update_rule_set(self, name: str, rule_set: RuleSetUpdateRequest) -> RuleSetR if name is not None: body['name'] = name if rule_set is not None: body['rule_set'] = rule_set.as_dict() headers = {'Accept': 'application/json', 'Content-Type': 'application/json', } + res = self._api.do('PUT', '/api/2.0/preview/accounts/access-control/rule-sets', body=body, @@ -1371,6 +1381,7 @@ def create(self, if roles is not None: body['roles'] = [v.as_dict() for v in roles] if schemas is not None: body['schemas'] = [v.value for v in schemas] headers = {'Accept': 'application/json', 'Content-Type': 'application/json', } + res = self._api.do('POST', f'/api/2.0/accounts/{self._api.account_id}/scim/v2/Groups', body=body, @@ -1389,6 +1400,7 @@ def delete(self, id: str): """ headers = {} + self._api.do('DELETE', f'/api/2.0/accounts/{self._api.account_id}/scim/v2/Groups/{id}', headers=headers) @@ -1405,6 +1417,7 @@ def get(self, id: str) -> Group: """ headers = {'Accept': 'application/json', } + res = self._api.do('GET', f'/api/2.0/accounts/{self._api.account_id}/scim/v2/Groups/{id}', headers=headers) @@ -1497,6 +1510,7 @@ def patch(self, if operations is not None: body['Operations'] = [v.as_dict() for v in operations] if schemas is not None: body['schemas'] = [v.value for v in schemas] headers = {'Accept': 'application/json', 'Content-Type': 'application/json', } + self._api.do('PATCH', f'/api/2.0/accounts/{self._api.account_id}/scim/v2/Groups/{id}', body=body, @@ -1548,6 +1562,7 @@ def update(self, if roles is not None: body['roles'] = [v.as_dict() for v in roles] if schemas is not None: body['schemas'] = [v.value for v in schemas] headers = {'Accept': 'application/json', 'Content-Type': 'application/json', } + self._api.do('PUT', f'/api/2.0/accounts/{self._api.account_id}/scim/v2/Groups/{id}', body=body, @@ -1612,6 +1627,7 @@ def create(self, if roles is not None: body['roles'] = [v.as_dict() for v in roles] if schemas is not None: body['schemas'] = [v.value for v in schemas] headers = {'Accept': 'application/json', 'Content-Type': 'application/json', } + res = self._api.do('POST', f'/api/2.0/accounts/{self._api.account_id}/scim/v2/ServicePrincipals', body=body, @@ -1630,6 +1646,7 @@ def delete(self, id: str): """ headers = {} + self._api.do('DELETE', f'/api/2.0/accounts/{self._api.account_id}/scim/v2/ServicePrincipals/{id}', headers=headers) @@ -1646,6 +1663,7 @@ def get(self, id: str) -> ServicePrincipal: """ headers = {'Accept': 'application/json', } + res = self._api.do('GET', f'/api/2.0/accounts/{self._api.account_id}/scim/v2/ServicePrincipals/{id}', headers=headers) @@ -1738,6 +1756,7 @@ def patch(self, if operations is not None: body['Operations'] = [v.as_dict() for v in operations] if schemas is not None: body['schemas'] = [v.value for v in schemas] headers = {'Accept': 'application/json', 'Content-Type': 'application/json', } + self._api.do('PATCH', f'/api/2.0/accounts/{self._api.account_id}/scim/v2/ServicePrincipals/{id}', body=body, @@ -1792,6 +1811,7 @@ def update(self, if roles is not None: body['roles'] = [v.as_dict() for v in roles] if schemas is not None: body['schemas'] = [v.value for v in schemas] headers = {'Accept': 'application/json', 'Content-Type': 'application/json', } + self._api.do('PUT', f'/api/2.0/accounts/{self._api.account_id}/scim/v2/ServicePrincipals/{id}', body=body, @@ -1873,6 +1893,7 @@ def create(self, if schemas is not None: body['schemas'] = [v.value for v in schemas] if user_name is not None: body['userName'] = user_name headers = {'Accept': 'application/json', 'Content-Type': 'application/json', } + res = self._api.do('POST', f'/api/2.0/accounts/{self._api.account_id}/scim/v2/Users', body=body, @@ -1892,6 +1913,7 @@ def delete(self, id: str): """ headers = {} + self._api.do('DELETE', f'/api/2.0/accounts/{self._api.account_id}/scim/v2/Users/{id}', headers=headers) @@ -1945,6 +1967,7 @@ def get(self, if sort_order is not None: query['sortOrder'] = sort_order.value if start_index is not None: query['startIndex'] = start_index headers = {'Accept': 'application/json', } + res = self._api.do('GET', f'/api/2.0/accounts/{self._api.account_id}/scim/v2/Users/{id}', query=query, @@ -2039,6 +2062,7 @@ def patch(self, if operations is not None: body['Operations'] = [v.as_dict() for v in operations] if schemas is not None: body['schemas'] = [v.value for v in schemas] headers = {'Accept': 'application/json', 'Content-Type': 'application/json', } + self._api.do('PATCH', f'/api/2.0/accounts/{self._api.account_id}/scim/v2/Users/{id}', body=body, @@ -2103,6 +2127,7 @@ def update(self, if schemas is not None: body['schemas'] = [v.value for v in schemas] if user_name is not None: body['userName'] = user_name headers = {'Accept': 'application/json', 'Content-Type': 'application/json', } + self._api.do('PUT', f'/api/2.0/accounts/{self._api.account_id}/scim/v2/Users/{id}', body=body, @@ -2124,6 +2149,7 @@ def me(self) -> User: """ headers = {'Accept': 'application/json', } + res = self._api.do('GET', '/api/2.0/preview/scim/v2/Me', headers=headers) return User.from_dict(res) @@ -2186,6 +2212,7 @@ def create(self, if roles is not None: body['roles'] = [v.as_dict() for v in roles] if schemas is not None: body['schemas'] = [v.value for v in schemas] headers = {'Accept': 'application/json', 'Content-Type': 'application/json', } + res = self._api.do('POST', '/api/2.0/preview/scim/v2/Groups', body=body, headers=headers) return Group.from_dict(res) @@ -2201,6 +2228,7 @@ def delete(self, id: str): """ headers = {} + self._api.do('DELETE', f'/api/2.0/preview/scim/v2/Groups/{id}', headers=headers) def get(self, id: str) -> Group: @@ -2215,6 +2243,7 @@ def get(self, id: str) -> Group: """ headers = {'Accept': 'application/json', } + res = self._api.do('GET', f'/api/2.0/preview/scim/v2/Groups/{id}', headers=headers) return Group.from_dict(res) @@ -2302,6 +2331,7 @@ def patch(self, if operations is not None: body['Operations'] = [v.as_dict() for v in operations] if schemas is not None: body['schemas'] = [v.value for v in schemas] headers = {'Accept': 'application/json', 'Content-Type': 'application/json', } + self._api.do('PATCH', f'/api/2.0/preview/scim/v2/Groups/{id}', body=body, headers=headers) def update(self, @@ -2350,6 +2380,7 @@ def update(self, if roles is not None: body['roles'] = [v.as_dict() for v in roles] if schemas is not None: body['schemas'] = [v.value for v in schemas] headers = {'Accept': 'application/json', 'Content-Type': 'application/json', } + self._api.do('PUT', f'/api/2.0/preview/scim/v2/Groups/{id}', body=body, headers=headers) @@ -2419,6 +2450,7 @@ def get(self, request_object_type: str, request_object_id: str) -> ObjectPermiss """ headers = {'Accept': 'application/json', } + res = self._api.do('GET', f'/api/2.0/permissions/{request_object_type}/{request_object_id}', headers=headers) @@ -2439,6 +2471,7 @@ def get_permission_levels(self, request_object_type: str, """ headers = {'Accept': 'application/json', } + res = self._api.do('GET', f'/api/2.0/permissions/{request_object_type}/{request_object_id}/permissionLevels', headers=headers) @@ -2468,6 +2501,7 @@ def set(self, if access_control_list is not None: body['access_control_list'] = [v.as_dict() for v in access_control_list] headers = {'Accept': 'application/json', 'Content-Type': 'application/json', } + res = self._api.do('PUT', f'/api/2.0/permissions/{request_object_type}/{request_object_id}', body=body, @@ -2498,6 +2532,7 @@ def update(self, if access_control_list is not None: body['access_control_list'] = [v.as_dict() for v in access_control_list] headers = {'Accept': 'application/json', 'Content-Type': 'application/json', } + res = self._api.do('PATCH', f'/api/2.0/permissions/{request_object_type}/{request_object_id}', body=body, @@ -2563,6 +2598,7 @@ def create(self, if roles is not None: body['roles'] = [v.as_dict() for v in roles] if schemas is not None: body['schemas'] = [v.value for v in schemas] headers = {'Accept': 'application/json', 'Content-Type': 'application/json', } + res = self._api.do('POST', '/api/2.0/preview/scim/v2/ServicePrincipals', body=body, headers=headers) return ServicePrincipal.from_dict(res) @@ -2578,6 +2614,7 @@ def delete(self, id: str): """ headers = {} + self._api.do('DELETE', f'/api/2.0/preview/scim/v2/ServicePrincipals/{id}', headers=headers) def get(self, id: str) -> ServicePrincipal: @@ -2592,6 +2629,7 @@ def get(self, id: str) -> ServicePrincipal: """ headers = {'Accept': 'application/json', } + res = self._api.do('GET', f'/api/2.0/preview/scim/v2/ServicePrincipals/{id}', headers=headers) return ServicePrincipal.from_dict(res) @@ -2682,6 +2720,7 @@ def patch(self, if operations is not None: body['Operations'] = [v.as_dict() for v in operations] if schemas is not None: body['schemas'] = [v.value for v in schemas] headers = {'Accept': 'application/json', 'Content-Type': 'application/json', } + self._api.do('PATCH', f'/api/2.0/preview/scim/v2/ServicePrincipals/{id}', body=body, headers=headers) def update(self, @@ -2733,6 +2772,7 @@ def update(self, if roles is not None: body['roles'] = [v.as_dict() for v in roles] if schemas is not None: body['schemas'] = [v.value for v in schemas] headers = {'Accept': 'application/json', 'Content-Type': 'application/json', } + self._api.do('PUT', f'/api/2.0/preview/scim/v2/ServicePrincipals/{id}', body=body, headers=headers) @@ -2811,6 +2851,7 @@ def create(self, if schemas is not None: body['schemas'] = [v.value for v in schemas] if user_name is not None: body['userName'] = user_name headers = {'Accept': 'application/json', 'Content-Type': 'application/json', } + res = self._api.do('POST', '/api/2.0/preview/scim/v2/Users', body=body, headers=headers) return User.from_dict(res) @@ -2827,6 +2868,7 @@ def delete(self, id: str): """ headers = {} + self._api.do('DELETE', f'/api/2.0/preview/scim/v2/Users/{id}', headers=headers) def get(self, @@ -2878,6 +2920,7 @@ def get(self, if sort_order is not None: query['sortOrder'] = sort_order.value if start_index is not None: query['startIndex'] = start_index headers = {'Accept': 'application/json', } + res = self._api.do('GET', f'/api/2.0/preview/scim/v2/Users/{id}', query=query, headers=headers) return User.from_dict(res) @@ -2890,6 +2933,7 @@ def get_permission_levels(self) -> GetPasswordPermissionLevelsResponse: """ headers = {'Accept': 'application/json', } + res = self._api.do('GET', '/api/2.0/permissions/authorization/passwords/permissionLevels', headers=headers) @@ -2904,6 +2948,7 @@ def get_permissions(self) -> PasswordPermissions: """ headers = {'Accept': 'application/json', } + res = self._api.do('GET', '/api/2.0/permissions/authorization/passwords', headers=headers) return PasswordPermissions.from_dict(res) @@ -2992,6 +3037,7 @@ def patch(self, if operations is not None: body['Operations'] = [v.as_dict() for v in operations] if schemas is not None: body['schemas'] = [v.value for v in schemas] headers = {'Accept': 'application/json', 'Content-Type': 'application/json', } + self._api.do('PATCH', f'/api/2.0/preview/scim/v2/Users/{id}', body=body, headers=headers) def set_permissions( @@ -3010,6 +3056,7 @@ def set_permissions( if access_control_list is not None: body['access_control_list'] = [v.as_dict() for v in access_control_list] headers = {'Accept': 'application/json', 'Content-Type': 'application/json', } + res = self._api.do('PUT', '/api/2.0/permissions/authorization/passwords', body=body, headers=headers) return PasswordPermissions.from_dict(res) @@ -3072,6 +3119,7 @@ def update(self, if schemas is not None: body['schemas'] = [v.value for v in schemas] if user_name is not None: body['userName'] = user_name headers = {'Accept': 'application/json', 'Content-Type': 'application/json', } + self._api.do('PUT', f'/api/2.0/preview/scim/v2/Users/{id}', body=body, headers=headers) def update_permissions( @@ -3090,6 +3138,7 @@ def update_permissions( if access_control_list is not None: body['access_control_list'] = [v.as_dict() for v in access_control_list] headers = {'Accept': 'application/json', 'Content-Type': 'application/json', } + res = self._api.do('PATCH', '/api/2.0/permissions/authorization/passwords', body=body, @@ -3119,6 +3168,7 @@ def delete(self, workspace_id: int, principal_id: int): """ headers = {'Accept': 'application/json', } + self._api.do( 'DELETE', f'/api/2.0/accounts/{self._api.account_id}/workspaces/{workspace_id}/permissionassignments/principals/{principal_id}', @@ -3136,6 +3186,7 @@ def get(self, workspace_id: int) -> WorkspacePermissions: """ headers = {'Accept': 'application/json', } + res = self._api.do( 'GET', f'/api/2.0/accounts/{self._api.account_id}/workspaces/{workspace_id}/permissionassignments/permissions', @@ -3154,6 +3205,7 @@ def list(self, workspace_id: int) -> Iterator[PermissionAssignment]: """ headers = {'Accept': 'application/json', } + json = self._api.do( 'GET', f'/api/2.0/accounts/{self._api.account_id}/workspaces/{workspace_id}/permissionassignments', @@ -3179,6 +3231,7 @@ def update(self, workspace_id: int, principal_id: int, permissions: List[Workspa body = {} if permissions is not None: body['permissions'] = [v.value for v in permissions] headers = {'Accept': 'application/json', 'Content-Type': 'application/json', } + self._api.do( 'PUT', f'/api/2.0/accounts/{self._api.account_id}/workspaces/{workspace_id}/permissionassignments/principals/{principal_id}', diff --git a/databricks/sdk/service/jobs.py b/databricks/sdk/service/jobs.py index bdc5b8a20..3ef2d3457 100755 --- a/databricks/sdk/service/jobs.py +++ b/databricks/sdk/service/jobs.py @@ -4771,6 +4771,7 @@ def cancel_all_runs(self, *, all_queued_runs: Optional[bool] = None, job_id: Opt if all_queued_runs is not None: body['all_queued_runs'] = all_queued_runs if job_id is not None: body['job_id'] = job_id headers = {'Accept': 'application/json', 'Content-Type': 'application/json', } + self._api.do('POST', '/api/2.1/jobs/runs/cancel-all', body=body, headers=headers) def cancel_run(self, run_id: int) -> Wait[Run]: @@ -4789,6 +4790,7 @@ def cancel_run(self, run_id: int) -> Wait[Run]: body = {} if run_id is not None: body['run_id'] = run_id headers = {'Accept': 'application/json', 'Content-Type': 'application/json', } + self._api.do('POST', '/api/2.1/jobs/runs/cancel', body=body, headers=headers) return Wait(self.wait_get_run_job_terminated_or_skipped, run_id=run_id) @@ -4935,6 +4937,7 @@ def create(self, if trigger is not None: body['trigger'] = trigger.as_dict() if webhook_notifications is not None: body['webhook_notifications'] = webhook_notifications.as_dict() headers = {'Accept': 'application/json', 'Content-Type': 'application/json', } + res = self._api.do('POST', '/api/2.1/jobs/create', body=body, headers=headers) return CreateResponse.from_dict(res) @@ -4951,6 +4954,7 @@ def delete(self, job_id: int): body = {} if job_id is not None: body['job_id'] = job_id headers = {'Accept': 'application/json', 'Content-Type': 'application/json', } + self._api.do('POST', '/api/2.1/jobs/delete', body=body, headers=headers) def delete_run(self, run_id: int): @@ -4966,6 +4970,7 @@ def delete_run(self, run_id: int): body = {} if run_id is not None: body['run_id'] = run_id headers = {'Accept': 'application/json', 'Content-Type': 'application/json', } + self._api.do('POST', '/api/2.1/jobs/runs/delete', body=body, headers=headers) def export_run(self, run_id: int, *, views_to_export: Optional[ViewsToExport] = None) -> ExportRunOutput: @@ -4985,6 +4990,7 @@ def export_run(self, run_id: int, *, views_to_export: Optional[ViewsToExport] = if run_id is not None: query['run_id'] = run_id if views_to_export is not None: query['views_to_export'] = views_to_export.value headers = {'Accept': 'application/json', } + res = self._api.do('GET', '/api/2.1/jobs/runs/export', query=query, headers=headers) return ExportRunOutput.from_dict(res) @@ -5002,6 +5008,7 @@ def get(self, job_id: int) -> Job: query = {} if job_id is not None: query['job_id'] = job_id headers = {'Accept': 'application/json', } + res = self._api.do('GET', '/api/2.1/jobs/get', query=query, headers=headers) return Job.from_dict(res) @@ -5017,6 +5024,7 @@ def get_permission_levels(self, job_id: str) -> GetJobPermissionLevelsResponse: """ headers = {'Accept': 'application/json', } + res = self._api.do('GET', f'/api/2.0/permissions/jobs/{job_id}/permissionLevels', headers=headers) return GetJobPermissionLevelsResponse.from_dict(res) @@ -5032,6 +5040,7 @@ def get_permissions(self, job_id: str) -> JobPermissions: """ headers = {'Accept': 'application/json', } + res = self._api.do('GET', f'/api/2.0/permissions/jobs/{job_id}', headers=headers) return JobPermissions.from_dict(res) @@ -5059,6 +5068,7 @@ def get_run(self, if include_resolved_values is not None: query['include_resolved_values'] = include_resolved_values if run_id is not None: query['run_id'] = run_id headers = {'Accept': 'application/json', } + res = self._api.do('GET', '/api/2.1/jobs/runs/get', query=query, headers=headers) return Run.from_dict(res) @@ -5083,6 +5093,7 @@ def get_run_output(self, run_id: int) -> RunOutput: query = {} if run_id is not None: query['run_id'] = run_id headers = {'Accept': 'application/json', } + res = self._api.do('GET', '/api/2.1/jobs/runs/get-output', query=query, headers=headers) return RunOutput.from_dict(res) @@ -5325,6 +5336,7 @@ def repair_run(self, if spark_submit_params is not None: body['spark_submit_params'] = [v for v in spark_submit_params] if sql_params is not None: body['sql_params'] = sql_params headers = {'Accept': 'application/json', 'Content-Type': 'application/json', } + op_response = self._api.do('POST', '/api/2.1/jobs/runs/repair', body=body, headers=headers) return Wait(self.wait_get_run_job_terminated_or_skipped, response=RepairRunResponse.from_dict(op_response), @@ -5383,6 +5395,7 @@ def reset(self, job_id: int, new_settings: JobSettings): if job_id is not None: body['job_id'] = job_id if new_settings is not None: body['new_settings'] = new_settings.as_dict() headers = {'Accept': 'application/json', 'Content-Type': 'application/json', } + self._api.do('POST', '/api/2.1/jobs/reset', body=body, headers=headers) def run_now(self, @@ -5507,6 +5520,7 @@ def run_now(self, if spark_submit_params is not None: body['spark_submit_params'] = [v for v in spark_submit_params] if sql_params is not None: body['sql_params'] = sql_params headers = {'Accept': 'application/json', 'Content-Type': 'application/json', } + op_response = self._api.do('POST', '/api/2.1/jobs/run-now', body=body, headers=headers) return Wait(self.wait_get_run_job_terminated_or_skipped, response=RunNowResponse.from_dict(op_response), @@ -5559,6 +5573,7 @@ def set_permissions( if access_control_list is not None: body['access_control_list'] = [v.as_dict() for v in access_control_list] headers = {'Accept': 'application/json', 'Content-Type': 'application/json', } + res = self._api.do('PUT', f'/api/2.0/permissions/jobs/{job_id}', body=body, headers=headers) return JobPermissions.from_dict(res) @@ -5640,6 +5655,7 @@ def submit(self, if timeout_seconds is not None: body['timeout_seconds'] = timeout_seconds if webhook_notifications is not None: body['webhook_notifications'] = webhook_notifications.as_dict() headers = {'Accept': 'application/json', 'Content-Type': 'application/json', } + op_response = self._api.do('POST', '/api/2.1/jobs/runs/submit', body=body, headers=headers) return Wait(self.wait_get_run_job_terminated_or_skipped, response=SubmitRunResponse.from_dict(op_response), @@ -5706,6 +5722,7 @@ def update(self, if job_id is not None: body['job_id'] = job_id if new_settings is not None: body['new_settings'] = new_settings.as_dict() headers = {'Accept': 'application/json', 'Content-Type': 'application/json', } + self._api.do('POST', '/api/2.1/jobs/update', body=body, headers=headers) def update_permissions( @@ -5727,5 +5744,6 @@ def update_permissions( if access_control_list is not None: body['access_control_list'] = [v.as_dict() for v in access_control_list] headers = {'Accept': 'application/json', 'Content-Type': 'application/json', } + res = self._api.do('PATCH', f'/api/2.0/permissions/jobs/{job_id}', body=body, headers=headers) return JobPermissions.from_dict(res) diff --git a/databricks/sdk/service/ml.py b/databricks/sdk/service/ml.py index 8194f5436..734f3eb59 100755 --- a/databricks/sdk/service/ml.py +++ b/databricks/sdk/service/ml.py @@ -3517,6 +3517,7 @@ def create_experiment(self, if name is not None: body['name'] = name if tags is not None: body['tags'] = [v.as_dict() for v in tags] headers = {'Accept': 'application/json', 'Content-Type': 'application/json', } + res = self._api.do('POST', '/api/2.0/mlflow/experiments/create', body=body, headers=headers) return CreateExperimentResponse.from_dict(res) @@ -3550,6 +3551,7 @@ def create_run(self, if tags is not None: body['tags'] = [v.as_dict() for v in tags] if user_id is not None: body['user_id'] = user_id headers = {'Accept': 'application/json', 'Content-Type': 'application/json', } + res = self._api.do('POST', '/api/2.0/mlflow/runs/create', body=body, headers=headers) return CreateRunResponse.from_dict(res) @@ -3567,6 +3569,7 @@ def delete_experiment(self, experiment_id: str): body = {} if experiment_id is not None: body['experiment_id'] = experiment_id headers = {'Accept': 'application/json', 'Content-Type': 'application/json', } + self._api.do('POST', '/api/2.0/mlflow/experiments/delete', body=body, headers=headers) def delete_run(self, run_id: str): @@ -3582,6 +3585,7 @@ def delete_run(self, run_id: str): body = {} if run_id is not None: body['run_id'] = run_id headers = {'Accept': 'application/json', 'Content-Type': 'application/json', } + self._api.do('POST', '/api/2.0/mlflow/runs/delete', body=body, headers=headers) def delete_runs(self, @@ -3611,6 +3615,7 @@ def delete_runs(self, if max_runs is not None: body['max_runs'] = max_runs if max_timestamp_millis is not None: body['max_timestamp_millis'] = max_timestamp_millis headers = {'Accept': 'application/json', 'Content-Type': 'application/json', } + res = self._api.do('POST', '/api/2.0/mlflow/databricks/runs/delete-runs', body=body, headers=headers) return DeleteRunsResponse.from_dict(res) @@ -3631,6 +3636,7 @@ def delete_tag(self, run_id: str, key: str): if key is not None: body['key'] = key if run_id is not None: body['run_id'] = run_id headers = {'Accept': 'application/json', 'Content-Type': 'application/json', } + self._api.do('POST', '/api/2.0/mlflow/runs/delete-tag', body=body, headers=headers) def get_by_name(self, experiment_name: str) -> GetExperimentResponse: @@ -3653,6 +3659,7 @@ def get_by_name(self, experiment_name: str) -> GetExperimentResponse: query = {} if experiment_name is not None: query['experiment_name'] = experiment_name headers = {'Accept': 'application/json', } + res = self._api.do('GET', '/api/2.0/mlflow/experiments/get-by-name', query=query, headers=headers) return GetExperimentResponse.from_dict(res) @@ -3670,6 +3677,7 @@ def get_experiment(self, experiment_id: str) -> GetExperimentResponse: query = {} if experiment_id is not None: query['experiment_id'] = experiment_id headers = {'Accept': 'application/json', } + res = self._api.do('GET', '/api/2.0/mlflow/experiments/get', query=query, headers=headers) return GetExperimentResponse.from_dict(res) @@ -3729,6 +3737,7 @@ def get_permission_levels(self, experiment_id: str) -> GetExperimentPermissionLe """ headers = {'Accept': 'application/json', } + res = self._api.do('GET', f'/api/2.0/permissions/experiments/{experiment_id}/permissionLevels', headers=headers) @@ -3746,6 +3755,7 @@ def get_permissions(self, experiment_id: str) -> ExperimentPermissions: """ headers = {'Accept': 'application/json', } + res = self._api.do('GET', f'/api/2.0/permissions/experiments/{experiment_id}', headers=headers) return ExperimentPermissions.from_dict(res) @@ -3770,6 +3780,7 @@ def get_run(self, run_id: str, *, run_uuid: Optional[str] = None) -> GetRunRespo if run_id is not None: query['run_id'] = run_id if run_uuid is not None: query['run_uuid'] = run_uuid headers = {'Accept': 'application/json', } + res = self._api.do('GET', '/api/2.0/mlflow/runs/get', query=query, headers=headers) return GetRunResponse.from_dict(res) @@ -3912,6 +3923,7 @@ def log_batch(self, if run_id is not None: body['run_id'] = run_id if tags is not None: body['tags'] = [v.as_dict() for v in tags] headers = {'Accept': 'application/json', 'Content-Type': 'application/json', } + self._api.do('POST', '/api/2.0/mlflow/runs/log-batch', body=body, headers=headers) def log_inputs(self, *, datasets: Optional[List[DatasetInput]] = None, run_id: Optional[str] = None): @@ -3930,6 +3942,7 @@ def log_inputs(self, *, datasets: Optional[List[DatasetInput]] = None, run_id: O if datasets is not None: body['datasets'] = [v.as_dict() for v in datasets] if run_id is not None: body['run_id'] = run_id headers = {'Accept': 'application/json', 'Content-Type': 'application/json', } + self._api.do('POST', '/api/2.0/mlflow/runs/log-inputs', body=body, headers=headers) def log_metric(self, @@ -3970,6 +3983,7 @@ def log_metric(self, if timestamp is not None: body['timestamp'] = timestamp if value is not None: body['value'] = value headers = {'Accept': 'application/json', 'Content-Type': 'application/json', } + self._api.do('POST', '/api/2.0/mlflow/runs/log-metric', body=body, headers=headers) def log_model(self, *, model_json: Optional[str] = None, run_id: Optional[str] = None): @@ -3988,6 +4002,7 @@ def log_model(self, *, model_json: Optional[str] = None, run_id: Optional[str] = if model_json is not None: body['model_json'] = model_json if run_id is not None: body['run_id'] = run_id headers = {'Accept': 'application/json', 'Content-Type': 'application/json', } + self._api.do('POST', '/api/2.0/mlflow/runs/log-model', body=body, headers=headers) def log_param(self, @@ -4020,6 +4035,7 @@ def log_param(self, if run_uuid is not None: body['run_uuid'] = run_uuid if value is not None: body['value'] = value headers = {'Accept': 'application/json', 'Content-Type': 'application/json', } + self._api.do('POST', '/api/2.0/mlflow/runs/log-parameter', body=body, headers=headers) def restore_experiment(self, experiment_id: str): @@ -4039,6 +4055,7 @@ def restore_experiment(self, experiment_id: str): body = {} if experiment_id is not None: body['experiment_id'] = experiment_id headers = {'Accept': 'application/json', 'Content-Type': 'application/json', } + self._api.do('POST', '/api/2.0/mlflow/experiments/restore', body=body, headers=headers) def restore_run(self, run_id: str): @@ -4054,6 +4071,7 @@ def restore_run(self, run_id: str): body = {} if run_id is not None: body['run_id'] = run_id headers = {'Accept': 'application/json', 'Content-Type': 'application/json', } + self._api.do('POST', '/api/2.0/mlflow/runs/restore', body=body, headers=headers) def restore_runs(self, @@ -4083,6 +4101,7 @@ def restore_runs(self, if max_runs is not None: body['max_runs'] = max_runs if min_timestamp_millis is not None: body['min_timestamp_millis'] = min_timestamp_millis headers = {'Accept': 'application/json', 'Content-Type': 'application/json', } + res = self._api.do('POST', '/api/2.0/mlflow/databricks/runs/restore-runs', body=body, headers=headers) return RestoreRunsResponse.from_dict(res) @@ -4210,6 +4229,7 @@ def set_experiment_tag(self, experiment_id: str, key: str, value: str): if key is not None: body['key'] = key if value is not None: body['value'] = value headers = {'Accept': 'application/json', 'Content-Type': 'application/json', } + self._api.do('POST', '/api/2.0/mlflow/experiments/set-experiment-tag', body=body, headers=headers) def set_permissions( @@ -4232,6 +4252,7 @@ def set_permissions( if access_control_list is not None: body['access_control_list'] = [v.as_dict() for v in access_control_list] headers = {'Accept': 'application/json', 'Content-Type': 'application/json', } + res = self._api.do('PUT', f'/api/2.0/permissions/experiments/{experiment_id}', body=body, @@ -4263,6 +4284,7 @@ def set_tag(self, key: str, value: str, *, run_id: Optional[str] = None, run_uui if run_uuid is not None: body['run_uuid'] = run_uuid if value is not None: body['value'] = value headers = {'Accept': 'application/json', 'Content-Type': 'application/json', } + self._api.do('POST', '/api/2.0/mlflow/runs/set-tag', body=body, headers=headers) def update_experiment(self, experiment_id: str, *, new_name: Optional[str] = None): @@ -4281,6 +4303,7 @@ def update_experiment(self, experiment_id: str, *, new_name: Optional[str] = Non if experiment_id is not None: body['experiment_id'] = experiment_id if new_name is not None: body['new_name'] = new_name headers = {'Accept': 'application/json', 'Content-Type': 'application/json', } + self._api.do('POST', '/api/2.0/mlflow/experiments/update', body=body, headers=headers) def update_permissions( @@ -4303,6 +4326,7 @@ def update_permissions( if access_control_list is not None: body['access_control_list'] = [v.as_dict() for v in access_control_list] headers = {'Accept': 'application/json', 'Content-Type': 'application/json', } + res = self._api.do('PATCH', f'/api/2.0/permissions/experiments/{experiment_id}', body=body, @@ -4337,6 +4361,7 @@ def update_run(self, if run_uuid is not None: body['run_uuid'] = run_uuid if status is not None: body['status'] = status.value headers = {'Accept': 'application/json', 'Content-Type': 'application/json', } + res = self._api.do('POST', '/api/2.0/mlflow/runs/update', body=body, headers=headers) return UpdateRunResponse.from_dict(res) @@ -4393,6 +4418,7 @@ def approve_transition_request(self, if stage is not None: body['stage'] = stage.value if version is not None: body['version'] = version headers = {'Accept': 'application/json', 'Content-Type': 'application/json', } + res = self._api.do('POST', '/api/2.0/mlflow/transition-requests/approve', body=body, headers=headers) return ApproveTransitionRequestResponse.from_dict(res) @@ -4416,6 +4442,7 @@ def create_comment(self, name: str, version: str, comment: str) -> CreateComment if name is not None: body['name'] = name if version is not None: body['version'] = version headers = {'Accept': 'application/json', 'Content-Type': 'application/json', } + res = self._api.do('POST', '/api/2.0/mlflow/comments/create', body=body, headers=headers) return CreateCommentResponse.from_dict(res) @@ -4444,6 +4471,7 @@ def create_model(self, if name is not None: body['name'] = name if tags is not None: body['tags'] = [v.as_dict() for v in tags] headers = {'Accept': 'application/json', 'Content-Type': 'application/json', } + res = self._api.do('POST', '/api/2.0/mlflow/registered-models/create', body=body, headers=headers) return CreateModelResponse.from_dict(res) @@ -4484,6 +4512,7 @@ def create_model_version(self, if source is not None: body['source'] = source if tags is not None: body['tags'] = [v.as_dict() for v in tags] headers = {'Accept': 'application/json', 'Content-Type': 'application/json', } + res = self._api.do('POST', '/api/2.0/mlflow/model-versions/create', body=body, headers=headers) return CreateModelVersionResponse.from_dict(res) @@ -4522,6 +4551,7 @@ def create_transition_request(self, if stage is not None: body['stage'] = stage.value if version is not None: body['version'] = version headers = {'Accept': 'application/json', 'Content-Type': 'application/json', } + res = self._api.do('POST', '/api/2.0/mlflow/transition-requests/create', body=body, headers=headers) return CreateTransitionRequestResponse.from_dict(res) @@ -4593,6 +4623,7 @@ def create_webhook(self, if model_name is not None: body['model_name'] = model_name if status is not None: body['status'] = status.value headers = {'Accept': 'application/json', 'Content-Type': 'application/json', } + res = self._api.do('POST', '/api/2.0/mlflow/registry-webhooks/create', body=body, headers=headers) return CreateWebhookResponse.from_dict(res) @@ -4609,6 +4640,7 @@ def delete_comment(self, id: str): query = {} if id is not None: query['id'] = id headers = {'Accept': 'application/json', } + self._api.do('DELETE', '/api/2.0/mlflow/comments/delete', query=query, headers=headers) def delete_model(self, name: str): @@ -4625,6 +4657,7 @@ def delete_model(self, name: str): query = {} if name is not None: query['name'] = name headers = {'Accept': 'application/json', } + self._api.do('DELETE', '/api/2.0/mlflow/registered-models/delete', query=query, headers=headers) def delete_model_tag(self, name: str, key: str): @@ -4645,6 +4678,7 @@ def delete_model_tag(self, name: str, key: str): if key is not None: query['key'] = key if name is not None: query['name'] = name headers = {'Accept': 'application/json', } + self._api.do('DELETE', '/api/2.0/mlflow/registered-models/delete-tag', query=query, headers=headers) def delete_model_version(self, name: str, version: str): @@ -4664,6 +4698,7 @@ def delete_model_version(self, name: str, version: str): if name is not None: query['name'] = name if version is not None: query['version'] = version headers = {'Accept': 'application/json', } + self._api.do('DELETE', '/api/2.0/mlflow/model-versions/delete', query=query, headers=headers) def delete_model_version_tag(self, name: str, version: str, key: str): @@ -4687,6 +4722,7 @@ def delete_model_version_tag(self, name: str, version: str, key: str): if name is not None: query['name'] = name if version is not None: query['version'] = version headers = {'Accept': 'application/json', } + self._api.do('DELETE', '/api/2.0/mlflow/model-versions/delete-tag', query=query, headers=headers) def delete_transition_request(self, @@ -4730,6 +4766,7 @@ def delete_transition_request(self, if stage is not None: query['stage'] = stage.value if version is not None: query['version'] = version headers = {'Accept': 'application/json', } + self._api.do('DELETE', '/api/2.0/mlflow/transition-requests/delete', query=query, headers=headers) def delete_webhook(self, *, id: Optional[str] = None): @@ -4748,6 +4785,7 @@ def delete_webhook(self, *, id: Optional[str] = None): query = {} if id is not None: query['id'] = id headers = {'Accept': 'application/json', } + self._api.do('DELETE', '/api/2.0/mlflow/registry-webhooks/delete', query=query, headers=headers) def get_latest_versions(self, name: str, *, stages: Optional[List[str]] = None) -> Iterator[ModelVersion]: @@ -4766,6 +4804,7 @@ def get_latest_versions(self, name: str, *, stages: Optional[List[str]] = None) if name is not None: body['name'] = name if stages is not None: body['stages'] = [v for v in stages] headers = {'Accept': 'application/json', 'Content-Type': 'application/json', } + json = self._api.do('POST', '/api/2.0/mlflow/registered-models/get-latest-versions', body=body, @@ -4791,6 +4830,7 @@ def get_model(self, name: str) -> GetModelResponse: query = {} if name is not None: query['name'] = name headers = {'Accept': 'application/json', } + res = self._api.do('GET', '/api/2.0/mlflow/databricks/registered-models/get', query=query, @@ -4814,6 +4854,7 @@ def get_model_version(self, name: str, version: str) -> GetModelVersionResponse: if name is not None: query['name'] = name if version is not None: query['version'] = version headers = {'Accept': 'application/json', } + res = self._api.do('GET', '/api/2.0/mlflow/model-versions/get', query=query, headers=headers) return GetModelVersionResponse.from_dict(res) @@ -4834,6 +4875,7 @@ def get_model_version_download_uri(self, name: str, version: str) -> GetModelVer if name is not None: query['name'] = name if version is not None: query['version'] = version headers = {'Accept': 'application/json', } + res = self._api.do('GET', '/api/2.0/mlflow/model-versions/get-download-uri', query=query, @@ -4852,6 +4894,7 @@ def get_permission_levels(self, registered_model_id: str) -> GetRegisteredModelP """ headers = {'Accept': 'application/json', } + res = self._api.do('GET', f'/api/2.0/permissions/registered-models/{registered_model_id}/permissionLevels', headers=headers) @@ -4870,6 +4913,7 @@ def get_permissions(self, registered_model_id: str) -> RegisteredModelPermission """ headers = {'Accept': 'application/json', } + res = self._api.do('GET', f'/api/2.0/permissions/registered-models/{registered_model_id}', headers=headers) @@ -4922,6 +4966,7 @@ def list_transition_requests(self, name: str, version: str) -> Iterator[Activity if name is not None: query['name'] = name if version is not None: query['version'] = version headers = {'Accept': 'application/json', } + json = self._api.do('GET', '/api/2.0/mlflow/transition-requests/list', query=query, headers=headers) parsed = ListTransitionRequestsResponse.from_dict(json).requests return parsed if parsed is not None else [] @@ -4999,6 +5044,7 @@ def reject_transition_request(self, if stage is not None: body['stage'] = stage.value if version is not None: body['version'] = version headers = {'Accept': 'application/json', 'Content-Type': 'application/json', } + res = self._api.do('POST', '/api/2.0/mlflow/transition-requests/reject', body=body, headers=headers) return RejectTransitionRequestResponse.from_dict(res) @@ -5018,6 +5064,7 @@ def rename_model(self, name: str, *, new_name: Optional[str] = None) -> RenameMo if name is not None: body['name'] = name if new_name is not None: body['new_name'] = new_name headers = {'Accept': 'application/json', 'Content-Type': 'application/json', } + res = self._api.do('POST', '/api/2.0/mlflow/registered-models/rename', body=body, headers=headers) return RenameModelResponse.from_dict(res) @@ -5129,6 +5176,7 @@ def set_model_tag(self, name: str, key: str, value: str): if name is not None: body['name'] = name if value is not None: body['value'] = value headers = {'Accept': 'application/json', 'Content-Type': 'application/json', } + self._api.do('POST', '/api/2.0/mlflow/registered-models/set-tag', body=body, headers=headers) def set_model_version_tag(self, name: str, version: str, key: str, value: str): @@ -5156,6 +5204,7 @@ def set_model_version_tag(self, name: str, version: str, key: str, value: str): if value is not None: body['value'] = value if version is not None: body['version'] = version headers = {'Accept': 'application/json', 'Content-Type': 'application/json', } + self._api.do('POST', '/api/2.0/mlflow/model-versions/set-tag', body=body, headers=headers) def set_permissions( @@ -5179,6 +5228,7 @@ def set_permissions( if access_control_list is not None: body['access_control_list'] = [v.as_dict() for v in access_control_list] headers = {'Accept': 'application/json', 'Content-Type': 'application/json', } + res = self._api.do('PUT', f'/api/2.0/permissions/registered-models/{registered_model_id}', body=body, @@ -5207,6 +5257,7 @@ def test_registry_webhook(self, if event is not None: body['event'] = event.value if id is not None: body['id'] = id headers = {'Accept': 'application/json', 'Content-Type': 'application/json', } + res = self._api.do('POST', '/api/2.0/mlflow/registry-webhooks/test', body=body, headers=headers) return TestRegistryWebhookResponse.from_dict(res) @@ -5253,6 +5304,7 @@ def transition_stage(self, if stage is not None: body['stage'] = stage.value if version is not None: body['version'] = version headers = {'Accept': 'application/json', 'Content-Type': 'application/json', } + res = self._api.do('POST', '/api/2.0/mlflow/databricks/model-versions/transition-stage', body=body, @@ -5275,6 +5327,7 @@ def update_comment(self, id: str, comment: str) -> UpdateCommentResponse: if comment is not None: body['comment'] = comment if id is not None: body['id'] = id headers = {'Accept': 'application/json', 'Content-Type': 'application/json', } + res = self._api.do('PATCH', '/api/2.0/mlflow/comments/update', body=body, headers=headers) return UpdateCommentResponse.from_dict(res) @@ -5294,6 +5347,7 @@ def update_model(self, name: str, *, description: Optional[str] = None): if description is not None: body['description'] = description if name is not None: body['name'] = name headers = {'Accept': 'application/json', 'Content-Type': 'application/json', } + self._api.do('PATCH', '/api/2.0/mlflow/registered-models/update', body=body, headers=headers) def update_model_version(self, name: str, version: str, *, description: Optional[str] = None): @@ -5315,6 +5369,7 @@ def update_model_version(self, name: str, version: str, *, description: Optional if name is not None: body['name'] = name if version is not None: body['version'] = version headers = {'Accept': 'application/json', 'Content-Type': 'application/json', } + self._api.do('PATCH', '/api/2.0/mlflow/model-versions/update', body=body, headers=headers) def update_permissions( @@ -5338,6 +5393,7 @@ def update_permissions( if access_control_list is not None: body['access_control_list'] = [v.as_dict() for v in access_control_list] headers = {'Accept': 'application/json', 'Content-Type': 'application/json', } + res = self._api.do('PATCH', f'/api/2.0/permissions/registered-models/{registered_model_id}', body=body, @@ -5412,4 +5468,5 @@ def update_webhook(self, if job_spec is not None: body['job_spec'] = job_spec.as_dict() if status is not None: body['status'] = status.value headers = {'Accept': 'application/json', 'Content-Type': 'application/json', } + self._api.do('PATCH', '/api/2.0/mlflow/registry-webhooks/update', body=body, headers=headers) diff --git a/databricks/sdk/service/oauth2.py b/databricks/sdk/service/oauth2.py index bf0fc4436..180bee7af 100755 --- a/databricks/sdk/service/oauth2.py +++ b/databricks/sdk/service/oauth2.py @@ -508,6 +508,7 @@ def create(self, if scopes is not None: body['scopes'] = [v for v in scopes] if token_access_policy is not None: body['token_access_policy'] = token_access_policy.as_dict() headers = {'Accept': 'application/json', 'Content-Type': 'application/json', } + res = self._api.do('POST', f'/api/2.0/accounts/{self._api.account_id}/oauth2/custom-app-integrations', body=body, @@ -527,6 +528,7 @@ def delete(self, integration_id: str): """ headers = {'Accept': 'application/json', } + self._api.do( 'DELETE', f'/api/2.0/accounts/{self._api.account_id}/oauth2/custom-app-integrations/{integration_id}', @@ -544,6 +546,7 @@ def get(self, integration_id: str) -> GetCustomAppIntegrationOutput: """ headers = {'Accept': 'application/json', } + res = self._api.do( 'GET', f'/api/2.0/accounts/{self._api.account_id}/oauth2/custom-app-integrations/{integration_id}', @@ -559,6 +562,7 @@ def list(self) -> Iterator[GetCustomAppIntegrationOutput]: """ headers = {'Accept': 'application/json', } + json = self._api.do('GET', f'/api/2.0/accounts/{self._api.account_id}/oauth2/custom-app-integrations', headers=headers) @@ -588,6 +592,7 @@ def update(self, if redirect_urls is not None: body['redirect_urls'] = [v for v in redirect_urls] if token_access_policy is not None: body['token_access_policy'] = token_access_policy.as_dict() headers = {'Accept': 'application/json', 'Content-Type': 'application/json', } + self._api.do( 'PATCH', f'/api/2.0/accounts/{self._api.account_id}/oauth2/custom-app-integrations/{integration_id}', @@ -666,6 +671,7 @@ def create( if app_id is not None: body['app_id'] = app_id if token_access_policy is not None: body['token_access_policy'] = token_access_policy.as_dict() headers = {'Accept': 'application/json', 'Content-Type': 'application/json', } + res = self._api.do('POST', f'/api/2.0/accounts/{self._api.account_id}/oauth2/published-app-integrations', body=body, @@ -685,6 +691,7 @@ def delete(self, integration_id: str): """ headers = {'Accept': 'application/json', } + self._api.do( 'DELETE', f'/api/2.0/accounts/{self._api.account_id}/oauth2/published-app-integrations/{integration_id}', @@ -702,6 +709,7 @@ def get(self, integration_id: str) -> GetPublishedAppIntegrationOutput: """ headers = {'Accept': 'application/json', } + res = self._api.do( 'GET', f'/api/2.0/accounts/{self._api.account_id}/oauth2/published-app-integrations/{integration_id}', @@ -717,6 +725,7 @@ def list(self) -> Iterator[GetPublishedAppIntegrationOutput]: """ headers = {'Accept': 'application/json', } + json = self._api.do('GET', f'/api/2.0/accounts/{self._api.account_id}/oauth2/published-app-integrations', headers=headers) @@ -739,6 +748,7 @@ def update(self, integration_id: str, *, token_access_policy: Optional[TokenAcce body = {} if token_access_policy is not None: body['token_access_policy'] = token_access_policy.as_dict() headers = {'Accept': 'application/json', 'Content-Type': 'application/json', } + self._api.do( 'PATCH', f'/api/2.0/accounts/{self._api.account_id}/oauth2/published-app-integrations/{integration_id}', @@ -774,6 +784,7 @@ def create(self, service_principal_id: int) -> CreateServicePrincipalSecretRespo """ headers = {'Accept': 'application/json', } + res = self._api.do( 'POST', f'/api/2.0/accounts/{self._api.account_id}/servicePrincipals/{service_principal_id}/credentials/secrets', @@ -794,6 +805,7 @@ def delete(self, service_principal_id: int, secret_id: str): """ headers = {} + self._api.do( 'DELETE', f'/api/2.0/accounts/{self._api.account_id}/servicePrincipals/{service_principal_id}/credentials/secrets/{secret_id}', @@ -812,6 +824,7 @@ def list(self, service_principal_id: int) -> Iterator[SecretInfo]: """ headers = {'Accept': 'application/json', } + json = self._api.do( 'GET', f'/api/2.0/accounts/{self._api.account_id}/servicePrincipals/{service_principal_id}/credentials/secrets', diff --git a/databricks/sdk/service/pipelines.py b/databricks/sdk/service/pipelines.py index 2dc12f1a0..07bb7f122 100755 --- a/databricks/sdk/service/pipelines.py +++ b/databricks/sdk/service/pipelines.py @@ -1810,6 +1810,7 @@ def create(self, if target is not None: body['target'] = target if trigger is not None: body['trigger'] = trigger.as_dict() headers = {'Accept': 'application/json', 'Content-Type': 'application/json', } + res = self._api.do('POST', '/api/2.0/pipelines', body=body, headers=headers) return CreatePipelineResponse.from_dict(res) @@ -1824,6 +1825,7 @@ def delete(self, pipeline_id: str): """ headers = {'Accept': 'application/json', } + self._api.do('DELETE', f'/api/2.0/pipelines/{pipeline_id}', headers=headers) def get(self, pipeline_id: str) -> GetPipelineResponse: @@ -1835,6 +1837,7 @@ def get(self, pipeline_id: str) -> GetPipelineResponse: """ headers = {'Accept': 'application/json', } + res = self._api.do('GET', f'/api/2.0/pipelines/{pipeline_id}', headers=headers) return GetPipelineResponse.from_dict(res) @@ -1850,6 +1853,7 @@ def get_permission_levels(self, pipeline_id: str) -> GetPipelinePermissionLevels """ headers = {'Accept': 'application/json', } + res = self._api.do('GET', f'/api/2.0/permissions/pipelines/{pipeline_id}/permissionLevels', headers=headers) @@ -1867,6 +1871,7 @@ def get_permissions(self, pipeline_id: str) -> PipelinePermissions: """ headers = {'Accept': 'application/json', } + res = self._api.do('GET', f'/api/2.0/permissions/pipelines/{pipeline_id}', headers=headers) return PipelinePermissions.from_dict(res) @@ -1884,6 +1889,7 @@ def get_update(self, pipeline_id: str, update_id: str) -> GetUpdateResponse: """ headers = {'Accept': 'application/json', } + res = self._api.do('GET', f'/api/2.0/pipelines/{pipeline_id}/updates/{update_id}', headers=headers) return GetUpdateResponse.from_dict(res) @@ -2015,6 +2021,7 @@ def list_updates(self, if page_token is not None: query['page_token'] = page_token if until_update_id is not None: query['until_update_id'] = until_update_id headers = {'Accept': 'application/json', } + res = self._api.do('GET', f'/api/2.0/pipelines/{pipeline_id}/updates', query=query, headers=headers) return ListUpdatesResponse.from_dict(res) @@ -2037,6 +2044,7 @@ def set_permissions( if access_control_list is not None: body['access_control_list'] = [v.as_dict() for v in access_control_list] headers = {'Accept': 'application/json', 'Content-Type': 'application/json', } + res = self._api.do('PUT', f'/api/2.0/permissions/pipelines/{pipeline_id}', body=body, headers=headers) return PipelinePermissions.from_dict(res) @@ -2079,6 +2087,7 @@ def start_update(self, if refresh_selection is not None: body['refresh_selection'] = [v for v in refresh_selection] if validate_only is not None: body['validate_only'] = validate_only headers = {'Accept': 'application/json', 'Content-Type': 'application/json', } + res = self._api.do('POST', f'/api/2.0/pipelines/{pipeline_id}/updates', body=body, headers=headers) return StartUpdateResponse.from_dict(res) @@ -2096,6 +2105,7 @@ def stop(self, pipeline_id: str) -> Wait[GetPipelineResponse]: """ headers = {'Accept': 'application/json', } + 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) @@ -2196,6 +2206,7 @@ def update(self, if target is not None: body['target'] = target if trigger is not None: body['trigger'] = trigger.as_dict() headers = {'Accept': 'application/json', 'Content-Type': 'application/json', } + self._api.do('PUT', f'/api/2.0/pipelines/{pipeline_id}', body=body, headers=headers) def update_permissions( @@ -2217,6 +2228,7 @@ def update_permissions( if access_control_list is not None: body['access_control_list'] = [v.as_dict() for v in access_control_list] headers = {'Accept': 'application/json', 'Content-Type': 'application/json', } + res = self._api.do('PATCH', f'/api/2.0/permissions/pipelines/{pipeline_id}', body=body, diff --git a/databricks/sdk/service/provisioning.py b/databricks/sdk/service/provisioning.py index 7633d230a..aa5f34e55 100755 --- a/databricks/sdk/service/provisioning.py +++ b/databricks/sdk/service/provisioning.py @@ -1581,6 +1581,7 @@ def create(self, credentials_name: str, aws_credentials: CreateCredentialAwsCred if aws_credentials is not None: body['aws_credentials'] = aws_credentials.as_dict() if credentials_name is not None: body['credentials_name'] = credentials_name headers = {'Accept': 'application/json', 'Content-Type': 'application/json', } + res = self._api.do('POST', f'/api/2.0/accounts/{self._api.account_id}/credentials', body=body, @@ -1600,6 +1601,7 @@ def delete(self, credentials_id: str): """ headers = {'Accept': 'application/json', } + self._api.do('DELETE', f'/api/2.0/accounts/{self._api.account_id}/credentials/{credentials_id}', headers=headers) @@ -1616,6 +1618,7 @@ def get(self, credentials_id: str) -> Credential: """ headers = {'Accept': 'application/json', } + res = self._api.do('GET', f'/api/2.0/accounts/{self._api.account_id}/credentials/{credentials_id}', headers=headers) @@ -1630,6 +1633,7 @@ def list(self) -> Iterator[Credential]: """ headers = {'Accept': 'application/json', } + res = self._api.do('GET', f'/api/2.0/accounts/{self._api.account_id}/credentials', headers=headers) return [Credential.from_dict(v) for v in res] @@ -1685,6 +1689,7 @@ def create(self, if gcp_key_info is not None: body['gcp_key_info'] = gcp_key_info.as_dict() if use_cases is not None: body['use_cases'] = [v.value for v in use_cases] headers = {'Accept': 'application/json', 'Content-Type': 'application/json', } + res = self._api.do('POST', f'/api/2.0/accounts/{self._api.account_id}/customer-managed-keys', body=body, @@ -1704,6 +1709,7 @@ def delete(self, customer_managed_key_id: str): """ headers = {'Accept': 'application/json', } + self._api.do( 'DELETE', f'/api/2.0/accounts/{self._api.account_id}/customer-managed-keys/{customer_managed_key_id}', @@ -1732,6 +1738,7 @@ def get(self, customer_managed_key_id: str) -> CustomerManagedKey: """ headers = {'Accept': 'application/json', } + res = self._api.do( 'GET', f'/api/2.0/accounts/{self._api.account_id}/customer-managed-keys/{customer_managed_key_id}', @@ -1756,6 +1763,7 @@ def list(self) -> Iterator[CustomerManagedKey]: """ headers = {'Accept': 'application/json', } + res = self._api.do('GET', f'/api/2.0/accounts/{self._api.account_id}/customer-managed-keys', headers=headers) @@ -1812,6 +1820,7 @@ def create(self, if vpc_endpoints is not None: body['vpc_endpoints'] = vpc_endpoints.as_dict() if vpc_id is not None: body['vpc_id'] = vpc_id headers = {'Accept': 'application/json', 'Content-Type': 'application/json', } + res = self._api.do('POST', f'/api/2.0/accounts/{self._api.account_id}/networks', body=body, @@ -1833,6 +1842,7 @@ def delete(self, network_id: str): """ headers = {'Accept': 'application/json', } + self._api.do('DELETE', f'/api/2.0/accounts/{self._api.account_id}/networks/{network_id}', headers=headers) @@ -1849,6 +1859,7 @@ def get(self, network_id: str) -> Network: """ headers = {'Accept': 'application/json', } + res = self._api.do('GET', f'/api/2.0/accounts/{self._api.account_id}/networks/{network_id}', headers=headers) @@ -1865,6 +1876,7 @@ def list(self) -> Iterator[Network]: """ headers = {'Accept': 'application/json', } + res = self._api.do('GET', f'/api/2.0/accounts/{self._api.account_id}/networks', headers=headers) return [Network.from_dict(v) for v in res] @@ -1936,6 +1948,7 @@ def create(self, if public_access_enabled is not None: body['public_access_enabled'] = public_access_enabled if region is not None: body['region'] = region headers = {'Accept': 'application/json', 'Content-Type': 'application/json', } + res = self._api.do('POST', f'/api/2.0/accounts/{self._api.account_id}/private-access-settings', body=body, @@ -1960,6 +1973,7 @@ def delete(self, private_access_settings_id: str): """ headers = {'Accept': 'application/json', } + self._api.do( 'DELETE', f'/api/2.0/accounts/{self._api.account_id}/private-access-settings/{private_access_settings_id}', @@ -1983,6 +1997,7 @@ def get(self, private_access_settings_id: str) -> PrivateAccessSettings: """ headers = {'Accept': 'application/json', } + res = self._api.do( 'GET', f'/api/2.0/accounts/{self._api.account_id}/private-access-settings/{private_access_settings_id}', @@ -1998,6 +2013,7 @@ def list(self) -> Iterator[PrivateAccessSettings]: """ headers = {'Accept': 'application/json', } + res = self._api.do('GET', f'/api/2.0/accounts/{self._api.account_id}/private-access-settings', headers=headers) @@ -2072,6 +2088,7 @@ def replace(self, if public_access_enabled is not None: body['public_access_enabled'] = public_access_enabled if region is not None: body['region'] = region headers = {'Accept': 'application/json', 'Content-Type': 'application/json', } + self._api.do( 'PUT', f'/api/2.0/accounts/{self._api.account_id}/private-access-settings/{private_access_settings_id}', @@ -2114,6 +2131,7 @@ def create(self, storage_configuration_name: str, if storage_configuration_name is not None: body['storage_configuration_name'] = storage_configuration_name headers = {'Accept': 'application/json', 'Content-Type': 'application/json', } + res = self._api.do('POST', f'/api/2.0/accounts/{self._api.account_id}/storage-configurations', body=body, @@ -2133,6 +2151,7 @@ def delete(self, storage_configuration_id: str): """ headers = {'Accept': 'application/json', } + self._api.do( 'DELETE', f'/api/2.0/accounts/{self._api.account_id}/storage-configurations/{storage_configuration_id}', @@ -2150,6 +2169,7 @@ def get(self, storage_configuration_id: str) -> StorageConfiguration: """ headers = {'Accept': 'application/json', } + res = self._api.do( 'GET', f'/api/2.0/accounts/{self._api.account_id}/storage-configurations/{storage_configuration_id}', @@ -2165,6 +2185,7 @@ def list(self) -> Iterator[StorageConfiguration]: """ headers = {'Accept': 'application/json', } + res = self._api.do('GET', f'/api/2.0/accounts/{self._api.account_id}/storage-configurations', headers=headers) @@ -2215,6 +2236,7 @@ def create(self, if region is not None: body['region'] = region if vpc_endpoint_name is not None: body['vpc_endpoint_name'] = vpc_endpoint_name headers = {'Accept': 'application/json', 'Content-Type': 'application/json', } + res = self._api.do('POST', f'/api/2.0/accounts/{self._api.account_id}/vpc-endpoints', body=body, @@ -2240,6 +2262,7 @@ def delete(self, vpc_endpoint_id: str): """ headers = {'Accept': 'application/json', } + self._api.do('DELETE', f'/api/2.0/accounts/{self._api.account_id}/vpc-endpoints/{vpc_endpoint_id}', headers=headers) @@ -2260,6 +2283,7 @@ def get(self, vpc_endpoint_id: str) -> VpcEndpoint: """ headers = {'Accept': 'application/json', } + res = self._api.do('GET', f'/api/2.0/accounts/{self._api.account_id}/vpc-endpoints/{vpc_endpoint_id}', headers=headers) @@ -2278,6 +2302,7 @@ def list(self) -> Iterator[VpcEndpoint]: """ headers = {'Accept': 'application/json', } + res = self._api.do('GET', f'/api/2.0/accounts/{self._api.account_id}/vpc-endpoints', headers=headers) return [VpcEndpoint.from_dict(v) for v in res] @@ -2466,6 +2491,7 @@ def create(self, body['storage_customer_managed_key_id'] = storage_customer_managed_key_id if workspace_name is not None: body['workspace_name'] = workspace_name headers = {'Accept': 'application/json', 'Content-Type': 'application/json', } + op_response = self._api.do('POST', f'/api/2.0/accounts/{self._api.account_id}/workspaces', body=body, @@ -2528,6 +2554,7 @@ def delete(self, workspace_id: int): """ headers = {'Accept': 'application/json', } + self._api.do('DELETE', f'/api/2.0/accounts/{self._api.account_id}/workspaces/{workspace_id}', headers=headers) @@ -2555,6 +2582,7 @@ def get(self, workspace_id: int) -> Workspace: """ headers = {'Accept': 'application/json', } + res = self._api.do('GET', f'/api/2.0/accounts/{self._api.account_id}/workspaces/{workspace_id}', headers=headers) @@ -2572,6 +2600,7 @@ def list(self) -> Iterator[Workspace]: """ headers = {'Accept': 'application/json', } + res = self._api.do('GET', f'/api/2.0/accounts/{self._api.account_id}/workspaces', headers=headers) return [Workspace.from_dict(v) for v in res] @@ -2726,6 +2755,7 @@ def update(self, if storage_customer_managed_key_id is not None: body['storage_customer_managed_key_id'] = storage_customer_managed_key_id headers = {'Accept': 'application/json', 'Content-Type': 'application/json', } + self._api.do('PATCH', f'/api/2.0/accounts/{self._api.account_id}/workspaces/{workspace_id}', body=body, diff --git a/databricks/sdk/service/serving.py b/databricks/sdk/service/serving.py index b5cbdb702..13e6286e7 100755 --- a/databricks/sdk/service/serving.py +++ b/databricks/sdk/service/serving.py @@ -1272,6 +1272,10 @@ class QueryEndpointResponse: predictions: Optional[List[Any]] = None """The predictions returned by the serving endpoint.""" + served_model_name: Optional[str] = None + """The name of the served model that served the request. This is useful when there are multiple + models behind the same endpoint with traffic split.""" + usage: Optional[ExternalModelUsageElement] = None """The usage object that may be returned by the __external/foundation model__ serving endpoint. This contains information about the number of tokens used in the prompt and response.""" @@ -1286,6 +1290,7 @@ def as_dict(self) -> dict: if self.model is not None: body['model'] = self.model if self.object is not None: body['object'] = self.object.value if self.predictions: body['predictions'] = [v for v in self.predictions] + if self.served_model_name is not None: body['served-model-name'] = self.served_model_name if self.usage: body['usage'] = self.usage.as_dict() return body @@ -1299,6 +1304,7 @@ def from_dict(cls, d: Dict[str, any]) -> QueryEndpointResponse: model=d.get('model', None), object=_enum(d, 'object', QueryEndpointResponseObject), predictions=d.get('predictions', None), + served_model_name=d.get('served-model-name', None), usage=_from_dict(d, 'usage', ExternalModelUsageElement)) @@ -2258,6 +2264,7 @@ def create(self, manifest: AppManifest, *, resources: Optional[Any] = None) -> D if manifest is not None: body['manifest'] = manifest.as_dict() if resources is not None: body['resources'] = resources headers = {'Accept': 'application/json', 'Content-Type': 'application/json', } + res = self._api.do('POST', '/api/2.0/preview/apps/deployments', body=body, headers=headers) return DeploymentStatus.from_dict(res) @@ -2273,6 +2280,7 @@ def delete_app(self, name: str) -> DeleteAppResponse: """ headers = {'Accept': 'application/json', } + res = self._api.do('DELETE', f'/api/2.0/preview/apps/instances/{name}', headers=headers) return DeleteAppResponse.from_dict(res) @@ -2288,6 +2296,7 @@ def get_app(self, name: str) -> GetAppResponse: """ headers = {'Accept': 'application/json', } + res = self._api.do('GET', f'/api/2.0/preview/apps/instances/{name}', headers=headers) return GetAppResponse.from_dict(res) @@ -2310,6 +2319,7 @@ def get_app_deployment_status(self, query = {} if include_app_log is not None: query['include_app_log'] = include_app_log headers = {'Accept': 'application/json', } + res = self._api.do('GET', f'/api/2.0/preview/apps/deployments/{deployment_id}', query=query, @@ -2325,6 +2335,7 @@ def get_apps(self) -> ListAppsResponse: """ headers = {'Accept': 'application/json', } + res = self._api.do('GET', '/api/2.0/preview/apps/instances', headers=headers) return ListAppsResponse.from_dict(res) @@ -2340,6 +2351,7 @@ def get_events(self, name: str) -> ListAppEventsResponse: """ headers = {'Accept': 'application/json', } + res = self._api.do('GET', f'/api/2.0/preview/apps/{name}/events', headers=headers) return ListAppEventsResponse.from_dict(res) @@ -2405,6 +2417,7 @@ def build_logs(self, name: str, served_model_name: str) -> BuildLogsResponse: """ headers = {'Accept': 'application/json', } + res = self._api.do('GET', f'/api/2.0/serving-endpoints/{name}/served-models/{served_model_name}/build-logs', headers=headers) @@ -2439,6 +2452,7 @@ def create(self, if rate_limits is not None: body['rate_limits'] = [v.as_dict() for v in rate_limits] if tags is not None: body['tags'] = [v.as_dict() for v in tags] headers = {'Accept': 'application/json', 'Content-Type': 'application/json', } + op_response = self._api.do('POST', '/api/2.0/serving-endpoints', body=body, headers=headers) return Wait(self.wait_get_serving_endpoint_not_updating, response=ServingEndpointDetailed.from_dict(op_response), @@ -2465,6 +2479,7 @@ def delete(self, name: str): """ headers = {'Accept': 'application/json', } + self._api.do('DELETE', f'/api/2.0/serving-endpoints/{name}', headers=headers) def export_metrics(self, name: str): @@ -2480,6 +2495,7 @@ def export_metrics(self, name: str): """ headers = {} + self._api.do('GET', f'/api/2.0/serving-endpoints/{name}/metrics', headers=headers) def get(self, name: str) -> ServingEndpointDetailed: @@ -2494,6 +2510,7 @@ def get(self, name: str) -> ServingEndpointDetailed: """ headers = {'Accept': 'application/json', } + res = self._api.do('GET', f'/api/2.0/serving-endpoints/{name}', headers=headers) return ServingEndpointDetailed.from_dict(res) @@ -2509,6 +2526,7 @@ def get_permission_levels(self, serving_endpoint_id: str) -> GetServingEndpointP """ headers = {'Accept': 'application/json', } + res = self._api.do('GET', f'/api/2.0/permissions/serving-endpoints/{serving_endpoint_id}/permissionLevels', headers=headers) @@ -2527,6 +2545,7 @@ def get_permissions(self, serving_endpoint_id: str) -> ServingEndpointPermission """ headers = {'Accept': 'application/json', } + res = self._api.do('GET', f'/api/2.0/permissions/serving-endpoints/{serving_endpoint_id}', headers=headers) @@ -2539,6 +2558,7 @@ def list(self) -> Iterator[ServingEndpoint]: """ headers = {'Accept': 'application/json', } + json = self._api.do('GET', '/api/2.0/serving-endpoints', headers=headers) parsed = ListEndpointsResponse.from_dict(json).endpoints return parsed if parsed is not None else [] @@ -2557,6 +2577,7 @@ def logs(self, name: str, served_model_name: str) -> ServerLogsResponse: """ headers = {'Accept': 'application/json', } + res = self._api.do('GET', f'/api/2.0/serving-endpoints/{name}/served-models/{served_model_name}/logs', headers=headers) @@ -2584,6 +2605,7 @@ def patch(self, if add_tags is not None: body['add_tags'] = [v.as_dict() for v in add_tags] if delete_tags is not None: body['delete_tags'] = [v for v in delete_tags] headers = {'Accept': 'application/json', 'Content-Type': 'application/json', } + res = self._api.do('PATCH', f'/api/2.0/serving-endpoints/{name}/tags', body=body, headers=headers) return [EndpointTag.from_dict(v) for v in res] @@ -2603,6 +2625,7 @@ def put(self, name: str, *, rate_limits: Optional[List[RateLimit]] = None) -> Pu body = {} if rate_limits is not None: body['rate_limits'] = [v.as_dict() for v in rate_limits] headers = {'Accept': 'application/json', 'Content-Type': 'application/json', } + res = self._api.do('PUT', f'/api/2.0/serving-endpoints/{name}/rate-limits', body=body, @@ -2688,7 +2711,12 @@ def query(self, if stream is not None: body['stream'] = stream if temperature is not None: body['temperature'] = temperature headers = {'Accept': 'application/json', 'Content-Type': 'application/json', } - res = self._api.do('POST', f'/serving-endpoints/{name}/invocations', body=body, headers=headers) + response_headers = ['served-model-name', ] + res = self._api.do('POST', + f'/serving-endpoints/{name}/invocations', + body=body, + headers=headers, + response_headers=response_headers) return QueryEndpointResponse.from_dict(res) def set_permissions( @@ -2712,6 +2740,7 @@ def set_permissions( if access_control_list is not None: body['access_control_list'] = [v.as_dict() for v in access_control_list] headers = {'Accept': 'application/json', 'Content-Type': 'application/json', } + res = self._api.do('PUT', f'/api/2.0/permissions/serving-endpoints/{serving_endpoint_id}', body=body, @@ -2754,6 +2783,7 @@ def update_config(self, if served_models is not None: body['served_models'] = [v.as_dict() for v in served_models] if traffic_config is not None: body['traffic_config'] = traffic_config.as_dict() headers = {'Accept': 'application/json', 'Content-Type': 'application/json', } + op_response = self._api.do('PUT', f'/api/2.0/serving-endpoints/{name}/config', body=body, @@ -2798,6 +2828,7 @@ def update_permissions( if access_control_list is not None: body['access_control_list'] = [v.as_dict() for v in access_control_list] headers = {'Accept': 'application/json', 'Content-Type': 'application/json', } + res = self._api.do('PATCH', f'/api/2.0/permissions/serving-endpoints/{serving_endpoint_id}', body=body, diff --git a/databricks/sdk/service/settings.py b/databricks/sdk/service/settings.py index df351fa36..0671adc58 100755 --- a/databricks/sdk/service/settings.py +++ b/databricks/sdk/service/settings.py @@ -1615,6 +1615,7 @@ def create(self, if label is not None: body['label'] = label if list_type is not None: body['list_type'] = list_type.value headers = {'Accept': 'application/json', 'Content-Type': 'application/json', } + res = self._api.do('POST', f'/api/2.0/accounts/{self._api.account_id}/ip-access-lists', body=body, @@ -1633,6 +1634,7 @@ def delete(self, ip_access_list_id: str): """ headers = {'Accept': 'application/json', } + self._api.do('DELETE', f'/api/2.0/accounts/{self._api.account_id}/ip-access-lists/{ip_access_list_id}', headers=headers) @@ -1649,6 +1651,7 @@ def get(self, ip_access_list_id: str) -> GetIpAccessListResponse: """ headers = {'Accept': 'application/json', } + res = self._api.do('GET', f'/api/2.0/accounts/{self._api.account_id}/ip-access-lists/{ip_access_list_id}', headers=headers) @@ -1663,6 +1666,7 @@ def list(self) -> Iterator[IpAccessListInfo]: """ headers = {'Accept': 'application/json', } + json = self._api.do('GET', f'/api/2.0/accounts/{self._api.account_id}/ip-access-lists', headers=headers) @@ -1709,6 +1713,7 @@ def replace(self, if label is not None: body['label'] = label if list_type is not None: body['list_type'] = list_type.value headers = {'Accept': 'application/json', 'Content-Type': 'application/json', } + self._api.do('PUT', f'/api/2.0/accounts/{self._api.account_id}/ip-access-lists/{ip_access_list_id}', body=body, @@ -1758,6 +1763,7 @@ def update(self, if label is not None: body['label'] = label if list_type is not None: body['list_type'] = list_type.value headers = {'Accept': 'application/json', 'Content-Type': 'application/json', } + self._api.do('PATCH', f'/api/2.0/accounts/{self._api.account_id}/ip-access-lists/{ip_access_list_id}', body=body, @@ -1796,6 +1802,7 @@ def delete_personal_compute_setting(self, query = {} if etag is not None: query['etag'] = etag headers = {'Accept': 'application/json', } + res = self._api.do( 'DELETE', f'/api/2.0/accounts/{self._api.account_id}/settings/types/dcp_acct_enable/names/default', @@ -1821,6 +1828,7 @@ def get_personal_compute_setting(self, *, etag: Optional[str] = None) -> Persona query = {} if etag is not None: query['etag'] = etag headers = {'Accept': 'application/json', } + res = self._api.do( 'GET', f'/api/2.0/accounts/{self._api.account_id}/settings/types/dcp_acct_enable/names/default', @@ -1849,6 +1857,7 @@ def update_personal_compute_setting(self, allow_missing: bool, setting: Personal if field_mask is not None: body['field_mask'] = field_mask if setting is not None: body['setting'] = setting.as_dict() headers = {'Accept': 'application/json', 'Content-Type': 'application/json', } + res = self._api.do( 'PATCH', f'/api/2.0/accounts/{self._api.account_id}/settings/types/dcp_acct_enable/names/default', @@ -1885,6 +1894,7 @@ def exchange_token(self, partition_id: PartitionId, token_type: List[TokenType], if scopes is not None: body['scopes'] = [v for v in scopes] if token_type is not None: body['tokenType'] = [v.value for v in token_type] headers = {'Accept': 'application/json', 'Content-Type': 'application/json', } + res = self._api.do('POST', '/api/2.0/credentials-manager/exchange-tokens/token', body=body, @@ -1952,6 +1962,7 @@ def create(self, if label is not None: body['label'] = label if list_type is not None: body['list_type'] = list_type.value headers = {'Accept': 'application/json', 'Content-Type': 'application/json', } + res = self._api.do('POST', '/api/2.0/ip-access-lists', body=body, headers=headers) return CreateIpAccessListResponse.from_dict(res) @@ -1967,6 +1978,7 @@ def delete(self, ip_access_list_id: str): """ headers = {'Accept': 'application/json', } + self._api.do('DELETE', f'/api/2.0/ip-access-lists/{ip_access_list_id}', headers=headers) def get(self, ip_access_list_id: str) -> FetchIpAccessListResponse: @@ -1981,6 +1993,7 @@ def get(self, ip_access_list_id: str) -> FetchIpAccessListResponse: """ headers = {'Accept': 'application/json', } + res = self._api.do('GET', f'/api/2.0/ip-access-lists/{ip_access_list_id}', headers=headers) return FetchIpAccessListResponse.from_dict(res) @@ -1993,6 +2006,7 @@ def list(self) -> Iterator[IpAccessListInfo]: """ headers = {'Accept': 'application/json', } + json = self._api.do('GET', '/api/2.0/ip-access-lists', headers=headers) parsed = ListIpAccessListResponse.from_dict(json).ip_access_lists return parsed if parsed is not None else [] @@ -2038,6 +2052,7 @@ def replace(self, if label is not None: body['label'] = label if list_type is not None: body['list_type'] = list_type.value headers = {'Accept': 'application/json', 'Content-Type': 'application/json', } + self._api.do('PUT', f'/api/2.0/ip-access-lists/{ip_access_list_id}', body=body, headers=headers) def update(self, @@ -2085,6 +2100,7 @@ def update(self, if label is not None: body['label'] = label if list_type is not None: body['list_type'] = list_type.value headers = {'Accept': 'application/json', 'Content-Type': 'application/json', } + self._api.do('PATCH', f'/api/2.0/ip-access-lists/{ip_access_list_id}', body=body, headers=headers) @@ -2130,6 +2146,7 @@ def create_network_connectivity_configuration(self, name: str, if name is not None: body['name'] = name if region is not None: body['region'] = region headers = {'Accept': 'application/json', 'Content-Type': 'application/json', } + res = self._api.do('POST', f'/api/2.0/accounts/{self._api.account_id}/network-connectivity-configs', body=body, @@ -2165,6 +2182,7 @@ def create_private_endpoint_rule( if group_id is not None: body['group_id'] = group_id.value if resource_id is not None: body['resource_id'] = resource_id headers = {'Accept': 'application/json', 'Content-Type': 'application/json', } + res = self._api.do( 'POST', f'/api/2.0/accounts/{self._api.account_id}/network-connectivity-configs/{network_connectivity_config_id}/private-endpoint-rules', @@ -2184,6 +2202,7 @@ def delete_network_connectivity_configuration(self, network_connectivity_config_ """ headers = {'Accept': 'application/json', } + self._api.do( 'DELETE', f'/api/2.0/accounts/{self._api.account_id}/network-connectivity-configs/{network_connectivity_config_id}', @@ -2207,6 +2226,7 @@ def delete_private_endpoint_rule(self, network_connectivity_config_id: str, """ headers = {'Accept': 'application/json', } + res = self._api.do( 'DELETE', f'/api/2.0/accounts/{self._api.account_id}/network-connectivity-configs/{network_connectivity_config_id}/private-endpoint-rules/{private_endpoint_rule_id}', @@ -2226,6 +2246,7 @@ def get_network_connectivity_configuration( """ headers = {'Accept': 'application/json', } + res = self._api.do( 'GET', f'/api/2.0/accounts/{self._api.account_id}/network-connectivity-configs/{network_connectivity_config_id}', @@ -2247,6 +2268,7 @@ def get_private_endpoint_rule(self, network_connectivity_config_id: str, """ headers = {'Accept': 'application/json', } + res = self._api.do( 'GET', f'/api/2.0/accounts/{self._api.account_id}/network-connectivity-configs/{network_connectivity_config_id}/private-endpoint-rules/{private_endpoint_rule_id}', @@ -2356,6 +2378,7 @@ def delete_default_namespace_setting(self, query = {} if etag is not None: query['etag'] = etag headers = {'Accept': 'application/json', } + res = self._api.do('DELETE', '/api/2.0/settings/types/default_namespace_ws/names/default', query=query, @@ -2386,6 +2409,7 @@ def delete_restrict_workspace_admins_setting(self, query = {} if etag is not None: query['etag'] = etag headers = {'Accept': 'application/json', } + res = self._api.do('DELETE', '/api/2.0/settings/types/restrict_workspace_admins/names/default', query=query, @@ -2410,6 +2434,7 @@ def get_default_namespace_setting(self, *, etag: Optional[str] = None) -> Defaul query = {} if etag is not None: query['etag'] = etag headers = {'Accept': 'application/json', } + res = self._api.do('GET', '/api/2.0/settings/types/default_namespace_ws/names/default', query=query, @@ -2436,6 +2461,7 @@ def get_restrict_workspace_admins_setting(self, query = {} if etag is not None: query['etag'] = etag headers = {'Accept': 'application/json', } + res = self._api.do('GET', '/api/2.0/settings/types/restrict_workspace_admins/names/default', query=query, @@ -2475,6 +2501,7 @@ def update_default_namespace_setting(self, allow_missing: bool, setting: Default if field_mask is not None: body['field_mask'] = field_mask if setting is not None: body['setting'] = setting.as_dict() headers = {'Accept': 'application/json', 'Content-Type': 'application/json', } + res = self._api.do('PATCH', '/api/2.0/settings/types/default_namespace_ws/names/default', body=body, @@ -2506,6 +2533,7 @@ def update_restrict_workspace_admins_setting(self, allow_missing: bool, if field_mask is not None: body['field_mask'] = field_mask if setting is not None: body['setting'] = setting.as_dict() headers = {'Accept': 'application/json', 'Content-Type': 'application/json', } + res = self._api.do('PATCH', '/api/2.0/settings/types/restrict_workspace_admins/names/default', body=body, @@ -2543,6 +2571,7 @@ def create_obo_token(self, if comment is not None: body['comment'] = comment if lifetime_seconds is not None: body['lifetime_seconds'] = lifetime_seconds headers = {'Accept': 'application/json', 'Content-Type': 'application/json', } + res = self._api.do('POST', '/api/2.0/token-management/on-behalf-of/tokens', body=body, @@ -2561,6 +2590,7 @@ def delete(self, token_id: str): """ headers = {'Accept': 'application/json', } + self._api.do('DELETE', f'/api/2.0/token-management/tokens/{token_id}', headers=headers) def get(self, token_id: str) -> GetTokenResponse: @@ -2575,6 +2605,7 @@ def get(self, token_id: str) -> GetTokenResponse: """ headers = {'Accept': 'application/json', } + res = self._api.do('GET', f'/api/2.0/token-management/tokens/{token_id}', headers=headers) return GetTokenResponse.from_dict(res) @@ -2587,6 +2618,7 @@ def get_permission_levels(self) -> GetTokenPermissionLevelsResponse: """ headers = {'Accept': 'application/json', } + res = self._api.do('GET', '/api/2.0/permissions/authorization/tokens/permissionLevels', headers=headers) @@ -2601,6 +2633,7 @@ def get_permissions(self) -> TokenPermissions: """ headers = {'Accept': 'application/json', } + res = self._api.do('GET', '/api/2.0/permissions/authorization/tokens', headers=headers) return TokenPermissions.from_dict(res) @@ -2624,6 +2657,7 @@ def list(self, if created_by_id is not None: query['created_by_id'] = created_by_id if created_by_username is not None: query['created_by_username'] = created_by_username headers = {'Accept': 'application/json', } + json = self._api.do('GET', '/api/2.0/token-management/tokens', query=query, headers=headers) parsed = ListTokensResponse.from_dict(json).token_infos return parsed if parsed is not None else [] @@ -2644,6 +2678,7 @@ def set_permissions( if access_control_list is not None: body['access_control_list'] = [v.as_dict() for v in access_control_list] headers = {'Accept': 'application/json', 'Content-Type': 'application/json', } + res = self._api.do('PUT', '/api/2.0/permissions/authorization/tokens', body=body, headers=headers) return TokenPermissions.from_dict(res) @@ -2663,6 +2698,7 @@ def update_permissions( if access_control_list is not None: body['access_control_list'] = [v.as_dict() for v in access_control_list] headers = {'Accept': 'application/json', 'Content-Type': 'application/json', } + res = self._api.do('PATCH', '/api/2.0/permissions/authorization/tokens', body=body, headers=headers) return TokenPermissions.from_dict(res) @@ -2697,6 +2733,7 @@ def create(self, if comment is not None: body['comment'] = comment if lifetime_seconds is not None: body['lifetime_seconds'] = lifetime_seconds headers = {'Accept': 'application/json', 'Content-Type': 'application/json', } + res = self._api.do('POST', '/api/2.0/token/create', body=body, headers=headers) return CreateTokenResponse.from_dict(res) @@ -2715,6 +2752,7 @@ def delete(self, token_id: str): body = {} if token_id is not None: body['token_id'] = token_id headers = {'Accept': 'application/json', 'Content-Type': 'application/json', } + self._api.do('POST', '/api/2.0/token/delete', body=body, headers=headers) def list(self) -> Iterator[PublicTokenInfo]: @@ -2726,6 +2764,7 @@ def list(self) -> Iterator[PublicTokenInfo]: """ headers = {'Accept': 'application/json', } + json = self._api.do('GET', '/api/2.0/token/list', headers=headers) parsed = ListPublicTokensResponse.from_dict(json).token_infos return parsed if parsed is not None else [] @@ -2750,6 +2789,7 @@ def get_status(self, keys: str) -> WorkspaceConf: query = {} if keys is not None: query['keys'] = keys headers = {'Accept': 'application/json', } + res = self._api.do('GET', '/api/2.0/workspace-conf', query=query, headers=headers) return res @@ -2763,4 +2803,5 @@ def set_status(self, contents: Dict[str, str]): """ headers = {'Content-Type': 'application/json', } + self._api.do('PATCH', '/api/2.0/workspace-conf', body=contents, headers=headers) diff --git a/databricks/sdk/service/sharing.py b/databricks/sdk/service/sharing.py index ef4f98684..d367cc4db 100755 --- a/databricks/sdk/service/sharing.py +++ b/databricks/sdk/service/sharing.py @@ -1576,6 +1576,7 @@ def create(self, if name is not None: body['name'] = name if remote_detailed_info is not None: body['remote_detailed_info'] = remote_detailed_info.as_dict() headers = {'Accept': 'application/json', 'Content-Type': 'application/json', } + res = self._api.do('POST', '/api/2.1/unity-catalog/clean-rooms', body=body, headers=headers) return CleanRoomInfo.from_dict(res) @@ -1591,6 +1592,7 @@ def delete(self, name_arg: str): """ headers = {'Accept': 'application/json', } + self._api.do('DELETE', f'/api/2.1/unity-catalog/clean-rooms/{name_arg}', headers=headers) def get(self, name_arg: str, *, include_remote_details: Optional[bool] = None) -> CleanRoomInfo: @@ -1610,6 +1612,7 @@ def get(self, name_arg: str, *, include_remote_details: Optional[bool] = None) - query = {} if include_remote_details is not None: query['include_remote_details'] = include_remote_details headers = {'Accept': 'application/json', } + res = self._api.do('GET', f'/api/2.1/unity-catalog/clean-rooms/{name_arg}', query=query, @@ -1689,6 +1692,7 @@ def update(self, if comment is not None: body['comment'] = comment if owner is not None: body['owner'] = owner headers = {'Accept': 'application/json', 'Content-Type': 'application/json', } + res = self._api.do('PATCH', f'/api/2.1/unity-catalog/clean-rooms/{name_arg}', body=body, @@ -1731,6 +1735,7 @@ def create(self, if name is not None: body['name'] = name if recipient_profile_str is not None: body['recipient_profile_str'] = recipient_profile_str headers = {'Accept': 'application/json', 'Content-Type': 'application/json', } + res = self._api.do('POST', '/api/2.1/unity-catalog/providers', body=body, headers=headers) return ProviderInfo.from_dict(res) @@ -1747,6 +1752,7 @@ def delete(self, name: str): """ headers = {'Accept': 'application/json', } + self._api.do('DELETE', f'/api/2.1/unity-catalog/providers/{name}', headers=headers) def get(self, name: str) -> ProviderInfo: @@ -1762,6 +1768,7 @@ def get(self, name: str) -> ProviderInfo: """ headers = {'Accept': 'application/json', } + res = self._api.do('GET', f'/api/2.1/unity-catalog/providers/{name}', headers=headers) return ProviderInfo.from_dict(res) @@ -1783,6 +1790,7 @@ def list(self, *, data_provider_global_metastore_id: Optional[str] = None) -> It if data_provider_global_metastore_id is not None: query['data_provider_global_metastore_id'] = data_provider_global_metastore_id headers = {'Accept': 'application/json', } + json = self._api.do('GET', '/api/2.1/unity-catalog/providers', query=query, headers=headers) parsed = ListProvidersResponse.from_dict(json).providers return parsed if parsed is not None else [] @@ -1801,6 +1809,7 @@ def list_shares(self, name: str) -> Iterator[ProviderShare]: """ headers = {'Accept': 'application/json', } + json = self._api.do('GET', f'/api/2.1/unity-catalog/providers/{name}/shares', headers=headers) parsed = ListProviderSharesResponse.from_dict(json).shares return parsed if parsed is not None else [] @@ -1837,6 +1846,7 @@ def update(self, if owner is not None: body['owner'] = owner if recipient_profile_str is not None: body['recipient_profile_str'] = recipient_profile_str headers = {'Accept': 'application/json', 'Content-Type': 'application/json', } + res = self._api.do('PATCH', f'/api/2.1/unity-catalog/providers/{name}', body=body, headers=headers) return ProviderInfo.from_dict(res) @@ -1865,6 +1875,7 @@ def get_activation_url_info(self, activation_url: str): """ headers = {'Accept': 'application/json', } + self._api.do('GET', f'/api/2.1/unity-catalog/public/data_sharing_activation_info/{activation_url}', headers=headers) @@ -1881,6 +1892,7 @@ def retrieve_token(self, activation_url: str) -> RetrieveTokenResponse: """ headers = {'Accept': 'application/json', } + res = self._api.do('GET', f'/api/2.1/unity-catalog/public/data_sharing_activation/{activation_url}', headers=headers) @@ -1953,6 +1965,7 @@ def create(self, if properties_kvpairs is not None: body['properties_kvpairs'] = properties_kvpairs.as_dict() if sharing_code is not None: body['sharing_code'] = sharing_code headers = {'Accept': 'application/json', 'Content-Type': 'application/json', } + res = self._api.do('POST', '/api/2.1/unity-catalog/recipients', body=body, headers=headers) return RecipientInfo.from_dict(res) @@ -1968,6 +1981,7 @@ def delete(self, name: str): """ headers = {'Accept': 'application/json', } + self._api.do('DELETE', f'/api/2.1/unity-catalog/recipients/{name}', headers=headers) def get(self, name: str) -> RecipientInfo: @@ -1984,6 +1998,7 @@ def get(self, name: str) -> RecipientInfo: """ headers = {'Accept': 'application/json', } + res = self._api.do('GET', f'/api/2.1/unity-catalog/recipients/{name}', headers=headers) return RecipientInfo.from_dict(res) @@ -2006,6 +2021,7 @@ def list(self, *, data_recipient_global_metastore_id: Optional[str] = None) -> I if data_recipient_global_metastore_id is not None: query['data_recipient_global_metastore_id'] = data_recipient_global_metastore_id headers = {'Accept': 'application/json', } + json = self._api.do('GET', '/api/2.1/unity-catalog/recipients', query=query, headers=headers) parsed = ListRecipientsResponse.from_dict(json).recipients return parsed if parsed is not None else [] @@ -2029,6 +2045,7 @@ def rotate_token(self, name: str, existing_token_expire_in_seconds: int) -> Reci if existing_token_expire_in_seconds is not None: body['existing_token_expire_in_seconds'] = existing_token_expire_in_seconds headers = {'Accept': 'application/json', 'Content-Type': 'application/json', } + res = self._api.do('POST', f'/api/2.1/unity-catalog/recipients/{name}/rotate-token', body=body, @@ -2048,6 +2065,7 @@ def share_permissions(self, name: str) -> GetRecipientSharePermissionsResponse: """ headers = {'Accept': 'application/json', } + res = self._api.do('GET', f'/api/2.1/unity-catalog/recipients/{name}/share-permissions', headers=headers) @@ -2091,6 +2109,7 @@ def update(self, if owner is not None: body['owner'] = owner if properties_kvpairs is not None: body['properties_kvpairs'] = properties_kvpairs.as_dict() headers = {'Accept': 'application/json', 'Content-Type': 'application/json', } + self._api.do('PATCH', f'/api/2.1/unity-catalog/recipients/{name}', body=body, headers=headers) @@ -2120,6 +2139,7 @@ def create(self, name: str, *, comment: Optional[str] = None) -> ShareInfo: if comment is not None: body['comment'] = comment if name is not None: body['name'] = name headers = {'Accept': 'application/json', 'Content-Type': 'application/json', } + res = self._api.do('POST', '/api/2.1/unity-catalog/shares', body=body, headers=headers) return ShareInfo.from_dict(res) @@ -2135,6 +2155,7 @@ def delete(self, name: str): """ headers = {'Accept': 'application/json', } + self._api.do('DELETE', f'/api/2.1/unity-catalog/shares/{name}', headers=headers) def get(self, name: str, *, include_shared_data: Optional[bool] = None) -> ShareInfo: @@ -2154,6 +2175,7 @@ def get(self, name: str, *, include_shared_data: Optional[bool] = None) -> Share query = {} if include_shared_data is not None: query['include_shared_data'] = include_shared_data headers = {'Accept': 'application/json', } + res = self._api.do('GET', f'/api/2.1/unity-catalog/shares/{name}', query=query, headers=headers) return ShareInfo.from_dict(res) @@ -2167,6 +2189,7 @@ def list(self) -> Iterator[ShareInfo]: """ headers = {'Accept': 'application/json', } + json = self._api.do('GET', '/api/2.1/unity-catalog/shares', headers=headers) parsed = ListSharesResponse.from_dict(json).shares return parsed if parsed is not None else [] @@ -2184,6 +2207,7 @@ def share_permissions(self, name: str) -> catalog.PermissionsList: """ headers = {'Accept': 'application/json', } + res = self._api.do('GET', f'/api/2.1/unity-catalog/shares/{name}/permissions', headers=headers) return PermissionsList.from_dict(res) @@ -2229,6 +2253,7 @@ def update(self, if owner is not None: body['owner'] = owner if updates is not None: body['updates'] = [v.as_dict() for v in updates] headers = {'Accept': 'application/json', 'Content-Type': 'application/json', } + res = self._api.do('PATCH', f'/api/2.1/unity-catalog/shares/{name}', body=body, headers=headers) return ShareInfo.from_dict(res) @@ -2251,4 +2276,5 @@ def update_permissions(self, name: str, *, changes: Optional[List[catalog.Permis body = {} if changes is not None: body['changes'] = [v.as_dict() for v in changes] headers = {'Accept': 'application/json', 'Content-Type': 'application/json', } + self._api.do('PATCH', f'/api/2.1/unity-catalog/shares/{name}/permissions', body=body, headers=headers) diff --git a/databricks/sdk/service/sql.py b/databricks/sdk/service/sql.py index c1bf9ea41..c5da129e6 100755 --- a/databricks/sdk/service/sql.py +++ b/databricks/sdk/service/sql.py @@ -346,7 +346,6 @@ def from_dict(cls, d: Dict[str, any]) -> ChannelInfo: class ChannelName(Enum): - """Name of the channel""" CHANNEL_NAME_CURRENT = 'CHANNEL_NAME_CURRENT' CHANNEL_NAME_CUSTOM = 'CHANNEL_NAME_CUSTOM' @@ -3802,6 +3801,7 @@ def create(self, if query_id is not None: body['query_id'] = query_id if rearm is not None: body['rearm'] = rearm headers = {'Accept': 'application/json', 'Content-Type': 'application/json', } + res = self._api.do('POST', '/api/2.0/preview/sql/alerts', body=body, headers=headers) return Alert.from_dict(res) @@ -3817,6 +3817,7 @@ def delete(self, alert_id: str): """ headers = {'Accept': 'application/json', } + self._api.do('DELETE', f'/api/2.0/preview/sql/alerts/{alert_id}', headers=headers) def get(self, alert_id: str) -> Alert: @@ -3830,6 +3831,7 @@ def get(self, alert_id: str) -> Alert: """ headers = {'Accept': 'application/json', } + res = self._api.do('GET', f'/api/2.0/preview/sql/alerts/{alert_id}', headers=headers) return Alert.from_dict(res) @@ -3842,6 +3844,7 @@ def list(self) -> Iterator[Alert]: """ headers = {'Accept': 'application/json', } + res = self._api.do('GET', '/api/2.0/preview/sql/alerts', headers=headers) return [Alert.from_dict(v) for v in res] @@ -3875,6 +3878,7 @@ def update(self, if query_id is not None: body['query_id'] = query_id if rearm is not None: body['rearm'] = rearm headers = {'Accept': 'application/json', 'Content-Type': 'application/json', } + self._api.do('PUT', f'/api/2.0/preview/sql/alerts/{alert_id}', body=body, headers=headers) @@ -3914,6 +3918,7 @@ def create(self, if visualization_id is not None: body['visualization_id'] = visualization_id if width is not None: body['width'] = width headers = {'Accept': 'application/json', 'Content-Type': 'application/json', } + res = self._api.do('POST', '/api/2.0/preview/sql/widgets', body=body, headers=headers) return Widget.from_dict(res) @@ -3927,6 +3932,7 @@ def delete(self, id: str): """ headers = {'Accept': 'application/json', } + self._api.do('DELETE', f'/api/2.0/preview/sql/widgets/{id}', headers=headers) def update(self, @@ -3961,6 +3967,7 @@ def update(self, if visualization_id is not None: body['visualization_id'] = visualization_id if width is not None: body['width'] = width headers = {'Accept': 'application/json', 'Content-Type': 'application/json', } + res = self._api.do('POST', f'/api/2.0/preview/sql/widgets/{id}', body=body, headers=headers) return Widget.from_dict(res) @@ -4009,6 +4016,7 @@ def create(self, if run_as_role is not None: body['run_as_role'] = run_as_role.value if tags is not None: body['tags'] = [v for v in tags] headers = {'Accept': 'application/json', 'Content-Type': 'application/json', } + res = self._api.do('POST', '/api/2.0/preview/sql/dashboards', body=body, headers=headers) return Dashboard.from_dict(res) @@ -4024,6 +4032,7 @@ def delete(self, dashboard_id: str): """ headers = {'Accept': 'application/json', } + self._api.do('DELETE', f'/api/2.0/preview/sql/dashboards/{dashboard_id}', headers=headers) def get(self, dashboard_id: str) -> Dashboard: @@ -4037,6 +4046,7 @@ def get(self, dashboard_id: str) -> Dashboard: """ headers = {'Accept': 'application/json', } + res = self._api.do('GET', f'/api/2.0/preview/sql/dashboards/{dashboard_id}', headers=headers) return Dashboard.from_dict(res) @@ -4099,6 +4109,7 @@ def restore(self, dashboard_id: str): """ headers = {'Accept': 'application/json', } + self._api.do('POST', f'/api/2.0/preview/sql/dashboards/trash/{dashboard_id}', headers=headers) def update(self, @@ -4126,6 +4137,7 @@ def update(self, if name is not None: body['name'] = name if run_as_role is not None: body['run_as_role'] = run_as_role.value headers = {'Accept': 'application/json', 'Content-Type': 'application/json', } + res = self._api.do('POST', f'/api/2.0/preview/sql/dashboards/{dashboard_id}', body=body, @@ -4156,6 +4168,7 @@ def list(self) -> Iterator[DataSource]: """ headers = {'Accept': 'application/json', } + res = self._api.do('GET', '/api/2.0/preview/sql/data_sources', headers=headers) return [DataSource.from_dict(v) for v in res] @@ -4190,6 +4203,7 @@ def get(self, object_type: ObjectTypePlural, object_id: str) -> GetResponse: """ headers = {'Accept': 'application/json', } + res = self._api.do('GET', f'/api/2.0/preview/sql/permissions/{object_type.value}/{object_id}', headers=headers) @@ -4217,6 +4231,7 @@ def set(self, if access_control_list is not None: body['access_control_list'] = [v.as_dict() for v in access_control_list] headers = {'Accept': 'application/json', 'Content-Type': 'application/json', } + res = self._api.do('POST', f'/api/2.0/preview/sql/permissions/{object_type.value}/{object_id}', body=body, @@ -4244,6 +4259,7 @@ def transfer_ownership(self, body = {} if new_owner is not None: body['new_owner'] = new_owner headers = {'Accept': 'application/json', 'Content-Type': 'application/json', } + res = self._api.do('POST', f'/api/2.0/preview/sql/permissions/{object_type.value}/{object_id}/transfer', body=body, @@ -4311,6 +4327,7 @@ def create(self, if query is not None: body['query'] = query if run_as_role is not None: body['run_as_role'] = run_as_role.value headers = {'Accept': 'application/json', 'Content-Type': 'application/json', } + res = self._api.do('POST', '/api/2.0/preview/sql/queries', body=body, headers=headers) return Query.from_dict(res) @@ -4326,6 +4343,7 @@ def delete(self, query_id: str): """ headers = {'Accept': 'application/json', } + self._api.do('DELETE', f'/api/2.0/preview/sql/queries/{query_id}', headers=headers) def get(self, query_id: str) -> Query: @@ -4340,6 +4358,7 @@ def get(self, query_id: str) -> Query: """ headers = {'Accept': 'application/json', } + res = self._api.do('GET', f'/api/2.0/preview/sql/queries/{query_id}', headers=headers) return Query.from_dict(res) @@ -4415,6 +4434,7 @@ def restore(self, query_id: str): """ headers = {'Accept': 'application/json', } + self._api.do('POST', f'/api/2.0/preview/sql/queries/trash/{query_id}', headers=headers) def update(self, @@ -4462,6 +4482,7 @@ def update(self, if query is not None: body['query'] = query if run_as_role is not None: body['run_as_role'] = run_as_role.value headers = {'Accept': 'application/json', 'Content-Type': 'application/json', } + res = self._api.do('POST', f'/api/2.0/preview/sql/queries/{query_id}', body=body, headers=headers) return Query.from_dict(res) @@ -4552,6 +4573,7 @@ def create(self, if query_id is not None: body['query_id'] = query_id if type is not None: body['type'] = type headers = {'Accept': 'application/json', 'Content-Type': 'application/json', } + res = self._api.do('POST', '/api/2.0/preview/sql/visualizations', body=body, headers=headers) return Visualization.from_dict(res) @@ -4565,6 +4587,7 @@ def delete(self, id: str): """ headers = {'Accept': 'application/json', } + self._api.do('DELETE', f'/api/2.0/preview/sql/visualizations/{id}', headers=headers) def update(self, @@ -4602,6 +4625,7 @@ def update(self, if type is not None: body['type'] = type if updated_at is not None: body['updated_at'] = updated_at headers = {'Accept': 'application/json', 'Content-Type': 'application/json', } + res = self._api.do('POST', f'/api/2.0/preview/sql/visualizations/{id}', body=body, headers=headers) return Visualization.from_dict(res) @@ -4707,6 +4731,7 @@ def cancel_execution(self, statement_id: str): """ headers = {} + self._api.do('POST', f'/api/2.0/sql/statements/{statement_id}/cancel', headers=headers) def execute_statement(self, @@ -4862,6 +4887,7 @@ def execute_statement(self, if wait_timeout is not None: body['wait_timeout'] = wait_timeout if warehouse_id is not None: body['warehouse_id'] = warehouse_id headers = {'Accept': 'application/json', 'Content-Type': 'application/json', } + res = self._api.do('POST', '/api/2.0/sql/statements/', body=body, headers=headers) return ExecuteStatementResponse.from_dict(res) @@ -4884,6 +4910,7 @@ def get_statement(self, statement_id: str) -> GetStatementResponse: """ headers = {'Accept': 'application/json', } + res = self._api.do('GET', f'/api/2.0/sql/statements/{statement_id}', headers=headers) return GetStatementResponse.from_dict(res) @@ -4906,6 +4933,7 @@ def get_statement_result_chunk_n(self, statement_id: str, chunk_index: int) -> R """ headers = {'Accept': 'application/json', } + res = self._api.do('GET', f'/api/2.0/sql/statements/{statement_id}/result/chunks/{chunk_index}', headers=headers) @@ -5077,6 +5105,7 @@ def create( if tags is not None: body['tags'] = tags.as_dict() if warehouse_type is not None: body['warehouse_type'] = warehouse_type.value headers = {'Accept': 'application/json', 'Content-Type': 'application/json', } + op_response = self._api.do('POST', '/api/2.0/sql/warehouses', body=body, headers=headers) return Wait(self.wait_get_warehouse_running, response=CreateWarehouseResponse.from_dict(op_response), @@ -5126,6 +5155,7 @@ def delete(self, id: str): """ headers = {'Accept': 'application/json', } + self._api.do('DELETE', f'/api/2.0/sql/warehouses/{id}', headers=headers) def edit( @@ -5226,6 +5256,7 @@ def edit( if tags is not None: body['tags'] = tags.as_dict() if warehouse_type is not None: body['warehouse_type'] = warehouse_type.value headers = {'Accept': 'application/json', 'Content-Type': 'application/json', } + 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) @@ -5275,6 +5306,7 @@ def get(self, id: str) -> GetWarehouseResponse: """ headers = {'Accept': 'application/json', } + res = self._api.do('GET', f'/api/2.0/sql/warehouses/{id}', headers=headers) return GetWarehouseResponse.from_dict(res) @@ -5290,6 +5322,7 @@ def get_permission_levels(self, warehouse_id: str) -> GetWarehousePermissionLeve """ headers = {'Accept': 'application/json', } + res = self._api.do('GET', f'/api/2.0/permissions/warehouses/{warehouse_id}/permissionLevels', headers=headers) @@ -5308,6 +5341,7 @@ def get_permissions(self, warehouse_id: str) -> WarehousePermissions: """ headers = {'Accept': 'application/json', } + res = self._api.do('GET', f'/api/2.0/permissions/warehouses/{warehouse_id}', headers=headers) return WarehousePermissions.from_dict(res) @@ -5320,6 +5354,7 @@ def get_workspace_warehouse_config(self) -> GetWorkspaceWarehouseConfigResponse: """ headers = {'Accept': 'application/json', } + res = self._api.do('GET', '/api/2.0/sql/config/warehouses', headers=headers) return GetWorkspaceWarehouseConfigResponse.from_dict(res) @@ -5338,6 +5373,7 @@ def list(self, *, run_as_user_id: Optional[int] = None) -> Iterator[EndpointInfo query = {} if run_as_user_id is not None: query['run_as_user_id'] = run_as_user_id headers = {'Accept': 'application/json', } + json = self._api.do('GET', '/api/2.0/sql/warehouses', query=query, headers=headers) parsed = ListWarehousesResponse.from_dict(json).warehouses return parsed if parsed is not None else [] @@ -5361,6 +5397,7 @@ def set_permissions(self, if access_control_list is not None: body['access_control_list'] = [v.as_dict() for v in access_control_list] headers = {'Accept': 'application/json', 'Content-Type': 'application/json', } + res = self._api.do('PUT', f'/api/2.0/permissions/warehouses/{warehouse_id}', body=body, @@ -5422,6 +5459,7 @@ def set_workspace_warehouse_config( if sql_configuration_parameters is not None: body['sql_configuration_parameters'] = sql_configuration_parameters.as_dict() headers = {'Accept': 'application/json', 'Content-Type': 'application/json', } + self._api.do('PUT', '/api/2.0/sql/config/warehouses', body=body, headers=headers) def start(self, id: str) -> Wait[GetWarehouseResponse]: @@ -5438,6 +5476,7 @@ def start(self, id: str) -> Wait[GetWarehouseResponse]: """ headers = {'Accept': 'application/json', } + self._api.do('POST', f'/api/2.0/sql/warehouses/{id}/start', headers=headers) return Wait(self.wait_get_warehouse_running, id=id) @@ -5458,6 +5497,7 @@ def stop(self, id: str) -> Wait[GetWarehouseResponse]: """ headers = {'Accept': 'application/json', } + self._api.do('POST', f'/api/2.0/sql/warehouses/{id}/stop', headers=headers) return Wait(self.wait_get_warehouse_stopped, id=id) @@ -5484,6 +5524,7 @@ def update_permissions(self, if access_control_list is not None: body['access_control_list'] = [v.as_dict() for v in access_control_list] headers = {'Accept': 'application/json', 'Content-Type': 'application/json', } + res = self._api.do('PATCH', f'/api/2.0/permissions/warehouses/{warehouse_id}', body=body, diff --git a/databricks/sdk/service/vectorsearch.py b/databricks/sdk/service/vectorsearch.py index 9815eb0bf..0249eeb0f 100755 --- a/databricks/sdk/service/vectorsearch.py +++ b/databricks/sdk/service/vectorsearch.py @@ -926,6 +926,7 @@ def create_endpoint(self, name: str, endpoint_type: EndpointType) -> Wait[Endpoi if endpoint_type is not None: body['endpoint_type'] = endpoint_type.value if name is not None: body['name'] = name headers = {'Accept': 'application/json', 'Content-Type': 'application/json', } + op_response = self._api.do('POST', '/api/2.0/vector-search/endpoints', body=body, headers=headers) return Wait(self.wait_get_endpoint_vector_search_endpoint_online, response=EndpointInfo.from_dict(op_response), @@ -947,6 +948,7 @@ def delete_endpoint(self, endpoint_name: str, name: str): """ headers = {} + self._api.do('DELETE', f'/api/2.0/vector-search/endpoints/{endpoint_name}', headers=headers) def get_endpoint(self, endpoint_name: str) -> EndpointInfo: @@ -959,6 +961,7 @@ def get_endpoint(self, endpoint_name: str) -> EndpointInfo: """ headers = {'Accept': 'application/json', } + res = self._api.do('GET', f'/api/2.0/vector-search/endpoints/{endpoint_name}', headers=headers) return EndpointInfo.from_dict(res) @@ -1038,6 +1041,7 @@ def create_index(self, if name is not None: body['name'] = name if primary_key is not None: body['primary_key'] = primary_key headers = {'Accept': 'application/json', 'Content-Type': 'application/json', } + res = self._api.do('POST', '/api/2.0/vector-search/indexes', body=body, headers=headers) return CreateVectorIndexResponse.from_dict(res) @@ -1056,6 +1060,7 @@ def delete_data_vector_index(self, name: str, primary_keys: List[str]) -> Delete body = {} if primary_keys is not None: body['primary_keys'] = [v for v in primary_keys] headers = {'Accept': 'application/json', 'Content-Type': 'application/json', } + res = self._api.do('POST', f'/api/2.0/vector-search/indexes/{name}/delete-data', body=body, @@ -1074,6 +1079,7 @@ def delete_index(self, index_name: str): """ headers = {} + self._api.do('DELETE', f'/api/2.0/vector-search/indexes/{index_name}', headers=headers) def get_index(self, index_name: str) -> VectorIndex: @@ -1088,6 +1094,7 @@ def get_index(self, index_name: str) -> VectorIndex: """ headers = {'Accept': 'application/json', } + res = self._api.do('GET', f'/api/2.0/vector-search/indexes/{index_name}', headers=headers) return VectorIndex.from_dict(res) @@ -1160,6 +1167,7 @@ def query_index(self, if query_text is not None: body['query_text'] = query_text if query_vector is not None: body['query_vector'] = [v for v in query_vector] headers = {'Accept': 'application/json', 'Content-Type': 'application/json', } + res = self._api.do('POST', f'/api/2.0/vector-search/indexes/{index_name}/query', body=body, @@ -1178,6 +1186,7 @@ def sync_index(self, index_name: str): """ headers = {} + self._api.do('POST', f'/api/2.0/vector-search/indexes/{index_name}/sync', headers=headers) def upsert_data_vector_index(self, name: str, inputs_json: str) -> UpsertDataVectorIndexResponse: @@ -1195,6 +1204,7 @@ def upsert_data_vector_index(self, name: str, inputs_json: str) -> UpsertDataVec body = {} if inputs_json is not None: body['inputs_json'] = inputs_json headers = {'Accept': 'application/json', 'Content-Type': 'application/json', } + res = self._api.do('POST', f'/api/2.0/vector-search/indexes/{name}/upsert-data', body=body, diff --git a/databricks/sdk/service/workspace.py b/databricks/sdk/service/workspace.py index d5d5e6a2a..17205e5c0 100755 --- a/databricks/sdk/service/workspace.py +++ b/databricks/sdk/service/workspace.py @@ -1320,6 +1320,7 @@ def create(self, if git_username is not None: body['git_username'] = git_username if personal_access_token is not None: body['personal_access_token'] = personal_access_token headers = {'Accept': 'application/json', 'Content-Type': 'application/json', } + res = self._api.do('POST', '/api/2.0/git-credentials', body=body, headers=headers) return CreateCredentialsResponse.from_dict(res) @@ -1335,6 +1336,7 @@ def delete(self, credential_id: int): """ headers = {} + self._api.do('DELETE', f'/api/2.0/git-credentials/{credential_id}', headers=headers) def get(self, credential_id: int) -> CredentialInfo: @@ -1349,6 +1351,7 @@ def get(self, credential_id: int) -> CredentialInfo: """ headers = {'Accept': 'application/json', } + res = self._api.do('GET', f'/api/2.0/git-credentials/{credential_id}', headers=headers) return CredentialInfo.from_dict(res) @@ -1361,6 +1364,7 @@ def list(self) -> Iterator[CredentialInfo]: """ headers = {'Accept': 'application/json', } + json = self._api.do('GET', '/api/2.0/git-credentials', headers=headers) parsed = GetCredentialsResponse.from_dict(json).credentials return parsed if parsed is not None else [] @@ -1393,6 +1397,7 @@ def update(self, if git_username is not None: body['git_username'] = git_username if personal_access_token is not None: body['personal_access_token'] = personal_access_token headers = {'Accept': 'application/json', 'Content-Type': 'application/json', } + self._api.do('PATCH', f'/api/2.0/git-credentials/{credential_id}', body=body, headers=headers) @@ -1441,6 +1446,7 @@ def create(self, if sparse_checkout is not None: body['sparse_checkout'] = sparse_checkout.as_dict() if url is not None: body['url'] = url headers = {'Accept': 'application/json', 'Content-Type': 'application/json', } + res = self._api.do('POST', '/api/2.0/repos', body=body, headers=headers) return RepoInfo.from_dict(res) @@ -1456,6 +1462,7 @@ def delete(self, repo_id: int): """ headers = {} + self._api.do('DELETE', f'/api/2.0/repos/{repo_id}', headers=headers) def get(self, repo_id: int) -> RepoInfo: @@ -1470,6 +1477,7 @@ def get(self, repo_id: int) -> RepoInfo: """ headers = {'Accept': 'application/json', } + res = self._api.do('GET', f'/api/2.0/repos/{repo_id}', headers=headers) return RepoInfo.from_dict(res) @@ -1485,6 +1493,7 @@ def get_permission_levels(self, repo_id: str) -> GetRepoPermissionLevelsResponse """ headers = {'Accept': 'application/json', } + res = self._api.do('GET', f'/api/2.0/permissions/repos/{repo_id}/permissionLevels', headers=headers) return GetRepoPermissionLevelsResponse.from_dict(res) @@ -1500,6 +1509,7 @@ def get_permissions(self, repo_id: str) -> RepoPermissions: """ headers = {'Accept': 'application/json', } + res = self._api.do('GET', f'/api/2.0/permissions/repos/{repo_id}', headers=headers) return RepoPermissions.from_dict(res) @@ -1554,6 +1564,7 @@ def set_permissions( if access_control_list is not None: body['access_control_list'] = [v.as_dict() for v in access_control_list] headers = {'Accept': 'application/json', 'Content-Type': 'application/json', } + res = self._api.do('PUT', f'/api/2.0/permissions/repos/{repo_id}', body=body, headers=headers) return RepoPermissions.from_dict(res) @@ -1587,6 +1598,7 @@ def update(self, if sparse_checkout is not None: body['sparse_checkout'] = sparse_checkout.as_dict() if tag is not None: body['tag'] = tag headers = {'Accept': 'application/json', 'Content-Type': 'application/json', } + self._api.do('PATCH', f'/api/2.0/repos/{repo_id}', body=body, headers=headers) def update_permissions( @@ -1608,6 +1620,7 @@ def update_permissions( if access_control_list is not None: body['access_control_list'] = [v.as_dict() for v in access_control_list] headers = {'Accept': 'application/json', 'Content-Type': 'application/json', } + res = self._api.do('PATCH', f'/api/2.0/permissions/repos/{repo_id}', body=body, headers=headers) return RepoPermissions.from_dict(res) @@ -1655,6 +1668,7 @@ def create_scope(self, if scope is not None: body['scope'] = scope if scope_backend_type is not None: body['scope_backend_type'] = scope_backend_type.value headers = {'Accept': 'application/json', 'Content-Type': 'application/json', } + self._api.do('POST', '/api/2.0/secrets/scopes/create', body=body, headers=headers) def delete_acl(self, scope: str, principal: str): @@ -1677,6 +1691,7 @@ def delete_acl(self, scope: str, principal: str): if principal is not None: body['principal'] = principal if scope is not None: body['scope'] = scope headers = {'Accept': 'application/json', 'Content-Type': 'application/json', } + self._api.do('POST', '/api/2.0/secrets/acls/delete', body=body, headers=headers) def delete_scope(self, scope: str): @@ -1695,6 +1710,7 @@ def delete_scope(self, scope: str): body = {} if scope is not None: body['scope'] = scope headers = {'Accept': 'application/json', 'Content-Type': 'application/json', } + self._api.do('POST', '/api/2.0/secrets/scopes/delete', body=body, headers=headers) def delete_secret(self, scope: str, key: str): @@ -1717,6 +1733,7 @@ def delete_secret(self, scope: str, key: str): if key is not None: body['key'] = key if scope is not None: body['scope'] = scope headers = {'Accept': 'application/json', 'Content-Type': 'application/json', } + self._api.do('POST', '/api/2.0/secrets/delete', body=body, headers=headers) def get_acl(self, scope: str, principal: str) -> AclItem: @@ -1740,6 +1757,7 @@ def get_acl(self, scope: str, principal: str) -> AclItem: if principal is not None: query['principal'] = principal if scope is not None: query['scope'] = scope headers = {'Accept': 'application/json', } + res = self._api.do('GET', '/api/2.0/secrets/acls/get', query=query, headers=headers) return AclItem.from_dict(res) @@ -1768,6 +1786,7 @@ def get_secret(self, scope: str, key: str) -> GetSecretResponse: if key is not None: query['key'] = key if scope is not None: query['scope'] = scope headers = {'Accept': 'application/json', } + res = self._api.do('GET', '/api/2.0/secrets/get', query=query, headers=headers) return GetSecretResponse.from_dict(res) @@ -1788,6 +1807,7 @@ def list_acls(self, scope: str) -> Iterator[AclItem]: query = {} if scope is not None: query['scope'] = scope headers = {'Accept': 'application/json', } + json = self._api.do('GET', '/api/2.0/secrets/acls/list', query=query, headers=headers) parsed = ListAclsResponse.from_dict(json).items return parsed if parsed is not None else [] @@ -1803,6 +1823,7 @@ def list_scopes(self) -> Iterator[SecretScope]: """ headers = {'Accept': 'application/json', } + json = self._api.do('GET', '/api/2.0/secrets/scopes/list', headers=headers) parsed = ListScopesResponse.from_dict(json).scopes return parsed if parsed is not None else [] @@ -1826,6 +1847,7 @@ def list_secrets(self, scope: str) -> Iterator[SecretMetadata]: query = {} if scope is not None: query['scope'] = scope headers = {'Accept': 'application/json', } + json = self._api.do('GET', '/api/2.0/secrets/list', query=query, headers=headers) parsed = ListSecretsResponse.from_dict(json).secrets return parsed if parsed is not None else [] @@ -1872,6 +1894,7 @@ def put_acl(self, scope: str, principal: str, permission: AclPermission): if principal is not None: body['principal'] = principal if scope is not None: body['scope'] = scope headers = {'Accept': 'application/json', 'Content-Type': 'application/json', } + self._api.do('POST', '/api/2.0/secrets/acls/put', body=body, headers=headers) def put_secret(self, @@ -1915,6 +1938,7 @@ def put_secret(self, if scope is not None: body['scope'] = scope if string_value is not None: body['string_value'] = string_value headers = {'Accept': 'application/json', 'Content-Type': 'application/json', } + self._api.do('POST', '/api/2.0/secrets/put', body=body, headers=headers) @@ -1950,6 +1974,7 @@ def delete(self, path: str, *, recursive: Optional[bool] = None): if path is not None: body['path'] = path if recursive is not None: body['recursive'] = recursive headers = {'Accept': 'application/json', 'Content-Type': 'application/json', } + self._api.do('POST', '/api/2.0/workspace/delete', body=body, headers=headers) def export(self, path: str, *, format: Optional[ExportFormat] = None) -> ExportResponse: @@ -1984,6 +2009,7 @@ def export(self, path: str, *, format: Optional[ExportFormat] = None) -> ExportR if format is not None: query['format'] = format.value if path is not None: query['path'] = path headers = {'Accept': 'application/json', } + res = self._api.do('GET', '/api/2.0/workspace/export', query=query, headers=headers) return ExportResponse.from_dict(res) @@ -2002,6 +2028,7 @@ def get_permission_levels(self, workspace_object_type: str, """ headers = {'Accept': 'application/json', } + res = self._api.do( 'GET', f'/api/2.0/permissions/{workspace_object_type}/{workspace_object_id}/permissionLevels', @@ -2024,6 +2051,7 @@ def get_permissions(self, workspace_object_type: str, """ headers = {'Accept': 'application/json', } + res = self._api.do('GET', f'/api/2.0/permissions/{workspace_object_type}/{workspace_object_id}', headers=headers) @@ -2044,6 +2072,7 @@ def get_status(self, path: str) -> ObjectInfo: query = {} if path is not None: query['path'] = path headers = {'Accept': 'application/json', } + res = self._api.do('GET', '/api/2.0/workspace/get-status', query=query, headers=headers) return ObjectInfo.from_dict(res) @@ -2096,6 +2125,7 @@ def import_(self, if overwrite is not None: body['overwrite'] = overwrite if path is not None: body['path'] = path headers = {'Accept': 'application/json', 'Content-Type': 'application/json', } + self._api.do('POST', '/api/2.0/workspace/import', body=body, headers=headers) def list(self, path: str, *, notebooks_modified_after: Optional[int] = None) -> Iterator[ObjectInfo]: @@ -2116,6 +2146,7 @@ def list(self, path: str, *, notebooks_modified_after: Optional[int] = None) -> if notebooks_modified_after is not None: query['notebooks_modified_after'] = notebooks_modified_after if path is not None: query['path'] = path headers = {'Accept': 'application/json', } + json = self._api.do('GET', '/api/2.0/workspace/list', query=query, headers=headers) parsed = ListResponse.from_dict(json).objects return parsed if parsed is not None else [] @@ -2139,6 +2170,7 @@ def mkdirs(self, path: str): body = {} if path is not None: body['path'] = path headers = {'Accept': 'application/json', 'Content-Type': 'application/json', } + self._api.do('POST', '/api/2.0/workspace/mkdirs', body=body, headers=headers) def set_permissions( @@ -2165,6 +2197,7 @@ def set_permissions( if access_control_list is not None: body['access_control_list'] = [v.as_dict() for v in access_control_list] headers = {'Accept': 'application/json', 'Content-Type': 'application/json', } + res = self._api.do('PUT', f'/api/2.0/permissions/{workspace_object_type}/{workspace_object_id}', body=body, @@ -2195,6 +2228,7 @@ def update_permissions( if access_control_list is not None: body['access_control_list'] = [v.as_dict() for v in access_control_list] headers = {'Accept': 'application/json', 'Content-Type': 'application/json', } + res = self._api.do('PATCH', f'/api/2.0/permissions/{workspace_object_type}/{workspace_object_id}', body=body, diff --git a/examples/connections/create_connections.py b/examples/connections/create_connections.py index 1bd9414aa..46701b767 100755 --- a/examples/connections/create_connections.py +++ b/examples/connections/create_connections.py @@ -18,4 +18,4 @@ }) # cleanup -w.connections.delete(name_arg=conn_create.name) +w.connections.delete(name=conn_create.name) diff --git a/examples/connections/get_connections.py b/examples/connections/get_connections.py index ebfba8b95..20d20c9ca 100755 --- a/examples/connections/get_connections.py +++ b/examples/connections/get_connections.py @@ -17,7 +17,7 @@ f'sdk-{time.time_ns()}', }) -conn_update = w.connections.update(name_arg=conn_create.name, +conn_update = w.connections.update(name=conn_create.name, options={ "host": "%s-fake-workspace.cloud.databricks.com" % (f'sdk-{time.time_ns()}'), @@ -27,7 +27,7 @@ f'sdk-{time.time_ns()}', }) -conn = w.connections.get(name_arg=conn_update.name) +conn = w.connections.get(name=conn_update.name) # cleanup -w.connections.delete(name_arg=conn_create.name) +w.connections.delete(name=conn_create.name) diff --git a/examples/connections/update_connections.py b/examples/connections/update_connections.py index f404feff7..49cfcdc36 100755 --- a/examples/connections/update_connections.py +++ b/examples/connections/update_connections.py @@ -17,7 +17,7 @@ f'sdk-{time.time_ns()}', }) -conn_update = w.connections.update(name_arg=conn_create.name, +conn_update = w.connections.update(name=conn_create.name, options={ "host": "%s-fake-workspace.cloud.databricks.com" % (f'sdk-{time.time_ns()}'), @@ -28,4 +28,4 @@ }) # cleanup -w.connections.delete(name_arg=conn_create.name) +w.connections.delete(name=conn_create.name) diff --git a/examples/volumes/create_volumes.py b/examples/volumes/create_volumes.py index e951798d9..03bf8211f 100755 --- a/examples/volumes/create_volumes.py +++ b/examples/volumes/create_volumes.py @@ -32,4 +32,4 @@ w.external_locations.delete(name=external_location.name) w.schemas.delete(full_name=created_schema.full_name) w.catalogs.delete(name=created_catalog.name, force=True) -w.volumes.delete(full_name_arg=created_volume.full_name) +w.volumes.delete(name=created_volume.full_name) diff --git a/examples/volumes/read_volumes.py b/examples/volumes/read_volumes.py index 88077c06e..d7c638058 100755 --- a/examples/volumes/read_volumes.py +++ b/examples/volumes/read_volumes.py @@ -27,11 +27,11 @@ storage_location=external_location.url, volume_type=catalog.VolumeType.EXTERNAL) -loaded_volume = w.volumes.read(full_name_arg=created_volume.full_name) +loaded_volume = w.volumes.read(name=created_volume.full_name) # cleanup w.storage_credentials.delete(name=storage_credential.name) w.external_locations.delete(name=external_location.name) w.schemas.delete(full_name=created_schema.full_name) w.catalogs.delete(name=created_catalog.name, force=True) -w.volumes.delete(full_name_arg=created_volume.full_name) +w.volumes.delete(name=created_volume.full_name) diff --git a/examples/volumes/update_volumes.py b/examples/volumes/update_volumes.py index 497ccf421..728322e35 100755 --- a/examples/volumes/update_volumes.py +++ b/examples/volumes/update_volumes.py @@ -27,13 +27,13 @@ storage_location=external_location.url, volume_type=catalog.VolumeType.EXTERNAL) -loaded_volume = w.volumes.read(full_name_arg=created_volume.full_name) +loaded_volume = w.volumes.read(name=created_volume.full_name) -_ = w.volumes.update(full_name_arg=loaded_volume.full_name, comment="Updated volume comment") +_ = w.volumes.update(name=loaded_volume.full_name, comment="Updated volume comment") # cleanup w.storage_credentials.delete(name=storage_credential.name) w.external_locations.delete(name=external_location.name) w.schemas.delete(full_name=created_schema.full_name) w.catalogs.delete(name=created_catalog.name, force=True) -w.volumes.delete(full_name_arg=created_volume.full_name) +w.volumes.delete(name=created_volume.full_name) diff --git a/tests/integration/test_files.py b/tests/integration/test_files.py index e15ded587..5820a80ae 100644 --- a/tests/integration/test_files.py +++ b/tests/integration/test_files.py @@ -221,7 +221,9 @@ def test_files_api_upload_download(ucws, random): f = io.BytesIO(b"some text data") target_file = f'/Volumes/main/{schema}/{volume}/filesit-{random()}.txt' w.files.upload(target_file, f) - + # TODO: Enable after generating with the latest spec + # m = w.files.get_metadata(target_file) + # assert m.content_type == 'application/octet-stream' with w.files.download(target_file).contents as f: assert f.read() == b"some text data"