databricks-sdk 0.37.0__py3-none-any.whl → 0.39.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 +24 -2
  2. databricks/sdk/_base_client.py +61 -14
  3. databricks/sdk/config.py +10 -9
  4. databricks/sdk/credentials_provider.py +6 -5
  5. databricks/sdk/mixins/jobs.py +49 -0
  6. databricks/sdk/mixins/open_ai_client.py +2 -2
  7. databricks/sdk/service/apps.py +185 -4
  8. databricks/sdk/service/billing.py +248 -1
  9. databricks/sdk/service/catalog.py +1943 -46
  10. databricks/sdk/service/cleanrooms.py +1281 -0
  11. databricks/sdk/service/compute.py +1486 -8
  12. databricks/sdk/service/dashboards.py +336 -11
  13. databricks/sdk/service/files.py +162 -2
  14. databricks/sdk/service/iam.py +353 -2
  15. databricks/sdk/service/jobs.py +1281 -16
  16. databricks/sdk/service/marketplace.py +688 -0
  17. databricks/sdk/service/ml.py +1038 -2
  18. databricks/sdk/service/oauth2.py +176 -0
  19. databricks/sdk/service/pipelines.py +602 -15
  20. databricks/sdk/service/provisioning.py +402 -0
  21. databricks/sdk/service/serving.py +615 -0
  22. databricks/sdk/service/settings.py +1190 -3
  23. databricks/sdk/service/sharing.py +328 -2
  24. databricks/sdk/service/sql.py +1186 -2
  25. databricks/sdk/service/vectorsearch.py +290 -0
  26. databricks/sdk/service/workspace.py +453 -1
  27. databricks/sdk/version.py +1 -1
  28. {databricks_sdk-0.37.0.dist-info → databricks_sdk-0.39.0.dist-info}/METADATA +26 -26
  29. {databricks_sdk-0.37.0.dist-info → databricks_sdk-0.39.0.dist-info}/RECORD +33 -31
  30. {databricks_sdk-0.37.0.dist-info → databricks_sdk-0.39.0.dist-info}/WHEEL +1 -1
  31. {databricks_sdk-0.37.0.dist-info → databricks_sdk-0.39.0.dist-info}/LICENSE +0 -0
  32. {databricks_sdk-0.37.0.dist-info → databricks_sdk-0.39.0.dist-info}/NOTICE +0 -0
  33. {databricks_sdk-0.37.0.dist-info → databricks_sdk-0.39.0.dist-info}/top_level.txt +0 -0
@@ -52,6 +52,8 @@ class App:
52
52
  resources: Optional[List[AppResource]] = None
53
53
  """Resources for the app."""
54
54
 
55
+ service_principal_client_id: Optional[str] = None
56
+
55
57
  service_principal_id: Optional[int] = None
56
58
 
57
59
  service_principal_name: Optional[str] = None
@@ -79,6 +81,32 @@ class App:
79
81
  if self.name is not None: body['name'] = self.name
80
82
  if self.pending_deployment: body['pending_deployment'] = self.pending_deployment.as_dict()
81
83
  if self.resources: body['resources'] = [v.as_dict() for v in self.resources]
84
+ if self.service_principal_client_id is not None:
85
+ body['service_principal_client_id'] = self.service_principal_client_id
86
+ if self.service_principal_id is not None: body['service_principal_id'] = self.service_principal_id
87
+ if self.service_principal_name is not None:
88
+ body['service_principal_name'] = self.service_principal_name
89
+ if self.update_time is not None: body['update_time'] = self.update_time
90
+ if self.updater is not None: body['updater'] = self.updater
91
+ if self.url is not None: body['url'] = self.url
92
+ return body
93
+
94
+ def as_shallow_dict(self) -> dict:
95
+ """Serializes the App into a shallow dictionary of its immediate attributes."""
96
+ body = {}
97
+ if self.active_deployment: body['active_deployment'] = self.active_deployment
98
+ if self.app_status: body['app_status'] = self.app_status
99
+ if self.compute_status: body['compute_status'] = self.compute_status
100
+ if self.create_time is not None: body['create_time'] = self.create_time
101
+ if self.creator is not None: body['creator'] = self.creator
102
+ if self.default_source_code_path is not None:
103
+ body['default_source_code_path'] = self.default_source_code_path
104
+ if self.description is not None: body['description'] = self.description
105
+ if self.name is not None: body['name'] = self.name
106
+ if self.pending_deployment: body['pending_deployment'] = self.pending_deployment
107
+ if self.resources: body['resources'] = self.resources
108
+ if self.service_principal_client_id is not None:
109
+ body['service_principal_client_id'] = self.service_principal_client_id
82
110
  if self.service_principal_id is not None: body['service_principal_id'] = self.service_principal_id
