databricks-sdk 0.63.0__py3-none-any.whl → 0.64.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.
- databricks/sdk/__init__.py +45 -3
- databricks/sdk/service/agentbricks.py +3 -3
- databricks/sdk/service/apps.py +519 -0
- databricks/sdk/service/catalog.py +712 -45
- databricks/sdk/service/cleanrooms.py +3 -3
- databricks/sdk/service/dashboards.py +155 -6
- databricks/sdk/service/jobs.py +36 -4
- databricks/sdk/service/serving.py +16 -0
- databricks/sdk/service/settingsv2.py +937 -0
- databricks/sdk/service/sharing.py +1 -28
- databricks/sdk/service/sql.py +64 -1
- databricks/sdk/service/tags.py +232 -0
- databricks/sdk/service/vectorsearch.py +13 -2
- databricks/sdk/version.py +1 -1
- {databricks_sdk-0.63.0.dist-info → databricks_sdk-0.64.0.dist-info}/METADATA +1 -1
- {databricks_sdk-0.63.0.dist-info → databricks_sdk-0.64.0.dist-info}/RECORD +20 -18
- {databricks_sdk-0.63.0.dist-info → databricks_sdk-0.64.0.dist-info}/WHEEL +0 -0
- {databricks_sdk-0.63.0.dist-info → databricks_sdk-0.64.0.dist-info}/licenses/LICENSE +0 -0
- {databricks_sdk-0.63.0.dist-info → databricks_sdk-0.64.0.dist-info}/licenses/NOTICE +0 -0
- {databricks_sdk-0.63.0.dist-info → databricks_sdk-0.64.0.dist-info}/top_level.txt +0 -0
|
@@ -19,6 +19,50 @@ _LOG = logging.getLogger("databricks.sdk")
|
|
|
19
19
|
# all definitions in this file are in alphabetical order
|
|
20
20
|
|
|
21
21
|
|
|
22
|
+
@dataclass
|
|
23
|
+
class AccessRequestDestinations:
|
|
24
|
+
destinations: List[NotificationDestination]
|
|
25
|
+
"""The access request destinations for the securable."""
|
|
26
|
+
|
|
27
|
+
securable: Securable
|
|
28
|
+
"""The securable for which the access request destinations are being retrieved."""
|
|
29
|
+
|
|
30
|
+
are_any_destinations_hidden: Optional[bool] = None
|
|
31
|
+
"""Indicates whether any destinations are hidden from the caller due to a lack of permissions. This
|
|
32
|
+
value is true if the caller does not have permission to see all destinations."""
|
|
33
|
+
|
|
34
|
+
def as_dict(self) -> dict:
|
|
35
|
+
"""Serializes the AccessRequestDestinations into a dictionary suitable for use as a JSON request body."""
|
|
36
|
+
body = {}
|
|
37
|
+
if self.are_any_destinations_hidden is not None:
|
|
38
|
+
body["are_any_destinations_hidden"] = self.are_any_destinations_hidden
|
|
39
|
+
if self.destinations:
|
|
40
|
+
body["destinations"] = [v.as_dict() for v in self.destinations]
|
|
41
|
+
if self.securable:
|
|
42
|
+
body["securable"] = self.securable.as_dict()
|
|
43
|
+
return body
|
|
44
|
+
|
|
45
|
+
def as_shallow_dict(self) -> dict:
|
|
46
|
+
"""Serializes the AccessRequestDestinations into a shallow dictionary of its immediate attributes."""
|
|
47
|
+
body = {}
|
|
48
|
+
if self.are_any_destinations_hidden is not None:
|
|
49
|
+
body["are_any_destinations_hidden"] = self.are_any_destinations_hidden
|
|
50
|
+
if self.destinations:
|
|
51
|
+
body["destinations"] = self.destinations
|
|
52
|
+
if self.securable:
|
|
53
|
+
body["securable"] = self.securable
|
|
54
|
+
return body
|
|
55
|
+
|
|
56
|
+
@classmethod
|
|
57
|
+
def from_dict(cls, d: Dict[str, Any]) -> AccessRequestDestinations:
|
|
58
|
+
"""Deserializes the AccessRequestDestinations from a dictionary."""
|
|
59
|
+
return cls(
|
|
60
|
+
are_any_destinations_hidden=d.get("are_any_destinations_hidden", None),
|
|
61
|
+
destinations=_repeated_dict(d, "destinations", NotificationDestination),
|
|
62
|
+
securable=_from_dict(d, "securable", Securable),
|
|
63
|
+
)
|
|
64
|
+
|
|
65
|
+
|
|
22
66
|
@dataclass
|
|
23
67
|
class AccountsMetastoreAssignment:
|
|
24
68
|
metastore_assignment: Optional[MetastoreAssignment] = None
|
|
@@ -706,6 +750,31 @@ class AzureUserDelegationSas:
|
|
|
706
750
|
return cls(sas_token=d.get("sas_token", None))
|
|
707
751
|
|
|
708
752
|
|
|
753
|
+
@dataclass
|
|
754
|
+
class BatchCreateAccessRequestsResponse:
|
|
755
|
+
responses: Optional[List[CreateAccessRequestResponse]] = None
|
|
756
|
+
"""The access request destinations for each securable object the principal requested."""
|
|
757
|
+
|
|
758
|
+
def as_dict(self) -> dict:
|
|
759
|
+
"""Serializes the BatchCreateAccessRequestsResponse into a dictionary suitable for use as a JSON request body."""
|
|
760
|
+
body = {}
|
|
761
|
+
if self.responses:
|
|
762
|
+
body["responses"] = [v.as_dict() for v in self.responses]
|
|
763
|
+
return body
|
|
764
|
+
|
|
765
|
+
def as_shallow_dict(self) -> dict:
|
|
766
|
+
"""Serializes the BatchCreateAccessRequestsResponse into a shallow dictionary of its immediate attributes."""
|
|
767
|
+
body = {}
|
|
768
|
+
if self.responses:
|
|
769
|
+
body["responses"] = self.responses
|
|
770
|
+
return body
|
|
771
|
+
|
|
772
|
+
@classmethod
|
|
773
|
+
def from_dict(cls, d: Dict[str, Any]) -> BatchCreateAccessRequestsResponse:
|
|
774
|
+
"""Deserializes the BatchCreateAccessRequestsResponse from a dictionary."""
|
|
775
|
+
return cls(responses=_repeated_dict(d, "responses", CreateAccessRequestResponse))
|
|
776
|
+
|
|
777
|
+
|
|
709
778
|
@dataclass
|
|
710
779
|
class CancelRefreshResponse:
|
|
711
780
|
def as_dict(self) -> dict:
|
|
@@ -1294,9 +1363,6 @@ class ConnectionInfo:
|
|
|
1294
1363
|
credential_type: Optional[CredentialType] = None
|
|
1295
1364
|
"""The type of credential."""
|
|
1296
1365
|
|
|
1297
|
-
environment_settings: Optional[EnvironmentSettings] = None
|
|
1298
|
-
"""[Create,Update:OPT] Connection environment settings as EnvironmentSettings object."""
|
|
1299
|
-
|
|
1300
1366
|
full_name: Optional[str] = None
|
|
1301
1367
|
"""Full name of connection."""
|
|
1302
1368
|
|
|
@@ -1346,8 +1412,6 @@ class ConnectionInfo:
|
|
|
1346
1412
|
body["created_by"] = self.created_by
|
|
1347
1413
|
if self.credential_type is not None:
|
|
1348
1414
|
body["credential_type"] = self.credential_type.value
|
|
1349
|
-
if self.environment_settings:
|
|
1350
|
-
body["environment_settings"] = self.environment_settings.as_dict()
|
|
1351
1415
|
if self.full_name is not None:
|
|
1352
1416
|
body["full_name"] = self.full_name
|
|
1353
1417
|
if self.metastore_id is not None:
|
|
@@ -1389,8 +1453,6 @@ class ConnectionInfo:
|
|
|
1389
1453
|
body["created_by"] = self.created_by
|
|
1390
1454
|
if self.credential_type is not None:
|
|
1391
1455
|
body["credential_type"] = self.credential_type
|
|
1392
|
-
if self.environment_settings:
|
|
1393
|
-
body["environment_settings"] = self.environment_settings
|
|
1394
1456
|
if self.full_name is not None:
|
|
1395
1457
|
body["full_name"] = self.full_name
|
|
1396
1458
|
if self.metastore_id is not None:
|
|
@@ -1427,7 +1489,6 @@ class ConnectionInfo:
|
|
|
1427
1489
|
created_at=d.get("created_at", None),
|
|
1428
1490
|
created_by=d.get("created_by", None),
|
|
1429
1491
|
credential_type=_enum(d, "credential_type", CredentialType),
|
|
1430
|
-
environment_settings=_from_dict(d, "environment_settings", EnvironmentSettings),
|
|
1431
1492
|
full_name=d.get("full_name", None),
|
|
1432
1493
|
metastore_id=d.get("metastore_id", None),
|
|
1433
1494
|
name=d.get("name", None),
|
|
@@ -1516,6 +1577,93 @@ class ContinuousUpdateStatus:
|
|
|
1516
1577
|
)
|
|
1517
1578
|
|
|
1518
1579
|
|
|
1580
|
+
@dataclass
|
|
1581
|
+
class CreateAccessRequest:
|
|
1582
|
+
behalf_of: Optional[Principal] = None
|
|
1583
|
+
"""Optional. The principal this request is for. Empty `behalf_of` defaults to the requester's
|
|
1584
|
+
identity.
|
|
1585
|
+
|
|
1586
|
+
Principals must be unique across the API call."""
|
|
1587
|
+
|
|
1588
|
+
comment: Optional[str] = None
|
|
1589
|
+
"""Optional. Comment associated with the request.
|
|
1590
|
+
|
|
1591
|
+
At most 200 characters, can only contain lowercase/uppercase letters (a-z, A-Z), numbers (0-9),
|
|
1592
|
+
punctuation, and spaces."""
|
|
1593
|
+
|
|
1594
|
+
securable_permissions: Optional[List[SecurablePermissions]] = None
|
|
1595
|
+
"""List of securables and their corresponding requested UC privileges.
|
|
1596
|
+
|
|
1597
|
+
At most 30 securables can be requested for a principal per batched call. Each securable can only
|
|
1598
|
+
be requested once per principal."""
|
|
1599
|
+
|
|
1600
|
+
def as_dict(self) -> dict:
|
|
1601
|
+
"""Serializes the CreateAccessRequest into a dictionary suitable for use as a JSON request body."""
|
|
1602
|
+
body = {}
|
|
1603
|
+
if self.behalf_of:
|
|
1604
|
+
body["behalf_of"] = self.behalf_of.as_dict()
|
|
1605
|
+
if self.comment is not None:
|
|
1606
|
+
body["comment"] = self.comment
|
|
1607
|
+
if self.securable_permissions:
|
|
1608
|
+
body["securable_permissions"] = [v.as_dict() for v in self.securable_permissions]
|
|
1609
|
+
return body
|
|
1610
|
+
|
|
1611
|
+
def as_shallow_dict(self) -> dict:
|
|
1612
|
+
"""Serializes the CreateAccessRequest into a shallow dictionary of its immediate attributes."""
|
|
1613
|
+
body = {}
|
|
1614
|
+
if self.behalf_of:
|
|
1615
|
+
body["behalf_of"] = self.behalf_of
|
|
1616
|
+
if self.comment is not None:
|
|
1617
|
+
body["comment"] = self.comment
|
|
1618
|
+
if self.securable_permissions:
|
|
1619
|
+
body["securable_permissions"] = self.securable_permissions
|
|
1620
|
+
return body
|
|
1621
|
+
|
|
1622
|
+
@classmethod
|
|
1623
|
+
def from_dict(cls, d: Dict[str, Any]) -> CreateAccessRequest:
|
|
1624
|
+
"""Deserializes the CreateAccessRequest from a dictionary."""
|
|
1625
|
+
return cls(
|
|
1626
|
+
behalf_of=_from_dict(d, "behalf_of", Principal),
|
|
1627
|
+
comment=d.get("comment", None),
|
|
1628
|
+
securable_permissions=_repeated_dict(d, "securable_permissions", SecurablePermissions),
|
|
1629
|
+
)
|
|
1630
|
+
|
|
1631
|
+
|
|
1632
|
+
@dataclass
|
|
1633
|
+
class CreateAccessRequestResponse:
|
|
1634
|
+
behalf_of: Optional[Principal] = None
|
|
1635
|
+
"""The principal the request was made on behalf of."""
|
|
1636
|
+
|
|
1637
|
+
request_destinations: Optional[List[AccessRequestDestinations]] = None
|
|
1638
|
+
"""The access request destinations for all the securables the principal requested."""
|
|
1639
|
+
|
|
1640
|
+
def as_dict(self) -> dict:
|
|
1641
|
+
"""Serializes the CreateAccessRequestResponse into a dictionary suitable for use as a JSON request body."""
|
|
1642
|
+
body = {}
|
|
1643
|
+
if self.behalf_of:
|
|
1644
|
+
body["behalf_of"] = self.behalf_of.as_dict()
|
|
1645
|
+
if self.request_destinations:
|
|
1646
|
+
body["request_destinations"] = [v.as_dict() for v in self.request_destinations]
|
|
1647
|
+
return body
|
|
1648
|
+
|
|
1649
|
+
def as_shallow_dict(self) -> dict:
|
|
1650
|
+
"""Serializes the CreateAccessRequestResponse into a shallow dictionary of its immediate attributes."""
|
|
1651
|
+
body = {}
|
|
1652
|
+
if self.behalf_of:
|
|
1653
|
+
body["behalf_of"] = self.behalf_of
|
|
1654
|
+
if self.request_destinations:
|
|
1655
|
+
body["request_destinations"] = self.request_destinations
|
|
1656
|
+
return body
|
|
1657
|
+
|
|
1658
|
+
@classmethod
|
|
1659
|
+
def from_dict(cls, d: Dict[str, Any]) -> CreateAccessRequestResponse:
|
|
1660
|
+
"""Deserializes the CreateAccessRequestResponse from a dictionary."""
|
|
1661
|
+
return cls(
|
|
1662
|
+
behalf_of=_from_dict(d, "behalf_of", Principal),
|
|
1663
|
+
request_destinations=_repeated_dict(d, "request_destinations", AccessRequestDestinations),
|
|
1664
|
+
)
|
|
1665
|
+
|
|
1666
|
+
|
|
1519
1667
|
@dataclass
|
|
1520
1668
|
class CreateFunction:
|
|
1521
1669
|
name: str
|
|
@@ -2635,6 +2783,15 @@ class DependencyList:
|
|
|
2635
2783
|
return cls(dependencies=_repeated_dict(d, "dependencies", Dependency))
|
|
2636
2784
|
|
|
2637
2785
|
|
|
2786
|
+
class DestinationType(Enum):
|
|
2787
|
+
|
|
2788
|
+
EMAIL = "EMAIL"
|
|
2789
|
+
GENERIC_WEBHOOK = "GENERIC_WEBHOOK"
|
|
2790
|
+
MICROSOFT_TEAMS = "MICROSOFT_TEAMS"
|
|
2791
|
+
SLACK = "SLACK"
|
|
2792
|
+
URL = "URL"
|
|
2793
|
+
|
|
2794
|
+
|
|
2638
2795
|
@dataclass
|
|
2639
2796
|
class DisableResponse:
|
|
2640
2797
|
def as_dict(self) -> dict:
|
|
@@ -2872,34 +3029,56 @@ class EncryptionDetails:
|
|
|
2872
3029
|
|
|
2873
3030
|
|
|
2874
3031
|
@dataclass
|
|
2875
|
-
class
|
|
2876
|
-
|
|
3032
|
+
class EntityTagAssignment:
|
|
3033
|
+
"""Represents a tag assignment to an entity"""
|
|
3034
|
+
|
|
3035
|
+
entity_name: str
|
|
3036
|
+
"""The fully qualified name of the entity to which the tag is assigned"""
|
|
2877
3037
|
|
|
2878
|
-
|
|
3038
|
+
tag_key: str
|
|
3039
|
+
"""The key of the tag"""
|
|
3040
|
+
|
|
3041
|
+
entity_type: str
|
|
3042
|
+
"""The type of the entity to which the tag is assigned. Allowed values are: catalogs, schemas,
|
|
3043
|
+
tables, columns, volumes."""
|
|
3044
|
+
|
|
3045
|
+
tag_value: Optional[str] = None
|
|
3046
|
+
"""The value of the tag"""
|
|
2879
3047
|
|
|
2880
3048
|
def as_dict(self) -> dict:
|
|
2881
|
-
"""Serializes the
|
|
3049
|
+
"""Serializes the EntityTagAssignment into a dictionary suitable for use as a JSON request body."""
|
|
2882
3050
|
body = {}
|
|
2883
|
-
if self.
|
|
2884
|
-
body["
|
|
2885
|
-
if self.
|
|
2886
|
-
body["
|
|
3051
|
+
if self.entity_name is not None:
|
|
3052
|
+
body["entity_name"] = self.entity_name
|
|
3053
|
+
if self.entity_type is not None:
|
|
3054
|
+
body["entity_type"] = self.entity_type
|
|
3055
|
+
if self.tag_key is not None:
|
|
3056
|
+
body["tag_key"] = self.tag_key
|
|
3057
|
+
if self.tag_value is not None:
|
|
3058
|
+
body["tag_value"] = self.tag_value
|
|
2887
3059
|
return body
|
|
2888
3060
|
|
|
2889
3061
|
def as_shallow_dict(self) -> dict:
|
|
2890
|
-
"""Serializes the
|
|
3062
|
+
"""Serializes the EntityTagAssignment into a shallow dictionary of its immediate attributes."""
|
|
2891
3063
|
body = {}
|
|
2892
|
-
if self.
|
|
2893
|
-
body["
|
|
2894
|
-
if self.
|
|
2895
|
-
body["
|
|
3064
|
+
if self.entity_name is not None:
|
|
3065
|
+
body["entity_name"] = self.entity_name
|
|
3066
|
+
if self.entity_type is not None:
|
|
3067
|
+
body["entity_type"] = self.entity_type
|
|
3068
|
+
if self.tag_key is not None:
|
|
3069
|
+
body["tag_key"] = self.tag_key
|
|
3070
|
+
if self.tag_value is not None:
|
|
3071
|
+
body["tag_value"] = self.tag_value
|
|
2896
3072
|
return body
|
|
2897
3073
|
|
|
2898
3074
|
@classmethod
|
|
2899
|
-
def from_dict(cls, d: Dict[str, Any]) ->
|
|
2900
|
-
"""Deserializes the
|
|
3075
|
+
def from_dict(cls, d: Dict[str, Any]) -> EntityTagAssignment:
|
|
3076
|
+
"""Deserializes the EntityTagAssignment from a dictionary."""
|
|
2901
3077
|
return cls(
|
|
2902
|
-
|
|
3078
|
+
entity_name=d.get("entity_name", None),
|
|
3079
|
+
entity_type=d.get("entity_type", None),
|
|
3080
|
+
tag_key=d.get("tag_key", None),
|
|
3081
|
+
tag_value=d.get("tag_value", None),
|
|
2903
3082
|
)
|
|
2904
3083
|
|
|
2905
3084
|
|
|
@@ -5125,6 +5304,41 @@ class ListCredentialsResponse:
|
|
|
5125
5304
|
)
|
|
5126
5305
|
|
|
5127
5306
|
|
|
5307
|
+
@dataclass
|
|
5308
|
+
class ListEntityTagAssignmentsResponse:
|
|
5309
|
+
next_page_token: Optional[str] = None
|
|
5310
|
+
"""Optional. Pagination token for retrieving the next page of results"""
|
|
5311
|
+
|
|
5312
|
+
tag_assignments: Optional[List[EntityTagAssignment]] = None
|
|
5313
|
+
"""The list of tag assignments"""
|
|
5314
|
+
|
|
5315
|
+
def as_dict(self) -> dict:
|
|
5316
|
+
"""Serializes the ListEntityTagAssignmentsResponse into a dictionary suitable for use as a JSON request body."""
|
|
5317
|
+
body = {}
|
|
5318
|
+
if self.next_page_token is not None:
|
|
5319
|
+
body["next_page_token"] = self.next_page_token
|
|
5320
|
+
if self.tag_assignments:
|
|
5321
|
+
body["tag_assignments"] = [v.as_dict() for v in self.tag_assignments]
|
|
5322
|
+
return body
|
|
5323
|
+
|
|
5324
|
+
def as_shallow_dict(self) -> dict:
|
|
5325
|
+
"""Serializes the ListEntityTagAssignmentsResponse into a shallow dictionary of its immediate attributes."""
|
|
5326
|
+
body = {}
|
|
5327
|
+
if self.next_page_token is not None:
|
|
5328
|
+
body["next_page_token"] = self.next_page_token
|
|
5329
|
+
if self.tag_assignments:
|
|
5330
|
+
body["tag_assignments"] = self.tag_assignments
|
|
5331
|
+
return body
|
|
5332
|
+
|
|
5333
|
+
@classmethod
|
|
5334
|
+
def from_dict(cls, d: Dict[str, Any]) -> ListEntityTagAssignmentsResponse:
|
|
5335
|
+
"""Deserializes the ListEntityTagAssignmentsResponse from a dictionary."""
|
|
5336
|
+
return cls(
|
|
5337
|
+
next_page_token=d.get("next_page_token", None),
|
|
5338
|
+
tag_assignments=_repeated_dict(d, "tag_assignments", EntityTagAssignment),
|
|
5339
|
+
)
|
|
5340
|
+
|
|
5341
|
+
|
|
5128
5342
|
@dataclass
|
|
5129
5343
|
class ListExternalLineageRelationshipsResponse:
|
|
5130
5344
|
external_lineage_relationships: Optional[List[ExternalLineageInfo]] = None
|
|
@@ -6763,6 +6977,55 @@ class NamedTableConstraint:
|
|
|
6763
6977
|
return cls(name=d.get("name", None))
|
|
6764
6978
|
|
|
6765
6979
|
|
|
6980
|
+
@dataclass
|
|
6981
|
+
class NotificationDestination:
|
|
6982
|
+
destination_id: Optional[str] = None
|
|
6983
|
+
"""The identifier for the destination. This is the email address for EMAIL destinations, the URL
|
|
6984
|
+
for URL destinations, or the unique Databricks notification destination ID for all other
|
|
6985
|
+
external destinations."""
|
|
6986
|
+
|
|
6987
|
+
destination_type: Optional[DestinationType] = None
|
|
6988
|
+
"""The type of the destination."""
|
|
6989
|
+
|
|
6990
|
+
special_destination: Optional[SpecialDestination] = None
|
|
6991
|
+
"""This field is used to denote whether the destination is the email of the owner of the securable
|
|
6992
|
+
object. The special destination cannot be assigned to a securable and only represents the
|
|
6993
|
+
default destination of the securable. The securable types that support default special
|
|
6994
|
+
destinations are: "catalog", "external_location", "connection", "credential", and "metastore".
|
|
6995
|
+
The **destination_type** of a **special_destination** is always EMAIL."""
|
|
6996
|
+
|
|
6997
|
+
def as_dict(self) -> dict:
|
|
6998
|
+
"""Serializes the NotificationDestination into a dictionary suitable for use as a JSON request body."""
|
|
6999
|
+
body = {}
|
|
7000
|
+
if self.destination_id is not None:
|
|
7001
|
+
body["destination_id"] = self.destination_id
|
|
7002
|
+
if self.destination_type is not None:
|
|
7003
|
+
body["destination_type"] = self.destination_type.value
|
|
7004
|
+
if self.special_destination is not None:
|
|
7005
|
+
body["special_destination"] = self.special_destination.value
|
|
7006
|
+
return body
|
|
7007
|
+
|
|
7008
|
+
def as_shallow_dict(self) -> dict:
|
|
7009
|
+
"""Serializes the NotificationDestination into a shallow dictionary of its immediate attributes."""
|
|
7010
|
+
body = {}
|
|
7011
|
+
if self.destination_id is not None:
|
|
7012
|
+
body["destination_id"] = self.destination_id
|
|
7013
|
+
if self.destination_type is not None:
|
|
7014
|
+
body["destination_type"] = self.destination_type
|
|
7015
|
+
if self.special_destination is not None:
|
|
7016
|
+
body["special_destination"] = self.special_destination
|
|
7017
|
+
return body
|
|
7018
|
+
|
|
7019
|
+
@classmethod
|
|
7020
|
+
def from_dict(cls, d: Dict[str, Any]) -> NotificationDestination:
|
|
7021
|
+
"""Deserializes the NotificationDestination from a dictionary."""
|
|
7022
|
+
return cls(
|
|
7023
|
+
destination_id=d.get("destination_id", None),
|
|
7024
|
+
destination_type=_enum(d, "destination_type", DestinationType),
|
|
7025
|
+
special_destination=_enum(d, "special_destination", SpecialDestination),
|
|
7026
|
+
)
|
|
7027
|
+
|
|
7028
|
+
|
|
6766
7029
|
@dataclass
|
|
6767
7030
|
class OnlineTable:
|
|
6768
7031
|
"""Online Table information."""
|
|
@@ -7309,7 +7572,7 @@ class PolicyInfo:
|
|
|
7309
7572
|
update."""
|
|
7310
7573
|
|
|
7311
7574
|
for_securable_type: SecurableType
|
|
7312
|
-
"""Type of securables that the policy should take effect on. Only `
|
|
7575
|
+
"""Type of securables that the policy should take effect on. Only `TABLE` is supported at this
|
|
7313
7576
|
moment. Required on create and optional on update."""
|
|
7314
7577
|
|
|
7315
7578
|
policy_type: PolicyType
|
|
@@ -7337,19 +7600,19 @@ class PolicyInfo:
|
|
|
7337
7600
|
|
|
7338
7601
|
match_columns: Optional[List[MatchColumn]] = None
|
|
7339
7602
|
"""Optional list of condition expressions used to match table columns. Only valid when
|
|
7340
|
-
`for_securable_type` is `
|
|
7603
|
+
`for_securable_type` is `TABLE`. When specified, the policy only applies to tables whose columns
|
|
7341
7604
|
satisfy all match conditions."""
|
|
7342
7605
|
|
|
7343
7606
|
name: Optional[str] = None
|
|
7344
|
-
"""Name of the policy. Required on create and
|
|
7345
|
-
|
|
7607
|
+
"""Name of the policy. Required on create and optional on update. To rename the policy, set `name`
|
|
7608
|
+
to a different value on update."""
|
|
7346
7609
|
|
|
7347
7610
|
on_securable_fullname: Optional[str] = None
|
|
7348
7611
|
"""Full name of the securable on which the policy is defined. Required on create and ignored on
|
|
7349
7612
|
update."""
|
|
7350
7613
|
|
|
7351
7614
|
on_securable_type: Optional[SecurableType] = None
|
|
7352
|
-
"""Type of the securable on which the policy is defined. Only `
|
|
7615
|
+
"""Type of the securable on which the policy is defined. Only `CATALOG`, `SCHEMA` and `TABLE` are
|
|
7353
7616
|
supported at this moment. Required on create and ignored on update."""
|
|
7354
7617
|
|
|
7355
7618
|
row_filter: Optional[RowFilterOptions] = None
|
|
@@ -7525,6 +7788,44 @@ class PrimaryKeyConstraint:
|
|
|
7525
7788
|
)
|
|
7526
7789
|
|
|
7527
7790
|
|
|
7791
|
+
@dataclass
|
|
7792
|
+
class Principal:
|
|
7793
|
+
id: Optional[str] = None
|
|
7794
|
+
"""Databricks user, group or service principal ID."""
|
|
7795
|
+
|
|
7796
|
+
principal_type: Optional[PrincipalType] = None
|
|
7797
|
+
|
|
7798
|
+
def as_dict(self) -> dict:
|
|
7799
|
+
"""Serializes the Principal into a dictionary suitable for use as a JSON request body."""
|
|
7800
|
+
body = {}
|
|
7801
|
+
if self.id is not None:
|
|
7802
|
+
body["id"] = self.id
|
|
7803
|
+
if self.principal_type is not None:
|
|
7804
|
+
body["principal_type"] = self.principal_type.value
|
|
7805
|
+
return body
|
|
7806
|
+
|
|
7807
|
+
def as_shallow_dict(self) -> dict:
|
|
7808
|
+
"""Serializes the Principal into a shallow dictionary of its immediate attributes."""
|
|
7809
|
+
body = {}
|
|
7810
|
+
if self.id is not None:
|
|
7811
|
+
body["id"] = self.id
|
|
7812
|
+
if self.principal_type is not None:
|
|
7813
|
+
body["principal_type"] = self.principal_type
|
|
7814
|
+
return body
|
|
7815
|
+
|
|
7816
|
+
@classmethod
|
|
7817
|
+
def from_dict(cls, d: Dict[str, Any]) -> Principal:
|
|
7818
|
+
"""Deserializes the Principal from a dictionary."""
|
|
7819
|
+
return cls(id=d.get("id", None), principal_type=_enum(d, "principal_type", PrincipalType))
|
|
7820
|
+
|
|
7821
|
+
|
|
7822
|
+
class PrincipalType(Enum):
|
|
7823
|
+
|
|
7824
|
+
GROUP_PRINCIPAL = "GROUP_PRINCIPAL"
|
|
7825
|
+
SERVICE_PRINCIPAL = "SERVICE_PRINCIPAL"
|
|
7826
|
+
USER_PRINCIPAL = "USER_PRINCIPAL"
|
|
7827
|
+
|
|
7828
|
+
|
|
7528
7829
|
class Privilege(Enum):
|
|
7529
7830
|
|
|
7530
7831
|
ACCESS = "ACCESS"
|
|
@@ -8190,6 +8491,53 @@ class SchemaInfo:
|
|
|
8190
8491
|
)
|
|
8191
8492
|
|
|
8192
8493
|
|
|
8494
|
+
@dataclass
|
|
8495
|
+
class Securable:
|
|
8496
|
+
"""Generic definition of a securable, which is uniquely defined in a metastore by its type and full
|
|
8497
|
+
name."""
|
|
8498
|
+
|
|
8499
|
+
full_name: Optional[str] = None
|
|
8500
|
+
"""Required. The full name of the catalog/schema/table. Optional if resource_name is present."""
|
|
8501
|
+
|
|
8502
|
+
provider_share: Optional[str] = None
|
|
8503
|
+
"""Optional. The name of the Share object that contains the securable when the securable is getting
|
|
8504
|
+
shared in D2D Delta Sharing."""
|
|
8505
|
+
|
|
8506
|
+
type: Optional[SecurableType] = None
|
|
8507
|
+
"""Required. The type of securable (catalog/schema/table). Optional if resource_name is present."""
|
|
8508
|
+
|
|
8509
|
+
def as_dict(self) -> dict:
|
|
8510
|
+
"""Serializes the Securable into a dictionary suitable for use as a JSON request body."""
|
|
8511
|
+
body = {}
|
|
8512
|
+
if self.full_name is not None:
|
|
8513
|
+
body["full_name"] = self.full_name
|
|
8514
|
+
if self.provider_share is not None:
|
|
8515
|
+
body["provider_share"] = self.provider_share
|
|
8516
|
+
if self.type is not None:
|
|
8517
|
+
body["type"] = self.type.value
|
|
8518
|
+
return body
|
|
8519
|
+
|
|
8520
|
+
def as_shallow_dict(self) -> dict:
|
|
8521
|
+
"""Serializes the Securable into a shallow dictionary of its immediate attributes."""
|
|
8522
|
+
body = {}
|
|
8523
|
+
if self.full_name is not None:
|
|
8524
|
+
body["full_name"] = self.full_name
|
|
8525
|
+
if self.provider_share is not None:
|
|
8526
|
+
body["provider_share"] = self.provider_share
|
|
8527
|
+
if self.type is not None:
|
|
8528
|
+
body["type"] = self.type
|
|
8529
|
+
return body
|
|
8530
|
+
|
|
8531
|
+
@classmethod
|
|
8532
|
+
def from_dict(cls, d: Dict[str, Any]) -> Securable:
|
|
8533
|
+
"""Deserializes the Securable from a dictionary."""
|
|
8534
|
+
return cls(
|
|
8535
|
+
full_name=d.get("full_name", None),
|
|
8536
|
+
provider_share=d.get("provider_share", None),
|
|
8537
|
+
type=_enum(d, "type", SecurableType),
|
|
8538
|
+
)
|
|
8539
|
+
|
|
8540
|
+
|
|
8193
8541
|
class SecurableKind(Enum):
|
|
8194
8542
|
|
|
8195
8543
|
TABLE_DB_STORAGE = "TABLE_DB_STORAGE"
|
|
@@ -8321,6 +8669,38 @@ class SecurableKindManifest:
|
|
|
8321
8669
|
)
|
|
8322
8670
|
|
|
8323
8671
|
|
|
8672
|
+
@dataclass
|
|
8673
|
+
class SecurablePermissions:
|
|
8674
|
+
permissions: Optional[List[str]] = None
|
|
8675
|
+
"""List of requested Unity Catalog permissions."""
|
|
8676
|
+
|
|
8677
|
+
securable: Optional[Securable] = None
|
|
8678
|
+
"""The securable for which the access request destinations are being requested."""
|
|
8679
|
+
|
|
8680
|
+
def as_dict(self) -> dict:
|
|
8681
|
+
"""Serializes the SecurablePermissions into a dictionary suitable for use as a JSON request body."""
|
|
8682
|
+
body = {}
|
|
8683
|
+
if self.permissions:
|
|
8684
|
+
body["permissions"] = [v for v in self.permissions]
|
|
8685
|
+
if self.securable:
|
|
8686
|
+
body["securable"] = self.securable.as_dict()
|
|
8687
|
+
return body
|
|
8688
|
+
|
|
8689
|
+
def as_shallow_dict(self) -> dict:
|
|
8690
|
+
"""Serializes the SecurablePermissions into a shallow dictionary of its immediate attributes."""
|
|
8691
|
+
body = {}
|
|
8692
|
+
if self.permissions:
|
|
8693
|
+
body["permissions"] = self.permissions
|
|
8694
|
+
if self.securable:
|
|
8695
|
+
body["securable"] = self.securable
|
|
8696
|
+
return body
|
|
8697
|
+
|
|
8698
|
+
@classmethod
|
|
8699
|
+
def from_dict(cls, d: Dict[str, Any]) -> SecurablePermissions:
|
|
8700
|
+
"""Deserializes the SecurablePermissions from a dictionary."""
|
|
8701
|
+
return cls(permissions=d.get("permissions", None), securable=_from_dict(d, "securable", Securable))
|
|
8702
|
+
|
|
8703
|
+
|
|
8324
8704
|
class SecurableType(Enum):
|
|
8325
8705
|
"""The type of Unity Catalog securable."""
|
|
8326
8706
|
|
|
@@ -8343,6 +8723,15 @@ class SecurableType(Enum):
|
|
|
8343
8723
|
VOLUME = "VOLUME"
|
|
8344
8724
|
|
|
8345
8725
|
|
|
8726
|
+
class SpecialDestination(Enum):
|
|
8727
|
+
|
|
8728
|
+
SPECIAL_DESTINATION_CATALOG_OWNER = "SPECIAL_DESTINATION_CATALOG_OWNER"
|
|
8729
|
+
SPECIAL_DESTINATION_CONNECTION_OWNER = "SPECIAL_DESTINATION_CONNECTION_OWNER"
|
|
8730
|
+
SPECIAL_DESTINATION_CREDENTIAL_OWNER = "SPECIAL_DESTINATION_CREDENTIAL_OWNER"
|
|
8731
|
+
SPECIAL_DESTINATION_EXTERNAL_LOCATION_OWNER = "SPECIAL_DESTINATION_EXTERNAL_LOCATION_OWNER"
|
|
8732
|
+
SPECIAL_DESTINATION_METASTORE_OWNER = "SPECIAL_DESTINATION_METASTORE_OWNER"
|
|
8733
|
+
|
|
8734
|
+
|
|
8346
8735
|
@dataclass
|
|
8347
8736
|
class SseEncryptionDetails:
|
|
8348
8737
|
"""Server-Side Encryption properties for clients communicating with AWS s3."""
|
|
@@ -10701,7 +11090,6 @@ class ConnectionsAPI:
|
|
|
10701
11090
|
options: Dict[str, str],
|
|
10702
11091
|
*,
|
|
10703
11092
|
comment: Optional[str] = None,
|
|
10704
|
-
environment_settings: Optional[EnvironmentSettings] = None,
|
|
10705
11093
|
properties: Optional[Dict[str, str]] = None,
|
|
10706
11094
|
read_only: Optional[bool] = None,
|
|
10707
11095
|
) -> ConnectionInfo:
|
|
@@ -10718,8 +11106,6 @@ class ConnectionsAPI:
|
|
|
10718
11106
|
A map of key-value properties attached to the securable.
|
|
10719
11107
|
:param comment: str (optional)
|
|
10720
11108
|
User-provided free-form text description.
|
|
10721
|
-
:param environment_settings: :class:`EnvironmentSettings` (optional)
|
|
10722
|
-
[Create,Update:OPT] Connection environment settings as EnvironmentSettings object.
|
|
10723
11109
|
:param properties: Dict[str,str] (optional)
|
|
10724
11110
|
A map of key-value properties attached to the securable.
|
|
10725
11111
|
:param read_only: bool (optional)
|
|
@@ -10732,8 +11118,6 @@ class ConnectionsAPI:
|
|
|
10732
11118
|
body["comment"] = comment
|
|
10733
11119
|
if connection_type is not None:
|
|
10734
11120
|
body["connection_type"] = connection_type.value
|
|
10735
|
-
if environment_settings is not None:
|
|
10736
|
-
body["environment_settings"] = environment_settings.as_dict()
|
|
10737
11121
|
if name is not None:
|
|
10738
11122
|
body["name"] = name
|
|
10739
11123
|
if options is not None:
|
|
@@ -10814,13 +11198,7 @@ class ConnectionsAPI:
|
|
|
10814
11198
|
query["page_token"] = json["next_page_token"]
|
|
10815
11199
|
|
|
10816
11200
|
def update(
|
|
10817
|
-
self,
|
|
10818
|
-
name: str,
|
|
10819
|
-
options: Dict[str, str],
|
|
10820
|
-
*,
|
|
10821
|
-
environment_settings: Optional[EnvironmentSettings] = None,
|
|
10822
|
-
new_name: Optional[str] = None,
|
|
10823
|
-
owner: Optional[str] = None,
|
|
11201
|
+
self, name: str, options: Dict[str, str], *, new_name: Optional[str] = None, owner: Optional[str] = None
|
|
10824
11202
|
) -> ConnectionInfo:
|
|
10825
11203
|
"""Updates the connection that matches the supplied name.
|
|
10826
11204
|
|
|
@@ -10828,8 +11206,6 @@ class ConnectionsAPI:
|
|
|
10828
11206
|
Name of the connection.
|
|
10829
11207
|
:param options: Dict[str,str]
|
|
10830
11208
|
A map of key-value properties attached to the securable.
|
|
10831
|
-
:param environment_settings: :class:`EnvironmentSettings` (optional)
|
|
10832
|
-
[Create,Update:OPT] Connection environment settings as EnvironmentSettings object.
|
|
10833
11209
|
:param new_name: str (optional)
|
|
10834
11210
|
New name for the connection.
|
|
10835
11211
|
:param owner: str (optional)
|
|
@@ -10838,8 +11214,6 @@ class ConnectionsAPI:
|
|
|
10838
11214
|
:returns: :class:`ConnectionInfo`
|
|
10839
11215
|
"""
|
|
10840
11216
|
body = {}
|
|
10841
|
-
if environment_settings is not None:
|
|
10842
|
-
body["environment_settings"] = environment_settings.as_dict()
|
|
10843
11217
|
if new_name is not None:
|
|
10844
11218
|
body["new_name"] = new_name
|
|
10845
11219
|
if options is not None:
|
|
@@ -11204,6 +11578,193 @@ class CredentialsAPI:
|
|
|
11204
11578
|
return ValidateCredentialResponse.from_dict(res)
|
|
11205
11579
|
|
|
11206
11580
|
|
|
11581
|
+
class EntityTagAssignmentsAPI:
|
|
11582
|
+
"""Tags are attributes that include keys and optional values that you can use to organize and categorize
|
|
11583
|
+
entities in Unity Catalog. Entity tagging is currently supported on catalogs, schemas, tables (including
|
|
11584
|
+
views), columns, volumes. With these APIs, users can create, update, delete, and list tag assignments
|
|
11585
|
+
across Unity Catalog entities"""
|
|
11586
|
+
|
|
11587
|
+
def __init__(self, api_client):
|
|
11588
|
+
self._api = api_client
|
|
11589
|
+
|
|
11590
|
+
def create(self, tag_assignment: EntityTagAssignment) -> EntityTagAssignment:
|
|
11591
|
+
"""Creates a tag assignment for an Unity Catalog entity.
|
|
11592
|
+
|
|
11593
|
+
To add tags to Unity Catalog entities, you must own the entity or have the following privileges: -
|
|
11594
|
+
**APPLY TAG** on the entity - **USE SCHEMA** on the entity's parent schema - **USE CATALOG** on the
|
|
11595
|
+
entity's parent catalog
|
|
11596
|
+
|
|
11597
|
+
To add a governed tag to Unity Catalog entities, you must also have the **ASSIGN** or **MANAGE**
|
|
11598
|
+
permission on the tag policy. See [Manage tag policy permissions].
|
|
11599
|
+
|
|
11600
|
+
[Manage tag policy permissions]: https://docs.databricks.com/aws/en/admin/tag-policies/manage-permissions
|
|
11601
|
+
|
|
11602
|
+
:param tag_assignment: :class:`EntityTagAssignment`
|
|
11603
|
+
|
|
11604
|
+
:returns: :class:`EntityTagAssignment`
|
|
11605
|
+
"""
|
|
11606
|
+
body = tag_assignment.as_dict()
|
|
11607
|
+
headers = {
|
|
11608
|
+
"Accept": "application/json",
|
|
11609
|
+
"Content-Type": "application/json",
|
|
11610
|
+
}
|
|
11611
|
+
|
|
11612
|
+
res = self._api.do("POST", "/api/2.1/unity-catalog/entity-tag-assignments", body=body, headers=headers)
|
|
11613
|
+
return EntityTagAssignment.from_dict(res)
|
|
11614
|
+
|
|
11615
|
+
def delete(self, entity_type: str, entity_name: str, tag_key: str):
|
|
11616
|
+
"""Deletes a tag assignment for an Unity Catalog entity by its key.
|
|
11617
|
+
|
|
11618
|
+
To delete tags from Unity Catalog entities, you must own the entity or have the following privileges:
|
|
11619
|
+
- **APPLY TAG** on the entity - **USE_SCHEMA** on the entity's parent schema - **USE_CATALOG** on the
|
|
11620
|
+
entity's parent catalog
|
|
11621
|
+
|
|
11622
|
+
To delete a governed tag from Unity Catalog entities, you must also have the **ASSIGN** or **MANAGE**
|
|
11623
|
+
permission on the tag policy. See [Manage tag policy permissions].
|
|
11624
|
+
|
|
11625
|
+
[Manage tag policy permissions]: https://docs.databricks.com/aws/en/admin/tag-policies/manage-permissions
|
|
11626
|
+
|
|
11627
|
+
:param entity_type: str
|
|
11628
|
+
The type of the entity to which the tag is assigned. Allowed values are: catalogs, schemas, tables,
|
|
11629
|
+
columns, volumes.
|
|
11630
|
+
:param entity_name: str
|
|
11631
|
+
The fully qualified name of the entity to which the tag is assigned
|
|
11632
|
+
:param tag_key: str
|
|
11633
|
+
Required. The key of the tag to delete
|
|
11634
|
+
|
|
11635
|
+
|
|
11636
|
+
"""
|
|
11637
|
+
|
|
11638
|
+
headers = {
|
|
11639
|
+
"Accept": "application/json",
|
|
11640
|
+
}
|
|
11641
|
+
|
|
11642
|
+
self._api.do(
|
|
11643
|
+
"DELETE",
|
|
11644
|
+
f"/api/2.1/unity-catalog/entity-tag-assignments/{entity_type}/{entity_name}/tags/{tag_key}",
|
|
11645
|
+
headers=headers,
|
|
11646
|
+
)
|
|
11647
|
+
|
|
11648
|
+
def get(self, entity_type: str, entity_name: str, tag_key: str) -> EntityTagAssignment:
|
|
11649
|
+
"""Gets a tag assignment for an Unity Catalog entity by tag key.
|
|
11650
|
+
|
|
11651
|
+
:param entity_type: str
|
|
11652
|
+
The type of the entity to which the tag is assigned. Allowed values are: catalogs, schemas, tables,
|
|
11653
|
+
columns, volumes.
|
|
11654
|
+
:param entity_name: str
|
|
11655
|
+
The fully qualified name of the entity to which the tag is assigned
|
|
11656
|
+
:param tag_key: str
|
|
11657
|
+
Required. The key of the tag
|
|
11658
|
+
|
|
11659
|
+
:returns: :class:`EntityTagAssignment`
|
|
11660
|
+
"""
|
|
11661
|
+
|
|
11662
|
+
headers = {
|
|
11663
|
+
"Accept": "application/json",
|
|
11664
|
+
}
|
|
11665
|
+
|
|
11666
|
+
res = self._api.do(
|
|
11667
|
+
"GET",
|
|
11668
|
+
f"/api/2.1/unity-catalog/entity-tag-assignments/{entity_type}/{entity_name}/tags/{tag_key}",
|
|
11669
|
+
headers=headers,
|
|
11670
|
+
)
|
|
11671
|
+
return EntityTagAssignment.from_dict(res)
|
|
11672
|
+
|
|
11673
|
+
def list(
|
|
11674
|
+
self, entity_type: str, entity_name: str, *, max_results: Optional[int] = None, page_token: Optional[str] = None
|
|
11675
|
+
) -> Iterator[EntityTagAssignment]:
|
|
11676
|
+
"""List tag assignments for an Unity Catalog entity
|
|
11677
|
+
|
|
11678
|
+
:param entity_type: str
|
|
11679
|
+
The type of the entity to which the tag is assigned. Allowed values are: catalogs, schemas, tables,
|
|
11680
|
+
columns, volumes.
|
|
11681
|
+
:param entity_name: str
|
|
11682
|
+
The fully qualified name of the entity to which the tag is assigned
|
|
11683
|
+
:param max_results: int (optional)
|
|
11684
|
+
Optional. Maximum number of tag assignments to return in a single page
|
|
11685
|
+
:param page_token: str (optional)
|
|
11686
|
+
Optional. Pagination token to retrieve the next page of results
|
|
11687
|
+
|
|
11688
|
+
:returns: Iterator over :class:`EntityTagAssignment`
|
|
11689
|
+
"""
|
|
11690
|
+
|
|
11691
|
+
query = {}
|
|
11692
|
+
if max_results is not None:
|
|
11693
|
+
query["max_results"] = max_results
|
|
11694
|
+
if page_token is not None:
|
|
11695
|
+
query["page_token"] = page_token
|
|
11696
|
+
headers = {
|
|
11697
|
+
"Accept": "application/json",
|
|
11698
|
+
}
|
|
11699
|
+
|
|
11700
|
+
while True:
|
|
11701
|
+
json = self._api.do(
|
|
11702
|
+
"GET",
|
|
11703
|
+
f"/api/2.1/unity-catalog/entity-tag-assignments/{entity_type}/{entity_name}/tags",
|
|
11704
|
+
query=query,
|
|
11705
|
+
headers=headers,
|
|
11706
|
+
)
|
|
11707
|
+
if "tag_assignments" in json:
|
|
11708
|
+
for v in json["tag_assignments"]:
|
|
11709
|
+
yield EntityTagAssignment.from_dict(v)
|
|
11710
|
+
if "next_page_token" not in json or not json["next_page_token"]:
|
|
11711
|
+
return
|
|
11712
|
+
query["page_token"] = json["next_page_token"]
|
|
11713
|
+
|
|
11714
|
+
def update(
|
|
11715
|
+
self, entity_type: str, entity_name: str, tag_key: str, tag_assignment: EntityTagAssignment, update_mask: str
|
|
11716
|
+
) -> EntityTagAssignment:
|
|
11717
|
+
"""Updates an existing tag assignment for an Unity Catalog entity.
|
|
11718
|
+
|
|
11719
|
+
To update tags to Unity Catalog entities, you must own the entity or have the following privileges: -
|
|
11720
|
+
**APPLY TAG** on the entity - **USE SCHEMA** on the entity's parent schema - **USE CATALOG** on the
|
|
11721
|
+
entity's parent catalog
|
|
11722
|
+
|
|
11723
|
+
To update a governed tag to Unity Catalog entities, you must also have the **ASSIGN** or **MANAGE**
|
|
11724
|
+
permission on the tag policy. See [Manage tag policy permissions].
|
|
11725
|
+
|
|
11726
|
+
[Manage tag policy permissions]: https://docs.databricks.com/aws/en/admin/tag-policies/manage-permissions
|
|
11727
|
+
|
|
11728
|
+
:param entity_type: str
|
|
11729
|
+
The type of the entity to which the tag is assigned. Allowed values are: catalogs, schemas, tables,
|
|
11730
|
+
columns, volumes.
|
|
11731
|
+
:param entity_name: str
|
|
11732
|
+
The fully qualified name of the entity to which the tag is assigned
|
|
11733
|
+
:param tag_key: str
|
|
11734
|
+
The key of the tag
|
|
11735
|
+
:param tag_assignment: :class:`EntityTagAssignment`
|
|
11736
|
+
:param update_mask: str
|
|
11737
|
+
The field mask must be a single string, with multiple fields separated by commas (no spaces). The
|
|
11738
|
+
field path is relative to the resource object, using a dot (`.`) to navigate sub-fields (e.g.,
|
|
11739
|
+
`author.given_name`). Specification of elements in sequence or map fields is not allowed, as only
|
|
11740
|
+
the entire collection field can be specified. Field names must exactly match the resource field
|
|
11741
|
+
names.
|
|
11742
|
+
|
|
11743
|
+
A field mask of `*` indicates full replacement. It’s recommended to always explicitly list the
|
|
11744
|
+
fields being updated and avoid using `*` wildcards, as it can lead to unintended results if the API
|
|
11745
|
+
changes in the future.
|
|
11746
|
+
|
|
11747
|
+
:returns: :class:`EntityTagAssignment`
|
|
11748
|
+
"""
|
|
11749
|
+
body = tag_assignment.as_dict()
|
|
11750
|
+
query = {}
|
|
11751
|
+
if update_mask is not None:
|
|
11752
|
+
query["update_mask"] = update_mask
|
|
11753
|
+
headers = {
|
|
11754
|
+
"Accept": "application/json",
|
|
11755
|
+
"Content-Type": "application/json",
|
|
11756
|
+
}
|
|
11757
|
+
|
|
11758
|
+
res = self._api.do(
|
|
11759
|
+
"PATCH",
|
|
11760
|
+
f"/api/2.1/unity-catalog/entity-tag-assignments/{entity_type}/{entity_name}/tags/{tag_key}",
|
|
11761
|
+
query=query,
|
|
11762
|
+
body=body,
|
|
11763
|
+
headers=headers,
|
|
11764
|
+
)
|
|
11765
|
+
return EntityTagAssignment.from_dict(res)
|
|
11766
|
+
|
|
11767
|
+
|
|
11207
11768
|
class ExternalLineageAPI:
|
|
11208
11769
|
"""External Lineage APIs enable defining and managing lineage relationships between Databricks objects and
|
|
11209
11770
|
external systems. These APIs allow users to capture data flows connecting Databricks tables, models, and
|
|
@@ -13571,6 +14132,112 @@ class ResourceQuotasAPI:
|
|
|
13571
14132
|
query["page_token"] = json["next_page_token"]
|
|
13572
14133
|
|
|
13573
14134
|
|
|
14135
|
+
class RfaAPI:
|
|
14136
|
+
"""Request for Access enables customers to request access to and manage access request destinations for Unity
|
|
14137
|
+
Catalog securables.
|
|
14138
|
+
|
|
14139
|
+
These APIs provide a standardized way to update, get, and request to access request destinations.
|
|
14140
|
+
Fine-grained authorization ensures that only users with appropriate permissions can manage access request
|
|
14141
|
+
destinations."""
|
|
14142
|
+
|
|
14143
|
+
def __init__(self, api_client):
|
|
14144
|
+
self._api = api_client
|
|
14145
|
+
|
|
14146
|
+
def batch_create_access_requests(
|
|
14147
|
+
self, *, requests: Optional[List[CreateAccessRequest]] = None
|
|
14148
|
+
) -> BatchCreateAccessRequestsResponse:
|
|
14149
|
+
"""Creates access requests for Unity Catalog permissions for a specified principal on a securable object.
|
|
14150
|
+
This Batch API can take in multiple principals, securable objects, and permissions as the input and
|
|
14151
|
+
returns the access request destinations for each. Principals must be unique across the API call.
|
|
14152
|
+
|
|
14153
|
+
The supported securable types are: "metastore", "catalog", "schema", "table", "external_location",
|
|
14154
|
+
"connection", "credential", "function", "registered_model", and "volume".
|
|
14155
|
+
|
|
14156
|
+
:param requests: List[:class:`CreateAccessRequest`] (optional)
|
|
14157
|
+
A list of individual access requests, where each request corresponds to a set of permissions being
|
|
14158
|
+
requested on a list of securables for a specified principal.
|
|
14159
|
+
|
|
14160
|
+
At most 30 requests per API call.
|
|
14161
|
+
|
|
14162
|
+
:returns: :class:`BatchCreateAccessRequestsResponse`
|
|
14163
|
+
"""
|
|
14164
|
+
body = {}
|
|
14165
|
+
if requests is not None:
|
|
14166
|
+
body["requests"] = [v.as_dict() for v in requests]
|
|
14167
|
+
headers = {
|
|
14168
|
+
"Accept": "application/json",
|
|
14169
|
+
"Content-Type": "application/json",
|
|
14170
|
+
}
|
|
14171
|
+
|
|
14172
|
+
res = self._api.do("POST", "/api/3.0/rfa/requests", body=body, headers=headers)
|
|
14173
|
+
return BatchCreateAccessRequestsResponse.from_dict(res)
|
|
14174
|
+
|
|
14175
|
+
def get_access_request_destinations(self, securable_type: str, full_name: str) -> AccessRequestDestinations:
|
|
14176
|
+
"""Gets an array of access request destinations for the specified securable. Any caller can see URL
|
|
14177
|
+
destinations or the destinations on the metastore. Otherwise, only those with **BROWSE** permissions
|
|
14178
|
+
on the securable can see destinations.
|
|
14179
|
+
|
|
14180
|
+
The supported securable types are: "metastore", "catalog", "schema", "table", "external_location",
|
|
14181
|
+
"connection", "credential", "function", "registered_model", and "volume".
|
|
14182
|
+
|
|
14183
|
+
:param securable_type: str
|
|
14184
|
+
The type of the securable.
|
|
14185
|
+
:param full_name: str
|
|
14186
|
+
The full name of the securable.
|
|
14187
|
+
|
|
14188
|
+
:returns: :class:`AccessRequestDestinations`
|
|
14189
|
+
"""
|
|
14190
|
+
|
|
14191
|
+
headers = {
|
|
14192
|
+
"Accept": "application/json",
|
|
14193
|
+
}
|
|
14194
|
+
|
|
14195
|
+
res = self._api.do("GET", f"/api/3.0/rfa/destinations/{securable_type}/{full_name}", headers=headers)
|
|
14196
|
+
return AccessRequestDestinations.from_dict(res)
|
|
14197
|
+
|
|
14198
|
+
def update_access_request_destinations(
|
|
14199
|
+
self, access_request_destinations: AccessRequestDestinations, update_mask: str
|
|
14200
|
+
) -> AccessRequestDestinations:
|
|
14201
|
+
"""Updates the access request destinations for the given securable. The caller must be a metastore admin,
|
|
14202
|
+
the owner of the securable, or a user that has the **MANAGE** privilege on the securable in order to
|
|
14203
|
+
assign destinations. Destinations cannot be updated for securables underneath schemas (tables,
|
|
14204
|
+
volumes, functions, and models). For these securable types, destinations are inherited from the parent
|
|
14205
|
+
securable. A maximum of 5 emails and 5 external notification destinations (Slack, Microsoft Teams, and
|
|
14206
|
+
Generic Webhook destinations) can be assigned to a securable. If a URL destination is assigned, no
|
|
14207
|
+
other destinations can be set.
|
|
14208
|
+
|
|
14209
|
+
The supported securable types are: "metastore", "catalog", "schema", "table", "external_location",
|
|
14210
|
+
"connection", "credential", "function", "registered_model", and "volume".
|
|
14211
|
+
|
|
14212
|
+
:param access_request_destinations: :class:`AccessRequestDestinations`
|
|
14213
|
+
The access request destinations to assign to the securable. For each destination, a
|
|
14214
|
+
**destination_id** and **destination_type** must be defined.
|
|
14215
|
+
:param update_mask: str
|
|
14216
|
+
The field mask must be a single string, with multiple fields separated by commas (no spaces). The
|
|
14217
|
+
field path is relative to the resource object, using a dot (`.`) to navigate sub-fields (e.g.,
|
|
14218
|
+
`author.given_name`). Specification of elements in sequence or map fields is not allowed, as only
|
|
14219
|
+
the entire collection field can be specified. Field names must exactly match the resource field
|
|
14220
|
+
names.
|
|
14221
|
+
|
|
14222
|
+
A field mask of `*` indicates full replacement. It’s recommended to always explicitly list the
|
|
14223
|
+
fields being updated and avoid using `*` wildcards, as it can lead to unintended results if the API
|
|
14224
|
+
changes in the future.
|
|
14225
|
+
|
|
14226
|
+
:returns: :class:`AccessRequestDestinations`
|
|
14227
|
+
"""
|
|
14228
|
+
body = access_request_destinations.as_dict()
|
|
14229
|
+
query = {}
|
|
14230
|
+
if update_mask is not None:
|
|
14231
|
+
query["update_mask"] = update_mask
|
|
14232
|
+
headers = {
|
|
14233
|
+
"Accept": "application/json",
|
|
14234
|
+
"Content-Type": "application/json",
|
|
14235
|
+
}
|
|
14236
|
+
|
|
14237
|
+
res = self._api.do("PATCH", "/api/3.0/rfa/destinations", query=query, body=body, headers=headers)
|
|
14238
|
+
return AccessRequestDestinations.from_dict(res)
|
|
14239
|
+
|
|
14240
|
+
|
|
13574
14241
|
class SchemasAPI:
|
|
13575
14242
|
"""A schema (also called a database) is the second layer of Unity Catalog’s three-level namespace. A schema
|
|
13576
14243
|
organizes tables, views and functions. To access (or list) a table or view in a schema, users must have
|