databricks-sdk 0.28.0__py3-none-any.whl → 0.30.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 (31) hide show
  1. databricks/sdk/__init__.py +74 -22
  2. databricks/sdk/config.py +89 -48
  3. databricks/sdk/core.py +38 -9
  4. databricks/sdk/credentials_provider.py +134 -57
  5. databricks/sdk/data_plane.py +65 -0
  6. databricks/sdk/dbutils.py +81 -3
  7. databricks/sdk/mixins/files.py +12 -4
  8. databricks/sdk/oauth.py +8 -6
  9. databricks/sdk/service/apps.py +977 -0
  10. databricks/sdk/service/billing.py +602 -218
  11. databricks/sdk/service/catalog.py +263 -62
  12. databricks/sdk/service/compute.py +515 -94
  13. databricks/sdk/service/dashboards.py +1310 -2
  14. databricks/sdk/service/iam.py +99 -88
  15. databricks/sdk/service/jobs.py +159 -166
  16. databricks/sdk/service/marketplace.py +74 -58
  17. databricks/sdk/service/oauth2.py +149 -70
  18. databricks/sdk/service/pipelines.py +73 -53
  19. databricks/sdk/service/serving.py +332 -694
  20. databricks/sdk/service/settings.py +424 -4
  21. databricks/sdk/service/sharing.py +235 -26
  22. databricks/sdk/service/sql.py +2484 -553
  23. databricks/sdk/service/vectorsearch.py +75 -0
  24. databricks/sdk/useragent.py +144 -0
  25. databricks/sdk/version.py +1 -1
  26. {databricks_sdk-0.28.0.dist-info → databricks_sdk-0.30.0.dist-info}/METADATA +37 -16
  27. {databricks_sdk-0.28.0.dist-info → databricks_sdk-0.30.0.dist-info}/RECORD +31 -28
  28. {databricks_sdk-0.28.0.dist-info → databricks_sdk-0.30.0.dist-info}/WHEEL +1 -1
  29. {databricks_sdk-0.28.0.dist-info → databricks_sdk-0.30.0.dist-info}/LICENSE +0 -0
  30. {databricks_sdk-0.28.0.dist-info → databricks_sdk-0.30.0.dist-info}/NOTICE +0 -0
  31. {databricks_sdk-0.28.0.dist-info → databricks_sdk-0.30.0.dist-info}/top_level.txt +0 -0
@@ -132,16 +132,16 @@ class DeleteResponse:
132
132
 
133
133
 
134
134
  @dataclass
135
- class DeleteWorkspaceAssignments:
135
+ class DeleteWorkspacePermissionAssignmentResponse:
136
136
 
137
137
  def as_dict(self) -> dict:
138
- """Serializes the DeleteWorkspaceAssignments into a dictionary suitable for use as a JSON request body."""
138
+ """Serializes the DeleteWorkspacePermissionAssignmentResponse into a dictionary suitable for use as a JSON request body."""
139
139
  body = {}
140
140
  return body
141
141
 
142
142
  @classmethod
143
- def from_dict(cls, d: Dict[str, any]) -> DeleteWorkspaceAssignments:
144
- """Deserializes the DeleteWorkspaceAssignments from a dictionary."""
143
+ def from_dict(cls, d: Dict[str, any]) -> DeleteWorkspacePermissionAssignmentResponse:
144
+ """Deserializes the DeleteWorkspacePermissionAssignmentResponse from a dictionary."""
145
145
  return cls()
146
146
 
147
147
 
@@ -406,6 +406,56 @@ class ListUsersResponse:
406
406
  total_results=d.get('totalResults', None))
407
407
 
408
408
 
