databricks-sdk 0.30.0__tar.gz → 0.31.1__tar.gz

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 (85) hide show
  1. {databricks_sdk-0.30.0/databricks_sdk.egg-info → databricks_sdk-0.31.1}/PKG-INFO +1 -1
  2. {databricks_sdk-0.30.0 → databricks_sdk-0.31.1}/databricks/sdk/__init__.py +23 -3
  3. {databricks_sdk-0.30.0 → databricks_sdk-0.31.1}/databricks/sdk/credentials_provider.py +4 -1
  4. {databricks_sdk-0.30.0 → databricks_sdk-0.31.1}/databricks/sdk/errors/overrides.py +8 -0
  5. {databricks_sdk-0.30.0 → databricks_sdk-0.31.1}/databricks/sdk/errors/platform.py +5 -0
  6. {databricks_sdk-0.30.0 → databricks_sdk-0.31.1}/databricks/sdk/service/catalog.py +193 -0
  7. {databricks_sdk-0.30.0 → databricks_sdk-0.31.1}/databricks/sdk/service/compute.py +272 -0
  8. {databricks_sdk-0.30.0 → databricks_sdk-0.31.1}/databricks/sdk/service/dashboards.py +20 -13
  9. {databricks_sdk-0.30.0 → databricks_sdk-0.31.1}/databricks/sdk/service/jobs.py +298 -8
  10. {databricks_sdk-0.30.0 → databricks_sdk-0.31.1}/databricks/sdk/service/sql.py +14 -81
  11. {databricks_sdk-0.30.0 → databricks_sdk-0.31.1}/databricks/sdk/useragent.py +8 -1
  12. databricks_sdk-0.31.1/databricks/sdk/version.py +1 -0
  13. {databricks_sdk-0.30.0 → databricks_sdk-0.31.1/databricks_sdk.egg-info}/PKG-INFO +1 -1
  14. {databricks_sdk-0.30.0 → databricks_sdk-0.31.1}/tests/test_config.py +39 -0
  15. databricks_sdk-0.30.0/databricks/sdk/version.py +0 -1
  16. {databricks_sdk-0.30.0 → databricks_sdk-0.31.1}/LICENSE +0 -0
  17. {databricks_sdk-0.30.0 → databricks_sdk-0.31.1}/NOTICE +0 -0
  18. {databricks_sdk-0.30.0 → databricks_sdk-0.31.1}/README.md +0 -0
  19. {databricks_sdk-0.30.0 → databricks_sdk-0.31.1}/databricks/__init__.py +0 -0
  20. {databricks_sdk-0.30.0 → databricks_sdk-0.31.1}/databricks/sdk/_property.py +0 -0
  21. {databricks_sdk-0.30.0 → databricks_sdk-0.31.1}/databricks/sdk/_widgets/__init__.py +0 -0
  22. {databricks_sdk-0.30.0 → databricks_sdk-0.31.1}/databricks/sdk/_widgets/default_widgets_utils.py +0 -0
  23. {databricks_sdk-0.30.0 → databricks_sdk-0.31.1}/databricks/sdk/_widgets/ipywidgets_utils.py +0 -0
  24. {databricks_sdk-0.30.0 → databricks_sdk-0.31.1}/databricks/sdk/azure.py +0 -0
  25. {databricks_sdk-0.30.0 → databricks_sdk-0.31.1}/databricks/sdk/casing.py +0 -0
  26. {databricks_sdk-0.30.0 → databricks_sdk-0.31.1}/databricks/sdk/clock.py +0 -0
  27. {databricks_sdk-0.30.0 → databricks_sdk-0.31.1}/databricks/sdk/config.py +0 -0
  28. {databricks_sdk-0.30.0 → databricks_sdk-0.31.1}/databricks/sdk/core.py +0 -0
  29. {databricks_sdk-0.30.0 → databricks_sdk-0.31.1}/databricks/sdk/data_plane.py +0 -0
  30. {databricks_sdk-0.30.0 → databricks_sdk-0.31.1}/databricks/sdk/dbutils.py +0 -0
  31. {databricks_sdk-0.30.0 → databricks_sdk-0.31.1}/databricks/sdk/environments.py +0 -0
  32. {databricks_sdk-0.30.0 → databricks_sdk-0.31.1}/databricks/sdk/errors/__init__.py +0 -0
  33. {databricks_sdk-0.30.0 → databricks_sdk-0.31.1}/databricks/sdk/errors/base.py +0 -0
  34. {databricks_sdk-0.30.0 → databricks_sdk-0.31.1}/databricks/sdk/errors/mapper.py +0 -0
  35. {databricks_sdk-0.30.0 → databricks_sdk-0.31.1}/databricks/sdk/errors/private_link.py +0 -0
  36. {databricks_sdk-0.30.0 → databricks_sdk-0.31.1}/databricks/sdk/errors/sdk.py +0 -0
  37. {databricks_sdk-0.30.0 → databricks_sdk-0.31.1}/databricks/sdk/mixins/__init__.py +0 -0
  38. {databricks_sdk-0.30.0 → databricks_sdk-0.31.1}/databricks/sdk/mixins/compute.py +0 -0
  39. {databricks_sdk-0.30.0 → databricks_sdk-0.31.1}/databricks/sdk/mixins/files.py +0 -0
  40. {databricks_sdk-0.30.0 → databricks_sdk-0.31.1}/databricks/sdk/mixins/workspace.py +0 -0
  41. {databricks_sdk-0.30.0 → databricks_sdk-0.31.1}/databricks/sdk/oauth.py +0 -0
  42. {databricks_sdk-0.30.0 → databricks_sdk-0.31.1}/databricks/sdk/py.typed +0 -0
  43. {databricks_sdk-0.30.0 → databricks_sdk-0.31.1}/databricks/sdk/retries.py +0 -0
  44. {databricks_sdk-0.30.0 → databricks_sdk-0.31.1}/databricks/sdk/runtime/__init__.py +0 -0
  45. {databricks_sdk-0.30.0 → databricks_sdk-0.31.1}/databricks/sdk/runtime/dbutils_stub.py +0 -0
  46. {databricks_sdk-0.30.0 → databricks_sdk-0.31.1}/databricks/sdk/service/__init__.py +0 -0
  47. {databricks_sdk-0.30.0 → databricks_sdk-0.31.1}/databricks/sdk/service/_internal.py +0 -0
  48. {databricks_sdk-0.30.0 → databricks_sdk-0.31.1}/databricks/sdk/service/apps.py +0 -0
  49. {databricks_sdk-0.30.0 → databricks_sdk-0.31.1}/databricks/sdk/service/billing.py +0 -0
  50. {databricks_sdk-0.30.0 → databricks_sdk-0.31.1}/databricks/sdk/service/files.py +0 -0
  51. {databricks_sdk-0.30.0 → databricks_sdk-0.31.1}/databricks/sdk/service/iam.py +0 -0
  52. {databricks_sdk-0.30.0 → databricks_sdk-0.31.1}/databricks/sdk/service/marketplace.py +0 -0
  53. {databricks_sdk-0.30.0 → databricks_sdk-0.31.1}/databricks/sdk/service/ml.py +0 -0
  54. {databricks_sdk-0.30.0 → databricks_sdk-0.31.1}/databricks/sdk/service/oauth2.py +0 -0
  55. {databricks_sdk-0.30.0 → databricks_sdk-0.31.1}/databricks/sdk/service/pipelines.py +0 -0
  56. {databricks_sdk-0.30.0 → databricks_sdk-0.31.1}/databricks/sdk/service/provisioning.py +0 -0
  57. {databricks_sdk-0.30.0 → databricks_sdk-0.31.1}/databricks/sdk/service/serving.py +0 -0
  58. {databricks_sdk-0.30.0 → databricks_sdk-0.31.1}/databricks/sdk/service/settings.py +0 -0
  59. {databricks_sdk-0.30.0 → databricks_sdk-0.31.1}/databricks/sdk/service/sharing.py +0 -0
  60. {databricks_sdk-0.30.0 → databricks_sdk-0.31.1}/databricks/sdk/service/vectorsearch.py +0 -0
  61. {databricks_sdk-0.30.0 → databricks_sdk-0.31.1}/databricks/sdk/service/workspace.py +0 -0
  62. {databricks_sdk-0.30.0 → databricks_sdk-0.31.1}/databricks_sdk.egg-info/SOURCES.txt +0 -0
  63. {databricks_sdk-0.30.0 → databricks_sdk-0.31.1}/databricks_sdk.egg-info/dependency_links.txt +0 -0
  64. {databricks_sdk-0.30.0 → databricks_sdk-0.31.1}/databricks_sdk.egg-info/requires.txt +0 -0
  65. {databricks_sdk-0.30.0 → databricks_sdk-0.31.1}/databricks_sdk.egg-info/top_level.txt +0 -0
  66. {databricks_sdk-0.30.0 → databricks_sdk-0.31.1}/setup.cfg +0 -0
  67. {databricks_sdk-0.30.0 → databricks_sdk-0.31.1}/setup.py +0 -0
  68. {databricks_sdk-0.30.0 → databricks_sdk-0.31.1}/tests/test_auth.py +0 -0
  69. {databricks_sdk-0.30.0 → databricks_sdk-0.31.1}/tests/test_auth_manual_tests.py +0 -0
  70. {databricks_sdk-0.30.0 → databricks_sdk-0.31.1}/tests/test_client.py +0 -0
  71. {databricks_sdk-0.30.0 → databricks_sdk-0.31.1}/tests/test_compute_mixins.py +0 -0
  72. {databricks_sdk-0.30.0 → databricks_sdk-0.31.1}/tests/test_core.py +0 -0
  73. {databricks_sdk-0.30.0 → databricks_sdk-0.31.1}/tests/test_data_plane.py +0 -0
  74. {databricks_sdk-0.30.0 → databricks_sdk-0.31.1}/tests/test_dbfs_mixins.py +0 -0
  75. {databricks_sdk-0.30.0 → databricks_sdk-0.31.1}/tests/test_dbutils.py +0 -0
  76. {databricks_sdk-0.30.0 → databricks_sdk-0.31.1}/tests/test_environments.py +0 -0
  77. {databricks_sdk-0.30.0 → databricks_sdk-0.31.1}/tests/test_errors.py +0 -0
  78. {databricks_sdk-0.30.0 → databricks_sdk-0.31.1}/tests/test_init_file.py +0 -0
  79. {databricks_sdk-0.30.0 → databricks_sdk-0.31.1}/tests/test_internal.py +0 -0
  80. {databricks_sdk-0.30.0 → databricks_sdk-0.31.1}/tests/test_jobs.py +0 -0
  81. {databricks_sdk-0.30.0 → databricks_sdk-0.31.1}/tests/test_metadata_service_auth.py +0 -0
  82. {databricks_sdk-0.30.0 → databricks_sdk-0.31.1}/tests/test_misc.py +0 -0
  83. {databricks_sdk-0.30.0 → databricks_sdk-0.31.1}/tests/test_oauth.py +0 -0
  84. {databricks_sdk-0.30.0 → databricks_sdk-0.31.1}/tests/test_retries.py +0 -0
  85. {databricks_sdk-0.30.0 → databricks_sdk-0.31.1}/tests/test_user_agent.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: databricks-sdk
