databricks-sdk 0.29.0__py3-none-any.whl → 0.31.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 (30) hide show
  1. databricks/sdk/__init__.py +89 -21
  2. databricks/sdk/config.py +61 -75
  3. databricks/sdk/core.py +16 -9
  4. databricks/sdk/credentials_provider.py +15 -15
  5. databricks/sdk/data_plane.py +65 -0
  6. databricks/sdk/errors/overrides.py +8 -0
  7. databricks/sdk/errors/platform.py +5 -0
  8. databricks/sdk/mixins/files.py +12 -4
  9. databricks/sdk/service/apps.py +977 -0
  10. databricks/sdk/service/billing.py +602 -218
  11. databricks/sdk/service/catalog.py +324 -34
  12. databricks/sdk/service/compute.py +766 -81
  13. databricks/sdk/service/dashboards.py +628 -18
  14. databricks/sdk/service/iam.py +99 -88
  15. databricks/sdk/service/jobs.py +332 -23
  16. databricks/sdk/service/marketplace.py +2 -122
  17. databricks/sdk/service/oauth2.py +127 -70
  18. databricks/sdk/service/pipelines.py +72 -52
  19. databricks/sdk/service/serving.py +303 -750
  20. databricks/sdk/service/settings.py +423 -4
  21. databricks/sdk/service/sharing.py +235 -25
  22. databricks/sdk/service/sql.py +2328 -544
  23. databricks/sdk/useragent.py +151 -0
  24. databricks/sdk/version.py +1 -1
  25. {databricks_sdk-0.29.0.dist-info → databricks_sdk-0.31.0.dist-info}/METADATA +36 -16
  26. {databricks_sdk-0.29.0.dist-info → databricks_sdk-0.31.0.dist-info}/RECORD +30 -27
  27. {databricks_sdk-0.29.0.dist-info → databricks_sdk-0.31.0.dist-info}/WHEEL +1 -1
  28. {databricks_sdk-0.29.0.dist-info → databricks_sdk-0.31.0.dist-info}/LICENSE +0 -0
  29. {databricks_sdk-0.29.0.dist-info → databricks_sdk-0.31.0.dist-info}/NOTICE +0 -0
  30. {databricks_sdk-0.29.0.dist-info → databricks_sdk-0.31.0.dist-info}/top_level.txt +0 -0
@@ -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),
@@ -2418,6 +2437,13 @@ class FunctionParameterType(Enum):
2418
2437
  PARAM = 'PARAM'
2419
2438
 
2420
2439
 
2440
+ class GetBindingsSecurableType(Enum):
2441
+
2442
+ CATALOG = 'catalog'
2443
+ EXTERNAL_LOCATION = 'external_location'
2444
+ STORAGE_CREDENTIAL = 'storage_credential'
2445
+
2446
+
2421
2447
  @dataclass
2422
2448
  class GetMetastoreSummaryResponse:
2423
2449
  cloud: Optional[str] = None
@@ -2537,6 +2563,23 @@ class GetMetastoreSummaryResponseDeltaSharingScope(Enum):
2537
2563
  INTERNAL_AND_EXTERNAL = 'INTERNAL_AND_EXTERNAL'
2538
2564
 
2539
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
+
2540
2583
  class IsolationMode(Enum):
2541
2584
  """Whether the current securable is accessible from all workspaces or a specific set of workspaces."""
2542
2585
 
@@ -2712,6 +2755,29 @@ class ListModelVersionsResponse:
2712
2755
  next_page_token=d.get('next_page_token', None))
2713
2756
 
2714
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
+
2715
2781
  @dataclass
2716
2782
  class ListRegisteredModelsResponse:
2717
2783
  next_page_token: Optional[str] = None
@@ -2782,19 +2848,25 @@ class ListStorageCredentialsResponse:
2782
2848
 
2783
2849
  @dataclass
2784
2850
  class ListSystemSchemasResponse:
2851
+ next_page_token: Optional[str] = None
2852
+ """Opaque token to retrieve the next page of results. Absent if there are no more pages.
2853
+ __page_token__ should be set to this value for the next request (for the next page of results)."""
2854
+
2785
2855
  schemas: Optional[List[SystemSchemaInfo]] = None
2786
2856
  """An array of system schema information objects."""
2787
2857
 
2788
2858
  def as_dict(self) -> dict:
2789
2859
  """Serializes the ListSystemSchemasResponse into a dictionary suitable for use as a JSON request body."""
2790
2860
  body = {}
2861
+ if self.next_page_token is not None: body['next_page_token'] = self.next_page_token
2791
2862
  if self.schemas: body['schemas'] = [v.as_dict() for v in self.schemas]
2792
2863
  return body
2793
2864
 
2794
2865
  @classmethod
2795
2866
  def from_dict(cls, d: Dict[str, any]) -> ListSystemSchemasResponse:
2796
2867
  """Deserializes the ListSystemSchemasResponse from a dictionary."""
2797
- return cls(schemas=_repeated_dict(d, 'schemas', SystemSchemaInfo))
2868
+ return cls(next_page_token=d.get('next_page_token', None),
2869
+ schemas=_repeated_dict(d, 'schemas', SystemSchemaInfo))
2798
2870
 
2799
2871
 
2800
2872
  @dataclass
@@ -3019,6 +3091,9 @@ class MetastoreInfoDeltaSharingScope(Enum):
3019
3091
 
3020
3092
  @dataclass
3021
3093
  class ModelVersionInfo:
3094
+ aliases: Optional[List[RegisteredModelAlias]] = None
3095
+ """List of aliases associated with the model version"""
3096
+
3022
3097
  browse_only: Optional[bool] = None
3023
3098
  """Indicates whether the principal is limited to retrieving metadata for the associated object
3024
3099
  through the BROWSE privilege when include_browse is enabled in the request."""
@@ -3079,6 +3154,7 @@ class ModelVersionInfo:
3079
3154
  def as_dict(self) -> dict:
3080
3155
  """Serializes the ModelVersionInfo into a dictionary suitable for use as a JSON request body."""
3081
3156
  body = {}
3157
+ if self.aliases: body['aliases'] = [v.as_dict() for v in self.aliases]
3082
3158
  if self.browse_only is not None: body['browse_only'] = self.browse_only
3083
3159
  if self.catalog_name is not None: body['catalog_name'] = self.catalog_name
3084
3160
  if self.comment is not None: body['comment'] = self.comment
@@ -3103,7 +3179,8 @@ class ModelVersionInfo:
3103
3179
  @classmethod
3104
3180
  def from_dict(cls, d: Dict[str, any]) -> ModelVersionInfo:
3105
3181
  """Deserializes the ModelVersionInfo from a dictionary."""