409
+ @dataclass
410
+ class MigratePermissionsRequest:
411
+ workspace_id: int
412
+ """WorkspaceId of the associated workspace where the permission migration will occur."""
413
+
414
+ from_workspace_group_name: str
415
+ """The name of the workspace group that permissions will be migrated from."""
416
+
417
+ to_account_group_name: str
418
+ """The name of the account group that permissions will be migrated to."""
419
+
420
+ size: Optional[int] = None
421
+ """The maximum number of permissions that will be migrated."""
422
+
423
+ def as_dict(self) -> dict:
424
+ """Serializes the MigratePermissionsRequest into a dictionary suitable for use as a JSON request body."""
425
+ body = {}
426
+ if self.from_workspace_group_name is not None:
427
+ body['from_workspace_group_name'] = self.from_workspace_group_name
428
+ if self.size is not None: body['size'] = self.size
429
+ if self.to_account_group_name is not None: body['to_account_group_name'] = self.to_account_group_name
430
+ if self.workspace_id is not None: body['workspace_id'] = self.workspace_id
431
+ return body
432
+
433
+ @classmethod
434
+ def from_dict(cls, d: Dict[str, any]) -> MigratePermissionsRequest:
435
+ """Deserializes the MigratePermissionsRequest from a dictionary."""
436
+ return cls(from_workspace_group_name=d.get('from_workspace_group_name', None),
437
+ size=d.get('size', None),
438
+ to_account_group_name=d.get('to_account_group_name', None),
439
+ workspace_id=d.get('workspace_id', None))
440
+
441
+
442
+ @dataclass
443
+ class MigratePermissionsResponse:
444
+ permissions_migrated: Optional[int] = None
445
+ """Number of permissions migrated."""
446
+
447
+ def as_dict(self) -> dict:
448
+ """Serializes the MigratePermissionsResponse into a dictionary suitable for use as a JSON request body."""
449
+ body = {}
450
+ if self.permissions_migrated is not None: body['permissions_migrated'] = self.permissions_migrated
451
+ return body
452
+
453
+ @classmethod
454
+ def from_dict(cls, d: Dict[str, any]) -> MigratePermissionsResponse:
455
+ """Deserializes the MigratePermissionsResponse from a dictionary."""
456
+ return cls(permissions_migrated=d.get('permissions_migrated', None))
457
+
458
+
409
459
  @dataclass
410
460
  class Name:
411
461
  family_name: Optional[str] = None
@@ -723,6 +773,9 @@ class Permission:
723
773
 
724
774
  @dataclass
725
775
  class PermissionAssignment:
776
+ """The output format for existing workspace PermissionAssignment records, which contains some info
777
+ for user consumption."""
778
+
726
779
  error: Optional[str] = None
727
780
  """Error response associated with a workspace permission assignment, if any."""
728
781
 
@@ -777,6 +830,7 @@ class PermissionLevel(Enum):
777
830
  CAN_MANAGE_PRODUCTION_VERSIONS = 'CAN_MANAGE_PRODUCTION_VERSIONS'
778
831
  CAN_MANAGE_RUN = 'CAN_MANAGE_RUN'
779
832
  CAN_MANAGE_STAGING_VERSIONS = 'CAN_MANAGE_STAGING_VERSIONS'
833
+ CAN_MONITOR = 'CAN_MONITOR'
780
834
  CAN_QUERY = 'CAN_QUERY'
781
835
  CAN_READ = 'CAN_READ'
782
836
  CAN_RESTART = 'CAN_RESTART'
@@ -787,57 +841,6 @@ class PermissionLevel(Enum):
787
841
  IS_OWNER = 'IS_OWNER'
788
842
 
789
843
 