83
111
  if self.service_principal_name is not None:
84
112
  body['service_principal_name'] = self.service_principal_name
@@ -100,6 +128,7 @@ class App:
100
128
  name=d.get('name', None),
101
129
  pending_deployment=_from_dict(d, 'pending_deployment', AppDeployment),
102
130
  resources=_repeated_dict(d, 'resources', AppResource),
131
+ service_principal_client_id=d.get('service_principal_client_id', None),
103
132
  service_principal_id=d.get('service_principal_id', None),
104
133
  service_principal_name=d.get('service_principal_name', None),
105
134
  update_time=d.get('update_time', None),
@@ -131,6 +160,16 @@ class AppAccessControlRequest:
131
160
  if self.user_name is not None: body['user_name'] = self.user_name
132
161
  return body
133
162
 
163
+ def as_shallow_dict(self) -> dict:
164
+ """Serializes the AppAccessControlRequest into a shallow dictionary of its immediate attributes."""
165
+ body = {}
166
+ if self.group_name is not None: body['group_name'] = self.group_name
167
+ if self.permission_level is not None: body['permission_level'] = self.permission_level
168
+ if self.service_principal_name is not None:
169
+ body['service_principal_name'] = self.service_principal_name
170
+ if self.user_name is not None: body['user_name'] = self.user_name
171
+ return body
172
+
134
173
  @classmethod
135
174
  def from_dict(cls, d: Dict[str, any]) -> AppAccessControlRequest:
136
175
  """Deserializes the AppAccessControlRequest from a dictionary."""
@@ -168,6 +207,17 @@ class AppAccessControlResponse:
168
207
  if self.user_name is not None: body['user_name'] = self.user_name
169
208
  return body
170
209
 
210
+ def as_shallow_dict(self) -> dict:
211
+ """Serializes the AppAccessControlResponse into a shallow dictionary of its immediate attributes."""
212
+ body = {}
213
+ if self.all_permissions: body['all_permissions'] = self.all_permissions
214
+ if self.display_name is not None: body['display_name'] = self.display_name
215
+ if self.group_name is not None: body['group_name'] = self.group_name
216
+ if self.service_principal_name is not None:
217
+ body['service_principal_name'] = self.service_principal_name
218
+ if self.user_name is not None: body['user_name'] = self.user_name
219
+ return body
220
+
171
221
  @classmethod
172
222
  def from_dict(cls, d: Dict[str, any]) -> AppAccessControlResponse:
173
223
  """Deserializes the AppAccessControlResponse from a dictionary."""
@@ -221,6 +271,19 @@ class AppDeployment:
221
271
  if self.update_time is not None: body['update_time'] = self.update_time
222
272
  return body
223
273
 
274
+ def as_shallow_dict(self) -> dict:
275
+ """Serializes the AppDeployment into a shallow dictionary of its immediate attributes."""
276
+ body = {}
277
+ if self.create_time is not None: body['create_time'] = self.create_time
278
+ if self.creator is not None: body['creator'] = self.creator
279
+ if self.deployment_artifacts: body['deployment_artifacts'] = self.deployment_artifacts
280
+ if self.deployment_id is not None: body['deployment_id'] = self.deployment_id
281
+ if self.mode is not None: body['mode'] = self.mode
282
+ if self.source_code_path is not None: body['source_code_path'] = self.source_code_path
283
+ if self.status: body['status'] = self.status
284
+ if self.update_time is not None: body['update_time'] = self.update_time
285
+ return body
286
+
224
287
  @classmethod
225
288
  def from_dict(cls, d: Dict[str, any]) -> AppDeployment:
226
289
  """Deserializes the AppDeployment from a dictionary."""
@@ -245,6 +308,12 @@ class AppDeploymentArtifacts:
245
308
  if self.source_code_path is not None: body['source_code_path'] = self.source_code_path
246
309
  return body
247
310
 
311
+ def as_shallow_dict(self) -> dict:
312
+ """Serializes the AppDeploymentArtifacts into a shallow dictionary of its immediate attributes."""
313
+ body = {}
314
+ if self.source_code_path is not None: body['source_code_path'] = self.source_code_path
315
+ return body
316
+
248
317
  @classmethod