3106
- return cls(browse_only=d.get('browse_only', None),
3182
+ return cls(aliases=_repeated_dict(d, 'aliases', RegisteredModelAlias),
3183
+ browse_only=d.get('browse_only', None),
3107
3184
  catalog_name=d.get('catalog_name', None),
3108
3185
  comment=d.get('comment', None),
3109
3186
  created_at=d.get('created_at', None),
@@ -3742,7 +3819,6 @@ class OnlineTableState(Enum):
3742
3819
  ONLINE_CONTINUOUS_UPDATE = 'ONLINE_CONTINUOUS_UPDATE'
3743
3820
  ONLINE_NO_PENDING_UPDATE = 'ONLINE_NO_PENDING_UPDATE'
3744
3821
  ONLINE_PIPELINE_FAILED = 'ONLINE_PIPELINE_FAILED'
3745
- ONLINE_TABLE_STATE_UNSPECIFIED = 'ONLINE_TABLE_STATE_UNSPECIFIED'
3746
3822
  ONLINE_TRIGGERED_UPDATE = 'ONLINE_TRIGGERED_UPDATE'
3747
3823
  ONLINE_UPDATING_PIPELINE_RESOURCES = 'ONLINE_UPDATING_PIPELINE_RESOURCES'
3748
3824
  PROVISIONING = 'PROVISIONING'
@@ -3935,6 +4011,7 @@ class Privilege(Enum):
3935
4011
  CREATE_VIEW = 'CREATE_VIEW'
3936
4012
  CREATE_VOLUME = 'CREATE_VOLUME'
3937
4013
  EXECUTE = 'EXECUTE'
4014
+ MANAGE = 'MANAGE'
3938
4015
  MANAGE_ALLOWLIST = 'MANAGE_ALLOWLIST'
3939
4016
  MODIFY = 'MODIFY'
3940
4017
  READ_FILES = 'READ_FILES'
@@ -4030,6 +4107,49 @@ class ProvisioningStatus:
4030
4107
  initial_pipeline_sync_progress=_from_dict(d, 'initial_pipeline_sync_progress', PipelineProgress))
4031
4108
 
4032
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
+
4033
4153
  @dataclass
4034
4154
  class RegisteredModelAlias:
4035
4155
  """Registered model alias."""
@@ -4849,6 +4969,13 @@ class UpdateAssignmentResponse:
4849
4969
  return cls()
4850
4970
 
4851
4971
 
4972
+ class UpdateBindingsSecurableType(Enum):
4973
+
4974
+ CATALOG = 'catalog'
4975
+ EXTERNAL_LOCATION = 'external_location'
4976
+ STORAGE_CREDENTIAL = 'storage_credential'
4977
+
4978
+
4852
4979
  @dataclass
4853
4980
  class UpdateCatalog:
4854
4981
  comment: Optional[str] = None
@@ -4944,6 +5071,11 @@ class UpdateExternalLocation:
4944
5071
  encryption_details: Optional[EncryptionDetails] = None
4945
5072
  """Encryption options that apply to clients connecting to cloud storage."""
4946
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
+
4947
5079
  force: Optional[bool] = None
4948
5080
  """Force update even if changing url invalidates dependent external tables or mounts."""
4949
5081
 
@@ -4975,6 +5107,7 @@ class UpdateExternalLocation:
4975
5107
  if self.comment is not None: body['comment'] = self.comment
4976
5108
  if self.credential_name is not None: body['credential_name'] = self.credential_name
4977
5109
  if self.encryption_details: body['encryption_details'] = self.encryption_details.as_dict()
5110
+ if self.fallback is not None: body['fallback'] = self.fallback
4978
5111
  if self.force is not None: body['force'] = self.force
4979
5112
  if self.isolation_mode is not None: body['isolation_mode'] = self.isolation_mode.value
4980
5113
  if self.name is not None: body['name'] = self.name
@@ -4992,6 +5125,7 @@ class UpdateExternalLocation:
4992
5125
  comment=d.get('comment', None),
4993
5126
  credential_name=d.get('credential_name', None),
4994
5127
  encryption_details=_from_dict(d, 'encryption_details', EncryptionDetails),
5128
+ fallback=d.get('fallback', None),
4995
5129
  force=d.get('force', None),
4996
5130
  isolation_mode=_enum(d, 'isolation_mode', IsolationMode),
4997
5131
  name=d.get('name', None),
@@ -5492,8 +5626,8 @@ class UpdateWorkspaceBindingsParameters:
5492
5626
  securable_name: Optional[str] = None
5493
5627
  """The name of the securable."""
5494
5628
 
5495
- securable_type: Optional[str] = None
5496
- """The type of the securable."""
5629
+ securable_type: Optional[UpdateBindingsSecurableType] = None
5630
+ """The type of the securable to bind to a workspace."""
5497
5631
 
5498
5632
  def as_dict(self) -> dict:
5499
5633
  """Serializes the UpdateWorkspaceBindingsParameters into a dictionary suitable for use as a JSON request body."""
@@ -5501,7 +5635,7 @@ class UpdateWorkspaceBindingsParameters:
5501
5635
  if self.add: body['add'] = [v.as_dict() for v in self.add]
5502
5636
  if self.remove: body['remove'] = [v.as_dict() for v in self.remove]
5503
5637
  if self.securable_name is not None: body['securable_name'] = self.securable_name
5504
- if self.securable_type is not None: body['securable_type'] = self.securable_type
5638
+ if self.securable_type is not None: body['securable_type'] = self.securable_type.value
5505
5639
  return body
5506
5640
 
5507
5641
  @classmethod
@@ -5510,7 +5644,7 @@ class UpdateWorkspaceBindingsParameters:
5510
5644
  return cls(add=_repeated_dict(d, 'add', WorkspaceBinding),
5511
5645
  remove=_repeated_dict(d, 'remove', WorkspaceBinding),
5512
5646
  securable_name=d.get('securable_name', None),
5513
- securable_type=d.get('securable_type', None))
5647
+ securable_type=_enum(d, 'securable_type', UpdateBindingsSecurableType))
5514
5648
 