3
- Version: 0.30.0
3
+ Version: 0.31.1
4
4
  Summary: Databricks SDK for Python (Beta)
5
5
  Home-page: https://databricks-sdk-py.readthedocs.io
6
6
  Author: Serge Smertin
@@ -17,7 +17,8 @@ from databricks.sdk.service.catalog import (AccountMetastoreAssignmentsAPI,
17
17
  GrantsAPI, MetastoresAPI,
18
18
  ModelVersionsAPI, OnlineTablesAPI,
19
19
  QualityMonitorsAPI,
20
- RegisteredModelsAPI, SchemasAPI,
20
+ RegisteredModelsAPI,
21
+ ResourceQuotasAPI, SchemasAPI,
21
22
  StorageCredentialsAPI,
22
23
  SystemSchemasAPI,
23
24
  TableConstraintsAPI, TablesAPI,
@@ -27,6 +28,7 @@ from databricks.sdk.service.compute import (ClusterPoliciesAPI, ClustersAPI,
27
28
  GlobalInitScriptsAPI,
28
29
  InstancePoolsAPI,
29
30
  InstanceProfilesAPI, LibrariesAPI,
31
+ PolicyComplianceForClustersAPI,
30
32
  PolicyFamiliesAPI)
31
33
  from databricks.sdk.service.dashboards import GenieAPI, LakeviewAPI
32
34
  from databricks.sdk.service.files import DbfsAPI, FilesAPI
@@ -38,7 +40,7 @@ from databricks.sdk.service.iam import (AccountAccessControlAPI,
38
40
  GroupsAPI, PermissionMigrationAPI,
39
41
  PermissionsAPI, ServicePrincipalsAPI,
40
42
  UsersAPI, WorkspaceAssignmentAPI)
41
- from databricks.sdk.service.jobs import JobsAPI
43
+ from databricks.sdk.service.jobs import JobsAPI, PolicyComplianceForJobsAPI
42
44
  from databricks.sdk.service.marketplace import (
43
45
  ConsumerFulfillmentsAPI, ConsumerInstallationsAPI, ConsumerListingsAPI,
44
46
  ConsumerPersonalizationRequestsAPI, ConsumerProvidersAPI,
@@ -214,6 +216,8 @@ class WorkspaceClient:
214
216
  self._permission_migration = PermissionMigrationAPI(self._api_client)
215
217
  self._permissions = PermissionsAPI(self._api_client)
216
218
  self._pipelines = PipelinesAPI(self._api_client)
219
+ self._policy_compliance_for_clusters = PolicyComplianceForClustersAPI(self._api_client)
220
+ self._policy_compliance_for_jobs = PolicyComplianceForJobsAPI(self._api_client)
217
221
  self._policy_families = PolicyFamiliesAPI(self._api_client)
218
222
  self._provider_exchange_filters = ProviderExchangeFiltersAPI(self._api_client)
219
223
  self._provider_exchanges = ProviderExchangesAPI(self._api_client)
@@ -234,6 +238,7 @@ class WorkspaceClient:
234
238
  self._recipients = RecipientsAPI(self._api_client)
235
239
  self._registered_models = RegisteredModelsAPI(self._api_client)
236
240
  self._repos = ReposAPI(self._api_client)
241
+ self._resource_quotas = ResourceQuotasAPI(self._api_client)
237
242
  self._schemas = SchemasAPI(self._api_client)
238
243
  self._secrets = SecretsAPI(self._api_client)
239
244
  self._service_principals = ServicePrincipalsAPI(self._api_client)
@@ -499,6 +504,16 @@ class WorkspaceClient:
499
504
  """The Delta Live Tables API allows you to create, edit, delete, start, and view details about pipelines."""
500
505
  return self._pipelines
501
506
 
507
+ @property
508
+ def policy_compliance_for_clusters(self) -> PolicyComplianceForClustersAPI:
509
+ """The policy compliance APIs allow you to view and manage the policy compliance status of clusters in your workspace."""
510
+ return self._policy_compliance_for_clusters
511
+
512
+ @property
513
+ def policy_compliance_for_jobs(self) -> PolicyComplianceForJobsAPI:
514
+ """The compliance APIs allow you to view and manage the policy compliance status of jobs in your workspace."""
515
+ return self._policy_compliance_for_jobs
516
+
502
517
  @property
503
518
  def policy_families(self) -> PolicyFamiliesAPI:
504
519
  """View available policy families."""
@@ -561,7 +576,7 @@ class WorkspaceClient:
561
576
 
562
577
  @property
563
578
  def query_history(self) -> QueryHistoryAPI:
564
- """A service responsible for storing and retrieving the list of queries run against SQL endpoints, serverless compute, and DLT."""
579
+ """A service responsible for storing and retrieving the list of queries run against SQL endpoints and serverless compute."""
565
580
  return self._query_history
566
581
 
567
582
  @property
@@ -594,6 +609,11 @@ class WorkspaceClient:
594
609
  """The Repos API allows users to manage their git repos."""
595
610
  return self._repos
596
611
 
612
+ @property
613
+ def resource_quotas(self) -> ResourceQuotasAPI:
614
+ """Unity Catalog enforces resource quotas on all securable objects, which limits the number of resources that can be created."""
615
+ return self._resource_quotas
616
+
597
617
  @property
598
618
  def schemas(self) -> SchemasAPI:
599
619
  """A schema (also called a database) is the second layer of Unity Catalog’s three-level namespace."""
@@ -607,7 +607,10 @@ def databricks_cli(cfg: 'Config') -> Optional[CredentialsProvider]:
607
607
  token = token_source.token()
608
608
  return {'Authorization': f'{token.token_type} {token.access_token}'}
609
609
 
610
- return OAuthCredentialsProvider(inner, token_source.token)
610
+ def token() -> Token:
611
+ return token_source.token()
612
+
613
+ return OAuthCredentialsProvider(inner, token)
611
614
 
612
615
 
613
616
  class MetadataServiceTokenSource(Refreshable):
@@ -22,4 +22,12 @@ _ALL_OVERRIDES = [
22
22
  message_matcher=re.compile(r'Job .* does not exist'),
23
23
  custom_error=ResourceDoesNotExist,
24
24
  ),
25
+ _ErrorOverride(debug_name="Job Runs InvalidParameterValue=>ResourceDoesNotExist",
26
+ path_regex=re.compile(r'^/api/2\.\d/jobs/runs/get'),
27
+ verb="GET",
28
+ status_code_matcher=re.compile(r'^400$'),
29
+ error_code_matcher=re.compile(r'INVALID_PARAMETER_VALUE'),
30
+ message_matcher=re.compile(r'(Run .* does not exist|Run: .* in job: .* doesn\'t exist)'),
31
+ custom_error=ResourceDoesNotExist,
32
+ ),
25
33
  ]
@@ -47,6 +47,10 @@ class DeadlineExceeded(DatabricksError):
47
47
  """the deadline expired before the operation could complete"""
48
48
 
49
49
 
50
+ class InvalidState(BadRequest):
51
+ """unexpected state"""
52
+
53
+
50
54
  class InvalidParameterValue(BadRequest):
51
55
  """supplied value for a parameter was invalid"""
52
56
 
@@ -99,6 +103,7 @@ STATUS_CODE_MAPPING = {
99
103
  }
100
104
 
101
105
  ERROR_CODE_MAPPING = {
106
+ 'INVALID_STATE': InvalidState,
102
107
  'INVALID_PARAMETER_VALUE': InvalidParameterValue,
103
108
  'RESOURCE_DOES_NOT_EXIST': ResourceDoesNotExist,
104
109
  'ABORTED': Aborted,
@@ -849,7 +849,10 @@ class ConnectionInfoSecurableKind(Enum):
849
849
  """Kind of connection securable."""
850
850
 
851
851
  CONNECTION_BIGQUERY = 'CONNECTION_BIGQUERY'
852
+ CONNECTION_BUILTIN_HIVE_METASTORE = 'CONNECTION_BUILTIN_HIVE_METASTORE'
852
853
  CONNECTION_DATABRICKS = 'CONNECTION_DATABRICKS'
854
+ CONNECTION_EXTERNAL_HIVE_METASTORE = 'CONNECTION_EXTERNAL_HIVE_METASTORE'
855
+ CONNECTION_GLUE = 'CONNECTION_GLUE'
853
856
  CONNECTION_MYSQL = 'CONNECTION_MYSQL'
854
857
  CONNECTION_ONLINE_CATALOG = 'CONNECTION_ONLINE_CATALOG'
855
858
  CONNECTION_POSTGRESQL = 'CONNECTION_POSTGRESQL'
@@ -864,6 +867,8 @@ class ConnectionType(Enum):
864
867
 
865
868
  BIGQUERY = 'BIGQUERY'
866
869
  DATABRICKS = 'DATABRICKS'
870
+ GLUE = 'GLUE'
871
+ HIVE_METASTORE = 'HIVE_METASTORE'
867
872
  MYSQL = 'MYSQL'
868
873
  POSTGRESQL = 'POSTGRESQL'
869
874
  REDSHIFT = 'REDSHIFT'
@@ -1023,6 +1028,11 @@ class CreateExternalLocation:
1023
1028
  encryption_details: Optional[EncryptionDetails] = None
1024
1029
  """Encryption options that apply to clients connecting to cloud storage."""
1025
1030
 
1031
+ fallback: Optional[bool] = None
1032
+ """Indicates whether fallback mode is enabled for this external location. When fallback mode is
1033
+ enabled, the access to the location falls back to cluster credentials if UC credentials are not
1034
+ sufficient."""
1035
+
1026
1036
  read_only: Optional[bool] = None
1027
1037
  """Indicates whether the external location is read-only."""
1028
1038
 
@@ -1036,6 +1046,7 @@ class CreateExternalLocation:
1036
1046
  if self.comment is not None: body['comment'] = self.comment
1037
1047
  if self.credential_name is not None: body['credential_name'] = self.credential_name
1038
1048
  if self.encryption_details: body['encryption_details'] = self.encryption_details.as_dict()
1049
+ if self.fallback is not None: body['fallback'] = self.fallback
1039
1050
  if self.name is not None: body['name'] = self.name
1040
1051
  if self.read_only is not None: body['read_only'] = self.read_only
1041
1052
  if self.skip_validation is not None: body['skip_validation'] = self.skip_validation
@@ -1049,6 +1060,7 @@ class CreateExternalLocation:
1049
1060
  comment=d.get('comment', None),
1050
1061
  credential_name=d.get('credential_name', None),
1051
1062
  encryption_details=_from_dict(d, 'encryption_details', EncryptionDetails),
1063
+ fallback=d.get('fallback', None),
1052
1064
  name=d.get('name', None),
1053
1065
  read_only=d.get('read_only', None),
1054
1066
  skip_validation=d.get('skip_validation', None),
@@ -1974,6 +1986,11 @@ class ExternalLocationInfo:
1974
1986
  encryption_details: Optional[EncryptionDetails] = None
1975
1987
  """Encryption options that apply to clients connecting to cloud storage."""
1976
1988
 
1989
+ fallback: Optional[bool] = None
1990
+ """Indicates whether fallback mode is enabled for this external location. When fallback mode is
1991
+ enabled, the access to the location falls back to cluster credentials if UC credentials are not
1992
+ sufficient."""
1993
+
1977
1994
  isolation_mode: Optional[IsolationMode] = None
1978
1995
  """Whether the current securable is accessible from all workspaces or a specific set of workspaces."""
1979
1996
 
@@ -2009,6 +2026,7 @@ class ExternalLocationInfo:
2009
2026
  if self.credential_id is not None: body['credential_id'] = self.credential_id
2010
2027
  if self.credential_name is not None: body['credential_name'] = self.credential_name
2011
2028
  if self.encryption_details: body['encryption_details'] = self.encryption_details.as_dict()
2029
+ if self.fallback is not None: body['fallback'] = self.fallback
2012
2030
  if self.isolation_mode is not None: body['isolation_mode'] = self.isolation_mode.value
2013
2031
  if self.metastore_id is not None: body['metastore_id'] = self.metastore_id
2014
2032
  if self.name is not None: body['name'] = self.name
@@ -2030,6 +2048,7 @@ class ExternalLocationInfo:
2030
2048
  credential_id=d.get('credential_id', None),
2031
2049
  credential_name=d.get('credential_name', None),
2032
2050
  encryption_details=_from_dict(d, 'encryption_details', EncryptionDetails),
2051
+ fallback=d.get('fallback', None),
2033
2052
  isolation_mode=_enum(d, 'isolation_mode', IsolationMode),
2034
2053
  metastore_id=d.get('metastore_id', None),
2035
2054
  name=d.get('name', None),
@@ -2544,6 +2563,23 @@ class GetMetastoreSummaryResponseDeltaSharingScope(Enum):
2544
2563
  INTERNAL_AND_EXTERNAL = 'INTERNAL_AND_EXTERNAL'
2545
2564
 
2546
2565
 
2566
+ @dataclass
2567
+ class GetQuotaResponse:
2568
+ quota_info: Optional[QuotaInfo] = None
2569
+ """The returned QuotaInfo."""
2570
+
2571
+ def as_dict(self) -> dict:
2572
+ """Serializes the GetQuotaResponse into a dictionary suitable for use as a JSON request body."""
2573
+ body = {}
2574
+ if self.quota_info: body['quota_info'] = self.quota_info.as_dict()
2575
+ return body
2576
+
2577
+ @classmethod
2578
+ def from_dict(cls, d: Dict[str, any]) -> GetQuotaResponse:
2579
+ """Deserializes the GetQuotaResponse from a dictionary."""
2580
+ return cls(quota_info=_from_dict(d, 'quota_info', QuotaInfo))
2581
+
2582
+
2547
2583
  class IsolationMode(Enum):
2548
2584
  """Whether the current securable is accessible from all workspaces or a specific set of workspaces."""
2549
2585
 
@@ -2719,6 +2755,29 @@ class ListModelVersionsResponse:
2719
2755
  next_page_token=d.get('next_page_token', None))
2720
2756
 
2721
2757
 
2758
+ @dataclass
2759
+ class ListQuotasResponse:
2760
+ next_page_token: Optional[str] = None
2761
+ """Opaque token to retrieve the next page of results. Absent if there are no more pages.
2762
+ __page_token__ should be set to this value for the next request."""
2763
+
2764
+ quotas: Optional[List[QuotaInfo]] = None
2765
+ """An array of returned QuotaInfos."""
2766
+
2767
+ def as_dict(self) -> dict:
2768
+ """Serializes the ListQuotasResponse into a dictionary suitable for use as a JSON request body."""
2769
+ body = {}
2770
+ if self.next_page_token is not None: body['next_page_token'] = self.next_page_token
2771
+ if self.quotas: body['quotas'] = [v.as_dict() for v in self.quotas]
2772
+ return body
2773
+
2774
+ @classmethod
2775
+ def from_dict(cls, d: Dict[str, any]) -> ListQuotasResponse:
2776
+ """Deserializes the ListQuotasResponse from a dictionary."""
2777
+ return cls(next_page_token=d.get('next_page_token', None),
2778
+ quotas=_repeated_dict(d, 'quotas', QuotaInfo))
2779
+
2780
+
2722
2781
  @dataclass
2723
2782
  class ListRegisteredModelsResponse:
2724
2783
  next_page_token: Optional[str] = None
@@ -4048,6 +4107,49 @@ class ProvisioningStatus:
4048
4107
  initial_pipeline_sync_progress=_from_dict(d, 'initial_pipeline_sync_progress', PipelineProgress))