790
- @dataclass
791
- class PermissionMigrationRequest:
792
- workspace_id: int
793
- """WorkspaceId of the associated workspace where the permission migration will occur. Both
794
- workspace group and account group must be in this workspace."""
795
-
796
- from_workspace_group_name: str
797
- """The name of the workspace group that permissions will be migrated from."""
798
-
799
- to_account_group_name: str
800
- """The name of the account group that permissions will be migrated to."""
801
-
802
- size: Optional[int] = None
803
- """The maximum number of permissions that will be migrated."""
804
-
805
- def as_dict(self) -> dict:
806
- """Serializes the PermissionMigrationRequest into a dictionary suitable for use as a JSON request body."""
807
- body = {}
808
- if self.from_workspace_group_name is not None:
809
- body['from_workspace_group_name'] = self.from_workspace_group_name
810
- if self.size is not None: body['size'] = self.size
811
- if self.to_account_group_name is not None: body['to_account_group_name'] = self.to_account_group_name
812
- if self.workspace_id is not None: body['workspace_id'] = self.workspace_id
813
- return body
814
-
815
- @classmethod
816
- def from_dict(cls, d: Dict[str, any]) -> PermissionMigrationRequest:
817
- """Deserializes the PermissionMigrationRequest from a dictionary."""
818
- return cls(from_workspace_group_name=d.get('from_workspace_group_name', None),
819
- size=d.get('size', None),
820
- to_account_group_name=d.get('to_account_group_name', None),
821
- workspace_id=d.get('workspace_id', None))
822
-
823
-
824
- @dataclass
825
- class PermissionMigrationResponse:
826
- permissions_migrated: Optional[int] = None
827
- """Number of permissions migrated."""
828
-
829
- def as_dict(self) -> dict:
830
- """Serializes the PermissionMigrationResponse into a dictionary suitable for use as a JSON request body."""
831
- body = {}
832
- if self.permissions_migrated is not None: body['permissions_migrated'] = self.permissions_migrated
833
- return body
834
-
835
- @classmethod
836
- def from_dict(cls, d: Dict[str, any]) -> PermissionMigrationResponse:
837
- """Deserializes the PermissionMigrationResponse from a dictionary."""
838
- return cls(permissions_migrated=d.get('permissions_migrated', None))
839
-
840
-
841
844
  @dataclass
842
845
  class PermissionOutput:
843
846
  description: Optional[str] = None
@@ -888,9 +891,9 @@ class PermissionsRequest:
888
891
  """The id of the request object."""
889
892
 
890
893
  request_object_type: Optional[str] = None
891
- """The type of the request object. Can be one of the following: authorization, clusters,
892
- cluster-policies, directories, experiments, files, instance-pools, jobs, notebooks, pipelines,
893
- registered-models, repos, serving-endpoints, or warehouses."""
894
+ """The type of the request object. Can be one of the following: alerts, authorization, clusters,
895
+ cluster-policies, dbsql-dashboards, directories, experiments, files, instance-pools, jobs,
896
+ notebooks, pipelines, queries, registered-models, repos, serving-endpoints, or warehouses."""
894
897
 
895
898
  def as_dict(self) -> dict:
896
899
  """Serializes the PermissionsRequest into a dictionary suitable for use as a JSON request body."""
@@ -911,6 +914,8 @@ class PermissionsRequest:
911
914
 
912
915
  @dataclass
913
916
  class PrincipalOutput:
917
+ """Information about the principal assigned to the workspace."""
918
+
914
919
  display_name: Optional[str] = None
915
920
  """The display name of the principal."""
916
921
 
@@ -1134,16 +1139,18 @@ class UpdateRuleSetRequest:
1134
1139
 
1135
1140
  @dataclass
1136
1141
  class UpdateWorkspaceAssignments:
1137
- permissions: List[WorkspacePermission]
1138
- """Array of permissions assignments to update on the workspace. Note that excluding this field will
1139
- have the same effect as providing an empty list which will result in the deletion of all
1142
+ permissions: Optional[List[WorkspacePermission]] = None
1143
+ """Array of permissions assignments to update on the workspace. Valid values are "USER" and "ADMIN"
1144
+ (case-sensitive). If both "USER" and "ADMIN" are provided, "ADMIN" takes precedence. Other
1145
+ values will be ignored. Note that excluding this field, or providing unsupported values, will
1146
+ have the same effect as providing an empty list, which will result in the deletion of all
1140
1147
  permissions for the principal."""
1141
1148
 
1142
1149
  principal_id: Optional[int] = None
1143
1150
  """The ID of the user, service principal, or group."""
1144
1151
 
1145
1152
  workspace_id: Optional[int] = None
1146
- """The workspace ID."""
1153
+ """The workspace ID for the account."""
1147
1154
 
1148
1155
  def as_dict(self) -> dict:
1149
1156
  """Serializes the UpdateWorkspaceAssignments into a dictionary suitable for use as a JSON request body."""
@@ -2495,7 +2502,7 @@ class GroupsAPI:
2495
2502
 
2496
2503
 
2497
2504
  class PermissionMigrationAPI:
2498
- """This spec contains undocumented permission migration APIs used in https://github.com/databrickslabs/ucx."""
2505
+ """APIs for migrating acl permissions, used only by the ucx tool: https://github.com/databrickslabs/ucx"""
2499
2506
 
