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
@@ -448,7 +448,7 @@ class CatalogInfo:
448
448
  full_name: Optional[str] = None
449
449
  """The full name of the catalog. Corresponds with the name field."""
450
450
 
451
- isolation_mode: Optional[IsolationMode] = None
451
+ isolation_mode: Optional[CatalogIsolationMode] = None
452
452
  """Whether the current securable is accessible from all workspaces or a specific set of workspaces."""
453
453
 
454
454
  metastore_id: Optional[str] = None
@@ -541,7 +541,7 @@ class CatalogInfo:
541
541
  enable_predictive_optimization=_enum(d, 'enable_predictive_optimization',
542
542
  EnablePredictiveOptimization),
543
543
  full_name=d.get('full_name', None),
544
- isolation_mode=_enum(d, 'isolation_mode', IsolationMode),
544
+ isolation_mode=_enum(d, 'isolation_mode', CatalogIsolationMode),
545
545
  metastore_id=d.get('metastore_id', None),
546
546
  name=d.get('name', None),
547
547
  options=d.get('options', None),
@@ -571,13 +571,18 @@ class CatalogInfoSecurableKind(Enum):
571
571
  CATALOG_FOREIGN_SQLDW = 'CATALOG_FOREIGN_SQLDW'
572
572
  CATALOG_FOREIGN_SQLSERVER = 'CATALOG_FOREIGN_SQLSERVER'
573
573
  CATALOG_INTERNAL = 'CATALOG_INTERNAL'
574
- CATALOG_ONLINE = 'CATALOG_ONLINE'
575
- CATALOG_ONLINE_INDEX = 'CATALOG_ONLINE_INDEX'
576
574
  CATALOG_STANDARD = 'CATALOG_STANDARD'
577
575
  CATALOG_SYSTEM = 'CATALOG_SYSTEM'
578
576
  CATALOG_SYSTEM_DELTASHARING = 'CATALOG_SYSTEM_DELTASHARING'
579
577
 
580
578
 
579
+ class CatalogIsolationMode(Enum):
580
+ """Whether the current securable is accessible from all workspaces or a specific set of workspaces."""
581
+
582
+ ISOLATED = 'ISOLATED'
583
+ OPEN = 'OPEN'
584
+
585
+
581
586
  class CatalogType(Enum):
582
587
  """The type of the catalog."""
583
588
 
@@ -1222,8 +1227,9 @@ class CreateMetastore:
1222
1227
  """The user-specified name of the metastore."""
1223
1228
 
1224
1229
  region: Optional[str] = None
1225
- """Cloud region which the metastore serves (e.g., `us-west-2`, `westus`). If this field is omitted,
1226
- the region of the workspace receiving the request will be used."""
1230
+ """Cloud region which the metastore serves (e.g., `us-west-2`, `westus`). The field can be omitted
1231
+ in the __workspace-level__ __API__ but not in the __account-level__ __API__. If this field is
1232
+ omitted, the region of the workspace receiving the request will be used."""
1227
1233
 
1228
1234
  storage_root: Optional[str] = None
1229
1235
  """The storage root URL for metastore"""
@@ -1494,7 +1500,7 @@ class CreateStorageCredential:
1494
1500
  """Comment associated with the credential."""
1495
1501
 
1496
1502
  databricks_gcp_service_account: Optional[DatabricksGcpServiceAccountRequest] = None
1497
- """The <Databricks> managed GCP service account configuration."""
1503
+ """The Databricks managed GCP service account configuration."""
1498
1504
 
1499
1505
  read_only: Optional[bool] = None
1500
1506
  """Whether the storage credential is only usable for read operations."""
@@ -1627,14 +1633,28 @@ class DataSourceFormat(Enum):
1627
1633
  """Data source format"""
1628
1634
 
1629
1635
  AVRO = 'AVRO'
1636
+ BIGQUERY_FORMAT = 'BIGQUERY_FORMAT'
1630
1637
  CSV = 'CSV'
1638
+ DATABRICKS_FORMAT = 'DATABRICKS_FORMAT'
1631
1639
  DELTA = 'DELTA'
1632
1640
  DELTASHARING = 'DELTASHARING'
1641
+ HIVE_CUSTOM = 'HIVE_CUSTOM'
1642
+ HIVE_SERDE = 'HIVE_SERDE'
1633
1643
  JSON = 'JSON'
1644
+ MYSQL_FORMAT = 'MYSQL_FORMAT'
1645
+ NETSUITE_FORMAT = 'NETSUITE_FORMAT'
1634
1646
  ORC = 'ORC'
1635
1647
  PARQUET = 'PARQUET'
1648
+ POSTGRESQL_FORMAT = 'POSTGRESQL_FORMAT'
1649
+ REDSHIFT_FORMAT = 'REDSHIFT_FORMAT'
1650
+ SALESFORCE_FORMAT = 'SALESFORCE_FORMAT'
1651
+ SNOWFLAKE_FORMAT = 'SNOWFLAKE_FORMAT'
1652
+ SQLDW_FORMAT = 'SQLDW_FORMAT'
1653
+ SQLSERVER_FORMAT = 'SQLSERVER_FORMAT'
1636
1654
  TEXT = 'TEXT'
1637
1655
  UNITY_CATALOG = 'UNITY_CATALOG'
1656
+ VECTOR_INDEX_FORMAT = 'VECTOR_INDEX_FORMAT'
1657
+ WORKDAY_RAAS_FORMAT = 'WORKDAY_RAAS_FORMAT'
1638
1658
 
1639
1659
 
1640
1660
  @dataclass
@@ -1954,6 +1974,9 @@ class ExternalLocationInfo:
1954
1974
  encryption_details: Optional[EncryptionDetails] = None
1955
1975
  """Encryption options that apply to clients connecting to cloud storage."""
1956
1976
 
1977
+ isolation_mode: Optional[IsolationMode] = None
1978
+ """Whether the current securable is accessible from all workspaces or a specific set of workspaces."""
1979
+
1957
1980
  metastore_id: Optional[str] = None
1958
1981
  """Unique identifier of metastore hosting the external location."""
1959
1982
 
@@ -1986,6 +2009,7 @@ class ExternalLocationInfo:
1986
2009
  if self.credential_id is not None: body['credential_id'] = self.credential_id
1987
2010
  if self.credential_name is not None: body['credential_name'] = self.credential_name
1988
2011
  if self.encryption_details: body['encryption_details'] = self.encryption_details.as_dict()
2012
+ if self.isolation_mode is not None: body['isolation_mode'] = self.isolation_mode.value
1989
2013
  if self.metastore_id is not None: body['metastore_id'] = self.metastore_id