5515
5649
 
5516
5650
  @dataclass
@@ -5776,16 +5910,22 @@ class WorkspaceBindingsResponse:
5776
5910
  bindings: Optional[List[WorkspaceBinding]] = None
5777
5911
  """List of workspace bindings"""
5778
5912
 
5913
+ next_page_token: Optional[str] = None
5914
+ """Opaque token to retrieve the next page of results. Absent if there are no more pages.
5915
+ __page_token__ should be set to this value for the next request (for the next page of results)."""
5916
+
5779
5917
  def as_dict(self) -> dict:
5780
5918
  """Serializes the WorkspaceBindingsResponse into a dictionary suitable for use as a JSON request body."""
5781
5919
  body = {}
5782
5920
  if self.bindings: body['bindings'] = [v.as_dict() for v in self.bindings]
5921
+ if self.next_page_token is not None: body['next_page_token'] = self.next_page_token
5783
5922
  return body
5784
5923
 
5785
5924
  @classmethod
5786
5925
  def from_dict(cls, d: Dict[str, any]) -> WorkspaceBindingsResponse:
5787
5926
  """Deserializes the WorkspaceBindingsResponse from a dictionary."""
5788
- return cls(bindings=_repeated_dict(d, 'bindings', WorkspaceBinding))
5927
+ return cls(bindings=_repeated_dict(d, 'bindings', WorkspaceBinding),
5928
+ next_page_token=d.get('next_page_token', None))
5789
5929
 
5790
5930
 
5791
5931
  class AccountMetastoreAssignmentsAPI:
@@ -6566,6 +6706,7 @@ class ExternalLocationsAPI:
6566
6706
  access_point: Optional[str] = None,
6567
6707
  comment: Optional[str] = None,
6568
6708
  encryption_details: Optional[EncryptionDetails] = None,
6709
+ fallback: Optional[bool] = None,
6569
6710
  read_only: Optional[bool] = None,
6570
6711
  skip_validation: Optional[bool] = None) -> ExternalLocationInfo:
6571
6712
  """Create an external location.
@@ -6586,6 +6727,10 @@ class ExternalLocationsAPI:
6586
6727
  User-provided free-form text description.
6587
6728
  :param encryption_details: :class:`EncryptionDetails` (optional)
6588
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.
6589
6734
  :param read_only: bool (optional)
6590
6735
  Indicates whether the external location is read-only.
6591
6736
  :param skip_validation: bool (optional)
@@ -6598,6 +6743,7 @@ class ExternalLocationsAPI:
6598
6743
  if comment is not None: body['comment'] = comment
6599
6744
  if credential_name is not None: body['credential_name'] = credential_name
6600
6745
  if encryption_details is not None: body['encryption_details'] = encryption_details.as_dict()
6746
+ if fallback is not None: body['fallback'] = fallback
6601
6747
  if name is not None: body['name'] = name
6602
6748
  if read_only is not None: body['read_only'] = read_only
6603
6749
  if skip_validation is not None: body['skip_validation'] = skip_validation
@@ -6705,6 +6851,7 @@ class ExternalLocationsAPI:
6705
6851
  comment: Optional[str] = None,
6706
6852
  credential_name: Optional[str] = None,
6707
6853
  encryption_details: Optional[EncryptionDetails] = None,
6854
+ fallback: Optional[bool] = None,
6708
6855
  force: Optional[bool] = None,
6709
6856
  isolation_mode: Optional[IsolationMode] = None,
6710
6857
  new_name: Optional[str] = None,
@@ -6728,6 +6875,10 @@ class ExternalLocationsAPI:
6728
6875
  Name of the storage credential used with this location.
6729
6876
  :param encryption_details: :class:`EncryptionDetails` (optional)
6730
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.
6731
6882
  :param force: bool (optional)
6732
6883
  Force update even if changing url invalidates dependent external tables or mounts.
6733
6884
  :param isolation_mode: :class:`IsolationMode` (optional)
@@ -6750,6 +6901,7 @@ class ExternalLocationsAPI:
6750
6901
  if comment is not None: body['comment'] = comment
6751
6902
  if credential_name is not None: body['credential_name'] = credential_name
6752
6903
  if encryption_details is not None: body['encryption_details'] = encryption_details.as_dict()
6904
+ if fallback is not None: body['fallback'] = fallback
6753
6905
  if force is not None: body['force'] = force
6754
6906
  if isolation_mode is not None: body['isolation_mode'] = isolation_mode.value
6755
6907
  if new_name is not None: body['new_name'] = new_name
@@ -7325,7 +7477,8 @@ class ModelVersionsAPI:
7325
7477
  full_name: str,
7326
7478
  version: int,
7327
7479
  *,
7328
- include_browse: Optional[bool] = None) -> RegisteredModelInfo:
7480
+ include_aliases: Optional[bool] = None,
7481
+ include_browse: Optional[bool] = None) -> ModelVersionInfo:
7329
7482
  """Get a Model Version.
7330
7483
 
7331
7484
  Get a model version.
@@ -7338,14 +7491,17 @@ class ModelVersionsAPI:
7338
7491
  The three-level (fully qualified) name of the model version
7339
7492
  :param version: int
7340
7493
  The integer version number of the model version
7494
+ :param include_aliases: bool (optional)
7495
+ Whether to include aliases associated with the model version in the response
7341
7496
  :param include_browse: bool (optional)
7342
7497
  Whether to include model versions in the response for which the principal can only access selective
7343
7498
  metadata for
7344
7499
 
7345
- :returns: :class:`RegisteredModelInfo`
7500
+ :returns: :class:`ModelVersionInfo`
7346
7501
  """
7347
7502
 
7348
7503
  query = {}
7504
+ if include_aliases is not None: query['include_aliases'] = include_aliases
7349
7505
  if include_browse is not None: query['include_browse'] = include_browse
7350
7506
  headers = {'Accept': 'application/json', }
7351
7507
 
@@ -7353,9 +7509,13 @@ class ModelVersionsAPI:
7353
7509
  f'/api/2.1/unity-catalog/models/{full_name}/versions/{version}',
7354
7510
  query=query,
7355
7511
  headers=headers)
7356
- return RegisteredModelInfo.from_dict(res)
7512
+ return ModelVersionInfo.from_dict(res)
7357
7513
 
7358
- def get_by_alias(self, full_name: str, alias: str) -> ModelVersionInfo:
7514
+ def get_by_alias(self,
7515
+ full_name: str,
7516
+ alias: str,
7517
+ *,
7518
+ include_aliases: Optional[bool] = None) -> ModelVersionInfo:
7359
7519
  """Get Model Version By Alias.
7360
7520
 
7361
7521
  Get a model version by alias.
@@ -7368,14 +7528,19 @@ class ModelVersionsAPI:
7368
7528
  The three-level (fully qualified) name of the registered model
7369
7529
  :param alias: str
7370
7530
  The name of the alias
