databricks-sdk 0.0.7__py3-none-any.whl → 0.1.1__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 (41) hide show
  1. databricks/sdk/__init__.py +121 -104
  2. databricks/sdk/core.py +76 -16
  3. databricks/sdk/dbutils.py +18 -17
  4. databricks/sdk/mixins/compute.py +6 -6
  5. databricks/sdk/mixins/dbfs.py +6 -6
  6. databricks/sdk/oauth.py +28 -14
  7. databricks/sdk/service/{unitycatalog.py → catalog.py} +375 -1146
  8. databricks/sdk/service/{clusters.py → compute.py} +2176 -61
  9. databricks/sdk/service/{dbfs.py → files.py} +6 -6
  10. databricks/sdk/service/{scim.py → iam.py} +567 -27
  11. databricks/sdk/service/jobs.py +44 -34
  12. databricks/sdk/service/{mlflow.py → ml.py} +976 -1071
  13. databricks/sdk/service/oauth2.py +3 -3
  14. databricks/sdk/service/pipelines.py +46 -30
  15. databricks/sdk/service/{deployment.py → provisioning.py} +47 -29
  16. databricks/sdk/service/settings.py +849 -0
  17. databricks/sdk/service/sharing.py +1176 -0
  18. databricks/sdk/service/sql.py +15 -15
  19. databricks/sdk/service/workspace.py +917 -22
  20. databricks/sdk/version.py +1 -1
  21. {databricks_sdk-0.0.7.dist-info → databricks_sdk-0.1.1.dist-info}/METADATA +3 -1
  22. databricks_sdk-0.1.1.dist-info/RECORD +37 -0
  23. databricks/sdk/service/clusterpolicies.py +0 -399
  24. databricks/sdk/service/commands.py +0 -478
  25. databricks/sdk/service/gitcredentials.py +0 -202
  26. databricks/sdk/service/globalinitscripts.py +0 -262
  27. databricks/sdk/service/instancepools.py +0 -757
  28. databricks/sdk/service/ipaccesslists.py +0 -340
  29. databricks/sdk/service/libraries.py +0 -282
  30. databricks/sdk/service/permissions.py +0 -470
  31. databricks/sdk/service/repos.py +0 -250
  32. databricks/sdk/service/secrets.py +0 -472
  33. databricks/sdk/service/tokenmanagement.py +0 -182
  34. databricks/sdk/service/tokens.py +0 -137
  35. databricks/sdk/service/workspaceconf.py +0 -50
  36. databricks_sdk-0.0.7.dist-info/RECORD +0 -48
  37. /databricks/sdk/service/{endpoints.py → serving.py} +0 -0
  38. {databricks_sdk-0.0.7.dist-info → databricks_sdk-0.1.1.dist-info}/LICENSE +0 -0
  39. {databricks_sdk-0.0.7.dist-info → databricks_sdk-0.1.1.dist-info}/NOTICE +0 -0
  40. {databricks_sdk-0.0.7.dist-info → databricks_sdk-0.1.1.dist-info}/WHEEL +0 -0
  41. {databricks_sdk-0.0.7.dist-info → databricks_sdk-0.1.1.dist-info}/top_level.txt +0 -0
@@ -12,13 +12,6 @@ _LOG = logging.getLogger('databricks.sdk')
12
12
  # all definitions in this file are in alphabetical order
13
13
 
14
14
 
15
- class AuthenticationType(Enum):
16
- """The delta sharing authentication type."""
17
-
18
- DATABRICKS = 'DATABRICKS'
19
- TOKEN = 'TOKEN'
20
-
21
-
22
15
  @dataclass
23
16
  class AwsIamRole:
24
17
  role_arn: str
@@ -421,65 +414,6 @@ class CreateMetastoreAssignment:
421
414
  workspace_id=d.get('workspace_id', None))
422
415
 
423
416
 
424
- @dataclass
425
- class CreateProvider:
426
- name: str
427
- authentication_type: 'AuthenticationType'
428
- comment: str = None
429
- recipient_profile_str: str = None
430
-
431
- def as_dict(self) -> dict:
432
- body = {}
433
- if self.authentication_type: body['authentication_type'] = self.authentication_type.value
434
- if self.comment: body['comment'] = self.comment
435
- if self.name: body['name'] = self.name
436
- if self.recipient_profile_str: body['recipient_profile_str'] = self.recipient_profile_str
437
- return body
438
-
439
- @classmethod
440
- def from_dict(cls, d: Dict[str, any]) -> 'CreateProvider':
441
- return cls(authentication_type=_enum(d, 'authentication_type', AuthenticationType),
442
- comment=d.get('comment', None),
443
- name=d.get('name', None),
444
- recipient_profile_str=d.get('recipient_profile_str', None))
445
-
446
-
447
- @dataclass
448
- class CreateRecipient:
449
- name: str
450
- authentication_type: 'AuthenticationType'
451
- comment: str = None
452
- data_recipient_global_metastore_id: Any = None
453
- ip_access_list: 'IpAccessList' = None
454
- owner: str = None
455
- properties_kvpairs: Any = None
456
- sharing_code: str = None
457
-
458
- def as_dict(self) -> dict:
459
- body = {}
460
- if self.authentication_type: body['authentication_type'] = self.authentication_type.value
461
- if self.comment: body['comment'] = self.comment
462
- if self.data_recipient_global_metastore_id:
463
- body['data_recipient_global_metastore_id'] = self.data_recipient_global_metastore_id
464
- if self.ip_access_list: body['ip_access_list'] = self.ip_access_list.as_dict()
465
- if self.name: body['name'] = self.name
466
- if self.owner: body['owner'] = self.owner
467
- if self.properties_kvpairs: body['properties_kvpairs'] = self.properties_kvpairs
468
- if self.sharing_code: body['sharing_code'] = self.sharing_code
469
- return body
470
-
471
- @classmethod
472
- def from_dict(cls, d: Dict[str, any]) -> 'CreateRecipient':
473
- return cls(authentication_type=_enum(d, 'authentication_type', AuthenticationType),
474
- comment=d.get('comment', None),
475
- data_recipient_global_metastore_id=d.get('data_recipient_global_metastore_id', None),
476
- ip_access_list=_from_dict(d, 'ip_access_list', IpAccessList),
477
- name=d.get('name', None),
478
- owner=d.get('owner', None),
479
- properties_kvpairs=d.get('properties_kvpairs', None),
480
- sharing_code=d.get('sharing_code', None))
481
-
482
-
483
417
  @dataclass
484
418
  class CreateSchema:
485
419
  name: str
@@ -506,22 +440,6 @@ class CreateSchema:
506
440
  storage_root=d.get('storage_root', None))
507
441
 
508
442
 
509
- @dataclass
510
- class CreateShare:
511
- name: str
512
- comment: str = None
513
-
514
- def as_dict(self) -> dict:
515
- body = {}
516
- if self.comment: body['comment'] = self.comment
517
- if self.name: body['name'] = self.name
518
- return body
519
-
520
- @classmethod
521
- def from_dict(cls, d: Dict[str, any]) -> 'CreateShare':
522
- return cls(comment=d.get('comment', None), name=d.get('name', None))
523
-
524
-
525
443
  @dataclass
526
444
  class CreateStorageCredential:
527
445
  name: str
@@ -576,6 +494,35 @@ class CreateTableConstraint:
576
494
  full_name_arg=d.get('full_name_arg', None))
577
495
 
578
496
 
497
+ @dataclass
498
+ class CreateVolumeRequestContent:
499
+ catalog_name: str
500
+ name: str
501
+ schema_name: str
502
+ volume_type: 'VolumeType'
503
+ comment: str = None
504
+ storage_location: str = None
505
+
506
+ def as_dict(self) -> dict:
507
+ body = {}
508
+ if self.catalog_name: body['catalog_name'] = self.catalog_name
509
+ if self.comment: body['comment'] = self.comment
510
+ if self.name: body['name'] = self.name
511
+ if self.schema_name: body['schema_name'] = self.schema_name
512
+ if self.storage_location: body['storage_location'] = self.storage_location
513
+ if self.volume_type: body['volume_type'] = self.volume_type.value
514
+ return body
515
+
516
+ @classmethod
517
+ def from_dict(cls, d: Dict[str, any]) -> 'CreateVolumeRequestContent':
518
+ return cls(catalog_name=d.get('catalog_name', None),
519
+ comment=d.get('comment', None),
520
+ name=d.get('name', None),
521
+ schema_name=d.get('schema_name', None),
522
+ storage_location=d.get('storage_location', None),
523
+ volume_type=_enum(d, 'volume_type', VolumeType))
524
+
525
+
579
526
  class DataSourceFormat(Enum):
580
527
  """Data source format"""
581
528
 
@@ -637,20 +584,6 @@ class DeleteMetastoreRequest:
637
584
  force: bool = None
638
585
 
639
586
 
640
- @dataclass
641
- class DeleteProviderRequest:
642
- """Delete a provider"""
643
-
644
- name: str
645
-
646
-
647
- @dataclass
648
- class DeleteRecipientRequest:
649
- """Delete a share recipient"""
650
-
651
- name: str
652
-
653
-
654
587
  @dataclass
655
588
  class DeleteSchemaRequest:
656
589
  """Delete a schema"""
@@ -658,13 +591,6 @@ class DeleteSchemaRequest:
658
591
  full_name: str
659
592
 
660
593
 
661
- @dataclass
662
- class DeleteShareRequest:
663
- """Delete a share"""
664
-
665
- name: str
666
-
667
-
668
594
  @dataclass
669
595
  class DeleteStorageCredentialRequest:
670
596
  """Delete a credential"""
@@ -689,6 +615,13 @@ class DeleteTableRequest:
689
615
  full_name: str
690
616
 
691
617
 
618
+ @dataclass
619
+ class DeleteVolumeRequest:
620
+ """Delete a Volume"""
621
+
622
+ full_name_arg: str
623
+
624
+
692
625
  @dataclass
693
626
  class Dependency:
694
627
  """A dependency of a SQL object. Either the __table__ field or the __function__ field must be
@@ -1115,13 +1048,6 @@ class GetAccountStorageCredentialRequest:
1115
1048
  name: str
1116
1049
 
1117
1050
 
1118
- @dataclass
1119
- class GetActivationUrlInfoRequest:
1120
- """Get a share activation URL"""
1121
-
1122
- activation_url: str
1123
-
1124
-
1125
1051
  @dataclass
1126
1052
  class GetCatalogRequest:
1127
1053
  """Get a catalog"""
@@ -1248,34 +1174,6 @@ class GetMetastoreSummaryResponseDeltaSharingScope(Enum):
1248
1174
  INTERNAL_AND_EXTERNAL = 'INTERNAL_AND_EXTERNAL'
1249
1175
 
1250
1176
 
1251
- @dataclass
1252
- class GetProviderRequest:
1253
- """Get a provider"""
1254
-
1255
- name: str
1256
-
1257
-
1258
- @dataclass
1259
- class GetRecipientRequest:
1260
- """Get a share recipient"""
1261
-
1262
- name: str
1263
-
1264
-
1265
- @dataclass
1266
- class GetRecipientSharePermissionsResponse:
1267
- permissions_out: 'List[ShareToPrivilegeAssignment]' = None
1268
-
1269
- def as_dict(self) -> dict:
1270
- body = {}
1271
- if self.permissions_out: body['permissions_out'] = [v.as_dict() for v in self.permissions_out]
1272
- return body
1273
-
1274
- @classmethod
1275
- def from_dict(cls, d: Dict[str, any]) -> 'GetRecipientSharePermissionsResponse':
1276
- return cls(permissions_out=_repeated(d, 'permissions_out', ShareToPrivilegeAssignment))
1277
-
1278
-
1279
1177
  @dataclass
1280
1178
  class GetSchemaRequest:
1281
1179
  """Get a schema"""
@@ -1283,14 +1181,6 @@ class GetSchemaRequest:
1283
1181
  full_name: str
1284
1182
 
1285
1183
 
1286
- @dataclass
1287
- class GetShareRequest:
1288
- """Get a share"""
1289
-
1290
- name: str
1291
- include_shared_data: bool = None
1292
-
1293
-
1294
1184
  @dataclass
1295
1185
  class GetStorageCredentialRequest:
1296
1186
  """Get a credential"""
@@ -1306,20 +1196,6 @@ class GetTableRequest:
1306
1196
  include_delta_metadata: bool = None
1307
1197
 
1308
1198
 
1309
- @dataclass
1310
- class IpAccessList:
1311
- allowed_ip_addresses: 'List[str]' = None
1312
-
1313
- def as_dict(self) -> dict:
1314
- body = {}
1315
- if self.allowed_ip_addresses: body['allowed_ip_addresses'] = [v for v in self.allowed_ip_addresses]
1316
- return body
1317
-
1318
- @classmethod
1319
- def from_dict(cls, d: Dict[str, any]) -> 'IpAccessList':
1320
- return cls(allowed_ip_addresses=d.get('allowed_ip_addresses', None))
1321
-
1322
-
1323
1199
  @dataclass
1324
1200
  class ListAccountMetastoreAssignmentsRequest:
1325
1201
  """Get all workspaces assigned to a metastore"""
@@ -1399,62 +1275,6 @@ class ListMetastoresResponse:
1399
1275
  return cls(metastores=_repeated(d, 'metastores', MetastoreInfo))
1400
1276
 
1401
1277
 
1402
- @dataclass
1403
- class ListProviderSharesResponse:
1404
- shares: 'List[ProviderShare]' = None
1405
-
1406
- def as_dict(self) -> dict:
1407
- body = {}
1408
- if self.shares: body['shares'] = [v.as_dict() for v in self.shares]
1409
- return body
1410
-
1411
- @classmethod
1412
- def from_dict(cls, d: Dict[str, any]) -> 'ListProviderSharesResponse':
1413
- return cls(shares=_repeated(d, 'shares', ProviderShare))
1414
-
1415
-
1416
- @dataclass
1417
- class ListProvidersRequest:
1418
- """List providers"""
1419
-
1420
- data_provider_global_metastore_id: str = None
1421
-
1422
-
1423
- @dataclass
1424
- class ListProvidersResponse:
1425
- providers: 'List[ProviderInfo]' = None
1426
-
1427
- def as_dict(self) -> dict:
1428
- body = {}
1429
- if self.providers: body['providers'] = [v.as_dict() for v in self.providers]
1430
- return body
1431
-
1432
- @classmethod
1433
- def from_dict(cls, d: Dict[str, any]) -> 'ListProvidersResponse':
1434
- return cls(providers=_repeated(d, 'providers', ProviderInfo))
1435
-
1436
-
1437
- @dataclass
1438
- class ListRecipientsRequest:
1439
- """List share recipients"""
1440
-
1441
- data_recipient_global_metastore_id: str = None
1442
-
1443
-
1444
- @dataclass
1445
- class ListRecipientsResponse:
1446
- recipients: 'List[RecipientInfo]' = None
1447
-
1448
- def as_dict(self) -> dict:
1449
- body = {}
1450
- if self.recipients: body['recipients'] = [v.as_dict() for v in self.recipients]
1451
- return body
1452
-
1453
- @classmethod
1454
- def from_dict(cls, d: Dict[str, any]) -> 'ListRecipientsResponse':
1455
- return cls(recipients=_repeated(d, 'recipients', RecipientInfo))
1456
-
1457
-
1458
1278
  @dataclass
1459
1279
  class ListSchemasRequest:
1460
1280
  """List schemas"""
@@ -1476,27 +1296,6 @@ class ListSchemasResponse:
1476
1296
  return cls(schemas=_repeated(d, 'schemas', SchemaInfo))
1477
1297
 
1478
1298
 
1479
- @dataclass
1480
- class ListSharesRequest:
1481
- """List shares by Provider"""
1482
-
1483
- name: str
1484
-
1485
-
1486
- @dataclass
1487
- class ListSharesResponse:
1488
- shares: 'List[ShareInfo]' = None
1489
-
1490
- def as_dict(self) -> dict:
1491
- body = {}
1492
- if self.shares: body['shares'] = [v.as_dict() for v in self.shares]
1493
- return body
1494
-
1495
- @classmethod
1496
- def from_dict(cls, d: Dict[str, any]) -> 'ListSharesResponse':
1497
- return cls(shares=_repeated(d, 'shares', ShareInfo))
1498
-
1499
-
1500
1299
  @dataclass
1501
1300
  class ListSummariesRequest:
1502
1301
  """List table summaries"""
@@ -1532,20 +1331,46 @@ class ListTablesRequest:
1532
1331
  catalog_name: str
1533
1332
  schema_name: str
1534
1333
  include_delta_metadata: bool = None
1334
+ max_results: int = None
1335
+ page_token: str = None
1535
1336
 
1536
1337
 
1537
1338
  @dataclass
1538
1339
  class ListTablesResponse:
1340
+ next_page_token: str = None
1539
1341
  tables: 'List[TableInfo]' = None
1540
1342
 
1541
1343
  def as_dict(self) -> dict:
1542
1344
  body = {}
1345
+ if self.next_page_token: body['next_page_token'] = self.next_page_token
1543
1346
  if self.tables: body['tables'] = [v.as_dict() for v in self.tables]
1544
1347
  return body
1545
1348
 
1546
1349
  @classmethod
1547
1350
  def from_dict(cls, d: Dict[str, any]) -> 'ListTablesResponse':
1548
- return cls(tables=_repeated(d, 'tables', TableInfo))
1351
+ return cls(next_page_token=d.get('next_page_token', None), tables=_repeated(d, 'tables', TableInfo))
1352
+
1353
+
1354
+ @dataclass
1355
+ class ListVolumesRequest:
1356
+ """List Volumes"""
1357
+
1358
+ catalog_name: str
1359
+ schema_name: str
1360
+
1361
+
1362
+ @dataclass
1363
+ class ListVolumesResponseContent:
1364
+ volumes: 'List[VolumeInfo]' = None
1365
+
1366
+ def as_dict(self) -> dict:
1367
+ body = {}
1368
+ if self.volumes: body['volumes'] = [v.as_dict() for v in self.volumes]
1369
+ return body
1370
+
1371
+ @classmethod
1372
+ def from_dict(cls, d: Dict[str, any]) -> 'ListVolumesResponseContent':
1373
+ return cls(volumes=_repeated(d, 'volumes', VolumeInfo))
1549
1374
 
1550
1375
 
1551
1376
  @dataclass
@@ -1661,50 +1486,6 @@ class NamedTableConstraint:
1661
1486
  return cls(name=d.get('name', None))
1662
1487
 
1663
1488
 
1664
- @dataclass
1665
- class Partition:
1666
- values: 'List[PartitionValue]' = None
1667
-
1668
- def as_dict(self) -> dict:
1669
- body = {}
1670
- if self.values: body['values'] = [v.as_dict() for v in self.values]
1671
- return body
1672
-
1673
- @classmethod
1674
- def from_dict(cls, d: Dict[str, any]) -> 'Partition':
1675
- return cls(values=_repeated(d, 'values', PartitionValue))
1676
-
1677
-
1678
- @dataclass
1679
- class PartitionValue:
1680
- name: str = None
1681
- op: 'PartitionValueOp' = None
1682
- recipient_property_key: str = None
1683
- value: str = None
1684
-
1685
- def as_dict(self) -> dict:
1686
- body = {}
1687
- if self.name: body['name'] = self.name
1688
- if self.op: body['op'] = self.op.value
1689
- if self.recipient_property_key: body['recipient_property_key'] = self.recipient_property_key
1690
- if self.value: body['value'] = self.value
1691
- return body
1692
-
1693
- @classmethod
1694
- def from_dict(cls, d: Dict[str, any]) -> 'PartitionValue':
1695
- return cls(name=d.get('name', None),
1696
- op=_enum(d, 'op', PartitionValueOp),
1697
- recipient_property_key=d.get('recipient_property_key', None),
1698
- value=d.get('value', None))
1699
-
1700
-
1701
- class PartitionValueOp(Enum):
1702
- """The operator to apply for the value."""
1703
-
1704
- EQUAL = 'EQUAL'
1705
- LIKE = 'LIKE'
1706
-
1707
-
1708
1489
  @dataclass
1709
1490
  class PermissionsChange:
1710
1491
  add: 'List[Privilege]' = None
@@ -1805,290 +1586,63 @@ class PrivilegeAssignment:
1805
1586
 
1806
1587
 
1807
1588
  @dataclass
1808
- class ProviderInfo:
1809
- authentication_type: 'AuthenticationType' = None
1810
- cloud: str = None
1589
+ class ReadVolumeRequest:
1590
+ """Get a Volume"""
1591
+
1592
+ full_name_arg: str
1593
+
1594
+
1595
+ @dataclass
1596
+ class SchemaInfo:
1597
+ catalog_name: str = None
1598
+ catalog_type: str = None
1811
1599
  comment: str = None
1812
1600
  created_at: int = None
1813
1601
  created_by: str = None
1814
- data_provider_global_metastore_id: str = None
1602
+ effective_auto_maintenance_flag: 'EffectiveAutoMaintenanceFlag' = None
1603
+ enable_auto_maintenance: 'EnableAutoMaintenance' = None
1604
+ full_name: str = None
1815
1605
  metastore_id: str = None
1816
1606
  name: str = None
1817
1607
  owner: str = None
1818
- recipient_profile: 'RecipientProfile' = None
1819
- recipient_profile_str: str = None
1820
- region: str = None
1608
+ properties: 'Dict[str,str]' = None
1609
+ storage_location: str = None
1610
+ storage_root: str = None
1821
1611
  updated_at: int = None
1822
1612
  updated_by: str = None
1823
1613
 
1824
1614
  def as_dict(self) -> dict:
1825
1615
  body = {}
1826
- if self.authentication_type: body['authentication_type'] = self.authentication_type.value
1827
- if self.cloud: body['cloud'] = self.cloud
1616
+ if self.catalog_name: body['catalog_name'] = self.catalog_name
1617
+ if self.catalog_type: body['catalog_type'] = self.catalog_type
1828
1618
  if self.comment: body['comment'] = self.comment
1829
1619
  if self.created_at: body['created_at'] = self.created_at
1830
1620
  if self.created_by: body['created_by'] = self.created_by
1831
- if self.data_provider_global_metastore_id:
1832
- body['data_provider_global_metastore_id'] = self.data_provider_global_metastore_id
1621
+ if self.effective_auto_maintenance_flag:
1622
+ body['effective_auto_maintenance_flag'] = self.effective_auto_maintenance_flag.as_dict()
1623
+ if self.enable_auto_maintenance: body['enable_auto_maintenance'] = self.enable_auto_maintenance.value
1624
+ if self.full_name: body['full_name'] = self.full_name
1833
1625
  if self.metastore_id: body['metastore_id'] = self.metastore_id
1834
1626
  if self.name: body['name'] = self.name
1835
1627
  if self.owner: body['owner'] = self.owner
1836
- if self.recipient_profile: body['recipient_profile'] = self.recipient_profile.as_dict()
1837
- if self.recipient_profile_str: body['recipient_profile_str'] = self.recipient_profile_str
1838
- if self.region: body['region'] = self.region
1628
+ if self.properties: body['properties'] = self.properties
1629
+ if self.storage_location: body['storage_location'] = self.storage_location
1630
+ if self.storage_root: body['storage_root'] = self.storage_root
1839
1631
  if self.updated_at: body['updated_at'] = self.updated_at
1840
1632
  if self.updated_by: body['updated_by'] = self.updated_by
1841
1633
  return body
1842
1634
 
1843
1635
  @classmethod
1844
- def from_dict(cls, d: Dict[str, any]) -> 'ProviderInfo':
1845
- return cls(authentication_type=_enum(d, 'authentication_type', AuthenticationType),
1846
- cloud=d.get('cloud', None),
1636
+ def from_dict(cls, d: Dict[str, any]) -> 'SchemaInfo':
1637
+ return cls(catalog_name=d.get('catalog_name', None),
1638
+ catalog_type=d.get('catalog_type', None),
1847
1639
  comment=d.get('comment', None),
1848
1640
  created_at=d.get('created_at', None),
1849
1641
  created_by=d.get('created_by', None),
1850
- data_provider_global_metastore_id=d.get('data_provider_global_metastore_id', None),
1851
- metastore_id=d.get('metastore_id', None),
1852
- name=d.get('name', None),
1853
- owner=d.get('owner', None),
1854
- recipient_profile=_from_dict(d, 'recipient_profile', RecipientProfile),
1855
- recipient_profile_str=d.get('recipient_profile_str', None),
1856
- region=d.get('region', None),
1857
- updated_at=d.get('updated_at', None),
1858
- updated_by=d.get('updated_by', None))
1859
-
1860
-
1861
- @dataclass
1862
- class ProviderShare:
1863
- name: str = None
1864
-
1865
- def as_dict(self) -> dict:
1866
- body = {}
1867
- if self.name: body['name'] = self.name
1868
- return body
1869
-
1870
- @classmethod
1871
- def from_dict(cls, d: Dict[str, any]) -> 'ProviderShare':
1872
- return cls(name=d.get('name', None))
1873
-
1874
-
1875
- @dataclass
1876
- class RecipientInfo:
1877
- activated: bool = None
1878
- activation_url: str = None
1879
- authentication_type: 'AuthenticationType' = None
1880
- cloud: str = None
1881
- comment: str = None
1882
- created_at: int = None
1883
- created_by: str = None
1884
- data_recipient_global_metastore_id: Any = None
1885
- ip_access_list: 'IpAccessList' = None
1886
- metastore_id: str = None
1887
- name: str = None
1888
- owner: str = None
1889
- properties_kvpairs: Any = None
1890
- region: str = None
1891
- sharing_code: str = None
1892
- tokens: 'List[RecipientTokenInfo]' = None
1893
- updated_at: int = None
1894
- updated_by: str = None
1895
-
1896
- def as_dict(self) -> dict:
1897
- body = {}
1898
- if self.activated: body['activated'] = self.activated
1899
- if self.activation_url: body['activation_url'] = self.activation_url
1900
- if self.authentication_type: body['authentication_type'] = self.authentication_type.value
1901
- if self.cloud: body['cloud'] = self.cloud
1902
- if self.comment: body['comment'] = self.comment
1903
- if self.created_at: body['created_at'] = self.created_at
1904
- if self.created_by: body['created_by'] = self.created_by
1905
- if self.data_recipient_global_metastore_id:
1906
- body['data_recipient_global_metastore_id'] = self.data_recipient_global_metastore_id
1907
- if self.ip_access_list: body['ip_access_list'] = self.ip_access_list.as_dict()
1908
- if self.metastore_id: body['metastore_id'] = self.metastore_id
1909
- if self.name: body['name'] = self.name
1910
- if self.owner: body['owner'] = self.owner
1911
- if self.properties_kvpairs: body['properties_kvpairs'] = self.properties_kvpairs
1912
- if self.region: body['region'] = self.region
1913
- if self.sharing_code: body['sharing_code'] = self.sharing_code
1914
- if self.tokens: body['tokens'] = [v.as_dict() for v in self.tokens]
1915
- if self.updated_at: body['updated_at'] = self.updated_at
1916
- if self.updated_by: body['updated_by'] = self.updated_by
1917
- return body
1918
-
1919
- @classmethod
1920
- def from_dict(cls, d: Dict[str, any]) -> 'RecipientInfo':
1921
- return cls(activated=d.get('activated', None),
1922
- activation_url=d.get('activation_url', None),
1923
- authentication_type=_enum(d, 'authentication_type', AuthenticationType),
1924
- cloud=d.get('cloud', None),
1925
- comment=d.get('comment', None),
1926
- created_at=d.get('created_at', None),
1927
- created_by=d.get('created_by', None),
1928
- data_recipient_global_metastore_id=d.get('data_recipient_global_metastore_id', None),
1929
- ip_access_list=_from_dict(d, 'ip_access_list', IpAccessList),
1930
- metastore_id=d.get('metastore_id', None),
1931
- name=d.get('name', None),
1932
- owner=d.get('owner', None),
1933
- properties_kvpairs=d.get('properties_kvpairs', None),
1934
- region=d.get('region', None),
1935
- sharing_code=d.get('sharing_code', None),
1936
- tokens=_repeated(d, 'tokens', RecipientTokenInfo),
1937
- updated_at=d.get('updated_at', None),
1938
- updated_by=d.get('updated_by', None))
1939
-
1940
-
1941
- @dataclass
1942
- class RecipientProfile:
1943
- bearer_token: str = None
1944
- endpoint: str = None
1945
- share_credentials_version: int = None
1946
-
1947
- def as_dict(self) -> dict:
1948
- body = {}
1949
- if self.bearer_token: body['bearer_token'] = self.bearer_token
1950
- if self.endpoint: body['endpoint'] = self.endpoint
1951
- if self.share_credentials_version: body['share_credentials_version'] = self.share_credentials_version
1952
- return body
1953
-
1954
- @classmethod
1955
- def from_dict(cls, d: Dict[str, any]) -> 'RecipientProfile':
1956
- return cls(bearer_token=d.get('bearer_token', None),
1957
- endpoint=d.get('endpoint', None),
1958
- share_credentials_version=d.get('share_credentials_version', None))
1959
-
1960
-
1961
- @dataclass
1962
- class RecipientTokenInfo:
1963
- activation_url: str = None
1964
- created_at: int = None
1965
- created_by: str = None
1966
- expiration_time: int = None
1967
- id: str = None
1968
- updated_at: int = None
1969
- updated_by: str = None
1970
-
1971
- def as_dict(self) -> dict:
1972
- body = {}
1973
- if self.activation_url: body['activation_url'] = self.activation_url
1974
- if self.created_at: body['created_at'] = self.created_at
1975
- if self.created_by: body['created_by'] = self.created_by
1976
- if self.expiration_time: body['expiration_time'] = self.expiration_time
1977
- if self.id: body['id'] = self.id
1978
- if self.updated_at: body['updated_at'] = self.updated_at
1979
- if self.updated_by: body['updated_by'] = self.updated_by
1980
- return body
1981
-
1982
- @classmethod
1983
- def from_dict(cls, d: Dict[str, any]) -> 'RecipientTokenInfo':
1984
- return cls(activation_url=d.get('activation_url', None),
1985
- created_at=d.get('created_at', None),
1986
- created_by=d.get('created_by', None),
1987
- expiration_time=d.get('expiration_time', None),
1988
- id=d.get('id', None),
1989
- updated_at=d.get('updated_at', None),
1990
- updated_by=d.get('updated_by', None))
1991
-
1992
-
1993
- @dataclass
1994
- class RetrieveTokenRequest:
1995
- """Get an access token"""
1996
-
1997
- activation_url: str
1998
-
1999
-
2000
- @dataclass
2001
- class RetrieveTokenResponse:
2002
- bearer_token: str = None
2003
- endpoint: str = None
2004
- expiration_time: str = None
2005
- share_credentials_version: int = None
2006
-
2007
- def as_dict(self) -> dict:
2008
- body = {}
2009
- if self.bearer_token: body['bearerToken'] = self.bearer_token
2010
- if self.endpoint: body['endpoint'] = self.endpoint
2011
- if self.expiration_time: body['expirationTime'] = self.expiration_time
2012
- if self.share_credentials_version: body['shareCredentialsVersion'] = self.share_credentials_version
2013
- return body
2014
-
2015
- @classmethod
2016
- def from_dict(cls, d: Dict[str, any]) -> 'RetrieveTokenResponse':
2017
- return cls(bearer_token=d.get('bearerToken', None),
2018
- endpoint=d.get('endpoint', None),
2019
- expiration_time=d.get('expirationTime', None),
2020
- share_credentials_version=d.get('shareCredentialsVersion', None))
2021
-
2022
-
2023
- @dataclass
2024
- class RotateRecipientToken:
2025
- existing_token_expire_in_seconds: int
2026
- name: str
2027
-
2028
- def as_dict(self) -> dict:
2029
- body = {}
2030
- if self.existing_token_expire_in_seconds:
2031
- body['existing_token_expire_in_seconds'] = self.existing_token_expire_in_seconds
2032
- if self.name: body['name'] = self.name
2033
- return body
2034
-
2035
- @classmethod
2036
- def from_dict(cls, d: Dict[str, any]) -> 'RotateRecipientToken':
2037
- return cls(existing_token_expire_in_seconds=d.get('existing_token_expire_in_seconds', None),
2038
- name=d.get('name', None))
2039
-
2040
-
2041
- @dataclass
2042
- class SchemaInfo:
2043
- catalog_name: str = None
2044
- catalog_type: str = None
2045
- comment: str = None
2046
- created_at: int = None
2047
- created_by: str = None
2048
- effective_auto_maintenance_flag: 'EffectiveAutoMaintenanceFlag' = None
2049
- enable_auto_maintenance: 'EnableAutoMaintenance' = None
2050
- full_name: str = None
2051
- metastore_id: str = None
2052
- name: str = None
2053
- owner: str = None
2054
- properties: 'Dict[str,str]' = None
2055
- storage_location: str = None
2056
- storage_root: str = None
2057
- updated_at: int = None
2058
- updated_by: str = None
2059
-
2060
- def as_dict(self) -> dict:
2061
- body = {}
2062
- if self.catalog_name: body['catalog_name'] = self.catalog_name
2063
- if self.catalog_type: body['catalog_type'] = self.catalog_type
2064
- if self.comment: body['comment'] = self.comment
2065
- if self.created_at: body['created_at'] = self.created_at
2066
- if self.created_by: body['created_by'] = self.created_by
2067
- if self.effective_auto_maintenance_flag:
2068
- body['effective_auto_maintenance_flag'] = self.effective_auto_maintenance_flag.as_dict()
2069
- if self.enable_auto_maintenance: body['enable_auto_maintenance'] = self.enable_auto_maintenance.value
2070
- if self.full_name: body['full_name'] = self.full_name
2071
- if self.metastore_id: body['metastore_id'] = self.metastore_id
2072
- if self.name: body['name'] = self.name
2073
- if self.owner: body['owner'] = self.owner
2074
- if self.properties: body['properties'] = self.properties
2075
- if self.storage_location: body['storage_location'] = self.storage_location
2076
- if self.storage_root: body['storage_root'] = self.storage_root
2077
- if self.updated_at: body['updated_at'] = self.updated_at
2078
- if self.updated_by: body['updated_by'] = self.updated_by
2079
- return body
2080
-
2081
- @classmethod
2082
- def from_dict(cls, d: Dict[str, any]) -> 'SchemaInfo':
2083
- return cls(catalog_name=d.get('catalog_name', None),
2084
- catalog_type=d.get('catalog_type', None),
2085
- comment=d.get('comment', None),
2086
- created_at=d.get('created_at', None),
2087
- created_by=d.get('created_by', None),
2088
- effective_auto_maintenance_flag=_from_dict(d, 'effective_auto_maintenance_flag',
2089
- EffectiveAutoMaintenanceFlag),
2090
- enable_auto_maintenance=_enum(d, 'enable_auto_maintenance', EnableAutoMaintenance),
2091
- full_name=d.get('full_name', None),
1642
+ effective_auto_maintenance_flag=_from_dict(d, 'effective_auto_maintenance_flag',
1643
+ EffectiveAutoMaintenanceFlag),
1644
+ enable_auto_maintenance=_enum(d, 'enable_auto_maintenance', EnableAutoMaintenance),
1645
+ full_name=d.get('full_name', None),
2092
1646
  metastore_id=d.get('metastore_id', None),
2093
1647
  name=d.get('name', None),
2094
1648
  owner=d.get('owner', None),
@@ -2117,139 +1671,6 @@ class SecurableType(Enum):
2117
1671
  TABLE = 'TABLE'
2118
1672
 
2119
1673
 
2120
- @dataclass
2121
- class ShareInfo:
2122
- comment: str = None
2123
- created_at: int = None
2124
- created_by: str = None
2125
- name: str = None
2126
- objects: 'List[SharedDataObject]' = None
2127
- owner: str = None
2128
- updated_at: int = None
2129
- updated_by: str = None
2130
-
2131
- def as_dict(self) -> dict:
2132
- body = {}
2133
- if self.comment: body['comment'] = self.comment
2134
- if self.created_at: body['created_at'] = self.created_at
2135
- if self.created_by: body['created_by'] = self.created_by
2136
- if self.name: body['name'] = self.name
2137
- if self.objects: body['objects'] = [v.as_dict() for v in self.objects]
2138
- if self.owner: body['owner'] = self.owner
2139
- if self.updated_at: body['updated_at'] = self.updated_at
2140
- if self.updated_by: body['updated_by'] = self.updated_by
2141
- return body
2142
-
2143
- @classmethod
2144
- def from_dict(cls, d: Dict[str, any]) -> 'ShareInfo':
2145
- return cls(comment=d.get('comment', None),
2146
- created_at=d.get('created_at', None),
2147
- created_by=d.get('created_by', None),
2148
- name=d.get('name', None),
2149
- objects=_repeated(d, 'objects', SharedDataObject),
2150
- owner=d.get('owner', None),
2151
- updated_at=d.get('updated_at', None),
2152
- updated_by=d.get('updated_by', None))
2153
-
2154
-
2155
- @dataclass
2156
- class SharePermissionsRequest:
2157
- """Get recipient share permissions"""
2158
-
2159
- name: str
2160
-
2161
-
2162
- @dataclass
2163
- class ShareToPrivilegeAssignment:
2164
- privilege_assignments: 'List[PrivilegeAssignment]' = None
2165
- share_name: str = None
2166
-
2167
- def as_dict(self) -> dict:
2168
- body = {}
2169
- if self.privilege_assignments:
2170
- body['privilege_assignments'] = [v.as_dict() for v in self.privilege_assignments]
2171
- if self.share_name: body['share_name'] = self.share_name
2172
- return body
2173
-
2174
- @classmethod
2175
- def from_dict(cls, d: Dict[str, any]) -> 'ShareToPrivilegeAssignment':
2176
- return cls(privilege_assignments=_repeated(d, 'privilege_assignments', PrivilegeAssignment),
2177
- share_name=d.get('share_name', None))
2178
-
2179
-
2180
- @dataclass
2181
- class SharedDataObject:
2182
- name: str
2183
- added_at: int = None
2184
- added_by: str = None
2185
- cdf_enabled: bool = None
2186
- comment: str = None
2187
- data_object_type: str = None
2188
- partitions: 'List[Partition]' = None
2189
- shared_as: str = None
2190
- start_version: int = None
2191
- status: 'SharedDataObjectStatus' = None
2192
-
2193
- def as_dict(self) -> dict:
2194
- body = {}
2195
- if self.added_at: body['added_at'] = self.added_at
2196
- if self.added_by: body['added_by'] = self.added_by
2197
- if self.cdf_enabled: body['cdf_enabled'] = self.cdf_enabled
2198
- if self.comment: body['comment'] = self.comment
2199
- if self.data_object_type: body['data_object_type'] = self.data_object_type
2200
- if self.name: body['name'] = self.name
2201
- if self.partitions: body['partitions'] = [v.as_dict() for v in self.partitions]
2202
- if self.shared_as: body['shared_as'] = self.shared_as
2203
- if self.start_version: body['start_version'] = self.start_version
2204
- if self.status: body['status'] = self.status.value
2205
- return body
2206
-
2207
- @classmethod
2208
- def from_dict(cls, d: Dict[str, any]) -> 'SharedDataObject':
2209
- return cls(added_at=d.get('added_at', None),
2210
- added_by=d.get('added_by', None),
2211
- cdf_enabled=d.get('cdf_enabled', None),
2212
- comment=d.get('comment', None),
2213
- data_object_type=d.get('data_object_type', None),
2214
- name=d.get('name', None),
2215
- partitions=_repeated(d, 'partitions', Partition),
2216
- shared_as=d.get('shared_as', None),
2217
- start_version=d.get('start_version', None),
2218
- status=_enum(d, 'status', SharedDataObjectStatus))
2219
-
2220
-
2221
- class SharedDataObjectStatus(Enum):
2222
- """One of: **ACTIVE**, **PERMISSION_DENIED**."""
2223
-
2224
- ACTIVE = 'ACTIVE'
2225
- PERMISSION_DENIED = 'PERMISSION_DENIED'
2226
-
2227
-
2228
- @dataclass
2229
- class SharedDataObjectUpdate:
2230
- action: 'SharedDataObjectUpdateAction' = None
2231
- data_object: 'SharedDataObject' = None
2232
-
2233
- def as_dict(self) -> dict:
2234
- body = {}
2235
- if self.action: body['action'] = self.action.value
2236
- if self.data_object: body['data_object'] = self.data_object.as_dict()
2237
- return body
2238
-
2239
- @classmethod
2240
- def from_dict(cls, d: Dict[str, any]) -> 'SharedDataObjectUpdate':
2241
- return cls(action=_enum(d, 'action', SharedDataObjectUpdateAction),
2242
- data_object=_from_dict(d, 'data_object', SharedDataObject))
2243
-
2244
-
2245
- class SharedDataObjectUpdateAction(Enum):
2246
- """One of: **ADD**, **REMOVE**, **UPDATE**."""
2247
-
2248
- ADD = 'ADD'
2249
- REMOVE = 'REMOVE'
2250
- UPDATE = 'UPDATE'
2251
-
2252
-
2253
1674
  @dataclass
2254
1675
  class StorageCredentialInfo:
2255
1676
  aws_iam_role: 'AwsIamRole' = None
@@ -2506,6 +1927,42 @@ class UnassignRequest:
2506
1927
  metastore_id: str
2507
1928
 
2508
1929
 
1930
+ @dataclass
1931
+ class UpdateAutoMaintenance:
1932
+ metastore_id: str
1933
+ enable: bool
1934
+
1935
+ def as_dict(self) -> dict:
1936
+ body = {}
1937
+ if self.enable: body['enable'] = self.enable
1938
+ if self.metastore_id: body['metastore_id'] = self.metastore_id
1939
+ return body
1940
+
1941
+ @classmethod
1942
+ def from_dict(cls, d: Dict[str, any]) -> 'UpdateAutoMaintenance':
1943
+ return cls(enable=d.get('enable', None), metastore_id=d.get('metastore_id', None))
1944
+
1945
+
1946
+ @dataclass
1947
+ class UpdateAutoMaintenanceResponse:
1948
+ state: bool = None
1949
+ user_id: int = None
1950
+ username: str = None
1951
+
1952
+ def as_dict(self) -> dict:
1953
+ body = {}
1954
+ if self.state: body['state'] = self.state
1955
+ if self.user_id: body['user_id'] = self.user_id
1956
+ if self.username: body['username'] = self.username
1957
+ return body
1958
+
1959
+ @classmethod
1960
+ def from_dict(cls, d: Dict[str, any]) -> 'UpdateAutoMaintenanceResponse':
1961
+ return cls(state=d.get('state', None),
1962
+ user_id=d.get('user_id', None),
1963
+ username=d.get('username', None))
1964
+
1965
+
2509
1966
  @dataclass
2510
1967
  class UpdateCatalog:
2511
1968
  name: str
@@ -2667,55 +2124,6 @@ class UpdatePermissions:
2667
2124
  securable_type=_enum(d, 'securable_type', SecurableType))
2668
2125
 
2669
2126
 
2670
- @dataclass
2671
- class UpdateProvider:
2672
- name: str
2673
- comment: str = None
2674
- owner: str = None
2675
- recipient_profile_str: str = None
2676
-
2677
- def as_dict(self) -> dict:
2678
- body = {}
2679
- if self.comment: body['comment'] = self.comment
2680
- if self.name: body['name'] = self.name
2681
- if self.owner: body['owner'] = self.owner
2682
- if self.recipient_profile_str: body['recipient_profile_str'] = self.recipient_profile_str
2683
- return body
2684
-
2685
- @classmethod
2686
- def from_dict(cls, d: Dict[str, any]) -> 'UpdateProvider':
2687
- return cls(comment=d.get('comment', None),
2688
- name=d.get('name', None),
2689
- owner=d.get('owner', None),
2690
- recipient_profile_str=d.get('recipient_profile_str', None))
2691
-
2692
-
2693
- @dataclass
2694
- class UpdateRecipient:
2695
- name: str
2696
- comment: str = None
2697
- ip_access_list: 'IpAccessList' = None
2698
- owner: str = None
2699
- properties_kvpairs: Any = None
2700
-
2701
- def as_dict(self) -> dict:
2702
- body = {}
2703
- if self.comment: body['comment'] = self.comment
2704
- if self.ip_access_list: body['ip_access_list'] = self.ip_access_list.as_dict()
2705
- if self.name: body['name'] = self.name
2706
- if self.owner: body['owner'] = self.owner
2707
- if self.properties_kvpairs: body['properties_kvpairs'] = self.properties_kvpairs
2708
- return body
2709
-
2710
- @classmethod
2711
- def from_dict(cls, d: Dict[str, any]) -> 'UpdateRecipient':
2712
- return cls(comment=d.get('comment', None),
2713
- ip_access_list=_from_dict(d, 'ip_access_list', IpAccessList),
2714
- name=d.get('name', None),
2715
- owner=d.get('owner', None),
2716
- properties_kvpairs=d.get('properties_kvpairs', None))
2717
-
2718
-
2719
2127
  @dataclass
2720
2128
  class UpdateSchema:
2721
2129
  full_name: str
@@ -2742,45 +2150,6 @@ class UpdateSchema:
2742
2150
  properties=d.get('properties', None))
2743
2151
 
2744
2152
 
2745
- @dataclass
2746
- class UpdateShare:
2747
- name: str
2748
- comment: str = None
2749
- owner: str = None
2750
- updates: 'List[SharedDataObjectUpdate]' = None
2751
-
2752
- def as_dict(self) -> dict:
2753
- body = {}
2754
- if self.comment: body['comment'] = self.comment
2755
- if self.name: body['name'] = self.name
2756
- if self.owner: body['owner'] = self.owner
2757
- if self.updates: body['updates'] = [v.as_dict() for v in self.updates]
2758
- return body
2759
-
2760
- @classmethod
2761
- def from_dict(cls, d: Dict[str, any]) -> 'UpdateShare':
2762
- return cls(comment=d.get('comment', None),
2763
- name=d.get('name', None),
2764
- owner=d.get('owner', None),
2765
- updates=_repeated(d, 'updates', SharedDataObjectUpdate))
2766
-
2767
-
2768
- @dataclass
2769
- class UpdateSharePermissions:
2770
- name: str
2771
- changes: 'List[PermissionsChange]' = None
2772
-
2773
- def as_dict(self) -> dict:
2774
- body = {}
2775
- if self.changes: body['changes'] = [v.as_dict() for v in self.changes]
2776
- if self.name: body['name'] = self.name
2777
- return body
2778
-
2779
- @classmethod
2780
- def from_dict(cls, d: Dict[str, any]) -> 'UpdateSharePermissions':
2781
- return cls(changes=_repeated(d, 'changes', PermissionsChange), name=d.get('name', None))
2782
-
2783
-
2784
2153
  @dataclass
2785
2154
  class UpdateStorageCredential:
2786
2155
  name: str
@@ -2821,6 +2190,29 @@ class UpdateStorageCredential:
2821
2190
  skip_validation=d.get('skip_validation', None))
2822
2191
 
2823
2192
 
2193
+ @dataclass
2194
+ class UpdateVolumeRequestContent:
2195
+ full_name_arg: str
2196
+ comment: str = None
2197
+ name: str = None
2198
+ owner: str = None
2199
+
2200
+ def as_dict(self) -> dict:
2201
+ body = {}
2202
+ if self.comment: body['comment'] = self.comment
2203
+ if self.full_name_arg: body['full_name_arg'] = self.full_name_arg
2204
+ if self.name: body['name'] = self.name
2205
+ if self.owner: body['owner'] = self.owner
2206
+ return body
2207
+
2208
+ @classmethod
2209
+ def from_dict(cls, d: Dict[str, any]) -> 'UpdateVolumeRequestContent':
2210
+ return cls(comment=d.get('comment', None),
2211
+ full_name_arg=d.get('full_name_arg', None),
2212
+ name=d.get('name', None),
2213
+ owner=d.get('owner', None))
2214
+
2215
+
2824
2216
  @dataclass
2825
2217
  class ValidateStorageCredential:
2826
2218
  aws_iam_role: 'AwsIamRole' = None
@@ -2900,12 +2292,71 @@ class ValidationResultOperation(Enum):
2900
2292
  WRITE = 'WRITE'
2901
2293
 
2902
2294
 
2903
- class ValidationResultResult(Enum):
2904
- """The results of the tested operation."""
2295
+ class ValidationResultResult(Enum):
2296
+ """The results of the tested operation."""
2297
+
2298
+ FAIL = 'FAIL'
2299
+ PASS = 'PASS'
2300
+ SKIP = 'SKIP'
2301
+
2302
+
2303
+ @dataclass
2304
+ class VolumeInfo:
2305
+ catalog_name: str = None
2306
+ comment: str = None
2307
+ created_at: int = None
2308
+ created_by: str = None
2309
+ full_name: str = None
2310
+ metastore_id: str = None
2311
+ name: str = None
2312
+ owner: str = None
2313
+ schema_name: str = None
2314
+ storage_location: str = None
2315
+ updated_at: int = None
2316
+ updated_by: str = None
2317
+ volume_id: str = None
2318
+ volume_type: 'VolumeType' = None
2319
+
2320
+ def as_dict(self) -> dict:
2321
+ body = {}
2322
+ if self.catalog_name: body['catalog_name'] = self.catalog_name
2323
+ if self.comment: body['comment'] = self.comment
2324
+ if self.created_at: body['created_at'] = self.created_at
2325
+ if self.created_by: body['created_by'] = self.created_by
2326
+ if self.full_name: body['full_name'] = self.full_name
2327
+ if self.metastore_id: body['metastore_id'] = self.metastore_id
2328
+ if self.name: body['name'] = self.name
2329
+ if self.owner: body['owner'] = self.owner
2330
+ if self.schema_name: body['schema_name'] = self.schema_name
2331
+ if self.storage_location: body['storage_location'] = self.storage_location
2332
+ if self.updated_at: body['updated_at'] = self.updated_at
2333
+ if self.updated_by: body['updated_by'] = self.updated_by
2334
+ if self.volume_id: body['volume_id'] = self.volume_id
2335
+ if self.volume_type: body['volume_type'] = self.volume_type.value
2336
+ return body
2337
+
2338
+ @classmethod
2339
+ def from_dict(cls, d: Dict[str, any]) -> 'VolumeInfo':
2340
+ return cls(catalog_name=d.get('catalog_name', None),
2341
+ comment=d.get('comment', None),
2342
+ created_at=d.get('created_at', None),
2343
+ created_by=d.get('created_by', None),
2344
+ full_name=d.get('full_name', None),
2345
+ metastore_id=d.get('metastore_id', None),
2346
+ name=d.get('name', None),
2347
+ owner=d.get('owner', None),
2348
+ schema_name=d.get('schema_name', None),
2349
+ storage_location=d.get('storage_location', None),
2350
+ updated_at=d.get('updated_at', None),
2351
+ updated_by=d.get('updated_by', None),
2352
+ volume_id=d.get('volume_id', None),
2353
+ volume_type=_enum(d, 'volume_type', VolumeType))
2354
+
2355
+
2356
+ class VolumeType(Enum):
2905
2357
 
2906
- FAIL = 'FAIL'
2907
- PASS = 'PASS'
2908
- SKIP = 'SKIP'
2358
+ EXTERNAL = 'EXTERNAL'
2359
+ MANAGED = 'MANAGED'
2909
2360
 
2910
2361
 
2911
2362
  class AccountMetastoreAssignmentsAPI:
@@ -3659,6 +3110,18 @@ class MetastoresAPI:
3659
3110
  json = self._api.do('GET', '/api/2.1/unity-catalog/metastores')
3660
3111
  return [MetastoreInfo.from_dict(v) for v in json.get('metastores', [])]
3661
3112
 
3113
+ def maintenance(self, metastore_id: str, enable: bool, **kwargs) -> UpdateAutoMaintenanceResponse:
3114
+ """Enables or disables auto maintenance on the metastore.
3115
+
3116
+ Enables or disables auto maintenance on the metastore."""
3117
+ request = kwargs.get('request', None)
3118
+ if not request: # request is not given through keyed args
3119
+ request = UpdateAutoMaintenance(enable=enable, metastore_id=metastore_id)
3120
+ body = request.as_dict()
3121
+
3122
+ json = self._api.do('PATCH', '/api/2.0/auto-maintenance/service', body=body)
3123
+ return UpdateAutoMaintenanceResponse.from_dict(json)
3124
+
3662
3125
  def summary(self) -> GetMetastoreSummaryResponse:
3663
3126
  """Get a metastore summary.