2500
2507
  def __init__(self, api_client):
2501
2508
  self._api = api_client
@@ -2505,14 +2512,11 @@ class PermissionMigrationAPI:
2505
2512
  from_workspace_group_name: str,
2506
2513
  to_account_group_name: str,
2507
2514
  *,
2508
- size: Optional[int] = None) -> PermissionMigrationResponse:
2515
+ size: Optional[int] = None) -> MigratePermissionsResponse:
2509
2516
  """Migrate Permissions.
2510
2517
 
2511
- Migrate a batch of permissions from a workspace local group to an account group.
2512
-
2513
2518
  :param workspace_id: int
2514
- WorkspaceId of the associated workspace where the permission migration will occur. Both workspace
2515
- group and account group must be in this workspace.
2519
+ WorkspaceId of the associated workspace where the permission migration will occur.
2516
2520
  :param from_workspace_group_name: str
2517
2521
  The name of the workspace group that permissions will be migrated from.
2518
2522
  :param to_account_group_name: str
@@ -2520,7 +2524,7 @@ class PermissionMigrationAPI:
2520
2524
  :param size: int (optional)
2521
2525
  The maximum number of permissions that will be migrated.
2522
2526
 
2523
- :returns: :class:`PermissionMigrationResponse`
2527
+ :returns: :class:`MigratePermissionsResponse`
2524
2528
  """
2525
2529
  body = {}
2526
2530
  if from_workspace_group_name is not None:
@@ -2531,13 +2535,15 @@ class PermissionMigrationAPI:
2531
2535
  headers = {'Accept': 'application/json', 'Content-Type': 'application/json', }
2532
2536
 
2533
2537
  res = self._api.do('POST', '/api/2.0/permissionmigration', body=body, headers=headers)
2534
- return PermissionMigrationResponse.from_dict(res)
2538
+ return MigratePermissionsResponse.from_dict(res)
2535
2539
 
2536
2540
 
2537
2541
  class PermissionsAPI:
2538
2542
  """Permissions API are used to create read, write, edit, update and manage access for various users on
2539
2543
  different objects and endpoints.
2540
2544
 
2545
+ * **[Apps permissions](:service:apps)** — Manage which users can manage or use apps.
2546
+
2541
2547
  * **[Cluster permissions](:service:clusters)** — Manage which users can manage, restart, or attach to
2542
2548
  clusters.
2543
2549
 
@@ -2573,7 +2579,7 @@ class PermissionsAPI:
2573
2579
  * **[Token permissions](:service:tokenmanagement)** — Manage which users can create or use tokens.
2574
2580
 
2575
2581
  * **[Workspace object permissions](:service:workspace)** — Manage which users can read, run, edit, or
2576
- manage directories, files, and notebooks.
2582
+ manage alerts, dbsql-dashboards, directories, files, notebooks and queries.
2577
2583
 
2578
2584
  For the mapping of the required permissions for specific actions or abilities and other important
2579
2585
  information, see [Access Control].
@@ -2593,9 +2599,9 @@ class PermissionsAPI:
2593
2599
  object.
2594
2600
 
2595
2601
  :param request_object_type: str
2596
- The type of the request object. Can be one of the following: authorization, clusters,
2597
- cluster-policies, directories, experiments, files, instance-pools, jobs, notebooks, pipelines,
2598
- registered-models, repos, serving-endpoints, or warehouses.
2602
+ The type of the request object. Can be one of the following: alerts, authorization, clusters,
2603
+ cluster-policies, dbsql-dashboards, directories, experiments, files, instance-pools, jobs,
2604
+ notebooks, pipelines, queries, registered-models, repos, serving-endpoints, or warehouses.
2599
2605
  :param request_object_id: str
2600
2606
  The id of the request object.
2601
2607
 
@@ -2641,9 +2647,9 @@ class PermissionsAPI:
2641
2647
  object.
2642
2648
 
2643
2649
  :param request_object_type: str
2644
- The type of the request object. Can be one of the following: authorization, clusters,
2645
- cluster-policies, directories, experiments, files, instance-pools, jobs, notebooks, pipelines,
2646
- registered-models, repos, serving-endpoints, or warehouses.
2650
+ The type of the request object. Can be one of the following: alerts, authorization, clusters,
2651
+ cluster-policies, dbsql-dashboards, directories, experiments, files, instance-pools, jobs,
2652
+ notebooks, pipelines, queries, registered-models, repos, serving-endpoints, or warehouses.
2647
2653
  :param request_object_id: str
2648
2654
  The id of the request object.
2649
2655
  :param access_control_list: List[:class:`AccessControlRequest`] (optional)
@@ -2672,9 +2678,9 @@ class PermissionsAPI:
2672
2678
  root object.
2673
2679
 
2674
2680
  :param request_object_type: str
2675
- The type of the request object. Can be one of the following: authorization, clusters,
2676
- cluster-policies, directories, experiments, files, instance-pools, jobs, notebooks, pipelines,
2677
- registered-models, repos, serving-endpoints, or warehouses.
2681
+ The type of the request object. Can be one of the following: alerts, authorization, clusters,
2682
+ cluster-policies, dbsql-dashboards, directories, experiments, files, instance-pools, jobs,
2683
+ notebooks, pipelines, queries, registered-models, repos, serving-endpoints, or warehouses.
2678
2684
  :param request_object_id: str
2679
2685
  The id of the request object.
2680
2686
  :param access_control_list: List[:class:`AccessControlRequest`] (optional)
@@ -3313,7 +3319,7 @@ class WorkspaceAssignmentAPI:
3313
3319
  principal.
3314
3320
 
3315
3321
  :param workspace_id: int
3316
- The workspace ID.
3322
+ The workspace ID for the account.
3317
3323
  :param principal_id: int
3318
3324
  The ID of the user, service principal, or group.
3319
3325
 
@@ -3366,21 +3372,26 @@ class WorkspaceAssignmentAPI:
3366
3372
  parsed = PermissionAssignments.from_dict(json).permission_assignments
3367
3373
  return parsed if parsed is not None else []
3368
3374
 
3369
- def update(self, workspace_id: int, principal_id: int,
3370
- permissions: List[WorkspacePermission]) -> PermissionAssignment:
3375
+ def update(self,
3376
+ workspace_id: int,
3377
+ principal_id: int,
3378
+ *,
3379
+ permissions: Optional[List[WorkspacePermission]] = None) -> PermissionAssignment:
3371
3380
  """Create or update permissions assignment.
3372
3381
 
3373
3382
  Creates or updates the workspace permissions assignment in a given account and workspace for the
3374
3383
  specified principal.
3375
3384
 
3376
3385
  :param workspace_id: int
3377
- The workspace ID.
3386
+ The workspace ID for the account.
3378
3387
  :param principal_id: int
3379
3388
  The ID of the user, service principal, or group.
3380
- :param permissions: List[:class:`WorkspacePermission`]
3381
- Array of permissions assignments to update on the workspace. Note that excluding this field will
3382
- have the same effect as providing an empty list which will result in the deletion of all permissions
3383
- for the principal.
3389
+ :param permissions: List[:class:`WorkspacePermission`] (optional)
3390
+ Array of permissions assignments to update on the workspace. Valid values are "USER" and "ADMIN"
3391
+ (case-sensitive). If both "USER" and "ADMIN" are provided, "ADMIN" takes precedence. Other values
3392
+ will be ignored. Note that excluding this field, or providing unsupported values, will have the same
3393
+ effect as providing an empty list, which will result in the deletion of all permissions for the
3394
+ principal.
3384
3395
 
3385
3396
  :returns: :class:`PermissionAssignment`
3386
3397
  """