7531
+ :param include_aliases: bool (optional)
7532
+ Whether to include aliases associated with the model version in the response
7371
7533
 
7372
7534
  :returns: :class:`ModelVersionInfo`
7373
7535
  """
7374
7536
 
7537
+ query = {}
7538
+ if include_aliases is not None: query['include_aliases'] = include_aliases
7375
7539
  headers = {'Accept': 'application/json', }
7376
7540
 
7377
7541
  res = self._api.do('GET',
7378
7542
  f'/api/2.1/unity-catalog/models/{full_name}/aliases/{alias}',
7543
+ query=query,
7379
7544
  headers=headers)
7380
7545
  return ModelVersionInfo.from_dict(res)
7381
7546
 
@@ -7971,7 +8136,11 @@ class RegisteredModelsAPI:
7971
8136
 
7972
8137
  self._api.do('DELETE', f'/api/2.1/unity-catalog/models/{full_name}/aliases/{alias}', headers=headers)
7973
8138
 
7974
- def get(self, full_name: str, *, include_browse: Optional[bool] = None) -> RegisteredModelInfo:
8139
+ def get(self,
8140
+ full_name: str,
8141
+ *,
8142
+ include_aliases: Optional[bool] = None,
8143
+ include_browse: Optional[bool] = None) -> RegisteredModelInfo:
7975
8144
  """Get a Registered Model.
7976
8145
 
7977
8146
  Get a registered model.
@@ -7982,6 +8151,8 @@ class RegisteredModelsAPI:
7982
8151
 
7983
8152
  :param full_name: str
7984
8153
  The three-level (fully qualified) name of the registered model
8154
+ :param include_aliases: bool (optional)
8155
+ Whether to include registered model aliases in the response
7985
8156
  :param include_browse: bool (optional)
7986
8157
  Whether to include registered models in the response for which the principal can only access
7987
8158
  selective metadata for
@@ -7990,6 +8161,7 @@ class RegisteredModelsAPI:
7990
8161
  """
7991
8162
 
7992
8163
  query = {}
8164
+ if include_aliases is not None: query['include_aliases'] = include_aliases
7993
8165
  if include_browse is not None: query['include_browse'] = include_browse
7994
8166
  headers = {'Accept': 'application/json', }
7995
8167
 
@@ -8127,6 +8299,78 @@ class RegisteredModelsAPI:
8127
8299
  return RegisteredModelInfo.from_dict(res)
8128
8300
 
8129
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
+
8130
8374
  class SchemasAPI:
8131
8375
  """A schema (also called a database) is the second layer of Unity Catalog’s three-level namespace. A schema
8132
8376
  organizes tables, views and functions. To access (or list) a table or view in a schema, users must have
@@ -8172,7 +8416,7 @@ class SchemasAPI:
8172
8416
  res = self._api.do('POST', '/api/2.1/unity-catalog/schemas', body=body, headers=headers)
8173
8417
  return SchemaInfo.from_dict(res)
8174
8418
 
8175
- def delete(self, full_name: str):
8419
+ def delete(self, full_name: str, *, force: Optional[bool] = None):
8176
8420
  """Delete a schema.
8177
8421
 
8178
8422
  Deletes the specified schema from the parent catalog. The caller must be the owner of the schema or an
@@ -8180,13 +8424,17 @@ class SchemasAPI:
8180
8424
 
8181
8425
  :param full_name: str
8182
8426
  Full name of the schema.
8427
+ :param force: bool (optional)
8428
+ Force deletion even if the schema is not empty.
8183
8429
 
8184
8430
 
8185
8431
  """
8186
8432
 
8433
+ query = {}
8434
+ if force is not None: query['force'] = force
8187
8435
  headers = {'Accept': 'application/json', }
8188
8436
 
8189
- self._api.do('DELETE', f'/api/2.1/unity-catalog/schemas/{full_name}', headers=headers)
8437
+ self._api.do('DELETE', f'/api/2.1/unity-catalog/schemas/{full_name}', query=query, headers=headers)
8190
8438
 