3664
3127
 
@@ -3738,272 +3201,6 @@ class MetastoresAPI:
3738
3201
  body=body)
3739
3202
 
3740
3203
 
3741
- class ProvidersAPI:
3742
- """Databricks Delta Sharing: Providers REST API"""
3743
-
3744
- def __init__(self, api_client):
3745
- self._api = api_client
3746
-
3747
- def create(self,
3748
- name: str,
3749
- authentication_type: AuthenticationType,
3750
- *,
3751
- comment: str = None,
3752
- recipient_profile_str: str = None,
3753
- **kwargs) -> ProviderInfo:
3754
- """Create an auth provider.
3755
-
3756
- Creates a new authentication provider minimally based on a name and authentication type. The caller
3757
- must be an admin on the metastore."""
3758
- request = kwargs.get('request', None)
3759
- if not request: # request is not given through keyed args
3760
- request = CreateProvider(authentication_type=authentication_type,
3761
- comment=comment,
3762
- name=name,
3763
- recipient_profile_str=recipient_profile_str)
3764
- body = request.as_dict()
3765
-
3766
- json = self._api.do('POST', '/api/2.1/unity-catalog/providers', body=body)
3767
- return ProviderInfo.from_dict(json)
3768
-
3769
- def delete(self, name: str, **kwargs):
3770
- """Delete a provider.
3771
-
3772
- Deletes an authentication provider, if the caller is a metastore admin or is the owner of the
3773
- provider."""
3774
- request = kwargs.get('request', None)
3775
- if not request: # request is not given through keyed args
3776
- request = DeleteProviderRequest(name=name)
3777
-
3778
- self._api.do('DELETE', f'/api/2.1/unity-catalog/providers/{request.name}')
3779
-
3780
- def get(self, name: str, **kwargs) -> ProviderInfo:
3781
- """Get a provider.
3782
-
3783
- Gets a specific authentication provider. The caller must supply the name of the provider, and must
3784
- either be a metastore admin or the owner of the provider."""
3785
- request = kwargs.get('request', None)
3786
- if not request: # request is not given through keyed args
3787
- request = GetProviderRequest(name=name)
3788
-
3789
- json = self._api.do('GET', f'/api/2.1/unity-catalog/providers/{request.name}')
3790
- return ProviderInfo.from_dict(json)
3791
-
3792
- def list(self, *, data_provider_global_metastore_id: str = None, **kwargs) -> Iterator[ProviderInfo]:
3793
- """List providers.
3794
-
3795
- Gets an array of available authentication providers. The caller must either be a metastore admin or
3796
- the owner of the providers. Providers not owned by the caller are not included in the response. There
3797
- is no guarantee of a specific ordering of the elements in the array."""
3798
- request = kwargs.get('request', None)
3799
- if not request: # request is not given through keyed args
3800
- request = ListProvidersRequest(
3801
- data_provider_global_metastore_id=data_provider_global_metastore_id)
3802
-
3803
- query = {}
3804
- if data_provider_global_metastore_id:
3805
- query['data_provider_global_metastore_id'] = request.data_provider_global_metastore_id
3806
-
3807
- json = self._api.do('GET', '/api/2.1/unity-catalog/providers', query=query)
3808
- return [ProviderInfo.from_dict(v) for v in json.get('providers', [])]
3809
-
3810
- def list_shares(self, name: str, **kwargs) -> ListProviderSharesResponse:
3811
- """List shares by Provider.
3812
-
3813
- Gets an array of a specified provider's shares within the metastore where:
3814
-
3815
- * the caller is a metastore admin, or * the caller is the owner."""
3816
- request = kwargs.get('request', None)
3817
- if not request: # request is not given through keyed args
3818
- request = ListSharesRequest(name=name)
3819
-
3820
- json = self._api.do('GET', f'/api/2.1/unity-catalog/providers/{request.name}/shares')
3821
- return ListProviderSharesResponse.from_dict(json)
3822
-
3823
- def update(self,
3824
- name: str,
3825
- *,
3826
- comment: str = None,
3827
- owner: str = None,
3828
- recipient_profile_str: str = None,
3829
- **kwargs) -> ProviderInfo:
3830
- """Update a provider.
3831
-
3832
- Updates the information for an authentication provider, if the caller is a metastore admin or is the
3833
- owner of the provider. If the update changes the provider name, the caller must be both a metastore
3834
- admin and the owner of the provider."""
3835
- request = kwargs.get('request', None)
3836
- if not request: # request is not given through keyed args
3837
- request = UpdateProvider(comment=comment,
3838
- name=name,
3839
- owner=owner,
3840
- recipient_profile_str=recipient_profile_str)
3841
- body = request.as_dict()
3842
-
3843
- json = self._api.do('PATCH', f'/api/2.1/unity-catalog/providers/{request.name}', body=body)
3844
- return ProviderInfo.from_dict(json)
3845
-
3846
-
3847
- class RecipientActivationAPI:
3848
- """Databricks Delta Sharing: Recipient Activation REST API"""
3849
-
3850
- def __init__(self, api_client):
3851
- self._api = api_client
3852
-
3853
- def get_activation_url_info(self, activation_url: str, **kwargs):
3854
- """Get a share activation URL.
3855
-
3856
- Gets an activation URL for a share."""
3857
- request = kwargs.get('request', None)
3858
- if not request: # request is not given through keyed args
3859
- request = GetActivationUrlInfoRequest(activation_url=activation_url)
3860
-
3861
- self._api.do('GET',
3862
- f'/api/2.1/unity-catalog/public/data_sharing_activation_info/{request.activation_url}')
3863
-
3864
- def retrieve_token(self, activation_url: str, **kwargs) -> RetrieveTokenResponse:
3865
- """Get an access token.
3866
-
3867
- Retrieve access token with an activation url. This is a public API without any authentication."""
3868
- request = kwargs.get('request', None)
3869
- if not request: # request is not given through keyed args
3870
- request = RetrieveTokenRequest(activation_url=activation_url)
3871
-
3872
- json = self._api.do(
3873
- 'GET', f'/api/2.1/unity-catalog/public/data_sharing_activation/{request.activation_url}')
3874
- return RetrieveTokenResponse.from_dict(json)
3875
-
3876
-
3877
- class RecipientsAPI:
3878
- """Databricks Delta Sharing: Recipients REST API"""
3879
-
3880
- def __init__(self, api_client):
3881
- self._api = api_client
3882
-
3883
- def create(self,
3884
- name: str,
3885
- authentication_type: AuthenticationType,
3886
- *,
3887
- comment: str = None,
3888
- data_recipient_global_metastore_id: Any = None,
3889
- ip_access_list: IpAccessList = None,
3890
- owner: str = None,
3891
- properties_kvpairs: Any = None,
3892
- sharing_code: str = None,
3893
- **kwargs) -> RecipientInfo:
3894
- """Create a share recipient.
3895
-
3896
- Creates a new recipient with the delta sharing authentication type in the metastore. The caller must
3897
- be a metastore admin or has the **CREATE_RECIPIENT** privilege on the metastore."""
3898
- request = kwargs.get('request', None)
3899
- if not request: # request is not given through keyed args
3900
- request = CreateRecipient(authentication_type=authentication_type,
3901
- comment=comment,
3902
- data_recipient_global_metastore_id=data_recipient_global_metastore_id,
3903
- ip_access_list=ip_access_list,
3904
- name=name,
3905
- owner=owner,
3906
- properties_kvpairs=properties_kvpairs,
3907
- sharing_code=sharing_code)
3908
- body = request.as_dict()
3909
-
3910
- json = self._api.do('POST', '/api/2.1/unity-catalog/recipients', body=body)
3911
- return RecipientInfo.from_dict(json)
3912
-
3913
- def delete(self, name: str, **kwargs):
3914
- """Delete a share recipient.
3915
-
3916
- Deletes the specified recipient from the metastore. The caller must be the owner of the recipient."""
3917
- request = kwargs.get('request', None)
3918
- if not request: # request is not given through keyed args
3919
- request = DeleteRecipientRequest(name=name)
3920
-
3921
- self._api.do('DELETE', f'/api/2.1/unity-catalog/recipients/{request.name}')
3922
-
3923
- def get(self, name: str, **kwargs) -> RecipientInfo:
3924
- """Get a share recipient.
3925
-
3926
- Gets a share recipient from the metastore if:
3927
-
3928
- * the caller is the owner of the share recipient, or: * is a metastore admin"""
3929
- request = kwargs.get('request', None)
3930
- if not request: # request is not given through keyed args
3931
- request = GetRecipientRequest(name=name)
3932
-
3933
- json = self._api.do('GET', f'/api/2.1/unity-catalog/recipients/{request.name}')
3934
- return RecipientInfo.from_dict(json)
3935
-
3936
- def list(self, *, data_recipient_global_metastore_id: str = None, **kwargs) -> Iterator[RecipientInfo]:
3937
- """List share recipients.
3938
-
3939
- Gets an array of all share recipients within the current metastore where:
3940
-
3941
- * the caller is a metastore admin, or * the caller is the owner. There is no guarantee of a specific
3942
- ordering of the elements in the array."""
3943
- request = kwargs.get('request', None)
3944
- if not request: # request is not given through keyed args
3945
- request = ListRecipientsRequest(
3946
- data_recipient_global_metastore_id=data_recipient_global_metastore_id)
3947
-
3948
- query = {}
3949
- if data_recipient_global_metastore_id:
3950
- query['data_recipient_global_metastore_id'] = request.data_recipient_global_metastore_id
3951
-
3952
- json = self._api.do('GET', '/api/2.1/unity-catalog/recipients', query=query)
3953
- return [RecipientInfo.from_dict(v) for v in json.get('recipients', [])]
3954
-
3955
- def rotate_token(self, existing_token_expire_in_seconds: int, name: str, **kwargs) -> RecipientInfo:
3956
- """Rotate a token.
3957
-
3958
- Refreshes the specified recipient's delta sharing authentication token with the provided token info.
3959
- The caller must be the owner of the recipient."""
3960
- request = kwargs.get('request', None)
3961
- if not request: # request is not given through keyed args
3962
- request = RotateRecipientToken(existing_token_expire_in_seconds=existing_token_expire_in_seconds,
3963
- name=name)
3964
- body = request.as_dict()
3965
-
3966
- json = self._api.do('POST',
3967
- f'/api/2.1/unity-catalog/recipients/{request.name}/rotate-token',
3968
- body=body)
3969
- return RecipientInfo.from_dict(json)
3970
-
3971
- def share_permissions(self, name: str, **kwargs) -> GetRecipientSharePermissionsResponse:
3972
- """Get recipient share permissions.
3973
-
3974
- Gets the share permissions for the specified Recipient. The caller must be a metastore admin or the
3975
- owner of the Recipient."""
3976
- request = kwargs.get('request', None)
3977
- if not request: # request is not given through keyed args
3978
- request = SharePermissionsRequest(name=name)
3979
-
3980
- json = self._api.do('GET', f'/api/2.1/unity-catalog/recipients/{request.name}/share-permissions')
3981
- return GetRecipientSharePermissionsResponse.from_dict(json)
3982
-
3983
- def update(self,
3984
- name: str,
3985
- *,
3986
- comment: str = None,
3987
- ip_access_list: IpAccessList = None,
3988
- owner: str = None,
3989
- properties_kvpairs: Any = None,
3990
- **kwargs):
3991
- """Update a share recipient.
3992
-
3993
- Updates an existing recipient in the metastore. The caller must be a metastore admin or the owner of
3994
- the recipient. If the recipient name will be updated, the user must be both a metastore admin and the
3995
- owner of the recipient."""
3996
- request = kwargs.get('request', None)
3997
- if not request: # request is not given through keyed args
3998
- request = UpdateRecipient(comment=comment,
3999
- ip_access_list=ip_access_list,
4000
- name=name,
4001
- owner=owner,
4002
- properties_kvpairs=properties_kvpairs)
4003
- body = request.as_dict()
4004
- self._api.do('PATCH', f'/api/2.1/unity-catalog/recipients/{request.name}', body=body)
4005
-
4006
-
4007
3204
  class SchemasAPI:
4008
3205
  """A schema (also called a database) is the second layer of Unity Catalog’s three-level namespace. A schema
4009
3206
  organizes tables, views and functions. To access (or list) a table or view in a schema, users must have
@@ -4104,117 +3301,6 @@ class SchemasAPI:
4104
3301
  return SchemaInfo.from_dict(json)
4105
3302
 
4106
3303
 
4107
- class SharesAPI:
4108
- """Databricks Delta Sharing: Shares REST API"""
4109
-
4110
- def __init__(self, api_client):
4111
- self._api = api_client
4112
-
4113
- def create(self, name: str, *, comment: str = None, **kwargs) -> ShareInfo:
4114
- """Create a share.
4115
-
4116
- Creates a new share for data objects. Data objects can be added at this time or after creation with
4117
- **update**. The caller must be a metastore admin or have the **CREATE_SHARE** privilege on the
4118
- metastore."""
4119
- request = kwargs.get('request', None)
4120
- if not request: # request is not given through keyed args
4121
- request = CreateShare(comment=comment, name=name)
4122
- body = request.as_dict()
4123
-
4124
- json = self._api.do('POST', '/api/2.1/unity-catalog/shares', body=body)
4125
- return ShareInfo.from_dict(json)
4126
-
4127
- def delete(self, name: str, **kwargs):
4128
- """Delete a share.
4129
-
4130
- Deletes a data object share from the metastore. The caller must be an owner of the share."""
4131
- request = kwargs.get('request', None)
4132
- if not request: # request is not given through keyed args
4133
- request = DeleteShareRequest(name=name)
4134
-
4135
- self._api.do('DELETE', f'/api/2.1/unity-catalog/shares/{request.name}')
4136
-
4137
- def get(self, name: str, *, include_shared_data: bool = None, **kwargs) -> ShareInfo:
4138
- """Get a share.
4139
-
4140
- Gets a data object share from the metastore. The caller must be a metastore admin or the owner of the
4141
- share."""
4142
- request = kwargs.get('request', None)
4143
- if not request: # request is not given through keyed args
4144
- request = GetShareRequest(include_shared_data=include_shared_data, name=name)
4145
-
4146
- query = {}
4147
- if include_shared_data: query['include_shared_data'] = request.include_shared_data
4148
-
4149
- json = self._api.do('GET', f'/api/2.1/unity-catalog/shares/{request.name}', query=query)
4150
- return ShareInfo.from_dict(json)
4151
-
4152
- def list(self) -> Iterator[ShareInfo]:
4153
- """List shares.
4154
-
4155
- Gets an array of data object shares from the metastore. The caller must be a metastore admin or the
4156
- owner of the share. There is no guarantee of a specific ordering of the elements in the array."""
4157
-
4158
- json = self._api.do('GET', '/api/2.1/unity-catalog/shares')
4159
- return [ShareInfo.from_dict(v) for v in json.get('shares', [])]
4160
-
4161
- def share_permissions(self, name: str, **kwargs) -> PermissionsList:
4162
- """Get permissions.
4163
-
4164
- Gets the permissions for a data share from the metastore. The caller must be a metastore admin or the
4165
- owner of the share."""
4166
- request = kwargs.get('request', None)
4167
- if not request: # request is not given through keyed args
4168
- request = SharePermissionsRequest(name=name)
4169
-
4170
- json = self._api.do('GET', f'/api/2.1/unity-catalog/shares/{request.name}/permissions')
4171
- return PermissionsList.from_dict(json)
4172
-
4173
- def update(self,
4174
- name: str,
4175
- *,
4176
- comment: str = None,
4177
- owner: str = None,
4178
- updates: List[SharedDataObjectUpdate] = None,
4179
- **kwargs) -> ShareInfo:
4180
- """Update a share.
4181
-
4182
- Updates the share with the changes and data objects in the request. The caller must be the owner of
4183
- the share or a metastore admin.
4184
-
4185
- When the caller is a metastore admin, only the __owner__ field can be updated.
4186
-
4187
- In the case that the share name is changed, **updateShare** requires that the caller is both the share
4188
- owner and a metastore admin.
4189
-
4190
- For each table that is added through this method, the share owner must also have **SELECT** privilege
4191
- on the table. This privilege must be maintained indefinitely for recipients to be able to access the
4192
- table. Typically, you should use a group as the share owner.
4193
-
4194
- Table removals through **update** do not require additional privileges."""
4195
- request = kwargs.get('request', None)
4196
- if not request: # request is not given through keyed args
4197
- request = UpdateShare(comment=comment, name=name, owner=owner, updates=updates)
4198
- body = request.as_dict()
4199
-
4200
- json = self._api.do('PATCH', f'/api/2.1/unity-catalog/shares/{request.name}', body=body)
4201
- return ShareInfo.from_dict(json)
4202
-
4203
- def update_permissions(self, name: str, *, changes: List[PermissionsChange] = None, **kwargs):
4204
- """Update permissions.
4205
-
4206
- Updates the permissions for a data share in the metastore. The caller must be a metastore admin or an
4207
- owner of the share.
4208
-
4209
- For new recipient grants, the user must also be the owner of the recipients. recipient revocations do
4210
- not require additional privileges."""
4211
- request = kwargs.get('request', None)
4212
- if not request: # request is not given through keyed args
4213
- request = UpdateSharePermissions(changes=changes, name=name)
4214
- body = request.as_dict()
4215
- self._api.do('PATCH', f'/api/2.1/unity-catalog/shares/{request.name}/permissions', body=body)
4216
-
4217
-
4218
3304
  class StorageCredentialsAPI:
4219
3305
  """A storage credential represents an authentication and authorization mechanism for accessing data stored on
