databricks-sdk 0.20.0__py3-none-any.whl → 0.21.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of databricks-sdk might be problematic. Click here for more details.

Files changed (33) hide show
  1. databricks/sdk/__init__.py +21 -6
  2. databricks/sdk/_widgets/__init__.py +2 -2
  3. databricks/sdk/config.py +3 -2
  4. databricks/sdk/oauth.py +1 -1
  5. databricks/sdk/runtime/__init__.py +85 -11
  6. databricks/sdk/runtime/dbutils_stub.py +1 -1
  7. databricks/sdk/service/_internal.py +1 -1
  8. databricks/sdk/service/billing.py +42 -0
  9. databricks/sdk/service/catalog.py +245 -44
  10. databricks/sdk/service/compute.py +334 -13
  11. databricks/sdk/service/dashboards.py +14 -0
  12. databricks/sdk/service/files.py +154 -12
  13. databricks/sdk/service/iam.py +161 -0
  14. databricks/sdk/service/jobs.py +95 -8
  15. databricks/sdk/service/ml.py +350 -0
  16. databricks/sdk/service/oauth2.py +70 -0
  17. databricks/sdk/service/pipelines.py +66 -8
  18. databricks/sdk/service/provisioning.py +78 -36
  19. databricks/sdk/service/serving.py +28 -0
  20. databricks/sdk/service/settings.py +1292 -203
  21. databricks/sdk/service/sharing.py +56 -0
  22. databricks/sdk/service/sql.py +138 -11
  23. databricks/sdk/service/vectorsearch.py +95 -60
  24. databricks/sdk/service/workspace.py +141 -1
  25. databricks/sdk/version.py +1 -1
  26. {databricks_sdk-0.20.0.dist-info → databricks_sdk-0.21.0.dist-info}/METADATA +3 -1
  27. databricks_sdk-0.21.0.dist-info/RECORD +53 -0
  28. databricks/sdk/runtime/stub.py +0 -48
  29. databricks_sdk-0.20.0.dist-info/RECORD +0 -54
  30. {databricks_sdk-0.20.0.dist-info → databricks_sdk-0.21.0.dist-info}/LICENSE +0 -0
  31. {databricks_sdk-0.20.0.dist-info → databricks_sdk-0.21.0.dist-info}/NOTICE +0 -0
  32. {databricks_sdk-0.20.0.dist-info → databricks_sdk-0.21.0.dist-info}/WHEEL +0 -0
  33. {databricks_sdk-0.20.0.dist-info → databricks_sdk-0.21.0.dist-info}/top_level.txt +0 -0
@@ -8,7 +8,7 @@ import time
8
8
  from dataclasses import dataclass
9
9
  from datetime import timedelta
10
10
  from enum import Enum
11
- from typing import Any, Callable, Dict, Iterator, List, Optional
11
+ from typing import Callable, Dict, Iterator, List, Optional
12
12
 
13
13
  from ..errors import OperationFailed
14
14
  from ._internal import Wait, _enum, _from_dict, _repeated_dict
@@ -178,14 +178,14 @@ class DataPlaneId:
178
178
  instance: Optional[str] = None
179
179
  """The instance name of the data plane emitting an event."""
180
180
 
181
- seq_no: Optional[Any] = None
181
+ seq_no: Optional[int] = None
182
182
  """A sequence number, unique and increasing within the data plane instance."""
183
183
 
184
184
  def as_dict(self) -> dict:
185
185
  """Serializes the DataPlaneId into a dictionary suitable for use as a JSON request body."""
186
186
  body = {}
187
187
  if self.instance is not None: body['instance'] = self.instance
188
- if self.seq_no: body['seq_no'] = self.seq_no
188
+ if self.seq_no is not None: body['seq_no'] = self.seq_no
189
189
  return body
190
190
 
191
191
  @classmethod
@@ -194,6 +194,20 @@ class DataPlaneId:
194
194
  return cls(instance=d.get('instance', None), seq_no=d.get('seq_no', None))
195
195
 
196
196
 
197
+ @dataclass
198
+ class DeletePipelineResponse:
199
+
200
+ def as_dict(self) -> dict:
201
+ """Serializes the DeletePipelineResponse into a dictionary suitable for use as a JSON request body."""
202
+ body = {}
203
+ return body
204
+
205
+ @classmethod
206
+ def from_dict(cls, d: Dict[str, any]) -> DeletePipelineResponse:
207
+ """Deserializes the DeletePipelineResponse from a dictionary."""
208
+ return cls()
209
+
210
+
197
211
  @dataclass