4049
4108
 
4050
4109
 
4110
+ @dataclass
4111
+ class QuotaInfo:
4112
+ last_refreshed_at: Optional[int] = None
4113
+ """The timestamp that indicates when the quota count was last updated."""
4114
+
4115
+ parent_full_name: Optional[str] = None
4116
+ """Name of the parent resource. Returns metastore ID if the parent is a metastore."""
4117
+
4118
+ parent_securable_type: Optional[SecurableType] = None
4119
+ """The quota parent securable type."""
4120
+
4121
+ quota_count: Optional[int] = None
4122
+ """The current usage of the resource quota."""
4123
+
4124
+ quota_limit: Optional[int] = None
4125
+ """The current limit of the resource quota."""
4126
+
4127
+ quota_name: Optional[str] = None
4128
+ """The name of the quota."""
4129
+
4130
+ def as_dict(self) -> dict:
4131
+ """Serializes the QuotaInfo into a dictionary suitable for use as a JSON request body."""
4132
+ body = {}
4133
+ if self.last_refreshed_at is not None: body['last_refreshed_at'] = self.last_refreshed_at
4134
+ if self.parent_full_name is not None: body['parent_full_name'] = self.parent_full_name
4135
+ if self.parent_securable_type is not None:
4136
+ body['parent_securable_type'] = self.parent_securable_type.value
4137
+ if self.quota_count is not None: body['quota_count'] = self.quota_count
4138
+ if self.quota_limit is not None: body['quota_limit'] = self.quota_limit
4139
+ if self.quota_name is not None: body['quota_name'] = self.quota_name
4140
+ return body
4141
+
4142
+ @classmethod
4143
+ def from_dict(cls, d: Dict[str, any]) -> QuotaInfo:
4144
+ """Deserializes the QuotaInfo from a dictionary."""
4145
+ return cls(last_refreshed_at=d.get('last_refreshed_at', None),
4146
+ parent_full_name=d.get('parent_full_name', None),
4147
+ parent_securable_type=_enum(d, 'parent_securable_type', SecurableType),
4148
+ quota_count=d.get('quota_count', None),
4149
+ quota_limit=d.get('quota_limit', None),
4150
+ quota_name=d.get('quota_name', None))
4151
+
4152
+
4051
4153
  @dataclass