249
318
  def from_dict(cls, d: Dict[str, any]) -> AppDeploymentArtifacts:
250
319
  """Deserializes the AppDeploymentArtifacts from a dictionary."""
@@ -280,6 +349,13 @@ class AppDeploymentStatus:
280
349
  if self.state is not None: body['state'] = self.state.value
281
350
  return body
282
351
 
352
+ def as_shallow_dict(self) -> dict:
353
+ """Serializes the AppDeploymentStatus into a shallow dictionary of its immediate attributes."""
354
+ body = {}
355
+ if self.message is not None: body['message'] = self.message
356
+ if self.state is not None: body['state'] = self.state
357
+ return body
358
+
283
359
  @classmethod
284
360
  def from_dict(cls, d: Dict[str, any]) -> AppDeploymentStatus:
285
361
  """Deserializes the AppDeploymentStatus from a dictionary."""
@@ -303,6 +379,14 @@ class AppPermission:
303
379
  if self.permission_level is not None: body['permission_level'] = self.permission_level.value
304
380
  return body
305
381
 
382
+ def as_shallow_dict(self) -> dict:
383
+ """Serializes the AppPermission into a shallow dictionary of its immediate attributes."""
384
+ body = {}
385
+ if self.inherited is not None: body['inherited'] = self.inherited
386
+ if self.inherited_from_object: body['inherited_from_object'] = self.inherited_from_object
387
+ if self.permission_level is not None: body['permission_level'] = self.permission_level
388
+ return body
389
+
306
390
  @classmethod
307
391
  def from_dict(cls, d: Dict[str, any]) -> AppPermission:
308
392
  """Deserializes the AppPermission from a dictionary."""
@@ -335,6 +419,14 @@ class AppPermissions:
335
419
  if self.object_type is not None: body['object_type'] = self.object_type
336
420
  return body
337
421
 
422
+ def as_shallow_dict(self) -> dict:
423
+ """Serializes the AppPermissions into a shallow dictionary of its immediate attributes."""
424
+ body = {}
425
+ if self.access_control_list: body['access_control_list'] = self.access_control_list
426
+ if self.object_id is not None: body['object_id'] = self.object_id
427
+ if self.object_type is not None: body['object_type'] = self.object_type
428
+ return body
429
+
338
430
  @classmethod
339
431
  def from_dict(cls, d: Dict[str, any]) -> AppPermissions:
340
432
  """Deserializes the AppPermissions from a dictionary."""
@@ -357,6 +449,13 @@ class AppPermissionsDescription:
357
449
  if self.permission_level is not None: body['permission_level'] = self.permission_level.value
358
450
  return body
359
451
 
452
+ def as_shallow_dict(self) -> dict:
453
+ """Serializes the AppPermissionsDescription into a shallow dictionary of its immediate attributes."""
454
+ body = {}
455
+ if self.description is not None: body['description'] = self.description
456
+ if self.permission_level is not None: body['permission_level'] = self.permission_level
457
+ return body
458
+
360
459
  @classmethod
361
460
  def from_dict(cls, d: Dict[str, any]) -> AppPermissionsDescription:
362
461
  """Deserializes the AppPermissionsDescription from a dictionary."""
@@ -379,6 +478,13 @@ class AppPermissionsRequest:
379
478
  if self.app_name is not None: body['app_name'] = self.app_name
380
479
  return body
381
480
 
481
+ def as_shallow_dict(self) -> dict:
482
+ """Serializes the AppPermissionsRequest into a shallow dictionary of its immediate attributes."""
483
+ body = {}
484
+ if self.access_control_list: body['access_control_list'] = self.access_control_list
485
+ if self.app_name is not None: body['app_name'] = self.app_name
486
+ return body
487
+
382
488
  @classmethod
383
489
  def from_dict(cls, d: Dict[str, any]) -> AppPermissionsRequest:
384
490
  """Deserializes the AppPermissionsRequest from a dictionary."""
@@ -413,6 +519,17 @@ class AppResource:
413
519
  if self.sql_warehouse: body['sql_warehouse'] = self.sql_warehouse.as_dict()
414
520
  return body
415
521
 