198
212
  class EditPipeline:
199
213
  allow_duplicate_names: Optional[bool] = None
@@ -313,6 +327,20 @@ class EditPipeline:
313
327
  trigger=_from_dict(d, 'trigger', PipelineTrigger))
314
328
 
315
329
 
330
+ @dataclass
331
+ class EditPipelineResponse:
332
+
333
+ def as_dict(self) -> dict:
334
+ """Serializes the EditPipelineResponse into a dictionary suitable for use as a JSON request body."""
335
+ body = {}
336
+ return body
337
+
338
+ @classmethod
339
+ def from_dict(cls, d: Dict[str, any]) -> EditPipelineResponse:
340
+ """Deserializes the EditPipelineResponse from a dictionary."""
341
+ return cls()
342
+
343
+
316
344
  @dataclass
317
345
  class ErrorDetail:
318
346
  exceptions: Optional[List[SerializedException]] = None
@@ -566,6 +594,20 @@ class ListUpdatesResponse:
566
594
  updates=_repeated_dict(d, 'updates', UpdateInfo))
567
595
 
568
596
 
597
+ @dataclass
598
+ class ManualTrigger:
599
+
600
+ def as_dict(self) -> dict:
601
+ """Serializes the ManualTrigger into a dictionary suitable for use as a JSON request body."""
602
+ body = {}
603
+ return body
604
+
605
+ @classmethod
606
+ def from_dict(cls, d: Dict[str, any]) -> ManualTrigger:
607
+ """Deserializes the ManualTrigger from a dictionary."""
608
+ return cls()
609
+
610
+
569
611
  class MaturityLevel(Enum):
570
612
  """Maturity level for EventDetails."""
571
613
 
@@ -1335,19 +1377,19 @@ class PipelineStateInfo:
1335
1377
  class PipelineTrigger:
1336
1378
  cron: Optional[CronTrigger] = None
1337
1379
 
1338
- manual: Optional[Any] = None
1380
+ manual: Optional[ManualTrigger] = None
1339
1381
 
1340
1382
  def as_dict(self) -> dict:
1341
1383
  """Serializes the PipelineTrigger into a dictionary suitable for use as a JSON request body."""
1342
1384
  body = {}
1343
1385
  if self.cron: body['cron'] = self.cron.as_dict()
1344
- if self.manual: body['manual'] = self.manual
1386
+ if self.manual: body['manual'] = self.manual.as_dict()
1345
1387
  return body
1346
1388
 
1347
1389
  @classmethod
1348
1390
  def from_dict(cls, d: Dict[str, any]) -> PipelineTrigger:
1349
1391
  """Deserializes the PipelineTrigger from a dictionary."""
1350
- return cls(cron=_from_dict(d, 'cron', CronTrigger), manual=d.get('manual', None))
1392
+ return cls(cron=_from_dict(d, 'cron', CronTrigger), manual=_from_dict(d, 'manual', ManualTrigger))
1351
1393
 
1352
1394
 
1353
1395
  @dataclass
@@ -1503,6 +1545,20 @@ class StartUpdateResponse:
1503
1545
  return cls(update_id=d.get('update_id', None))
1504
1546
 
1505
1547
 
1548
+ @dataclass
1549
+ class StopPipelineResponse:
1550
+
1551
+ def as_dict(self) -> dict:
1552
+ """Serializes the StopPipelineResponse into a dictionary suitable for use as a JSON request body."""
1553
+ body = {}
1554
+ return body
1555
+
1556
+ @classmethod
1557
+ def from_dict(cls, d: Dict[str, any]) -> StopPipelineResponse:
1558
+ """Deserializes the StopPipelineResponse from a dictionary."""
1559
+ return cls()
1560
+
1561
+
1506
1562
  @dataclass
1507
1563
  class UpdateInfo:
1508
1564
  cause: Optional[UpdateInfoCause] = None
@@ -2106,8 +2162,10 @@ class PipelinesAPI:
2106
2162
 
2107
2163
  headers = {'Accept': 'application/json', }
2108
2164
 
2109
- self._api.do('POST', f'/api/2.0/pipelines/{pipeline_id}/stop', headers=headers)
2110
- return Wait(self.wait_get_pipeline_idle, pipeline_id=pipeline_id)
2165
+ op_response = self._api.do('POST', f'/api/2.0/pipelines/{pipeline_id}/stop', headers=headers)
2166
+ return Wait(self.wait_get_pipeline_idle,
2167
+ response=StopPipelineResponse.from_dict(op_response),
2168
+ pipeline_id=pipeline_id)
2111
2169
 