4220
3306
  your cloud tenant. Each storage credential is subject to Unity Catalog access-control policies that
@@ -4477,6 +3563,8 @@ class TablesAPI:
4477
3563
  schema_name: str,
4478
3564
  *,
4479
3565
  include_delta_metadata: bool = None,
3566
+ max_results: int = None,
3567
+ page_token: str = None,
4480
3568
  **kwargs) -> Iterator[TableInfo]:
4481
3569
  """List tables.
4482
3570
 
@@ -4489,15 +3577,26 @@ class TablesAPI:
4489
3577
  if not request: # request is not given through keyed args
4490
3578
  request = ListTablesRequest(catalog_name=catalog_name,
4491
3579
  include_delta_metadata=include_delta_metadata,
3580
+ max_results=max_results,
3581
+ page_token=page_token,
4492
3582
  schema_name=schema_name)
4493
3583
 
4494
3584
  query = {}
4495
3585
  if catalog_name: query['catalog_name'] = request.catalog_name
4496
3586
  if include_delta_metadata: query['include_delta_metadata'] = request.include_delta_metadata
3587
+ if max_results: query['max_results'] = request.max_results
3588
+ if page_token: query['page_token'] = request.page_token
4497
3589
  if schema_name: query['schema_name'] = request.schema_name
4498
3590
 
4499
- json = self._api.do('GET', '/api/2.1/unity-catalog/tables', query=query)
4500
- return [TableInfo.from_dict(v) for v in json.get('tables', [])]
3591
+ while True:
3592
+ json = self._api.do('GET', '/api/2.1/unity-catalog/tables', query=query)
3593
+ if 'tables' not in json or not json['tables']:
3594
+ return
3595
+ for v in json['tables']:
3596
+ yield TableInfo.from_dict(v)
3597
+ if 'next_page_token' not in json or not json['next_page_token']:
3598
+ return
3599
+ query['page_token'] = json['next_page_token']
4501
3600
 
4502
3601
  def list_summaries(self,
4503
3602
  catalog_name: str,
@@ -4536,3 +3635,133 @@ class TablesAPI:
4536
3635
 
4537
3636
  json = self._api.do('GET', '/api/2.1/unity-catalog/table-summaries', query=query)
4538
3637
  return ListTableSummariesResponse.from_dict(json)
3638
+
3639
+
3640
+ class VolumesAPI:
3641
+ """Volumes are a Unity Catalog (UC) capability for accessing, storing, governing, organizing and processing
3642
+ files. Use cases include running machine learning on unstructured data such as image, audio, video, or PDF
3643
+ files, organizing data sets during the data exploration stages in data science, working with libraries
3644
+ that require access to the local file system on cluster machines, storing library and config files of
3645
+ arbitrary formats such as .whl or .txt centrally and providing secure access across workspaces to it, or
3646
+ transforming and querying non-tabular data files in ETL."""
3647
+
3648
+ def __init__(self, api_client):
3649
+ self._api = api_client
3650
+
3651
+ def create(self,
3652
+ catalog_name: str,
3653
+ name: str,
3654
+ schema_name: str,
3655
+ volume_type: VolumeType,
3656
+ *,
3657
+ comment: str = None,
3658
+ storage_location: str = None,
3659
+ **kwargs) -> VolumeInfo:
3660
+ """Create a Volume.
3661
+
3662
+ Creates a new volume.
3663
+
3664
+ The user could create either an external volume or a managed volume. An external volume will be
3665
+ created in the specified external location, while a managed volume will be located in the default
3666
+ location which is specified by the parent schema, or the parent catalog, or the Metastore.
3667
+
3668
+ For the volume creation to succeed, the user must satisfy following conditions: - The caller must be a
3669
+ metastore admin, or be the owner of the parent catalog and schema, or have the **USE_CATALOG**
3670
+ privilege on the parent catalog and the **USE_SCHEMA** privilege on the parent schema. - The caller
3671
+ must have **CREATE VOLUME** privilege on the parent schema.
3672
+
3673
+ For an external volume, following conditions also need to satisfy - The caller must have **CREATE
3674
+ EXTERNAL VOLUME** privilege on the external location. - There are no other tables, nor volumes
3675
+ existing in the specified storage location. - The specified storage location is not under the location
3676
+ of other tables, nor volumes, or catalogs or schemas."""
3677
+ request = kwargs.get('request', None)
3678
+ if not request: # request is not given through keyed args
3679
+ request = CreateVolumeRequestContent(catalog_name=catalog_name,
3680
+ comment=comment,
3681
+ name=name,
3682
+ schema_name=schema_name,
3683
+ storage_location=storage_location,
3684
+ volume_type=volume_type)
3685
+ body = request.as_dict()
3686
+
3687
+ json = self._api.do('POST', '/api/2.1/unity-catalog/volumes', body=body)
3688
+ return VolumeInfo.from_dict(json)
3689
+
3690
+ def delete(self, full_name_arg: str, **kwargs):
3691
+ """Delete a Volume.
3692
+
3693
+ Deletes a volume from the specified parent catalog and schema.
3694
+
3695
+ The caller must be a metastore admin or an owner of the volume. For the latter case, the caller must
3696
+ also be the owner or have the **USE_CATALOG** privilege on the parent catalog and the **USE_SCHEMA**
3697
+ privilege on the parent schema."""
3698
+ request = kwargs.get('request', None)
3699
+ if not request: # request is not given through keyed args
3700
+ request = DeleteVolumeRequest(full_name_arg=full_name_arg)
3701
+
3702
+ self._api.do('DELETE', f'/api/2.1/unity-catalog/volumes/{request.full_name_arg}')
3703
+
3704
+ def list(self, catalog_name: str, schema_name: str, **kwargs) -> Iterator[VolumeInfo]:
3705
+ """List Volumes.
3706
+
3707
+ Gets an array of all volumes for the current metastore under the parent catalog and schema.
3708
+
3709
+ The returned volumes are filtered based on the privileges of the calling user. For example, the
3710
+ metastore admin is able to list all the volumes. A regular user needs to be the owner or have the
3711
+ **READ VOLUME** privilege on the volume to recieve the volumes in the response. For the latter case,
3712
+ the caller must also be the owner or have the **USE_CATALOG** privilege on the parent catalog and the
3713
+ **USE_SCHEMA** privilege on the parent schema.
3714
+
3715
+ There is no guarantee of a specific ordering of the elements in the array."""
3716
+ request = kwargs.get('request', None)
3717
+ if not request: # request is not given through keyed args
3718
+ request = ListVolumesRequest(catalog_name=catalog_name, schema_name=schema_name)
3719
+
3720
+ query = {}
3721
+ if catalog_name: query['catalog_name'] = request.catalog_name
3722
+ if schema_name: query['schema_name'] = request.schema_name
3723
+
3724
+ json = self._api.do('GET', '/api/2.1/unity-catalog/volumes', query=query)
3725
+ return [VolumeInfo.from_dict(v) for v in json.get('volumes', [])]
3726
+
3727
+ def read(self, full_name_arg: str, **kwargs) -> VolumeInfo:
3728
+ """Get a Volume.
3729
+
3730
+ Gets a volume from the metastore for a specific catalog and schema.
3731
+
3732
+ The caller must be a metastore admin or an owner of (or have the **READ VOLUME** privilege on) the
3733
+ volume. For the latter case, the caller must also be the owner or have the **USE_CATALOG** privilege
3734
+ on the parent catalog and the **USE_SCHEMA** privilege on the parent schema."""
3735
+ request = kwargs.get('request', None)
3736
+ if not request: # request is not given through keyed args
3737
+ request = ReadVolumeRequest(full_name_arg=full_name_arg)
3738
+
3739
+ json = self._api.do('GET', f'/api/2.1/unity-catalog/volumes/{request.full_name_arg}')
3740
+ return VolumeInfo.from_dict(json)
3741
+
3742
+ def update(self,
3743
+ full_name_arg: str,
3744
+ *,
3745
+ comment: str = None,
3746
+ name: str = None,
3747
+ owner: str = None,
3748
+ **kwargs) -> VolumeInfo:
3749
+ """Update a Volume.
3750
+
3751
+ Updates the specified volume under the specified parent catalog and schema.
3752
+
3753
+ The caller must be a metastore admin or an owner of the volume. For the latter case, the caller must
3754
+ also be the owner or have the **USE_CATALOG** privilege on the parent catalog and the **USE_SCHEMA**
3755
+ privilege on the parent schema.
3756
+
3757
+ Currently only the name, the owner or the comment of the volume could be updated."""
3758
+ request = kwargs.get('request', None)
3759
+ if not request: # request is not given through keyed args
3760
+ request = UpdateVolumeRequestContent(comment=comment,
3761
+ full_name_arg=full_name_arg,
3762
+ name=name,
3763
+ owner=owner)
3764
+ body = request.as_dict()
3765
+
3766
+ json = self._api.do('PATCH', f'/api/2.1/unity-catalog/volumes/{request.full_name_arg}', body=body)
3767
+ return VolumeInfo.from_dict(json)