522
+ def as_shallow_dict(self) -> dict:
523
+ """Serializes the AppResource into a shallow dictionary of its immediate attributes."""
524
+ body = {}
525
+ if self.description is not None: body['description'] = self.description
526
+ if self.job: body['job'] = self.job
527
+ if self.name is not None: body['name'] = self.name
528
+ if self.secret: body['secret'] = self.secret
529
+ if self.serving_endpoint: body['serving_endpoint'] = self.serving_endpoint
530
+ if self.sql_warehouse: body['sql_warehouse'] = self.sql_warehouse
531
+ return body
532
+
416
533
  @classmethod
417
534
  def from_dict(cls, d: Dict[str, any]) -> AppResource:
418
535
  """Deserializes the AppResource from a dictionary."""
@@ -440,6 +557,13 @@ class AppResourceJob:
440
557
  if self.permission is not None: body['permission'] = self.permission.value
441
558
  return body
442
559
 
560
+ def as_shallow_dict(self) -> dict:
561
+ """Serializes the AppResourceJob into a shallow dictionary of its immediate attributes."""
562
+ body = {}
563
+ if self.id is not None: body['id'] = self.id
564
+ if self.permission is not None: body['permission'] = self.permission
565
+ return body
566
+
443
567
  @classmethod
444
568
  def from_dict(cls, d: Dict[str, any]) -> AppResourceJob:
445
569
  """Deserializes the AppResourceJob from a dictionary."""
@@ -474,6 +598,14 @@ class AppResourceSecret:
474
598
  if self.scope is not None: body['scope'] = self.scope
475
599
  return body
476
600
 
601
+ def as_shallow_dict(self) -> dict:
602
+ """Serializes the AppResourceSecret into a shallow dictionary of its immediate attributes."""
603
+ body = {}
604
+ if self.key is not None: body['key'] = self.key
605
+ if self.permission is not None: body['permission'] = self.permission
606
+ if self.scope is not None: body['scope'] = self.scope
607
+ return body
608
+
477
609
  @classmethod
478
610
  def from_dict(cls, d: Dict[str, any]) -> AppResourceSecret:
479
611
  """Deserializes the AppResourceSecret from a dictionary."""
@@ -506,6 +638,13 @@ class AppResourceServingEndpoint:
506
638
  if self.permission is not None: body['permission'] = self.permission.value
507
639
  return body
508
640
 
641
+ def as_shallow_dict(self) -> dict:
642
+ """Serializes the AppResourceServingEndpoint into a shallow dictionary of its immediate attributes."""
643
+ body = {}
644
+ if self.name is not None: body['name'] = self.name
645
+ if self.permission is not None: body['permission'] = self.permission
646
+ return body
647
+
509
648
  @classmethod
510
649
  def from_dict(cls, d: Dict[str, any]) -> AppResourceServingEndpoint:
511
650
  """Deserializes the AppResourceServingEndpoint from a dictionary."""
@@ -536,6 +675,13 @@ class AppResourceSqlWarehouse:
536
675
  if self.permission is not None: body['permission'] = self.permission.value
537
676
  return body
538
677
 
678
+ def as_shallow_dict(self) -> dict:
679
+ """Serializes the AppResourceSqlWarehouse into a shallow dictionary of its immediate attributes."""
680
+ body = {}
681
+ if self.id is not None: body['id'] = self.id
682
+ if self.permission is not None: body['permission'] = self.permission
683
+ return body
684
+
539
685
  @classmethod
540
686
  def from_dict(cls, d: Dict[str, any]) -> AppResourceSqlWarehouse:
541
687
  """Deserializes the AppResourceSqlWarehouse from a dictionary."""
@@ -573,6 +719,13 @@ class ApplicationStatus:
573
719
  if self.state is not None: body['state'] = self.state.value
574
720
  return body
575
721
 
722
+ def as_shallow_dict(self) -> dict:
723
+ """Serializes the ApplicationStatus into a shallow dictionary of its immediate attributes."""
724
+ body = {}
725
+ if self.message is not None: body['message'] = self.message
726
+ if self.state is not None: body['state'] = self.state
727
+ return body
728
+
576
729
  @classmethod
577
730
  def from_dict(cls, d: Dict[str, any]) -> ApplicationStatus:
578
731
  """Deserializes the ApplicationStatus from a dictionary."""
@@ -605,6 +758,13 @@ class ComputeStatus:
605
758
  if self.state is not None: body['state'] = self.state.value
606
759
  return body
607
760
 