2112
2170
  def stop_and_wait(self, pipeline_id: str, timeout=timedelta(minutes=20)) -> GetPipelineResponse:
2113
2171
  return self.stop(pipeline_id=pipeline_id).result(timeout=timeout)
@@ -597,6 +597,20 @@ class CustomerManagedKey:
597
597
  use_cases=_repeated_enum(d, 'use_cases', KeyUseCase))
598
598
 
599
599
 
600
+ @dataclass
601
+ class DeleteResponse:
602
+
603
+ def as_dict(self) -> dict:
604
+ """Serializes the DeleteResponse into a dictionary suitable for use as a JSON request body."""
605
+ body = {}
606
+ return body
607
+
608
+ @classmethod
609
+ def from_dict(cls, d: Dict[str, any]) -> DeleteResponse:
610
+ """Deserializes the DeleteResponse from a dictionary."""
611
+ return cls()
612
+
613
+
600
614
  class EndpointUseCase(Enum):
601
615
  """This enumeration represents the type of Databricks VPC [endpoint service] that was used when
602
616
  creating this VPC endpoint.
@@ -1062,6 +1076,20 @@ class PrivateAccessSettings:
1062
1076
  region=d.get('region', None))
1063
1077
 
1064
1078
 
1079
+ @dataclass
1080
+ class ReplaceResponse:
1081
+
1082
+ def as_dict(self) -> dict:
1083
+ """Serializes the ReplaceResponse into a dictionary suitable for use as a JSON request body."""
1084
+ body = {}
1085
+ return body
1086
+
1087
+ @classmethod
1088
+ def from_dict(cls, d: Dict[str, any]) -> ReplaceResponse:
1089
+ """Deserializes the ReplaceResponse from a dictionary."""
1090
+ return cls()
1091
+
1092
+
1065
1093
  @dataclass
1066
1094
  class RootBucketInfo:
1067
1095
  """Root S3 bucket information."""
@@ -1142,6 +1170,20 @@ class StsRole:
1142
1170
  return cls(external_id=d.get('external_id', None), role_arn=d.get('role_arn', None))
1143
1171
 
1144
1172
 
1173
+ @dataclass
1174
+ class UpdateResponse:
1175
+
1176
+ def as_dict(self) -> dict:
1177
+ """Serializes the UpdateResponse into a dictionary suitable for use as a JSON request body."""
1178
+ body = {}
1179
+ return body
1180
+
1181
+ @classmethod
1182
+ def from_dict(cls, d: Dict[str, any]) -> UpdateResponse:
1183
+ """Deserializes the UpdateResponse from a dictionary."""
1184
+ return cls()
1185
+
1186
+
1145
1187
  @dataclass
1146
1188
  class UpdateWorkspaceRequest:
1147
1189
  aws_region: Optional[str] = None
@@ -1162,8 +1204,6 @@ class UpdateWorkspaceRequest:
1162
1204
  is available only for updating failed workspaces."""
1163
1205
 
1164
1206
  network_connectivity_config_id: Optional[str] = None
1165
- """The ID of the network connectivity configuration object, which is the parent resource of this
1166
- private endpoint rule object."""
1167
1207
 
1168
1208
  network_id: Optional[str] = None