1990
2014
  if self.name is not None: body['name'] = self.name
1991
2015
  if self.owner is not None: body['owner'] = self.owner
@@ -2006,6 +2030,7 @@ class ExternalLocationInfo:
2006
2030
  credential_id=d.get('credential_id', None),
2007
2031
  credential_name=d.get('credential_name', None),
2008
2032
  encryption_details=_from_dict(d, 'encryption_details', EncryptionDetails),
2033
+ isolation_mode=_enum(d, 'isolation_mode', IsolationMode),
2009
2034
  metastore_id=d.get('metastore_id', None),
2010
2035
  name=d.get('name', None),
2011
2036
  owner=d.get('owner', None),
@@ -2393,6 +2418,13 @@ class FunctionParameterType(Enum):
2393
2418
  PARAM = 'PARAM'
2394
2419
 
2395
2420
 
2421
+ class GetBindingsSecurableType(Enum):
2422
+
2423
+ CATALOG = 'catalog'
2424
+ EXTERNAL_LOCATION = 'external_location'
2425
+ STORAGE_CREDENTIAL = 'storage_credential'
2426
+
2427
+
2396
2428
  @dataclass
2397
2429
  class GetMetastoreSummaryResponse:
2398
2430
  cloud: Optional[str] = None
@@ -2515,8 +2547,8 @@ class GetMetastoreSummaryResponseDeltaSharingScope(Enum):
2515
2547
  class IsolationMode(Enum):
2516
2548
  """Whether the current securable is accessible from all workspaces or a specific set of workspaces."""
2517
2549
 
2518
- ISOLATED = 'ISOLATED'
2519
- OPEN = 'OPEN'
2550
+ ISOLATION_MODE_ISOLATED = 'ISOLATION_MODE_ISOLATED'
2551
+ ISOLATION_MODE_OPEN = 'ISOLATION_MODE_OPEN'
2520
2552
 
2521
2553
 
2522
2554
  @dataclass
@@ -2537,21 +2569,45 @@ class ListAccountMetastoreAssignmentsResponse:
2537
2569
  return cls(workspace_ids=d.get('workspace_ids', None))
2538
2570
 
2539
2571
 
2572
+ @dataclass
2573
+ class ListAccountStorageCredentialsResponse:
2574
+ storage_credentials: Optional[List[StorageCredentialInfo]] = None
2575
+ """An array of metastore storage credentials."""
2576
+
2577
+ def as_dict(self) -> dict:
2578
+ """Serializes the ListAccountStorageCredentialsResponse into a dictionary suitable for use as a JSON request body."""
2579
+ body = {}
2580
+ if self.storage_credentials:
2581
+ body['storage_credentials'] = [v.as_dict() for v in self.storage_credentials]
2582
+ return body
2583
+
2584
+ @classmethod
2585
+ def from_dict(cls, d: Dict[str, any]) -> ListAccountStorageCredentialsResponse:
2586
+ """Deserializes the ListAccountStorageCredentialsResponse from a dictionary."""
2587
+ return cls(storage_credentials=_repeated_dict(d, 'storage_credentials', StorageCredentialInfo))
2588
+
2589
+
2540
2590
  @dataclass
2541
2591
  class ListCatalogsResponse:
2542
2592
  catalogs: Optional[List[CatalogInfo]] = None
2543
2593
  """An array of catalog information objects."""
2544
2594
 
2595
+ next_page_token: Optional[str] = None
2596
+ """Opaque token to retrieve the next page of results. Absent if there are no more pages.
2597
+ __page_token__ should be set to this value for the next request (for the next page of results)."""
2598
+
2545
2599
  def as_dict(self) -> dict:
2546
2600
  """Serializes the ListCatalogsResponse into a dictionary suitable for use as a JSON request body."""
2547
2601
  body = {}
2548
2602
  if self.catalogs: body['catalogs'] = [v.as_dict() for v in self.catalogs]
2603
+ if self.next_page_token is not None: body['next_page_token'] = self.next_page_token
2549
2604
  return body
2550
2605
 
2551
2606
  @classmethod
2552
2607
  def from_dict(cls, d: Dict[str, any]) -> ListCatalogsResponse:
2553
2608
  """Deserializes the ListCatalogsResponse from a dictionary."""
2554
- return cls(catalogs=_repeated_dict(d, 'catalogs', CatalogInfo))
2609
+ return cls(catalogs=_repeated_dict(d, 'catalogs', CatalogInfo),
2610
+ next_page_token=d.get('next_page_token', None))
2555
2611
 
2556
2612
 
2557
2613
  @dataclass
@@ -2733,19 +2789,25 @@ class ListStorageCredentialsResponse:
2733
2789
 
2734
2790
  @dataclass
2735
2791
  class ListSystemSchemasResponse:
2792
+ next_page_token: Optional[str] = None
2793
+ """Opaque token to retrieve the next page of results. Absent if there are no more pages.
2794
+ __page_token__ should be set to this value for the next request (for the next page of results)."""
2795
+
2736
2796
  schemas: Optional[List[SystemSchemaInfo]] = None
2737
2797
  """An array of system schema information objects."""
2738
2798
 
2739
2799
  def as_dict(self) -> dict:
2740
2800
  """Serializes the ListSystemSchemasResponse into a dictionary suitable for use as a JSON request body."""
2741
2801
  body = {}
2802
+ if self.next_page_token is not None: body['next_page_token'] = self.next_page_token
2742
2803
  if self.schemas: body['schemas'] = [v.as_dict() for v in self.schemas]
2743
2804
  return body
2744
2805
 
2745
2806
  @classmethod
2746
2807
  def from_dict(cls, d: Dict[str, any]) -> ListSystemSchemasResponse:
2747
2808
  """Deserializes the ListSystemSchemasResponse from a dictionary."""
2748
- return cls(schemas=_repeated_dict(d, 'schemas', SystemSchemaInfo))
2809
+ return cls(next_page_token=d.get('next_page_token', None),
2810
+ schemas=_repeated_dict(d, 'schemas', SystemSchemaInfo))
2749
2811
 
2750
2812
 
2751
2813
  @dataclass
@@ -2970,6 +3032,9 @@ class MetastoreInfoDeltaSharingScope(Enum):
2970
3032
 
2971
3033
  @dataclass
2972
3034
  class ModelVersionInfo:
3035
+ aliases: Optional[List[RegisteredModelAlias]] = None
3036
+ """List of aliases associated with the model version"""
3037
+
2973
3038
  browse_only: Optional[bool] = None
2974
3039
  """Indicates whether the principal is limited to retrieving metadata for the associated object
2975
3040
  through the BROWSE privilege when include_browse is enabled in the request."""