4052
4154
  class RegisteredModelAlias:
4053
4155
  """Registered model alias."""
@@ -4969,6 +5071,11 @@ class UpdateExternalLocation:
4969
5071
  encryption_details: Optional[EncryptionDetails] = None
4970
5072
  """Encryption options that apply to clients connecting to cloud storage."""
4971
5073
 
5074
+ fallback: Optional[bool] = None
5075
+ """Indicates whether fallback mode is enabled for this external location. When fallback mode is
5076
+ enabled, the access to the location falls back to cluster credentials if UC credentials are not
5077
+ sufficient."""
5078
+
4972
5079
  force: Optional[bool] = None
4973
5080
  """Force update even if changing url invalidates dependent external tables or mounts."""
4974
5081
 
@@ -5000,6 +5107,7 @@ class UpdateExternalLocation:
5000
5107
  if self.comment is not None: body['comment'] = self.comment
5001
5108
  if self.credential_name is not None: body['credential_name'] = self.credential_name
5002
5109
  if self.encryption_details: body['encryption_details'] = self.encryption_details.as_dict()
5110
+ if self.fallback is not None: body['fallback'] = self.fallback
5003
5111
  if self.force is not None: body['force'] = self.force
5004
5112
  if self.isolation_mode is not None: body['isolation_mode'] = self.isolation_mode.value