1169
1209
  """The ID of the workspace's network configuration object. Used only if you already use a
@@ -2637,7 +2677,10 @@ class WorkspacesAPI:
2637
2677
  the private access settings ID to upgrade a workspace to add support for front-end, back-end, or both
2638
2678
  types of connectivity. You cannot remove (downgrade) any existing front-end or back-end PrivateLink
2639
2679
  support on a workspace. - Custom tags. Given you provide an empty custom tags, the update would not be
2640
- applied.
2680
+ applied. - Network connectivity configuration ID to add serverless stable IP support. You can add or
2681
+ update the network connectivity configuration ID to ensure the workspace uses the same set of stable
2682
+ IP CIDR blocks to access your resources. You cannot remove a network connectivity configuration from
2683
+ the workspace once attached, you can only switch to another one.
2641
2684
 
2642
2685
  After calling the `PATCH` operation to update the workspace configuration, make repeated `GET`
2643
2686
  requests with the workspace ID and check the workspace status. The workspace is successful if the
@@ -2648,28 +2691,29 @@ class WorkspacesAPI:
2648
2691
 
2649
2692
  ### Update a running workspace You can update a Databricks workspace configuration for running
2650
2693
  workspaces for some fields, but not all fields. For a running workspace, this request supports
2651
- updating the following fields only: - Credential configuration ID
2652
-
2653
- - Network configuration ID. Used only if you already use a customer-managed VPC. You cannot convert a
2654
- running workspace from a Databricks-managed VPC to a customer-managed VPC. You can use a network
2655
- configuration update in this API for a failed or running workspace to add support for PrivateLink,
2656
- although you also need to add a private access settings object.
2657
-
2658
- - Key configuration ID for managed services (control plane storage, such as notebook source and
2659
- Databricks SQL queries). Databricks does not directly encrypt the data with the customer-managed key
2660
- (CMK). Databricks uses both the CMK and the Databricks managed key (DMK) that is unique to your
2661
- workspace to encrypt the Data Encryption Key (DEK). Databricks uses the DEK to encrypt your
2662
- workspace's managed services persisted data. If the workspace does not already have a CMK for managed
2663
- services, adding this ID enables managed services encryption for new or updated data. Existing managed
2664
- services data that existed before adding the key remains not encrypted with the DEK until it is
2665
- modified. If the workspace already has customer-managed keys for managed services, this request
2666
- rotates (changes) the CMK keys and the DEK is re-encrypted with the DMK and the new CMK. - Key
2694
+ updating the following fields only: - Credential configuration ID - Network configuration ID. Used
2695
+ only if you already use a customer-managed VPC. You cannot convert a running workspace from a
2696
+ Databricks-managed VPC to a customer-managed VPC. You can use a network configuration update in this
2697
+ API for a failed or running workspace to add support for PrivateLink, although you also need to add a
2698
+ private access settings object. - Key configuration ID for managed services (control plane storage,
2699
+ such as notebook source and Databricks SQL queries). Databricks does not directly encrypt the data
2700
+ with the customer-managed key (CMK). Databricks uses both the CMK and the Databricks managed key (DMK)
2701
+ that is unique to your workspace to encrypt the Data Encryption Key (DEK). Databricks uses the DEK to
2702
+ encrypt your workspace's managed services persisted data. If the workspace does not already have a CMK
2703
+ for managed services, adding this ID enables managed services encryption for new or updated data.
2704
+ Existing managed services data that existed before adding the key remains not encrypted with the DEK
2705
+ until it is modified. If the workspace already has customer-managed keys for managed services, this
2706
+ request rotates (changes) the CMK keys and the DEK is re-encrypted with the DMK and the new CMK. - Key
2667
2707
  configuration ID for workspace storage (root S3 bucket and, optionally, EBS volumes). You can set this
2668
2708
  only if the workspace does not already have a customer-managed key configuration for workspace
2669
2709
  storage. - Private access settings ID to add PrivateLink support. You can add or update the private
2670
2710
  access settings ID to upgrade a workspace to add support for front-end, back-end, or both types of
2671
2711
  connectivity. You cannot remove (downgrade) any existing front-end or back-end PrivateLink support on
2672
- a workspace. - Custom tags. Given you provide an empty custom tags, the update would not be applied.
2712
+ a workspace. - Custom tags. Given you provide an empty custom tags, the update would not be applied. -
2713
+ Network connectivity configuration ID to add serverless stable IP support. You can add or update the
2714
+ network connectivity configuration ID to ensure the workspace uses the same set of stable IP CIDR
2715
+ blocks to access your resources. You cannot remove a network connectivity configuration from the
2716
+ workspace once attached, you can only switch to another one.
2673
2717
 
2674
2718
  **Important**: To update a running workspace, your workspace must have no running compute resources
2675
2719
  that run in your workspace's VPC in the Classic data plane. For example, stop all all-purpose
@@ -2684,15 +2728,13 @@ class WorkspacesAPI:
2684
2728
  [Account Console]. However, you cannot use or create clusters for another 20 minutes after that status
2685
2729
  change. This results in a total of up to 40 minutes in which you cannot create clusters. If you create
2686
2730
  or use clusters before this time interval elapses, clusters do not launch successfully, fail, or could
2687
- cause other unexpected behavior.
2688
-
2689
- * For workspaces with a customer-managed VPC, the workspace status stays at status `RUNNING` and the
2690
- VPC change happens immediately. A change to the storage customer-managed key configuration ID might
2691
- take a few minutes to update, so continue to check the workspace until you observe that it has been
2692
- updated. If the update fails, the workspace might revert silently to its original configuration. After
2693
- the workspace has been updated, you cannot use or create clusters for another 20 minutes. If you
2694
- create or use clusters before this time interval elapses, clusters do not launch successfully, fail,
2695
- or could cause other unexpected behavior.
2731
+ cause other unexpected behavior. * For workspaces with a customer-managed VPC, the workspace status
2732
+ stays at status `RUNNING` and the VPC change happens immediately. A change to the storage
2733
+ customer-managed key configuration ID might take a few minutes to update, so continue to check the
2734
+ workspace until you observe that it has been updated. If the update fails, the workspace might revert
2735
+ silently to its original configuration. After the workspace has been updated, you cannot use or create
2736
+ clusters for another 20 minutes. If you create or use clusters before this time interval elapses,
2737
+ clusters do not launch successfully, fail, or could cause other unexpected behavior.
2696
2738
 
2697
2739
  If you update the _storage_ customer-managed key configurations, it takes 20 minutes for the changes
2698
2740
  to fully take effect. During the 20 minute wait, it is important that you stop all REST API calls to
@@ -2725,8 +2767,6 @@ class WorkspacesAPI:
2725
2767
  The ID of the workspace's managed services encryption key configuration object. This parameter is
2726
2768
  available only for updating failed workspaces.
2727
2769
  :param network_connectivity_config_id: str (optional)
2728
- The ID of the network connectivity configuration object, which is the parent resource of this
2729
- private endpoint rule object.
2730
2770
  :param network_id: str (optional)
2731
2771
  The ID of the workspace's network configuration object. Used only if you already use a
2732
2772
  customer-managed VPC. For failed workspaces only, you can switch from a Databricks-managed VPC to a
@@ -2756,11 +2796,13 @@ class WorkspacesAPI:
2756
2796
  body['storage_customer_managed_key_id'] = storage_customer_managed_key_id
2757
2797
  headers = {'Accept': 'application/json', 'Content-Type': 'application/json', }
2758
2798
 
2759
- self._api.do('PATCH',
2760
- f'/api/2.0/accounts/{self._api.account_id}/workspaces/{workspace_id}',
2761
- body=body,
2762
- headers=headers)
2763
- return Wait(self.wait_get_workspace_running, workspace_id=workspace_id)
2799
+ op_response = self._api.do('PATCH',
2800
+ f'/api/2.0/accounts/{self._api.account_id}/workspaces/{workspace_id}',
2801
+ body=body,
2802
+ headers=headers)
2803
+ return Wait(self.wait_get_workspace_running,
2804
+ response=UpdateResponse.from_dict(op_response),
2805
+ workspace_id=workspace_id)
2764
2806
 
2765
2807
  def update_and_wait(
2766
2808
  self,
@@ -449,6 +449,20 @@ class DeleteAppResponse:
449
449
  return cls(name=d.get('name', None))
450
450
 
451
451
 
452
+ @dataclass
453
+ class DeleteResponse:
454
+
455
+ def as_dict(self) -> dict:
456
+ """Serializes the DeleteResponse into a dictionary suitable for use as a JSON request body."""
457
+ body = {}
458
+ return body
459
+
460
+ @classmethod
461
+ def from_dict(cls, d: Dict[str, any]) -> DeleteResponse:
462
+ """Deserializes the DeleteResponse from a dictionary."""
463
+ return cls()
464
+
465
+
452
466
  @dataclass
453
467
  class DeployAppRequest:
454
468
  manifest: AppManifest
@@ -751,6 +765,20 @@ class EndpointTag:
751
765
  return cls(key=d.get('key', None), value=d.get('value', None))
752
766
 
753
767
 
768
+ @dataclass
769
+ class ExportMetricsResponse:
770
+
771
+ def as_dict(self) -> dict:
772
+ """Serializes the ExportMetricsResponse into a dictionary suitable for use as a JSON request body."""
773
+ body = {}
774
+ return body
775
+
776
+ @classmethod
777
+ def from_dict(cls, d: Dict[str, any]) -> ExportMetricsResponse:
778
+ """Deserializes the ExportMetricsResponse from a dictionary."""
779
+ return cls()
780
+
781
+
754
782
  @dataclass
755
783
  class ExternalModel:
756
784
  provider: ExternalModelProvider