@@ -3030,6 +3095,7 @@ class ModelVersionInfo:
3030
3095
  def as_dict(self) -> dict:
3031
3096
  """Serializes the ModelVersionInfo into a dictionary suitable for use as a JSON request body."""
3032
3097
  body = {}
3098
+ if self.aliases: body['aliases'] = [v.as_dict() for v in self.aliases]
3033
3099
  if self.browse_only is not None: body['browse_only'] = self.browse_only
3034
3100
  if self.catalog_name is not None: body['catalog_name'] = self.catalog_name
3035
3101
  if self.comment is not None: body['comment'] = self.comment
@@ -3054,7 +3120,8 @@ class ModelVersionInfo:
3054
3120
  @classmethod
3055
3121
  def from_dict(cls, d: Dict[str, any]) -> ModelVersionInfo:
3056
3122
  """Deserializes the ModelVersionInfo from a dictionary."""
3057
- return cls(browse_only=d.get('browse_only', None),
3123
+ return cls(aliases=_repeated_dict(d, 'aliases', RegisteredModelAlias),
3124
+ browse_only=d.get('browse_only', None),
3058
3125
  catalog_name=d.get('catalog_name', None),
3059
3126
  comment=d.get('comment', None),
3060
3127
  created_at=d.get('created_at', None),
@@ -3578,12 +3645,16 @@ class OnlineTable:
3578
3645
  status: Optional[OnlineTableStatus] = None
3579
3646
  """Online Table status"""
3580
3647
 
3648
+ table_serving_url: Optional[str] = None
3649
+ """Data serving REST API URL for this table"""
3650
+
3581
3651
  def as_dict(self) -> dict:
3582
3652
  """Serializes the OnlineTable into a dictionary suitable for use as a JSON request body."""
3583
3653
  body = {}
3584
3654
  if self.name is not None: body['name'] = self.name
3585
3655
  if self.spec: body['spec'] = self.spec.as_dict()
3586
3656
  if self.status: body['status'] = self.status.as_dict()
3657
+ if self.table_serving_url is not None: body['table_serving_url'] = self.table_serving_url
3587
3658
  return body
3588
3659
 
3589
3660
  @classmethod
@@ -3591,7 +3662,8 @@ class OnlineTable:
3591
3662
  """Deserializes the OnlineTable from a dictionary."""
3592
3663
  return cls(name=d.get('name', None),
3593
3664
  spec=_from_dict(d, 'spec', OnlineTableSpec),
3594
- status=_from_dict(d, 'status', OnlineTableStatus))
3665
+ status=_from_dict(d, 'status', OnlineTableStatus),
3666
+ table_serving_url=d.get('table_serving_url', None))
3595
3667
 
3596
3668
 
3597
3669
  @dataclass
@@ -3688,7 +3760,6 @@ class OnlineTableState(Enum):
3688
3760
  ONLINE_CONTINUOUS_UPDATE = 'ONLINE_CONTINUOUS_UPDATE'
3689
3761
  ONLINE_NO_PENDING_UPDATE = 'ONLINE_NO_PENDING_UPDATE'
3690
3762
  ONLINE_PIPELINE_FAILED = 'ONLINE_PIPELINE_FAILED'
3691
- ONLINE_TABLE_STATE_UNSPECIFIED = 'ONLINE_TABLE_STATE_UNSPECIFIED'
3692
3763
  ONLINE_TRIGGERED_UPDATE = 'ONLINE_TRIGGERED_UPDATE'
3693
3764
  ONLINE_UPDATING_PIPELINE_RESOURCES = 'ONLINE_UPDATING_PIPELINE_RESOURCES'
3694
3765
  PROVISIONING = 'PROVISIONING'
@@ -3881,6 +3952,7 @@ class Privilege(Enum):
3881
3952
  CREATE_VIEW = 'CREATE_VIEW'
3882
3953
  CREATE_VOLUME = 'CREATE_VOLUME'
3883
3954
  EXECUTE = 'EXECUTE'
3955
+ MANAGE = 'MANAGE'
3884
3956
  MANAGE_ALLOWLIST = 'MANAGE_ALLOWLIST'
3885
3957
  MODIFY = 'MODIFY'
3886
3958
  READ_FILES = 'READ_FILES'
@@ -3889,7 +3961,6 @@ class Privilege(Enum):
3889
3961
  REFRESH = 'REFRESH'
3890
3962
  SELECT = 'SELECT'
3891
3963
  SET_SHARE_PERMISSION = 'SET_SHARE_PERMISSION'
3892
- SINGLE_USER_ACCESS = 'SINGLE_USER_ACCESS'
3893
3964
  USAGE = 'USAGE'
3894
3965
  USE_CATALOG = 'USE_CATALOG'
3895
3966
  USE_CONNECTION = 'USE_CONNECTION'
@@ -4318,11 +4389,14 @@ class StorageCredentialInfo:
4318
4389
  """Username of credential creator."""
4319
4390
 
4320
4391
  databricks_gcp_service_account: Optional[DatabricksGcpServiceAccountResponse] = None
4321
- """The <Databricks> managed GCP service account configuration."""
4392
+ """The Databricks managed GCP service account configuration."""
4322
4393
 
4323
4394
  id: Optional[str] = None
4324
4395
  """The unique identifier of the credential."""
4325
4396
 
4397
+ isolation_mode: Optional[IsolationMode] = None
4398
+ """Whether the current securable is accessible from all workspaces or a specific set of workspaces."""
4399
+
4326
4400
  metastore_id: Optional[str] = None
4327
4401
  """Unique identifier of parent metastore."""
4328
4402
 
@@ -4358,6 +4432,7 @@ class StorageCredentialInfo:
4358
4432
  if self.databricks_gcp_service_account:
4359
4433
  body['databricks_gcp_service_account'] = self.databricks_gcp_service_account.as_dict()
4360
4434
  if self.id is not None: body['id'] = self.id
4435
+ if self.isolation_mode is not None: body['isolation_mode'] = self.isolation_mode.value
4361
4436
  if self.metastore_id is not None: body['metastore_id'] = self.metastore_id
4362
4437
  if self.name is not None: body['name'] = self.name
4363
4438
  if self.owner is not None: body['owner'] = self.owner
@@ -4382,6 +4457,7 @@ class StorageCredentialInfo:
4382
4457
  databricks_gcp_service_account=_from_dict(d, 'databricks_gcp_service_account',
4383
4458
  DatabricksGcpServiceAccountResponse),
4384
4459
  id=d.get('id', None),
4460
+ isolation_mode=_enum(d, 'isolation_mode', IsolationMode),
4385
4461
  metastore_id=d.get('metastore_id', None),
4386
4462
  name=d.get('name', None),
4387
4463
  owner=d.get('owner', None),
@@ -4720,7 +4796,10 @@ class TableSummary:
4720
4796
  class TableType(Enum):
4721
4797
 
4722
4798
  EXTERNAL = 'EXTERNAL'
4799
+ EXTERNAL_SHALLOW_CLONE = 'EXTERNAL_SHALLOW_CLONE'
4800
+ FOREIGN = 'FOREIGN'
4723
4801
  MANAGED = 'MANAGED'
4802
+ MANAGED_SHALLOW_CLONE = 'MANAGED_SHALLOW_CLONE'
4724
4803
  MATERIALIZED_VIEW = 'MATERIALIZED_VIEW'
4725
4804
  STREAMING_TABLE = 'STREAMING_TABLE'
4726
4805
  VIEW = 'VIEW'
@@ -4788,6 +4867,13 @@ class UpdateAssignmentResponse:
4788
4867
  return cls()
4789
4868
 
4790
4869
 
4870
+ class UpdateBindingsSecurableType(Enum):
4871
+
4872
+ CATALOG = 'catalog'
4873
+ EXTERNAL_LOCATION = 'external_location'
4874
+ STORAGE_CREDENTIAL = 'storage_credential'
4875
+
4876
+
4791
4877
  @dataclass
4792
4878
  class UpdateCatalog:
4793
4879
  comment: Optional[str] = None
@@ -4796,7 +4882,7 @@ class UpdateCatalog:
4796
4882
  enable_predictive_optimization: Optional[EnablePredictiveOptimization] = None
4797
4883
  """Whether predictive optimization should be enabled for this object and objects under it."""
4798
4884
 
4799
- isolation_mode: Optional[IsolationMode] = None
4885
+ isolation_mode: Optional[CatalogIsolationMode] = None
4800
4886
  """Whether the current securable is accessible from all workspaces or a specific set of workspaces."""
4801
4887
 
4802
4888
  name: Optional[str] = None
@@ -4830,7 +4916,7 @@ class UpdateCatalog:
4830
4916
  return cls(comment=d.get('comment', None),
4831
4917
  enable_predictive_optimization=_enum(d, 'enable_predictive_optimization',
4832
4918
  EnablePredictiveOptimization),
4833
- isolation_mode=_enum(d, 'isolation_mode', IsolationMode),
4919
+ isolation_mode=_enum(d, 'isolation_mode', CatalogIsolationMode),
4834
4920
  name=d.get('name', None),
4835
4921
  new_name=d.get('new_name', None),
4836
4922
  owner=d.get('owner', None),
@@ -4886,6 +4972,9 @@ class UpdateExternalLocation:
4886
4972
  force: Optional[bool] = None
4887
4973
  """Force update even if changing url invalidates dependent external tables or mounts."""
4888
4974
 
4975
+ isolation_mode: Optional[IsolationMode] = None
4976
+ """Whether the current securable is accessible from all workspaces or a specific set of workspaces."""
4977
+
4889
4978
  name: Optional[str] = None
4890
4979
  """Name of the external location."""
4891
4980
 
@@ -4912,6 +5001,7 @@ class UpdateExternalLocation:
4912
5001
  if self.credential_name is not None: body['credential_name'] = self.credential_name
4913
5002
  if self.encryption_details: body['encryption_details'] = self.encryption_details.as_dict()
4914
5003
  if self.force is not None: body['force'] = self.force
5004
+ if self.isolation_mode is not None: body['isolation_mode'] = self.isolation_mode.value
4915
5005
  if self.name is not None: body['name'] = self.name
4916
5006
  if self.new_name is not None: body['new_name'] = self.new_name
4917
5007
  if self.owner is not None: body['owner'] = self.owner
@@ -4928,6 +5018,7 @@ class UpdateExternalLocation:
4928
5018
  credential_name=d.get('credential_name', None),
4929
5019
  encryption_details=_from_dict(d, 'encryption_details', EncryptionDetails),
4930
5020
  force=d.get('force', None),
5021
+ isolation_mode=_enum(d, 'isolation_mode', IsolationMode),
4931
5022
  name=d.get('name', None),
4932
5023
  new_name=d.get('new_name', None),
4933
5024
  owner=d.get('owner', None),
@@ -5293,11 +5384,14 @@ class UpdateStorageCredential:
5293
5384
  """Comment associated with the credential."""
5294
5385
 
5295
5386
  databricks_gcp_service_account: Optional[DatabricksGcpServiceAccountRequest] = None
5296
- """The <Databricks> managed GCP service account configuration."""
5387
+ """The Databricks managed GCP service account configuration."""
5297
5388
 
5298
5389
  force: Optional[bool] = None
5299
5390
  """Force update even if there are dependent external locations or external tables."""
5300
5391
 
5392
+ isolation_mode: Optional[IsolationMode] = None
5393
+ """Whether the current securable is accessible from all workspaces or a specific set of workspaces."""
5394
+
5301
5395
  name: Optional[str] = None
5302
5396
  """Name of the storage credential."""
5303
5397
 
@@ -5325,6 +5419,7 @@ class UpdateStorageCredential:
5325
5419
  if self.databricks_gcp_service_account:
5326
5420
  body['databricks_gcp_service_account'] = self.databricks_gcp_service_account.as_dict()
5327
5421
  if self.force is not None: body['force'] = self.force
5422
+ if self.isolation_mode is not None: body['isolation_mode'] = self.isolation_mode.value
5328
5423
  if self.name is not None: body['name'] = self.name
5329
5424
  if self.new_name is not None: body['new_name'] = self.new_name
5330
5425
  if self.owner is not None: body['owner'] = self.owner
@@ -5344,6 +5439,7 @@ class UpdateStorageCredential:
5344
5439
  databricks_gcp_service_account=_from_dict(d, 'databricks_gcp_service_account',
5345
5440
  DatabricksGcpServiceAccountRequest),
5346
5441
  force=d.get('force', None),
5442
+ isolation_mode=_enum(d, 'isolation_mode', IsolationMode),
5347
5443
  name=d.get('name', None),
5348
5444
  new_name=d.get('new_name', None),
5349
5445
  owner=d.get('owner', None),
@@ -5421,8 +5517,8 @@ class UpdateWorkspaceBindingsParameters:
5421
5517
  securable_name: Optional[str] = None
5422
5518
  """The name of the securable."""
5423
5519
 
5424
- securable_type: Optional[str] = None
5425
- """The type of the securable."""
5520
+ securable_type: Optional[UpdateBindingsSecurableType] = None
5521
+ """The type of the securable to bind to a workspace."""
5426
5522
 
5427
5523
  def as_dict(self) -> dict:
5428
5524
  """Serializes the UpdateWorkspaceBindingsParameters into a dictionary suitable for use as a JSON request body."""
@@ -5430,7 +5526,7 @@ class UpdateWorkspaceBindingsParameters:
5430
5526
  if self.add: body['add'] = [v.as_dict() for v in self.add]
5431
5527
  if self.remove: body['remove'] = [v.as_dict() for v in self.remove]
5432
5528
  if self.securable_name is not None: body['securable_name'] = self.securable_name
5433
- if self.securable_type is not None: body['securable_type'] = self.securable_type
5529
+ if self.securable_type is not None: body['securable_type'] = self.securable_type.value
5434
5530
  return body
5435
5531
 
5436
5532
  @classmethod
@@ -5439,7 +5535,7 @@ class UpdateWorkspaceBindingsParameters:
5439
5535
  return cls(add=_repeated_dict(d, 'add', WorkspaceBinding),
5440
5536
  remove=_repeated_dict(d, 'remove', WorkspaceBinding),
5441
5537
  securable_name=d.get('securable_name', None),
5442
- securable_type=d.get('securable_type', None))
5538
+ securable_type=_enum(d, 'securable_type', UpdateBindingsSecurableType))
5443
5539
 
5444
5540
 
5445
5541
  @dataclass
@@ -5705,16 +5801,22 @@ class WorkspaceBindingsResponse:
5705
5801
  bindings: Optional[List[WorkspaceBinding]] = None
5706
5802
  """List of workspace bindings"""
5707
5803
 
5804
+ next_page_token: Optional[str] = None
5805
+ """Opaque token to retrieve the next page of results. Absent if there are no more pages.
5806
+ __page_token__ should be set to this value for the next request (for the next page of results)."""
5807
+
5708
5808
  def as_dict(self) -> dict:
5709
5809
  """Serializes the WorkspaceBindingsResponse into a dictionary suitable for use as a JSON request body."""
5710
5810
  body = {}
5711
5811
  if self.bindings: body['bindings'] = [v.as_dict() for v in self.bindings]
5812
+ if self.next_page_token is not None: body['next_page_token'] = self.next_page_token
5712
5813
  return body
5713
5814
 
5714
5815
  @classmethod
5715
5816
  def from_dict(cls, d: Dict[str, any]) -> WorkspaceBindingsResponse:
5716
5817
  """Deserializes the WorkspaceBindingsResponse from a dictionary."""
5717
- return cls(bindings=_repeated_dict(d, 'bindings', WorkspaceBinding))
5818
+ return cls(bindings=_repeated_dict(d, 'bindings', WorkspaceBinding),
5819
+ next_page_token=d.get('next_page_token', None))
5718
5820
 
5719
5821
 
5720
5822
  class AccountMetastoreAssignmentsAPI:
@@ -6041,11 +6143,12 @@ class AccountStorageCredentialsAPI:
6041
6143
 
6042
6144
  headers = {'Accept': 'application/json', }
6043
6145
 
6044
- res = self._api.do(
6146
+ json = self._api.do(
6045
6147
  'GET',
6046
6148
  f'/api/2.0/accounts/{self._api.account_id}/metastores/{metastore_id}/storage-credentials',
6047
6149
  headers=headers)
6048
- return [StorageCredentialInfo.from_dict(v) for v in res]
6150
+ parsed = ListAccountStorageCredentialsResponse.from_dict(json).storage_credentials
6151
+ return parsed if parsed is not None else []
6049
6152
 
6050
6153
  def update(self,
6051
6154
  metastore_id: str,
@@ -6232,7 +6335,11 @@ class CatalogsAPI:
6232
6335
  res = self._api.do('GET', f'/api/2.1/unity-catalog/catalogs/{name}', query=query, headers=headers)
6233
6336
  return CatalogInfo.from_dict(res)
6234
6337
 
6235
- def list(self, *, include_browse: Optional[bool] = None) -> Iterator[CatalogInfo]:
6338
+ def list(self,
6339
+ *,
6340
+ include_browse: Optional[bool] = None,
6341
+ max_results: Optional[int] = None,
6342
+ page_token: Optional[str] = None) -> Iterator[CatalogInfo]:
6236
6343
  """List catalogs.
6237
6344
 
6238
6345
  Gets an array of catalogs in the metastore. If the caller is the metastore admin, all catalogs will be
@@ -6243,24 +6350,41 @@ class CatalogsAPI:
6243
6350
  :param include_browse: bool (optional)
6244
6351
  Whether to include catalogs in the response for which the principal can only access selective
6245
6352
  metadata for
6353
+ :param max_results: int (optional)
6354
+ Maximum number of catalogs to return. - when set to 0, the page length is set to a server configured
6355
+ value (recommended); - when set to a value greater than 0, the page length is the minimum of this
6356
+ value and a server configured value; - when set to a value less than 0, an invalid parameter error
6357
+ is returned; - If not set, all valid catalogs are returned (not recommended). - Note: The number of
6358
+ returned catalogs might be less than the specified max_results size, even zero. The only definitive
6359
+ indication that no further catalogs can be fetched is when the next_page_token is unset from the
6360
+ response.
6361
+ :param page_token: str (optional)
6362
+ Opaque pagination token to go to next page based on previous query.
6246
6363
 
6247
6364
  :returns: Iterator over :class:`CatalogInfo`
6248
6365
  """
6249
6366
 
6250
6367
  query = {}
6251
6368
  if include_browse is not None: query['include_browse'] = include_browse
6369
+ if max_results is not None: query['max_results'] = max_results
6370
+ if page_token is not None: query['page_token'] = page_token
6252
6371
  headers = {'Accept': 'application/json', }
6253
6372
 
6254
- json = self._api.do('GET', '/api/2.1/unity-catalog/catalogs', query=query, headers=headers)
6255
- parsed = ListCatalogsResponse.from_dict(json).catalogs
6256
- return parsed if parsed is not None else []
6373
+ while True:
6374
+ json = self._api.do('GET', '/api/2.1/unity-catalog/catalogs', query=query, headers=headers)
6375
+ if 'catalogs' in json:
6376
+ for v in json['catalogs']:
6377
+ yield CatalogInfo.from_dict(v)
6378
+ if 'next_page_token' not in json or not json['next_page_token']:
6379
+ return
6380
+ query['page_token'] = json['next_page_token']
6257
6381
 
6258
6382
  def update(self,
6259
6383
  name: str,
6260
6384
  *,
6261
6385
  comment: Optional[str] = None,
6262
6386
  enable_predictive_optimization: Optional[EnablePredictiveOptimization] = None,
6263
- isolation_mode: Optional[IsolationMode] = None,
6387
+ isolation_mode: Optional[CatalogIsolationMode] = None,
6264
6388
  new_name: Optional[str] = None,
6265
6389
  owner: Optional[str] = None,
6266
6390
  properties: Optional[Dict[str, str]] = None) -> CatalogInfo:
@@ -6275,7 +6399,7 @@ class CatalogsAPI:
6275
6399
  User-provided free-form text description.
6276
6400
  :param enable_predictive_optimization: :class:`EnablePredictiveOptimization` (optional)
6277
6401
  Whether predictive optimization should be enabled for this object and objects under it.
6278
- :param isolation_mode: :class:`IsolationMode` (optional)
6402
+ :param isolation_mode: :class:`CatalogIsolationMode` (optional)
6279
6403
  Whether the current securable is accessible from all workspaces or a specific set of workspaces.
6280
6404
  :param new_name: str (optional)
6281
6405
  New name for the catalog.
@@ -6613,6 +6737,7 @@ class ExternalLocationsAPI:
6613
6737
  credential_name: Optional[str] = None,
6614
6738
  encryption_details: Optional[EncryptionDetails] = None,
6615
6739
  force: Optional[bool] = None,
6740
+ isolation_mode: Optional[IsolationMode] = None,
6616
6741
  new_name: Optional[str] = None,
6617
6742
  owner: Optional[str] = None,
6618
6743
  read_only: Optional[bool] = None,
@@ -6636,6 +6761,8 @@ class ExternalLocationsAPI:
6636
6761
  Encryption options that apply to clients connecting to cloud storage.
6637
6762
  :param force: bool (optional)
6638
6763
  Force update even if changing url invalidates dependent external tables or mounts.
6764
+ :param isolation_mode: :class:`IsolationMode` (optional)
6765
+ Whether the current securable is accessible from all workspaces or a specific set of workspaces.
6639
6766
  :param new_name: str (optional)
6640
6767
  New name for the external location.
6641
6768
  :param owner: str (optional)
@@ -6655,6 +6782,7 @@ class ExternalLocationsAPI:
6655
6782
  if credential_name is not None: body['credential_name'] = credential_name
6656
6783
  if encryption_details is not None: body['encryption_details'] = encryption_details.as_dict()
6657
6784
  if force is not None: body['force'] = force
6785
+ if isolation_mode is not None: body['isolation_mode'] = isolation_mode.value
6658
6786
  if new_name is not None: body['new_name'] = new_name
6659
6787
  if owner is not None: body['owner'] = owner
6660
6788
  if read_only is not None: body['read_only'] = read_only
@@ -6682,6 +6810,8 @@ class FunctionsAPI:
6682
6810
  def create(self, function_info: CreateFunction) -> FunctionInfo:
6683
6811
  """Create a function.
6684
6812
 
6813
+ **WARNING: This API is experimental and will change in future versions**
6814
+
6685
6815
  Creates a new function
6686
6816
 
6687
6817
  The user must have the following permissions in order for the function to be created: -
@@ -6986,8 +7116,9 @@ class MetastoresAPI:
6986
7116
  :param name: str
6987
7117
  The user-specified name of the metastore.
6988
7118
  :param region: str (optional)
6989
- Cloud region which the metastore serves (e.g., `us-west-2`, `westus`). If this field is omitted, the
6990
- region of the workspace receiving the request will be used.
7119
+ Cloud region which the metastore serves (e.g., `us-west-2`, `westus`). The field can be omitted in
7120
+ the __workspace-level__ __API__ but not in the __account-level__ __API__. If this field is omitted,
7121
+ the region of the workspace receiving the request will be used.
6991
7122
  :param storage_root: str (optional)
6992
7123
  The storage root URL for metastore
6993
7124
 
@@ -7225,7 +7356,8 @@ class ModelVersionsAPI:
7225
7356
  full_name: str,
7226
7357
  version: int,
7227
7358
  *,
7228
- include_browse: Optional[bool] = None) -> RegisteredModelInfo:
7359
+ include_aliases: Optional[bool] = None,
7360
+ include_browse: Optional[bool] = None) -> ModelVersionInfo:
7229
7361
  """Get a Model Version.
7230
7362
 
7231
7363
  Get a model version.
@@ -7238,14 +7370,17 @@ class ModelVersionsAPI:
7238
7370
  The three-level (fully qualified) name of the model version
7239
7371
  :param version: int
7240
7372
  The integer version number of the model version
7373
+ :param include_aliases: bool (optional)
7374
+ Whether to include aliases associated with the model version in the response
7241
7375
  :param include_browse: bool (optional)
7242
7376
  Whether to include model versions in the response for which the principal can only access selective
7243
7377
  metadata for
7244
7378
 
7245
- :returns: :class:`RegisteredModelInfo`
7379
+ :returns: :class:`ModelVersionInfo`
7246
7380
  """
7247
7381
 
7248
7382
  query = {}
7383
+ if include_aliases is not None: query['include_aliases'] = include_aliases
7249
7384
  if include_browse is not None: query['include_browse'] = include_browse
7250
7385
  headers = {'Accept': 'application/json', }
7251
7386
 
@@ -7253,9 +7388,13 @@ class ModelVersionsAPI:
7253
7388
  f'/api/2.1/unity-catalog/models/{full_name}/versions/{version}',
7254
7389
  query=query,
7255
7390
  headers=headers)
7256
- return RegisteredModelInfo.from_dict(res)
7391
+ return ModelVersionInfo.from_dict(res)
7257
7392
 
7258
- def get_by_alias(self, full_name: str, alias: str) -> ModelVersionInfo:
7393
+ def get_by_alias(self,
7394
+ full_name: str,
7395
+ alias: str,
7396
+ *,
7397
+ include_aliases: Optional[bool] = None) -> ModelVersionInfo:
7259
7398
  """Get Model Version By Alias.
7260
7399
 
7261
7400
  Get a model version by alias.
@@ -7268,14 +7407,19 @@ class ModelVersionsAPI:
7268
7407
  The three-level (fully qualified) name of the registered model
7269
7408
  :param alias: str
7270
7409
  The name of the alias
7410
+ :param include_aliases: bool (optional)
7411
+ Whether to include aliases associated with the model version in the response
7271
7412
 
7272
7413
  :returns: :class:`ModelVersionInfo`
7273
7414
  """
7274
7415
 
7416
+ query = {}
7417
+ if include_aliases is not None: query['include_aliases'] = include_aliases
7275
7418
  headers = {'Accept': 'application/json', }
7276
7419
 
7277
7420
  res = self._api.do('GET',
7278
7421
  f'/api/2.1/unity-catalog/models/{full_name}/aliases/{alias}',
7422
+ query=query,
7279
7423
  headers=headers)
7280
7424
  return ModelVersionInfo.from_dict(res)
7281
7425
 
@@ -7871,7 +8015,11 @@ class RegisteredModelsAPI:
7871
8015
 
7872
8016
  self._api.do('DELETE', f'/api/2.1/unity-catalog/models/{full_name}/aliases/{alias}', headers=headers)
7873
8017
 
7874
- def get(self, full_name: str, *, include_browse: Optional[bool] = None) -> RegisteredModelInfo:
8018
+ def get(self,
8019
+ full_name: str,
8020
+ *,
8021
+ include_aliases: Optional[bool] = None,
8022
+ include_browse: Optional[bool] = None) -> RegisteredModelInfo:
7875
8023
  """Get a Registered Model.
7876
8024
 
7877
8025
  Get a registered model.
@@ -7882,6 +8030,8 @@ class RegisteredModelsAPI:
7882
8030
 
7883
8031
  :param full_name: str
7884
8032
  The three-level (fully qualified) name of the registered model
8033
+ :param include_aliases: bool (optional)
8034
+ Whether to include registered model aliases in the response
7885
8035
  :param include_browse: bool (optional)
7886
8036
  Whether to include registered models in the response for which the principal can only access
7887
8037
  selective metadata for
@@ -7890,6 +8040,7 @@ class RegisteredModelsAPI:
7890
8040
  """
7891
8041
 
7892
8042
  query = {}
8043
+ if include_aliases is not None: query['include_aliases'] = include_aliases
7893
8044
  if include_browse is not None: query['include_browse'] = include_browse
7894
8045
  headers = {'Accept': 'application/json', }
7895
8046
 
@@ -8072,7 +8223,7 @@ class SchemasAPI:
8072
8223
  res = self._api.do('POST', '/api/2.1/unity-catalog/schemas', body=body, headers=headers)
8073
8224
  return SchemaInfo.from_dict(res)
8074
8225
 
8075
- def delete(self, full_name: str):
8226
+ def delete(self, full_name: str, *, force: Optional[bool] = None):
8076
8227
  """Delete a schema.
8077
8228
 
8078
8229
  Deletes the specified schema from the parent catalog. The caller must be the owner of the schema or an
@@ -8080,13 +8231,17 @@ class SchemasAPI:
8080
8231
 
8081
8232
  :param full_name: str
8082
8233
  Full name of the schema.
8234
+ :param force: bool (optional)
8235
+ Force deletion even if the schema is not empty.
8083
8236
 
8084
8237
 
8085
8238
  """
8086
8239
 
8240
+ query = {}
8241
+ if force is not None: query['force'] = force
8087
8242
  headers = {'Accept': 'application/json', }
8088
8243
 
8089
- self._api.do('DELETE', f'/api/2.1/unity-catalog/schemas/{full_name}', headers=headers)
8244
+ self._api.do('DELETE', f'/api/2.1/unity-catalog/schemas/{full_name}', query=query, headers=headers)
8090
8245
 
8091
8246
  def get(self, full_name: str, *, include_browse: Optional[bool] = None) -> SchemaInfo:
8092
8247
  """Get a schema.
@@ -8241,7 +8396,7 @@ class StorageCredentialsAPI:
8241
8396
  :param comment: str (optional)
8242
8397
  Comment associated with the credential.
8243
8398
  :param databricks_gcp_service_account: :class:`DatabricksGcpServiceAccountRequest` (optional)
8244
- The <Databricks> managed GCP service account configuration.
8399
+ The Databricks managed GCP service account configuration.
8245
8400
  :param read_only: bool (optional)
8246
8401
  Whether the storage credential is only usable for read operations.
8247
8402
  :param skip_validation: bool (optional)
@@ -8357,6 +8512,7 @@ class StorageCredentialsAPI:
8357
8512
  comment: Optional[str] = None,
8358
8513
  databricks_gcp_service_account: Optional[DatabricksGcpServiceAccountRequest] = None,
8359
8514
  force: Optional[bool] = None,
8515
+ isolation_mode: Optional[IsolationMode] = None,
8360
8516
  new_name: Optional[str] = None,
8361
8517
  owner: Optional[str] = None,
8362
8518
  read_only: Optional[bool] = None,
@@ -8378,9 +8534,11 @@ class StorageCredentialsAPI:
8378
8534
  :param comment: str (optional)
8379
8535
  Comment associated with the credential.
8380
8536
  :param databricks_gcp_service_account: :class:`DatabricksGcpServiceAccountRequest` (optional)
8381
- The <Databricks> managed GCP service account configuration.
8537
+ The Databricks managed GCP service account configuration.
8382
8538
  :param force: bool (optional)
8383
8539
  Force update even if there are dependent external locations or external tables.
8540
+ :param isolation_mode: :class:`IsolationMode` (optional)
8541
+ Whether the current securable is accessible from all workspaces or a specific set of workspaces.
8384
8542
  :param new_name: str (optional)
8385
8543
  New name for the storage credential.
8386
8544
  :param owner: str (optional)
@@ -8403,6 +8561,7 @@ class StorageCredentialsAPI:
8403
8561
  if databricks_gcp_service_account is not None:
8404
8562
  body['databricks_gcp_service_account'] = databricks_gcp_service_account.as_dict()
8405
8563
  if force is not None: body['force'] = force
8564
+ if isolation_mode is not None: body['isolation_mode'] = isolation_mode.value
8406
8565
  if new_name is not None: body['new_name'] = new_name
8407
8566
  if owner is not None: body['owner'] = owner
8408
8567
  if read_only is not None: body['read_only'] = read_only
@@ -8528,7 +8687,11 @@ class SystemSchemasAPI:
8528
8687
  f'/api/2.1/unity-catalog/metastores/{metastore_id}/systemschemas/{schema_name}',
8529
8688
  headers=headers)
8530
8689
 
8531
- def list(self, metastore_id: str) -> Iterator[SystemSchemaInfo]:
8690
+ def list(self,
8691
+ metastore_id: str,
8692
+ *,
8693
+ max_results: Optional[int] = None,
8694
+ page_token: Optional[str] = None) -> Iterator[SystemSchemaInfo]:
8532
8695
  """List system schemas.
8533
8696
 
8534
8697
  Gets an array of system schemas for a metastore. The caller must be an account admin or a metastore
@@ -8536,17 +8699,33 @@ class SystemSchemasAPI:
8536
8699
 
8537
8700
  :param metastore_id: str
8538
8701
  The ID for the metastore in which the system schema resides.
8702
+ :param max_results: int (optional)
8703
+ Maximum number of schemas to return. - When set to 0, the page length is set to a server configured
8704
+ value (recommended); - When set to a value greater than 0, the page length is the minimum of this
8705
+ value and a server configured value; - When set to a value less than 0, an invalid parameter error
8706
+ is returned; - If not set, all the schemas are returned (not recommended).
8707
+ :param page_token: str (optional)
8708
+ Opaque pagination token to go to next page based on previous query.
8539
8709
 
8540
8710
  :returns: Iterator over :class:`SystemSchemaInfo`
8541
8711
  """
8542
8712
 
8713
+ query = {}
8714
+ if max_results is not None: query['max_results'] = max_results
8715
+ if page_token is not None: query['page_token'] = page_token
8543
8716
  headers = {'Accept': 'application/json', }
8544
8717
 
8545
- json = self._api.do('GET',
8546
- f'/api/2.1/unity-catalog/metastores/{metastore_id}/systemschemas',
8547
- headers=headers)
8548
- parsed = ListSystemSchemasResponse.from_dict(json).schemas
8549
- return parsed if parsed is not None else []
8718
+ while True:
8719
+ json = self._api.do('GET',
8720
+ f'/api/2.1/unity-catalog/metastores/{metastore_id}/systemschemas',
8721
+ query=query,
8722
+ headers=headers)
8723
+ if 'schemas' in json:
8724
+ for v in json['schemas']:
8725
+ yield SystemSchemaInfo.from_dict(v)
8726
+ if 'next_page_token' not in json or not json['next_page_token']:
8727
+ return
8728
+ query['page_token'] = json['next_page_token']
8550
8729
 
8551
8730
 
8552
8731
  class TableConstraintsAPI:
@@ -9068,7 +9247,7 @@ class WorkspaceBindingsAPI:
9068
9247
  the new path (/api/2.1/unity-catalog/bindings/{securable_type}/{securable_name}) which introduces the
9069
9248
  ability to bind a securable in READ_ONLY mode (catalogs only).
9070
9249
 
9071
- Securables that support binding: - catalog"""
9250
+ Securable types that support binding: - catalog - storage_credential - external_location"""
9072
9251
 
9073
9252
  def __init__(self, api_client):
9074
9253
  self._api = api_client
@@ -9092,26 +9271,48 @@ class WorkspaceBindingsAPI:
9092
9271
  headers=headers)
9093
9272
  return CurrentWorkspaceBindings.from_dict(res)
9094
9273
 
9095
- def get_bindings(self, securable_type: str, securable_name: str) -> WorkspaceBindingsResponse:
9274
+ def get_bindings(self,
9275
+ securable_type: GetBindingsSecurableType,
9276
+ securable_name: str,
9277
+ *,
9278
+ max_results: Optional[int] = None,
9279
+ page_token: Optional[str] = None) -> Iterator[WorkspaceBinding]:
9096
9280
  """Get securable workspace bindings.
9097
9281
 
9098
9282
  Gets workspace bindings of the securable. The caller must be a metastore admin or an owner of the
9099
9283
  securable.
9100
9284
 
9101
- :param securable_type: str
9102
- The type of the securable.
9285
+ :param securable_type: :class:`GetBindingsSecurableType`
9286
+ The type of the securable to bind to a workspace.
9103
9287
  :param securable_name: str
9104
9288
  The name of the securable.
9289
+ :param max_results: int (optional)
9290
+ Maximum number of workspace bindings to return. - When set to 0, the page length is set to a server
9291
+ configured value (recommended); - When set to a value greater than 0, the page length is the minimum
9292
+ of this value and a server configured value; - When set to a value less than 0, an invalid parameter
9293
+ error is returned; - If not set, all the workspace bindings are returned (not recommended).
9294
+ :param page_token: str (optional)
9295
+ Opaque pagination token to go to next page based on previous query.
9105
9296
 
9106
- :returns: :class:`WorkspaceBindingsResponse`
9297
+ :returns: Iterator over :class:`WorkspaceBinding`
9107
9298
  """
9108
9299
 
9300
+ query = {}
9301
+ if max_results is not None: query['max_results'] = max_results
9302
+ if page_token is not None: query['page_token'] = page_token
9109
9303
  headers = {'Accept': 'application/json', }
9110
9304
 
9111
- res = self._api.do('GET',
9112
- f'/api/2.1/unity-catalog/bindings/{securable_type}/{securable_name}',
9113
- headers=headers)
9114
- return WorkspaceBindingsResponse.from_dict(res)
9305
+ while True:
9306
+ json = self._api.do('GET',
9307
+ f'/api/2.1/unity-catalog/bindings/{securable_type.value}/{securable_name}',
9308
+ query=query,
9309
+ headers=headers)
9310
+ if 'bindings' in json:
9311
+ for v in json['bindings']:
9312
+ yield WorkspaceBinding.from_dict(v)
9313
+ if 'next_page_token' not in json or not json['next_page_token']:
9314
+ return
9315
+ query['page_token'] = json['next_page_token']
9115
9316
 
9116
9317
  def update(self,
9117
9318
  name: str,
@@ -9144,7 +9345,7 @@ class WorkspaceBindingsAPI:
9144
9345
  return CurrentWorkspaceBindings.from_dict(res)
9145
9346
 
9146
9347
  def update_bindings(self,
9147
- securable_type: str,
9348
+ securable_type: UpdateBindingsSecurableType,
9148
9349
  securable_name: str,
9149
9350
  *,
9150
9351
  add: Optional[List[WorkspaceBinding]] = None,
@@ -9154,8 +9355,8 @@ class WorkspaceBindingsAPI:
9154
9355
  Updates workspace bindings of the securable. The caller must be a metastore admin or an owner of the
9155
9356
  securable.
9156
9357
 
9157
- :param securable_type: str
9158
- The type of the securable.
9358
+ :param securable_type: :class:`UpdateBindingsSecurableType`
9359
+ The type of the securable to bind to a workspace.
9159
9360
  :param securable_name: str
9160
9361
  The name of the securable.
9161
9362
  :param add: List[:class:`WorkspaceBinding`] (optional)
@@ -9171,7 +9372,7 @@ class WorkspaceBindingsAPI:
9171
9372
  headers = {'Accept': 'application/json', 'Content-Type': 'application/json', }
9172
9373
 
9173
9374
  res = self._api.do('PATCH',
9174
- f'/api/2.1/unity-catalog/bindings/{securable_type}/{securable_name}',
9375
+ f'/api/2.1/unity-catalog/bindings/{securable_type.value}/{securable_name}',
9175
9376
  body=body,
9176
9377
  headers=headers)
9177
9378
  return WorkspaceBindingsResponse.from_dict(res)