761
+ def as_shallow_dict(self) -> dict:
762
+ """Serializes the ComputeStatus into a shallow dictionary of its immediate attributes."""
763
+ body = {}
764
+ if self.message is not None: body['message'] = self.message
765
+ if self.state is not None: body['state'] = self.state
766
+ return body
767
+
608
768
  @classmethod
609
769
  def from_dict(cls, d: Dict[str, any]) -> ComputeStatus:
610
770
  """Deserializes the ComputeStatus from a dictionary."""
@@ -622,6 +782,12 @@ class GetAppPermissionLevelsResponse:
622
782
  if self.permission_levels: body['permission_levels'] = [v.as_dict() for v in self.permission_levels]
623
783
  return body
624
784
 
785
+ def as_shallow_dict(self) -> dict:
786
+ """Serializes the GetAppPermissionLevelsResponse into a shallow dictionary of its immediate attributes."""
787
+ body = {}
788
+ if self.permission_levels: body['permission_levels'] = self.permission_levels
789
+ return body
790
+
625
791
  @classmethod
626
792
  def from_dict(cls, d: Dict[str, any]) -> GetAppPermissionLevelsResponse:
627
793
  """Deserializes the GetAppPermissionLevelsResponse from a dictionary."""
@@ -643,6 +809,13 @@ class ListAppDeploymentsResponse:
643
809
  if self.next_page_token is not None: body['next_page_token'] = self.next_page_token
644
810
  return body
645
811
 
812
+ def as_shallow_dict(self) -> dict:
813
+ """Serializes the ListAppDeploymentsResponse into a shallow dictionary of its immediate attributes."""
814
+ body = {}
815
+ if self.app_deployments: body['app_deployments'] = self.app_deployments
816
+ if self.next_page_token is not None: body['next_page_token'] = self.next_page_token
817
+ return body
818
+
646
819
  @classmethod
647
820
  def from_dict(cls, d: Dict[str, any]) -> ListAppDeploymentsResponse:
648
821
  """Deserializes the ListAppDeploymentsResponse from a dictionary."""
@@ -664,6 +837,13 @@ class ListAppsResponse:
664
837
  if self.next_page_token is not None: body['next_page_token'] = self.next_page_token
665
838
  return body
666
839
 
840
+ def as_shallow_dict(self) -> dict:
841
+ """Serializes the ListAppsResponse into a shallow dictionary of its immediate attributes."""
842
+ body = {}
843
+ if self.apps: body['apps'] = self.apps
844
+ if self.next_page_token is not None: body['next_page_token'] = self.next_page_token
845
+ return body
846
+
667
847
  @classmethod
668
848
  def from_dict(cls, d: Dict[str, any]) -> ListAppsResponse:
669
849
  """Deserializes the ListAppsResponse from a dictionary."""
@@ -798,7 +978,7 @@ class AppsAPI:
798
978
  Long-running operation waiter for :class:`App`.
799
979
  See :method:wait_get_app_active for more details.
800
980
  """
801
- body = app
981
+ body = app.as_dict()
802
982
  headers = {'Accept': 'application/json', 'Content-Type': 'application/json', }
803
983
 
804
984
  op_response = self._api.do('POST', '/api/2.0/apps', body=body, headers=headers)
@@ -836,7 +1016,7 @@ class AppsAPI:
836
1016
  Long-running operation waiter for :class:`AppDeployment`.
837
1017
  See :method:wait_get_deployment_app_succeeded for more details.
838
1018
  """
839
- body = app_deployment
1019
+ body = app_deployment.as_dict()
840
1020
  headers = {'Accept': 'application/json', 'Content-Type': 'application/json', }
841
1021
 
842
1022
  op_response = self._api.do('POST',
@@ -1053,12 +1233,13 @@ class AppsAPI:
1053
1233
  Updates the app with the supplied name.
1054
1234
 
1055
1235
  :param name: str
1056
- The name of the app.
1236
+ The name of the app. The name must contain only lowercase alphanumeric characters and hyphens. It
1237
+ must be unique within the workspace.
1057
1238
  :param app: :class:`App` (optional)
1058
1239
 
1059
1240
  :returns: :class:`App`
1060
1241
  """
1061
- body = app
1242
+ body = app.as_dict()
1062
1243
  headers = {'Accept': 'application/json', 'Content-Type': 'application/json', }
1063
1244
 
1064
1245
  res = self._api.do('PATCH', f'/api/2.0/apps/{name}', body=body, headers=headers)