5005
5113
  if self.name is not None: body['name'] = self.name
@@ -5017,6 +5125,7 @@ class UpdateExternalLocation:
5017
5125
  comment=d.get('comment', None),
5018
5126
  credential_name=d.get('credential_name', None),
5019
5127
  encryption_details=_from_dict(d, 'encryption_details', EncryptionDetails),
5128
+ fallback=d.get('fallback', None),
5020
5129
  force=d.get('force', None),
5021
5130
  isolation_mode=_enum(d, 'isolation_mode', IsolationMode),
5022
5131
  name=d.get('name', None),
@@ -6597,6 +6706,7 @@ class ExternalLocationsAPI:
6597
6706
  access_point: Optional[str] = None,
6598
6707
  comment: Optional[str] = None,
6599
6708
  encryption_details: Optional[EncryptionDetails] = None,
6709
+ fallback: Optional[bool] = None,
6600
6710
  read_only: Optional[bool] = None,
6601
6711
  skip_validation: Optional[bool] = None) -> ExternalLocationInfo:
6602
6712
  """Create an external location.
@@ -6617,6 +6727,10 @@ class ExternalLocationsAPI:
6617
6727
  User-provided free-form text description.
6618
6728
  :param encryption_details: :class:`EncryptionDetails` (optional)
6619
6729
  Encryption options that apply to clients connecting to cloud storage.
6730
+ :param fallback: bool (optional)
6731
+ Indicates whether fallback mode is enabled for this external location. When fallback mode is
6732
+ enabled, the access to the location falls back to cluster credentials if UC credentials are not
6733
+ sufficient.
6620
6734
  :param read_only: bool (optional)
6621
6735
  Indicates whether the external location is read-only.
6622
6736
  :param skip_validation: bool (optional)
@@ -6629,6 +6743,7 @@ class ExternalLocationsAPI:
6629
6743
  if comment is not None: body['comment'] = comment
6630
6744
  if credential_name is not None: body['credential_name'] = credential_name
6631
6745
  if encryption_details is not None: body['encryption_details'] = encryption_details.as_dict()
6746
+ if fallback is not None: body['fallback'] = fallback
6632
6747
  if name is not None: body['name'] = name
6633
6748
  if read_only is not None: body['read_only'] = read_only
6634
6749
  if skip_validation is not None: body['skip_validation'] = skip_validation
@@ -6736,6 +6851,7 @@ class ExternalLocationsAPI:
6736
6851
  comment: Optional[str] = None,
6737
6852
  credential_name: Optional[str] = None,
6738
6853
  encryption_details: Optional[EncryptionDetails] = None,
6854
+ fallback: Optional[bool] = None,
6739
6855
  force: Optional[bool] = None,
6740
6856
  isolation_mode: Optional[IsolationMode] = None,
6741
6857
  new_name: Optional[str] = None,
@@ -6759,6 +6875,10 @@ class ExternalLocationsAPI:
6759
6875
  Name of the storage credential used with this location.
6760
6876
  :param encryption_details: :class:`EncryptionDetails` (optional)
6761
6877
  Encryption options that apply to clients connecting to cloud storage.
6878
+ :param fallback: bool (optional)
6879
+ Indicates whether fallback mode is enabled for this external location. When fallback mode is
6880
+ enabled, the access to the location falls back to cluster credentials if UC credentials are not
6881
+ sufficient.
6762
6882
  :param force: bool (optional)
6763
6883
  Force update even if changing url invalidates dependent external tables or mounts.
6764
6884
  :param isolation_mode: :class:`IsolationMode` (optional)
@@ -6781,6 +6901,7 @@ class ExternalLocationsAPI:
6781
6901
  if comment is not None: body['comment'] = comment
6782
6902
  if credential_name is not None: body['credential_name'] = credential_name
6783
6903
  if encryption_details is not None: body['encryption_details'] = encryption_details.as_dict()
6904
+ if fallback is not None: body['fallback'] = fallback
6784
6905
  if force is not None: body['force'] = force
6785
6906
  if isolation_mode is not None: body['isolation_mode'] = isolation_mode.value
6786
6907
  if new_name is not None: body['new_name'] = new_name
@@ -8178,6 +8299,78 @@ class RegisteredModelsAPI:
8178
8299
  return RegisteredModelInfo.from_dict(res)
8179
8300
 
8180
8301
 
8302
+ class ResourceQuotasAPI:
8303
+ """Unity Catalog enforces resource quotas on all securable objects, which limits the number of resources that
8304
+ can be created. Quotas are expressed in terms of a resource type and a parent (for example, tables per
8305
+ metastore or schemas per catalog). The resource quota APIs enable you to monitor your current usage and
8306
+ limits. For more information on resource quotas see the [Unity Catalog documentation].
8307
+
8308
+ [Unity Catalog documentation]: https://docs.databricks.com/en/data-governance/unity-catalog/index.html#resource-quotas"""
8309
+
8310
+ def __init__(self, api_client):
8311
+ self._api = api_client
8312
+
8313
+ def get_quota(self, parent_securable_type: str, parent_full_name: str,
8314
+ quota_name: str) -> GetQuotaResponse:
8315
+ """Get information for a single resource quota.
8316
+
8317
+ The GetQuota API returns usage information for a single resource quota, defined as a child-parent
8318
+ pair. This API also refreshes the quota count if it is out of date. Refreshes are triggered
8319
+ asynchronously. The updated count might not be returned in the first call.
8320
+
8321
+ :param parent_securable_type: str
8322
+ Securable type of the quota parent.
8323
+ :param parent_full_name: str
8324
+ Full name of the parent resource. Provide the metastore ID if the parent is a metastore.
8325
+ :param quota_name: str
8326
+ Name of the quota. Follows the pattern of the quota type, with "-quota" added as a suffix.
8327
+
8328
+ :returns: :class:`GetQuotaResponse`
8329
+ """
8330
+
8331
+ headers = {'Accept': 'application/json', }
8332
+
8333
+ res = self._api.do(
8334
+ 'GET',
8335
+ f'/api/2.1/unity-catalog/resource-quotas/{parent_securable_type}/{parent_full_name}/{quota_name}',
8336
+ headers=headers)
8337
+ return GetQuotaResponse.from_dict(res)
8338
+
8339
+ def list_quotas(self,
8340
+ *,
8341
+ max_results: Optional[int] = None,
8342
+ page_token: Optional[str] = None) -> Iterator[QuotaInfo]:
8343
+ """List all resource quotas under a metastore.
8344
+
8345
+ ListQuotas returns all quota values under the metastore. There are no SLAs on the freshness of the
8346
+ counts returned. This API does not trigger a refresh of quota counts.
8347
+
8348
+ :param max_results: int (optional)
8349
+ The number of quotas to return.
8350
+ :param page_token: str (optional)
8351
+ Opaque token for the next page of results.
8352
+
8353
+ :returns: Iterator over :class:`QuotaInfo`
8354
+ """
8355
+
8356
+ query = {}
8357
+ if max_results is not None: query['max_results'] = max_results
8358
+ if page_token is not None: query['page_token'] = page_token
8359
+ headers = {'Accept': 'application/json', }
8360
+
8361
+ while True:
8362
+ json = self._api.do('GET',
8363
+ '/api/2.1/unity-catalog/resource-quotas/all-resource-quotas',
8364
+ query=query,
8365
+ headers=headers)
8366
+ if 'quotas' in json:
8367
+ for v in json['quotas']:
8368
+ yield QuotaInfo.from_dict(v)
8369
+ if 'next_page_token' not in json or not json['next_page_token']:
8370
+ return
8371
+ query['page_token'] = json['next_page_token']
8372
+
8373
+
8181
8374
  class SchemasAPI:
8182
8375
  """A schema (also called a database) is the second layer of Unity Catalog’s three-level namespace. A schema
8183
8376
  organizes tables, views and functions. To access (or list) a table or view in a schema, users must have