databricks-sdk 0.39.0__py3-none-any.whl → 0.40.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 +15 -1
- databricks/sdk/service/catalog.py +2 -2
- databricks/sdk/service/compute.py +361 -63
- databricks/sdk/service/dashboards.py +16 -2
- databricks/sdk/service/jobs.py +89 -14
- databricks/sdk/service/oauth2.py +461 -0
- databricks/sdk/service/pipelines.py +5 -5
- databricks/sdk/version.py +1 -1
- {databricks_sdk-0.39.0.dist-info → databricks_sdk-0.40.0.dist-info}/METADATA +1 -1
- {databricks_sdk-0.39.0.dist-info → databricks_sdk-0.40.0.dist-info}/RECORD +14 -14
- {databricks_sdk-0.39.0.dist-info → databricks_sdk-0.40.0.dist-info}/LICENSE +0 -0
- {databricks_sdk-0.39.0.dist-info → databricks_sdk-0.40.0.dist-info}/NOTICE +0 -0
- {databricks_sdk-0.39.0.dist-info → databricks_sdk-0.40.0.dist-info}/WHEEL +0 -0
- {databricks_sdk-0.39.0.dist-info → databricks_sdk-0.40.0.dist-info}/top_level.txt +0 -0
databricks/sdk/service/oauth2.py
CHANGED
|
@@ -288,6 +288,60 @@ class DeleteResponse:
|
|
|
288
288
|
return cls()
|
|
289
289
|
|
|
290
290
|
|
|
291
|
+
@dataclass
|
|
292
|
+
class FederationPolicy:
|
|
293
|
+
create_time: Optional[str] = None
|
|
294
|
+
"""Creation time of the federation policy."""
|
|
295
|
+
|
|
296
|
+
description: Optional[str] = None
|
|
297
|
+
"""Description of the federation policy."""
|
|
298
|
+
|
|
299
|
+
name: Optional[str] = None
|
|
300
|
+
"""Name of the federation policy. The name must contain only lowercase alphanumeric characters,
|
|
301
|
+
numbers, and hyphens. It must be unique within the account."""
|
|
302
|
+
|
|
303
|
+
oidc_policy: Optional[OidcFederationPolicy] = None
|
|
304
|
+
"""Specifies the policy to use for validating OIDC claims in your federated tokens."""
|
|
305
|
+
|
|
306
|
+
uid: Optional[str] = None
|
|
307
|
+
"""Unique, immutable id of the federation policy."""
|
|
308
|
+
|
|
309
|
+
update_time: Optional[str] = None
|
|
310
|
+
"""Last update time of the federation policy."""
|
|
311
|
+
|
|
312
|
+
def as_dict(self) -> dict:
|
|
313
|
+
"""Serializes the FederationPolicy into a dictionary suitable for use as a JSON request body."""
|
|
314
|
+
body = {}
|
|
315
|
+
if self.create_time is not None: body['create_time'] = self.create_time
|
|
316
|
+
if self.description is not None: body['description'] = self.description
|
|
317
|
+
if self.name is not None: body['name'] = self.name
|
|
318
|
+
if self.oidc_policy: body['oidc_policy'] = self.oidc_policy.as_dict()
|
|
319
|
+
if self.uid is not None: body['uid'] = self.uid
|
|
320
|
+
if self.update_time is not None: body['update_time'] = self.update_time
|
|
321
|
+
return body
|
|
322
|
+
|
|
323
|
+
def as_shallow_dict(self) -> dict:
|
|
324
|
+
"""Serializes the FederationPolicy into a shallow dictionary of its immediate attributes."""
|
|
325
|
+
body = {}
|
|
326
|
+
if self.create_time is not None: body['create_time'] = self.create_time
|
|
327
|
+
if self.description is not None: body['description'] = self.description
|
|
328
|
+
if self.name is not None: body['name'] = self.name
|
|
329
|
+
if self.oidc_policy: body['oidc_policy'] = self.oidc_policy
|
|
330
|
+
if self.uid is not None: body['uid'] = self.uid
|
|
331
|
+
if self.update_time is not None: body['update_time'] = self.update_time
|
|
332
|
+
return body
|
|
333
|
+
|
|
334
|
+
@classmethod
|
|
335
|
+
def from_dict(cls, d: Dict[str, any]) -> FederationPolicy:
|
|
336
|
+
"""Deserializes the FederationPolicy from a dictionary."""
|
|
337
|
+
return cls(create_time=d.get('create_time', None),
|
|
338
|
+
description=d.get('description', None),
|
|
339
|
+
name=d.get('name', None),
|
|
340
|
+
oidc_policy=_from_dict(d, 'oidc_policy', OidcFederationPolicy),
|
|
341
|
+
uid=d.get('uid', None),
|
|
342
|
+
update_time=d.get('update_time', None))
|
|
343
|
+
|
|
344
|
+
|
|
291
345
|
@dataclass
|
|
292
346
|
class GetCustomAppIntegrationOutput:
|
|
293
347
|
client_id: Optional[str] = None
|
|
@@ -498,6 +552,33 @@ class GetPublishedAppsOutput:
|
|
|
498
552
|
next_page_token=d.get('next_page_token', None))
|
|
499
553
|
|
|
500
554
|
|
|
555
|
+
@dataclass
|
|
556
|
+
class ListFederationPoliciesResponse:
|
|
557
|
+
next_page_token: Optional[str] = None
|
|
558
|
+
|
|
559
|
+
policies: Optional[List[FederationPolicy]] = None
|
|
560
|
+
|
|
561
|
+
def as_dict(self) -> dict:
|
|
562
|
+
"""Serializes the ListFederationPoliciesResponse into a dictionary suitable for use as a JSON request body."""
|
|
563
|
+
body = {}
|
|
564
|
+
if self.next_page_token is not None: body['next_page_token'] = self.next_page_token
|
|
565
|
+
if self.policies: body['policies'] = [v.as_dict() for v in self.policies]
|
|
566
|
+
return body
|
|
567
|
+
|
|
568
|
+
def as_shallow_dict(self) -> dict:
|
|
569
|
+
"""Serializes the ListFederationPoliciesResponse into a shallow dictionary of its immediate attributes."""
|
|
570
|
+
body = {}
|
|
571
|
+
if self.next_page_token is not None: body['next_page_token'] = self.next_page_token
|
|
572
|
+
if self.policies: body['policies'] = self.policies
|
|
573
|
+
return body
|
|
574
|
+
|
|
575
|
+
@classmethod
|
|
576
|
+
def from_dict(cls, d: Dict[str, any]) -> ListFederationPoliciesResponse:
|
|
577
|
+
"""Deserializes the ListFederationPoliciesResponse from a dictionary."""
|
|
578
|
+
return cls(next_page_token=d.get('next_page_token', None),
|
|
579
|
+
policies=_repeated_dict(d, 'policies', FederationPolicy))
|
|
580
|
+
|
|
581
|
+
|
|
501
582
|
@dataclass
|
|
502
583
|
class ListServicePrincipalSecretsResponse:
|
|
503
584
|
next_page_token: Optional[str] = None
|
|
@@ -527,6 +608,64 @@ class ListServicePrincipalSecretsResponse:
|
|
|
527
608
|
secrets=_repeated_dict(d, 'secrets', SecretInfo))
|
|
528
609
|
|
|
529
610
|
|
|
611
|
+
@dataclass
|
|
612
|
+
class OidcFederationPolicy:
|
|
613
|
+
"""Specifies the policy to use for validating OIDC claims in your federated tokens."""
|
|
614
|
+
|
|
615
|
+
audiences: Optional[List[str]] = None
|
|
616
|
+
"""The allowed token audiences, as specified in the 'aud' claim of federated tokens. The audience
|
|
617
|
+
identifier is intended to represent the recipient of the token. Can be any non-empty string
|
|
618
|
+
value. As long as the audience in the token matches at least one audience in the policy, the
|
|
619
|
+
token is considered a match. If audiences is unspecified, defaults to your Databricks account
|
|
620
|
+
id."""
|
|
621
|
+
|
|
622
|
+
issuer: Optional[str] = None
|
|
623
|
+
"""The required token issuer, as specified in the 'iss' claim of federated tokens."""
|
|
624
|
+
|
|
625
|
+
jwks_json: Optional[str] = None
|
|
626
|
+
"""The public keys used to validate the signature of federated tokens, in JWKS format. If
|
|
627
|
+
unspecified (recommended), Databricks automatically fetches the public keys from your issuer’s
|
|
628
|
+
well known endpoint. Databricks strongly recommends relying on your issuer’s well known
|
|
629
|
+
endpoint for discovering public keys."""
|
|
630
|
+
|
|
631
|
+
subject: Optional[str] = None
|
|
632
|
+
"""The required token subject, as specified in the subject claim of federated tokens. Must be
|
|
633
|
+
specified for service principal federation policies. Must not be specified for account
|
|
634
|
+
federation policies."""
|
|
635
|
+
|
|
636
|
+
subject_claim: Optional[str] = None
|
|
637
|
+
"""The claim that contains the subject of the token. If unspecified, the default value is 'sub'."""
|
|
638
|
+
|
|
639
|
+
def as_dict(self) -> dict:
|
|
640
|
+
"""Serializes the OidcFederationPolicy into a dictionary suitable for use as a JSON request body."""
|
|
641
|
+
body = {}
|
|
642
|
+
if self.audiences: body['audiences'] = [v for v in self.audiences]
|
|
643
|
+
if self.issuer is not None: body['issuer'] = self.issuer
|
|
644
|
+
if self.jwks_json is not None: body['jwks_json'] = self.jwks_json
|
|
645
|
+
if self.subject is not None: body['subject'] = self.subject
|
|
646
|
+
if self.subject_claim is not None: body['subject_claim'] = self.subject_claim
|
|
647
|
+
return body
|
|
648
|
+
|
|
649
|
+
def as_shallow_dict(self) -> dict:
|
|
650
|
+
"""Serializes the OidcFederationPolicy into a shallow dictionary of its immediate attributes."""
|
|
651
|
+
body = {}
|
|
652
|
+
if self.audiences: body['audiences'] = self.audiences
|
|
653
|
+
if self.issuer is not None: body['issuer'] = self.issuer
|
|
654
|
+
if self.jwks_json is not None: body['jwks_json'] = self.jwks_json
|
|
655
|
+
if self.subject is not None: body['subject'] = self.subject
|
|
656
|
+
if self.subject_claim is not None: body['subject_claim'] = self.subject_claim
|
|
657
|
+
return body
|
|
658
|
+
|
|
659
|
+
@classmethod
|
|
660
|
+
def from_dict(cls, d: Dict[str, any]) -> OidcFederationPolicy:
|
|
661
|
+
"""Deserializes the OidcFederationPolicy from a dictionary."""
|
|
662
|
+
return cls(audiences=d.get('audiences', None),
|
|
663
|
+
issuer=d.get('issuer', None),
|
|
664
|
+
jwks_json=d.get('jwks_json', None),
|
|
665
|
+
subject=d.get('subject', None),
|
|
666
|
+
subject_claim=d.get('subject_claim', None))
|
|
667
|
+
|
|
668
|
+
|
|
530
669
|
@dataclass
|
|
531
670
|
class PublishedAppOutput:
|
|
532
671
|
app_id: Optional[str] = None
|
|
@@ -769,6 +908,158 @@ class UpdatePublishedAppIntegrationOutput:
|
|
|
769
908
|
return cls()
|
|
770
909
|
|
|
771
910
|
|
|
911
|
+
class AccountFederationPolicyAPI:
|
|
912
|
+
"""These APIs manage account federation policies.
|
|
913
|
+
|
|
914
|
+
Account federation policies allow users and service principals in your Databricks account to securely
|
|
915
|
+
access Databricks APIs using tokens from your trusted identity providers (IdPs).
|
|
916
|
+
|
|
917
|
+
With token federation, your users and service principals can exchange tokens from your IdP for Databricks
|
|
918
|
+
OAuth tokens, which can be used to access Databricks APIs. Token federation eliminates the need to manage
|
|
919
|
+
Databricks secrets, and allows you to centralize management of token issuance policies in your IdP.
|
|
920
|
+
Databricks token federation is typically used in combination with [SCIM], so users in your IdP are
|
|
921
|
+
synchronized into your Databricks account.
|
|
922
|
+
|
|
923
|
+
Token federation is configured in your Databricks account using an account federation policy. An account
|
|
924
|
+
federation policy specifies: * which IdP, or issuer, your Databricks account should accept tokens from *
|
|
925
|
+
how to determine which Databricks user, or subject, a token is issued for
|
|
926
|
+
|
|
927
|
+
To configure a federation policy, you provide the following: * The required token __issuer__, as specified
|
|
928
|
+
in the “iss” claim of your tokens. The issuer is an https URL that identifies your IdP. * The allowed
|
|
929
|
+
token __audiences__, as specified in the “aud” claim of your tokens. This identifier is intended to
|
|
930
|
+
represent the recipient of the token. As long as the audience in the token matches at least one audience
|
|
931
|
+
in the policy, the token is considered a match. If unspecified, the default value is your Databricks
|
|
932
|
+
account id. * The __subject claim__, which indicates which token claim contains the Databricks username of
|
|
933
|
+
the user the token was issued for. If unspecified, the default value is “sub”. * Optionally, the
|
|
934
|
+
public keys used to validate the signature of your tokens, in JWKS format. If unspecified (recommended),
|
|
935
|
+
Databricks automatically fetches the public keys from your issuer’s well known endpoint. Databricks
|
|
936
|
+
strongly recommends relying on your issuer’s well known endpoint for discovering public keys.
|
|
937
|
+
|
|
938
|
+
An example federation policy is: ``` issuer: "https://idp.mycompany.com/oidc" audiences: ["databricks"]
|
|
939
|
+
subject_claim: "sub" ```
|
|
940
|
+
|
|
941
|
+
An example JWT token body that matches this policy and could be used to authenticate to Databricks as user
|
|
942
|
+
`username@mycompany.com` is: ``` { "iss": "https://idp.mycompany.com/oidc", "aud": "databricks", "sub":
|
|
943
|
+
"username@mycompany.com" } ```
|
|
944
|
+
|
|
945
|
+
You may also need to configure your IdP to generate tokens for your users to exchange with Databricks, if
|
|
946
|
+
your users do not already have the ability to generate tokens that are compatible with your federation
|
|
947
|
+
policy.
|
|
948
|
+
|
|
949
|
+
You do not need to configure an OAuth application in Databricks to use token federation.
|
|
950
|
+
|
|
951
|
+
[SCIM]: https://docs.databricks.com/admin/users-groups/scim/index.html"""
|
|
952
|
+
|
|
953
|
+
def __init__(self, api_client):
|
|
954
|
+
self._api = api_client
|
|
955
|
+
|
|
956
|
+
def create(self,
|
|
957
|
+
*,
|
|
958
|
+
policy: Optional[FederationPolicy] = None,
|
|
959
|
+
policy_id: Optional[str] = None) -> FederationPolicy:
|
|
960
|
+
"""Create account federation policy.
|
|
961
|
+
|
|
962
|
+
:param policy: :class:`FederationPolicy` (optional)
|
|
963
|
+
:param policy_id: str (optional)
|
|
964
|
+
The identifier for the federation policy. If unspecified, the id will be assigned by Databricks.
|
|
965
|
+
|
|
966
|
+
:returns: :class:`FederationPolicy`
|
|
967
|
+
"""
|
|
968
|
+
body = policy.as_dict()
|
|
969
|
+
headers = {'Accept': 'application/json', 'Content-Type': 'application/json', }
|
|
970
|
+
|
|
971
|
+
res = self._api.do('POST',
|
|
972
|
+
f'/api/2.0/accounts/{self._api.account_id}/federationPolicies',
|
|
973
|
+
query=query,
|
|
974
|
+
body=body,
|
|
975
|
+
headers=headers)
|
|
976
|
+
return FederationPolicy.from_dict(res)
|
|
977
|
+
|
|
978
|
+
def delete(self, policy_id: str):
|
|
979
|
+
"""Delete account federation policy.
|
|
980
|
+
|
|
981
|
+
:param policy_id: str
|
|
982
|
+
|
|
983
|
+
|
|
984
|
+
"""
|
|
985
|
+
|
|
986
|
+
headers = {'Accept': 'application/json', }
|
|
987
|
+
|
|
988
|
+
self._api.do('DELETE',
|
|
989
|
+
f'/api/2.0/accounts/{self._api.account_id}/federationPolicies/{policy_id}',
|
|
990
|
+
headers=headers)
|
|
991
|
+
|
|
992
|
+
def get(self, policy_id: str) -> FederationPolicy:
|
|
993
|
+
"""Get account federation policy.
|
|
994
|
+
|
|
995
|
+
:param policy_id: str
|
|
996
|
+
|
|
997
|
+
:returns: :class:`FederationPolicy`
|
|
998
|
+
"""
|
|
999
|
+
|
|
1000
|
+
headers = {'Accept': 'application/json', }
|
|
1001
|
+
|
|
1002
|
+
res = self._api.do('GET',
|
|
1003
|
+
f'/api/2.0/accounts/{self._api.account_id}/federationPolicies/{policy_id}',
|
|
1004
|
+
headers=headers)
|
|
1005
|
+
return FederationPolicy.from_dict(res)
|
|
1006
|
+
|
|
1007
|
+
def list(self,
|
|
1008
|
+
*,
|
|
1009
|
+
page_size: Optional[int] = None,
|
|
1010
|
+
page_token: Optional[str] = None) -> Iterator[FederationPolicy]:
|
|
1011
|
+
"""List account federation policies.
|
|
1012
|
+
|
|
1013
|
+
:param page_size: int (optional)
|
|
1014
|
+
:param page_token: str (optional)
|
|
1015
|
+
|
|
1016
|
+
:returns: Iterator over :class:`FederationPolicy`
|
|
1017
|
+
"""
|
|
1018
|
+
|
|
1019
|
+
query = {}
|
|
1020
|
+
if page_size is not None: query['page_size'] = page_size
|
|
1021
|
+
if page_token is not None: query['page_token'] = page_token
|
|
1022
|
+
headers = {'Accept': 'application/json', }
|
|
1023
|
+
|
|
1024
|
+
while True:
|
|
1025
|
+
json = self._api.do('GET',
|
|
1026
|
+
f'/api/2.0/accounts/{self._api.account_id}/federationPolicies',
|
|
1027
|
+
query=query,
|
|
1028
|
+
headers=headers)
|
|
1029
|
+
if 'policies' in json:
|
|
1030
|
+
for v in json['policies']:
|
|
1031
|
+
yield FederationPolicy.from_dict(v)
|
|
1032
|
+
if 'next_page_token' not in json or not json['next_page_token']:
|
|
1033
|
+
return
|
|
1034
|
+
query['page_token'] = json['next_page_token']
|
|
1035
|
+
|
|
1036
|
+
def update(self,
|
|
1037
|
+
policy_id: str,
|
|
1038
|
+
update_mask: str,
|
|
1039
|
+
*,
|
|
1040
|
+
policy: Optional[FederationPolicy] = None) -> FederationPolicy:
|
|
1041
|
+
"""Update account federation policy.
|
|
1042
|
+
|
|
1043
|
+
:param policy_id: str
|
|
1044
|
+
:param update_mask: str
|
|
1045
|
+
Field mask is required to be passed into the PATCH request. Field mask specifies which fields of the
|
|
1046
|
+
setting payload will be updated. The field mask needs to be supplied as single string. To specify
|
|
1047
|
+
multiple fields in the field mask, use comma as the separator (no space).
|
|
1048
|
+
:param policy: :class:`FederationPolicy` (optional)
|
|
1049
|
+
|
|
1050
|
+
:returns: :class:`FederationPolicy`
|
|
1051
|
+
"""
|
|
1052
|
+
body = policy.as_dict()
|
|
1053
|
+
headers = {'Accept': 'application/json', 'Content-Type': 'application/json', }
|
|
1054
|
+
|
|
1055
|
+
res = self._api.do('PATCH',
|
|
1056
|
+
f'/api/2.0/accounts/{self._api.account_id}/federationPolicies/{policy_id}',
|
|
1057
|
+
query=query,
|
|
1058
|
+
body=body,
|
|
1059
|
+
headers=headers)
|
|
1060
|
+
return FederationPolicy.from_dict(res)
|
|
1061
|
+
|
|
1062
|
+
|
|
772
1063
|
class CustomAppIntegrationAPI:
|
|
773
1064
|
"""These APIs enable administrators to manage custom OAuth app integrations, which is required for
|
|
774
1065
|
adding/using Custom OAuth App Integration like Tableau Cloud for Databricks in AWS cloud."""
|
|
@@ -1086,6 +1377,176 @@ class PublishedAppIntegrationAPI:
|
|
|
1086
1377
|
headers=headers)
|
|
1087
1378
|
|
|
1088
1379
|
|
|
1380
|
+
class ServicePrincipalFederationPolicyAPI:
|
|
1381
|
+
"""These APIs manage service principal federation policies.
|
|
1382
|
+
|
|
1383
|
+
Service principal federation, also known as Workload Identity Federation, allows your automated workloads
|
|
1384
|
+
running outside of Databricks to securely access Databricks APIs without the need for Databricks secrets.
|
|
1385
|
+
With Workload Identity Federation, your application (or workload) authenticates to Databricks as a
|
|
1386
|
+
Databricks service principal, using tokens provided by the workload runtime.
|
|
1387
|
+
|
|
1388
|
+
Databricks strongly recommends using Workload Identity Federation to authenticate to Databricks from
|
|
1389
|
+
automated workloads, over alternatives such as OAuth client secrets or Personal Access Tokens, whenever
|
|
1390
|
+
possible. Workload Identity Federation is supported by many popular services, including Github Actions,
|
|
1391
|
+
Azure DevOps, GitLab, Terraform Cloud, and Kubernetes clusters, among others.
|
|
1392
|
+
|
|
1393
|
+
Workload identity federation is configured in your Databricks account using a service principal federation
|
|
1394
|
+
policy. A service principal federation policy specifies: * which IdP, or issuer, the service principal is
|
|
1395
|
+
allowed to authenticate from * which workload identity, or subject, is allowed to authenticate as the
|
|
1396
|
+
Databricks service principal
|
|
1397
|
+
|
|
1398
|
+
To configure a federation policy, you provide the following: * The required token __issuer__, as specified
|
|
1399
|
+
in the “iss” claim of workload identity tokens. The issuer is an https URL that identifies the
|
|
1400
|
+
workload identity provider. * The required token __subject__, as specified in the “sub” claim of
|
|
1401
|
+
workload identity tokens. The subject uniquely identifies the workload in the workload runtime
|
|
1402
|
+
environment. * The allowed token __audiences__, as specified in the “aud” claim of workload identity
|
|
1403
|
+
tokens. The audience is intended to represent the recipient of the token. As long as the audience in the
|
|
1404
|
+
token matches at least one audience in the policy, the token is considered a match. If unspecified, the
|
|
1405
|
+
default value is your Databricks account id. * Optionally, the public keys used to validate the signature
|
|
1406
|
+
of the workload identity tokens, in JWKS format. If unspecified (recommended), Databricks automatically
|
|
1407
|
+
fetches the public keys from the issuer’s well known endpoint. Databricks strongly recommends relying on
|
|
1408
|
+
the issuer’s well known endpoint for discovering public keys.
|
|
1409
|
+
|
|
1410
|
+
An example service principal federation policy, for a Github Actions workload, is: ``` issuer:
|
|
1411
|
+
"https://token.actions.githubusercontent.com" audiences: ["https://github.com/my-github-org"] subject:
|
|
1412
|
+
"repo:my-github-org/my-repo:environment:prod" ```
|
|
1413
|
+
|
|
1414
|
+
An example JWT token body that matches this policy and could be used to authenticate to Databricks is: ```
|
|
1415
|
+
{ "iss": "https://token.actions.githubusercontent.com", "aud": "https://github.com/my-github-org", "sub":
|
|
1416
|
+
"repo:my-github-org/my-repo:environment:prod" } ```
|
|
1417
|
+
|
|
1418
|
+
You may also need to configure the workload runtime to generate tokens for your workloads.
|
|
1419
|
+
|
|
1420
|
+
You do not need to configure an OAuth application in Databricks to use token federation."""
|
|
1421
|
+
|
|
1422
|
+
def __init__(self, api_client):
|
|
1423
|
+
self._api = api_client
|
|
1424
|
+
|
|
1425
|
+
def create(self,
|
|
1426
|
+
service_principal_id: int,
|
|
1427
|
+
*,
|
|
1428
|
+
policy: Optional[FederationPolicy] = None,
|
|
1429
|
+
policy_id: Optional[str] = None) -> FederationPolicy:
|
|
1430
|
+
"""Create service principal federation policy.
|
|
1431
|
+
|
|
1432
|
+
:param service_principal_id: int
|
|
1433
|
+
The service principal id for the federation policy.
|
|
1434
|
+
:param policy: :class:`FederationPolicy` (optional)
|
|
1435
|
+
:param policy_id: str (optional)
|
|
1436
|
+
The identifier for the federation policy. If unspecified, the id will be assigned by Databricks.
|
|
1437
|
+
|
|
1438
|
+
:returns: :class:`FederationPolicy`
|
|
1439
|
+
"""
|
|
1440
|
+
body = policy.as_dict()
|
|
1441
|
+
headers = {'Accept': 'application/json', 'Content-Type': 'application/json', }
|
|
1442
|
+
|
|
1443
|
+
res = self._api.do(
|
|
1444
|
+
'POST',
|
|
1445
|
+
f'/api/2.0/accounts/{self._api.account_id}/servicePrincipals/{service_principal_id}/federationPolicies',
|
|
1446
|
+
query=query,
|
|
1447
|
+
body=body,
|
|
1448
|
+
headers=headers)
|
|
1449
|
+
return FederationPolicy.from_dict(res)
|
|
1450
|
+
|
|
1451
|
+
def delete(self, service_principal_id: int, policy_id: str):
|
|
1452
|
+
"""Delete service principal federation policy.
|
|
1453
|
+
|
|
1454
|
+
:param service_principal_id: int
|
|
1455
|
+
The service principal id for the federation policy.
|
|
1456
|
+
:param policy_id: str
|
|
1457
|
+
|
|
1458
|
+
|
|
1459
|
+
"""
|
|
1460
|
+
|
|
1461
|
+
headers = {'Accept': 'application/json', }
|
|
1462
|
+
|
|
1463
|
+
self._api.do(
|
|
1464
|
+
'DELETE',
|
|
1465
|
+
f'/api/2.0/accounts/{self._api.account_id}/servicePrincipals/{service_principal_id}/federationPolicies/{policy_id}',
|
|
1466
|
+
headers=headers)
|
|
1467
|
+
|
|
1468
|
+
def get(self, service_principal_id: int, policy_id: str) -> FederationPolicy:
|
|
1469
|
+
"""Get service principal federation policy.
|
|
1470
|
+
|
|
1471
|
+
:param service_principal_id: int
|
|
1472
|
+
The service principal id for the federation policy.
|
|
1473
|
+
:param policy_id: str
|
|
1474
|
+
|
|
1475
|
+
:returns: :class:`FederationPolicy`
|
|
1476
|
+
"""
|
|
1477
|
+
|
|
1478
|
+
headers = {'Accept': 'application/json', }
|
|
1479
|
+
|
|
1480
|
+
res = self._api.do(
|
|
1481
|
+
'GET',
|
|
1482
|
+
f'/api/2.0/accounts/{self._api.account_id}/servicePrincipals/{service_principal_id}/federationPolicies/{policy_id}',
|
|
1483
|
+
headers=headers)
|
|
1484
|
+
return FederationPolicy.from_dict(res)
|
|
1485
|
+
|
|
1486
|
+
def list(self,
|
|
1487
|
+
service_principal_id: int,
|
|
1488
|
+
*,
|
|
1489
|
+
page_size: Optional[int] = None,
|
|
1490
|
+
page_token: Optional[str] = None) -> Iterator[FederationPolicy]:
|
|
1491
|
+
"""List service principal federation policies.
|
|
1492
|
+
|
|
1493
|
+
:param service_principal_id: int
|
|
1494
|
+
The service principal id for the federation policy.
|
|
1495
|
+
:param page_size: int (optional)
|
|
1496
|
+
:param page_token: str (optional)
|
|
1497
|
+
|
|
1498
|
+
:returns: Iterator over :class:`FederationPolicy`
|
|
1499
|
+
"""
|
|
1500
|
+
|
|
1501
|
+
query = {}
|
|
1502
|
+
if page_size is not None: query['page_size'] = page_size
|
|
1503
|
+
if page_token is not None: query['page_token'] = page_token
|
|
1504
|
+
headers = {'Accept': 'application/json', }
|
|
1505
|
+
|
|
1506
|
+
while True:
|
|
1507
|
+
json = self._api.do(
|
|
1508
|
+
'GET',
|
|
1509
|
+
f'/api/2.0/accounts/{self._api.account_id}/servicePrincipals/{service_principal_id}/federationPolicies',
|
|
1510
|
+
query=query,
|
|
1511
|
+
headers=headers)
|
|
1512
|
+
if 'policies' in json:
|
|
1513
|
+
for v in json['policies']:
|
|
1514
|
+
yield FederationPolicy.from_dict(v)
|
|
1515
|
+
if 'next_page_token' not in json or not json['next_page_token']:
|
|
1516
|
+
return
|
|
1517
|
+
query['page_token'] = json['next_page_token']
|
|
1518
|
+
|
|
1519
|
+
def update(self,
|
|
1520
|
+
service_principal_id: int,
|
|
1521
|
+
policy_id: str,
|
|
1522
|
+
update_mask: str,
|
|
1523
|
+
*,
|
|
1524
|
+
policy: Optional[FederationPolicy] = None) -> FederationPolicy:
|
|
1525
|
+
"""Update service principal federation policy.
|
|
1526
|
+
|
|
1527
|
+
:param service_principal_id: int
|
|
1528
|
+
The service principal id for the federation policy.
|
|
1529
|
+
:param policy_id: str
|
|
1530
|
+
:param update_mask: str
|
|
1531
|
+
Field mask is required to be passed into the PATCH request. Field mask specifies which fields of the
|
|
1532
|
+
setting payload will be updated. The field mask needs to be supplied as single string. To specify
|
|
1533
|
+
multiple fields in the field mask, use comma as the separator (no space).
|
|
1534
|
+
:param policy: :class:`FederationPolicy` (optional)
|
|
1535
|
+
|
|
1536
|
+
:returns: :class:`FederationPolicy`
|
|
1537
|
+
"""
|
|
1538
|
+
body = policy.as_dict()
|
|
1539
|
+
headers = {'Accept': 'application/json', 'Content-Type': 'application/json', }
|
|
1540
|
+
|
|
1541
|
+
res = self._api.do(
|
|
1542
|
+
'PATCH',
|
|
1543
|
+
f'/api/2.0/accounts/{self._api.account_id}/servicePrincipals/{service_principal_id}/federationPolicies/{policy_id}',
|
|
1544
|
+
query=query,
|
|
1545
|
+
body=body,
|
|
1546
|
+
headers=headers)
|
|
1547
|
+
return FederationPolicy.from_dict(res)
|
|
1548
|
+
|
|
1549
|
+
|
|
1089
1550
|
class ServicePrincipalSecretsAPI:
|
|
1090
1551
|
"""These APIs enable administrators to manage service principal secrets.
|
|
1091
1552
|
|
|
@@ -11,7 +11,7 @@ from enum import Enum
|
|
|
11
11
|
from typing import Callable, Dict, Iterator, List, Optional
|
|
12
12
|
|
|
13
13
|
from ..errors import OperationFailed
|
|
14
|
-
from ._internal import Wait, _enum, _from_dict, _repeated_dict
|
|
14
|
+
from ._internal import Wait, _enum, _from_dict, _repeated_dict, _repeated_enum
|
|
15
15
|
|
|
16
16
|
_LOG = logging.getLogger('databricks.sdk')
|
|
17
17
|
|
|
@@ -2105,7 +2105,7 @@ class RestartWindow:
|
|
|
2105
2105
|
"""An integer between 0 and 23 denoting the start hour for the restart window in the 24-hour day.
|
|
2106
2106
|
Continuous pipeline restart is triggered only within a five-hour window starting at this hour."""
|
|
2107
2107
|
|
|
2108
|
-
days_of_week: Optional[RestartWindowDaysOfWeek] = None
|
|
2108
|
+
days_of_week: Optional[List[RestartWindowDaysOfWeek]] = None
|
|
2109
2109
|
"""Days of week in which the restart is allowed to happen (within a five-hour window starting at
|
|
2110
2110
|
start_hour). If not specified all days of the week will be used."""
|
|
2111
2111
|
|
|
@@ -2117,7 +2117,7 @@ class RestartWindow:
|
|
|
2117
2117
|
def as_dict(self) -> dict:
|
|
2118
2118
|
"""Serializes the RestartWindow into a dictionary suitable for use as a JSON request body."""
|
|
2119
2119
|
body = {}
|
|
2120
|
-
if self.days_of_week
|
|
2120
|
+
if self.days_of_week: body['days_of_week'] = [v.value for v in self.days_of_week]
|
|
2121
2121
|
if self.start_hour is not None: body['start_hour'] = self.start_hour
|
|
2122
2122
|
if self.time_zone_id is not None: body['time_zone_id'] = self.time_zone_id
|
|
2123
2123
|
return body
|
|
@@ -2125,7 +2125,7 @@ class RestartWindow:
|
|
|
2125
2125
|
def as_shallow_dict(self) -> dict:
|
|
2126
2126
|
"""Serializes the RestartWindow into a shallow dictionary of its immediate attributes."""
|
|
2127
2127
|
body = {}
|
|
2128
|
-
if self.days_of_week
|
|
2128
|
+
if self.days_of_week: body['days_of_week'] = self.days_of_week
|
|
2129
2129
|
if self.start_hour is not None: body['start_hour'] = self.start_hour
|
|
2130
2130
|
if self.time_zone_id is not None: body['time_zone_id'] = self.time_zone_id
|
|
2131
2131
|
return body
|
|
@@ -2133,7 +2133,7 @@ class RestartWindow:
|
|
|
2133
2133
|
@classmethod
|
|
2134
2134
|
def from_dict(cls, d: Dict[str, any]) -> RestartWindow:
|
|
2135
2135
|
"""Deserializes the RestartWindow from a dictionary."""
|
|
2136
|
-
return cls(days_of_week=
|
|
2136
|
+
return cls(days_of_week=_repeated_enum(d, 'days_of_week', RestartWindowDaysOfWeek),
|
|
2137
2137
|
start_hour=d.get('start_hour', None),
|
|
2138
2138
|
time_zone_id=d.get('time_zone_id', None))
|
|
2139
2139
|
|
databricks/sdk/version.py
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
__version__ = '0.
|
|
1
|
+
__version__ = '0.40.0'
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
databricks/__init__.py,sha256=CF2MJcZFwbpn9TwQER8qnCDhkPooBGQNVkX4v7g6p3g,537
|
|
2
|
-
databricks/sdk/__init__.py,sha256=
|
|
2
|
+
databricks/sdk/__init__.py,sha256=4vJP5nJIcDwpnfEMI7NlqVo90z6vIGFiq-nzHKDjxWk,50253
|
|
3
3
|
databricks/sdk/_base_client.py,sha256=KDEj19LQfkcKw79e_9s0nYGsox5N6gWOUE9LNuR1CwY,15771
|
|
4
4
|
databricks/sdk/_property.py,sha256=sGjsipeFrjMBSVPjtIb0HNCRcMIhFpVx6wq4BkC3LWs,1636
|
|
5
5
|
databricks/sdk/azure.py,sha256=8P7nEdun0hbQCap9Ojo7yZse_JHxnhYsE6ApojnPz7Q,1009
|
|
@@ -15,7 +15,7 @@ databricks/sdk/oauth.py,sha256=ZlIzEGlKTUgGGgLfv5NQJr3Y_mWpKgTr8-hUEwwqfEE,23861
|
|
|
15
15
|
databricks/sdk/py.typed,sha256=pSvaHpbY1UPNEXyVFUjlgBhjPFZMmVC_UNrPC7eMOHI,74
|
|
16
16
|
databricks/sdk/retries.py,sha256=WgLh12bwdBc6fCQlaig3kKu18cVhPzFDGsspvq629Ew,2454
|
|
17
17
|
databricks/sdk/useragent.py,sha256=I2-VnJSE6cg9QV4GXkoQSkHsEB3bDvRGgkawbBNl4G0,5540
|
|
18
|
-
databricks/sdk/version.py,sha256=
|
|
18
|
+
databricks/sdk/version.py,sha256=Dd98vmdfuExNZfcwTv7GU830B3vTvaSukPPI7hq8M2E,23
|
|
19
19
|
databricks/sdk/_widgets/__init__.py,sha256=Qm3JB8LmdPgEn_-VgxKkodTO4gn6OdaDPwsYcDmeIRI,2667
|
|
20
20
|
databricks/sdk/_widgets/default_widgets_utils.py,sha256=Rk59AFzVYVpOektB_yC_7j-vSt5OdtZA85IlG0kw0xA,1202
|
|
21
21
|
databricks/sdk/_widgets/ipywidgets_utils.py,sha256=P-AyGeahPiX3S59mxpAMgffi4gyJ0irEOY7Ekkn9nQ0,2850
|
|
@@ -43,17 +43,17 @@ databricks/sdk/service/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3
|
|
|
43
43
|
databricks/sdk/service/_internal.py,sha256=nWbJfW5eJCQgAZ3TmA26xoWb6SNZ5N76ZA8bO1N4AsU,1961
|
|
44
44
|
databricks/sdk/service/apps.py,sha256=ymLui8bJhicFC2K83EYxuZvsDK_n4EezmhTC_xnMqZg,52140
|
|
45
45
|
databricks/sdk/service/billing.py,sha256=0_L2aaJqOWehOJjiLwyDNmGwMOCGv7vKpifiSROJF60,82792
|
|
46
|
-
databricks/sdk/service/catalog.py,sha256=
|
|
46
|
+
databricks/sdk/service/catalog.py,sha256=xBHSXxUXVGMGBl8hCpY0v7SF5RJ2owzDwHciuWx-rck,591192
|
|
47
47
|
databricks/sdk/service/cleanrooms.py,sha256=W0YCFDvGO5SwXxIW_lYTpBMLHfHQTK_-ZLY_XqqxKwg,57873
|
|
48
|
-
databricks/sdk/service/compute.py,sha256=
|
|
49
|
-
databricks/sdk/service/dashboards.py,sha256=
|
|
48
|
+
databricks/sdk/service/compute.py,sha256=kR8Puh48DoIPO9VTKcu8Bp9l1zBGZyi5SKKfkbLuZQw,533995
|
|
49
|
+
databricks/sdk/service/dashboards.py,sha256=FC_F3I1pRDlptTO-mVu7FxWXjTEKb552WNqqEq0ZZmg,82487
|
|
50
50
|
databricks/sdk/service/files.py,sha256=GG9fVy_UGtPgVOa18-8BKu2_V3-xSqO-CAnPykAxkOc,45137
|
|
51
51
|
databricks/sdk/service/iam.py,sha256=TlSZcZPmGtYCO2gXYr-PihOOt2wACaMzsWf7BeTZLeQ,166352
|
|
52
|
-
databricks/sdk/service/jobs.py,sha256=
|
|
52
|
+
databricks/sdk/service/jobs.py,sha256=tJ76jwiT294q0yLkHJdkcZzCha8tc3myxrDXLxe8XLk,411218
|
|
53
53
|
databricks/sdk/service/marketplace.py,sha256=KDqjLT1WRvdq6BOjYI4BhBFhKkp9iZjK7BuF-fuNT6Y,171731
|
|
54
54
|
databricks/sdk/service/ml.py,sha256=wvheyoVzDUczufsWOjrUvBkK3KKwV1ZSJ6kXWQN4y_M,286771
|
|
55
|
-
databricks/sdk/service/oauth2.py,sha256=
|
|
56
|
-
databricks/sdk/service/pipelines.py,sha256=
|
|
55
|
+
databricks/sdk/service/oauth2.py,sha256=hlsT4sjp7LSvYdVuprmHp79m-lRPol_bc7e5ymwXiu4,72106
|
|
56
|
+
databricks/sdk/service/pipelines.py,sha256=P1hfjXrTFOR77xfxe2saKRpwEHDr7FD2Kb9xMjgy3t0,157968
|
|
57
57
|
databricks/sdk/service/provisioning.py,sha256=QAFKTjRP6rh9gPIP17ownqhAFY2XE0HvqNfTsf3D27w,168727
|
|
58
58
|
databricks/sdk/service/serving.py,sha256=XJAS-kBYgrADxkZj8kSBJpiqrA2J5ZC2i-H74dORi10,190206
|
|
59
59
|
databricks/sdk/service/settings.py,sha256=sT9sRLVYEZXwLgjw_82EfArhABzX8BYZKskUFzOISeM,298239
|
|
@@ -61,9 +61,9 @@ databricks/sdk/service/sharing.py,sha256=993EkqqolqZfKbOr4YiCMwEMjE8K92iIE0VRU8w
|
|
|
61
61
|
databricks/sdk/service/sql.py,sha256=bKIPoiygWc33prTjR-UOltwi1MKVv4D41y4ZFCm9AXw,392721
|
|
62
62
|
databricks/sdk/service/vectorsearch.py,sha256=5p5pW94Bv_Q2tw4j8kFb35nAoFa9GUG5FIHTdfAHWps,77997
|
|
63
63
|
databricks/sdk/service/workspace.py,sha256=BCoi43R1L2eJI9DYq9vwCVdjbMsdLuzDebN6AZvT4kg,128751
|
|
64
|
-
databricks_sdk-0.
|
|
65
|
-
databricks_sdk-0.
|
|
66
|
-
databricks_sdk-0.
|
|
67
|
-
databricks_sdk-0.
|
|
68
|
-
databricks_sdk-0.
|
|
69
|
-
databricks_sdk-0.
|
|
64
|
+
databricks_sdk-0.40.0.dist-info/LICENSE,sha256=afBgTZo-JsYqj4VOjnejBetMuHKcFR30YobDdpVFkqY,11411
|
|
65
|
+
databricks_sdk-0.40.0.dist-info/METADATA,sha256=IdOrdbHLXn89YIXorjCKjcNYoZw84_uKZ01vq9Nr7Uw,38270
|
|
66
|
+
databricks_sdk-0.40.0.dist-info/NOTICE,sha256=tkRcQYA1k68wDLcnOWbg2xJDsUOJw8G8DGBhb8dnI3w,1588
|
|
67
|
+
databricks_sdk-0.40.0.dist-info/WHEEL,sha256=PZUExdf71Ui_so67QXpySuHtCi3-J3wvF4ORK6k_S8U,91
|
|
68
|
+
databricks_sdk-0.40.0.dist-info/top_level.txt,sha256=7kRdatoSgU0EUurRQJ_3F1Nv4EOSHWAr6ng25tJOJKU,11
|
|
69
|
+
databricks_sdk-0.40.0.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|