8191
8439
  def get(self, full_name: str, *, include_browse: Optional[bool] = None) -> SchemaInfo:
8192
8440
  """Get a schema.
@@ -8632,7 +8880,11 @@ class SystemSchemasAPI:
8632
8880
  f'/api/2.1/unity-catalog/metastores/{metastore_id}/systemschemas/{schema_name}',
8633
8881
  headers=headers)
8634
8882
 
8635
- def list(self, metastore_id: str) -> Iterator[SystemSchemaInfo]:
8883
+ def list(self,
8884
+ metastore_id: str,
8885
+ *,
8886
+ max_results: Optional[int] = None,
8887
+ page_token: Optional[str] = None) -> Iterator[SystemSchemaInfo]:
8636
8888
  """List system schemas.
8637
8889
 
8638
8890
  Gets an array of system schemas for a metastore. The caller must be an account admin or a metastore
@@ -8640,17 +8892,33 @@ class SystemSchemasAPI:
8640
8892
 
8641
8893
  :param metastore_id: str
8642
8894
  The ID for the metastore in which the system schema resides.
8895
+ :param max_results: int (optional)
8896
+ Maximum number of schemas to return. - When set to 0, the page length is set to a server configured
8897
+ value (recommended); - When set to a value greater than 0, the page length is the minimum of this
8898
+ value and a server configured value; - When set to a value less than 0, an invalid parameter error
8899
+ is returned; - If not set, all the schemas are returned (not recommended).
8900
+ :param page_token: str (optional)
8901
+ Opaque pagination token to go to next page based on previous query.
8643
8902
 
8644
8903
  :returns: Iterator over :class:`SystemSchemaInfo`
8645
8904
  """
8646
8905
 
8906
+ query = {}
8907
+ if max_results is not None: query['max_results'] = max_results
8908
+ if page_token is not None: query['page_token'] = page_token
8647
8909
  headers = {'Accept': 'application/json', }
8648
8910
 
8649
- json = self._api.do('GET',
8650
- f'/api/2.1/unity-catalog/metastores/{metastore_id}/systemschemas',
8651
- headers=headers)
8652
- parsed = ListSystemSchemasResponse.from_dict(json).schemas
8653
- return parsed if parsed is not None else []
8911
+ while True:
8912
+ json = self._api.do('GET',
8913
+ f'/api/2.1/unity-catalog/metastores/{metastore_id}/systemschemas',
8914
+ query=query,
8915
+ headers=headers)
8916
+ if 'schemas' in json:
8917
+ for v in json['schemas']:
8918
+ yield SystemSchemaInfo.from_dict(v)
8919
+ if 'next_page_token' not in json or not json['next_page_token']:
8920
+ return
8921
+ query['page_token'] = json['next_page_token']
8654
8922
 
8655
8923
 
8656
8924
  class TableConstraintsAPI:
@@ -9172,7 +9440,7 @@ class WorkspaceBindingsAPI:
9172
9440
  the new path (/api/2.1/unity-catalog/bindings/{securable_type}/{securable_name}) which introduces the
9173
9441
  ability to bind a securable in READ_ONLY mode (catalogs only).
9174
9442
 
9175
- Securables that support binding: - catalog"""
9443
+ Securable types that support binding: - catalog - storage_credential - external_location"""
9176
9444
 
9177
9445
  def __init__(self, api_client):
9178
9446
  self._api = api_client
@@ -9196,26 +9464,48 @@ class WorkspaceBindingsAPI:
9196
9464
  headers=headers)
9197
9465
  return CurrentWorkspaceBindings.from_dict(res)
9198
9466
 
9199
- def get_bindings(self, securable_type: str, securable_name: str) -> WorkspaceBindingsResponse:
9467
+ def get_bindings(self,
9468
+ securable_type: GetBindingsSecurableType,
9469
+ securable_name: str,
9470
+ *,
9471
+ max_results: Optional[int] = None,
9472
+ page_token: Optional[str] = None) -> Iterator[WorkspaceBinding]:
9200
9473
  """Get securable workspace bindings.
9201
9474
 
9202
9475
  Gets workspace bindings of the securable. The caller must be a metastore admin or an owner of the
9203
9476
  securable.
9204
9477
 
9205
- :param securable_type: str
9206
- The type of the securable.
9478
+ :param securable_type: :class:`GetBindingsSecurableType`
9479
+ The type of the securable to bind to a workspace.
9207
9480
  :param securable_name: str
9208
9481
  The name of the securable.
9482
+ :param max_results: int (optional)
9483
+ Maximum number of workspace bindings to return. - When set to 0, the page length is set to a server
9484
+ configured value (recommended); - When set to a value greater than 0, the page length is the minimum
9485
+ of this value and a server configured value; - When set to a value less than 0, an invalid parameter
9486
+ error is returned; - If not set, all the workspace bindings are returned (not recommended).
9487
+ :param page_token: str (optional)
9488
+ Opaque pagination token to go to next page based on previous query.
9209
9489
 
9210
- :returns: :class:`WorkspaceBindingsResponse`
9490
+ :returns: Iterator over :class:`WorkspaceBinding`
9211
9491
  """
9212
9492
 
9493
+ query = {}
9494
+ if max_results is not None: query['max_results'] = max_results
9495
+ if page_token is not None: query['page_token'] = page_token
9213
9496
  headers = {'Accept': 'application/json', }
9214
9497
 
9215
- res = self._api.do('GET',
9216
- f'/api/2.1/unity-catalog/bindings/{securable_type}/{securable_name}',
9217
- headers=headers)
9218
- return WorkspaceBindingsResponse.from_dict(res)
9498
+ while True:
9499
+ json = self._api.do('GET',
9500
+ f'/api/2.1/unity-catalog/bindings/{securable_type.value}/{securable_name}',
9501
+ query=query,
9502
+ headers=headers)
9503
+ if 'bindings' in json:
9504
+ for v in json['bindings']:
9505
+ yield WorkspaceBinding.from_dict(v)
9506
+ if 'next_page_token' not in json or not json['next_page_token']:
9507
+ return
9508
+ query['page_token'] = json['next_page_token']
9219
9509
 
9220
9510
  def update(self,
9221
9511
  name: str,
@@ -9248,7 +9538,7 @@ class WorkspaceBindingsAPI:
9248
9538
  return CurrentWorkspaceBindings.from_dict(res)
9249
9539
 
9250
9540
  def update_bindings(self,
9251
- securable_type: str,
9541
+ securable_type: UpdateBindingsSecurableType,
9252
9542
  securable_name: str,
9253
9543
  *,
9254
9544
  add: Optional[List[WorkspaceBinding]] = None,
@@ -9258,8 +9548,8 @@ class WorkspaceBindingsAPI:
9258
9548
  Updates workspace bindings of the securable. The caller must be a metastore admin or an owner of the
9259
9549
  securable.
9260
9550
 
9261
- :param securable_type: str
9262
- The type of the securable.
9551
+ :param securable_type: :class:`UpdateBindingsSecurableType`
9552
+ The type of the securable to bind to a workspace.
9263
9553
  :param securable_name: str
9264
9554
  The name of the securable.
9265
9555
  :param add: List[:class:`WorkspaceBinding`] (optional)
@@ -9275,7 +9565,7 @@ class WorkspaceBindingsAPI:
9275
9565
  headers = {'Accept': 'application/json', 'Content-Type': 'application/json', }
9276
9566
 
9277
9567
  res = self._api.do('PATCH',
9278
- f'/api/2.1/unity-catalog/bindings/{securable_type}/{securable_name}',
9568
+ f'/api/2.1/unity-catalog/bindings/{securable_type.value}/{securable_name}',
9279
9569
  body=body,
9280
9570
  headers=headers)
9281
9571
  return WorkspaceBindingsResponse.from_dict(res)