databricks-sdk 0.40.0__py3-none-any.whl → 0.42.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 +273 -239
- databricks/sdk/_base_client.py +36 -24
- databricks/sdk/config.py +5 -0
- databricks/sdk/credentials_provider.py +35 -20
- databricks/sdk/data_plane.py +1 -1
- databricks/sdk/mixins/files.py +184 -1
- databricks/sdk/mixins/open_ai_client.py +55 -1
- databricks/sdk/retries.py +5 -1
- databricks/sdk/service/apps.py +12 -4
- databricks/sdk/service/billing.py +348 -0
- databricks/sdk/service/catalog.py +16 -62
- databricks/sdk/service/cleanrooms.py +73 -2
- databricks/sdk/service/compute.py +40 -0
- databricks/sdk/service/dashboards.py +12 -4
- databricks/sdk/service/files.py +6 -3
- databricks/sdk/service/iam.py +158 -0
- databricks/sdk/service/jobs.py +253 -17
- databricks/sdk/service/oauth2.py +94 -50
- databricks/sdk/service/pipelines.py +89 -12
- databricks/sdk/service/serving.py +424 -222
- databricks/sdk/service/settings.py +206 -0
- databricks/sdk/service/sharing.py +51 -54
- databricks/sdk/useragent.py +54 -0
- databricks/sdk/version.py +1 -1
- {databricks_sdk-0.40.0.dist-info → databricks_sdk-0.42.0.dist-info}/METADATA +26 -26
- {databricks_sdk-0.40.0.dist-info → databricks_sdk-0.42.0.dist-info}/RECORD +30 -30
- {databricks_sdk-0.40.0.dist-info → databricks_sdk-0.42.0.dist-info}/WHEEL +1 -1
- {databricks_sdk-0.40.0.dist-info → databricks_sdk-0.42.0.dist-info}/LICENSE +0 -0
- {databricks_sdk-0.40.0.dist-info → databricks_sdk-0.42.0.dist-info}/NOTICE +0 -0
- {databricks_sdk-0.40.0.dist-info → databricks_sdk-0.42.0.dist-info}/top_level.txt +0 -0
databricks/sdk/service/oauth2.py
CHANGED
|
@@ -31,6 +31,10 @@ class CreateCustomAppIntegration:
|
|
|
31
31
|
token_access_policy: Optional[TokenAccessPolicy] = None
|
|
32
32
|
"""Token access policy"""
|
|
33
33
|
|
|
34
|
+
user_authorized_scopes: Optional[List[str]] = None
|
|
35
|
+
"""Scopes that will need to be consented by end user to mint the access token. If the user does not
|
|
36
|
+
authorize the access token will not be minted. Must be a subset of scopes."""
|
|
37
|
+
|
|
34
38
|
def as_dict(self) -> dict:
|
|
35
39
|
"""Serializes the CreateCustomAppIntegration into a dictionary suitable for use as a JSON request body."""
|
|
36
40
|
body = {}
|
|
@@ -39,6 +43,8 @@ class CreateCustomAppIntegration:
|
|
|
39
43
|
if self.redirect_urls: body['redirect_urls'] = [v for v in self.redirect_urls]
|
|
40
44
|
if self.scopes: body['scopes'] = [v for v in self.scopes]
|
|
41
45
|
if self.token_access_policy: body['token_access_policy'] = self.token_access_policy.as_dict()
|
|
46
|
+
if self.user_authorized_scopes:
|
|
47
|
+
body['user_authorized_scopes'] = [v for v in self.user_authorized_scopes]
|
|
42
48
|
return body
|
|
43
49
|
|
|
44
50
|
def as_shallow_dict(self) -> dict:
|
|
@@ -49,6 +55,7 @@ class CreateCustomAppIntegration:
|
|
|
49
55
|
if self.redirect_urls: body['redirect_urls'] = self.redirect_urls
|
|
50
56
|
if self.scopes: body['scopes'] = self.scopes
|
|
51
57
|
if self.token_access_policy: body['token_access_policy'] = self.token_access_policy
|
|
58
|
+
if self.user_authorized_scopes: body['user_authorized_scopes'] = self.user_authorized_scopes
|
|
52
59
|
return body
|
|
53
60
|
|
|
54
61
|
@classmethod
|
|
@@ -58,7 +65,8 @@ class CreateCustomAppIntegration:
|
|
|
58
65
|
name=d.get('name', None),
|
|
59
66
|
redirect_urls=d.get('redirect_urls', None),
|
|
60
67
|
scopes=d.get('scopes', None),
|
|
61
|
-
token_access_policy=_from_dict(d, 'token_access_policy', TokenAccessPolicy)
|
|
68
|
+
token_access_policy=_from_dict(d, 'token_access_policy', TokenAccessPolicy),
|
|
69
|
+
user_authorized_scopes=d.get('user_authorized_scopes', None))
|
|
62
70
|
|
|
63
71
|
|
|
64
72
|
@dataclass
|
|
@@ -202,35 +210,6 @@ class CreateServicePrincipalSecretResponse:
|
|
|
202
210
|
update_time=d.get('update_time', None))
|
|
203
211
|
|
|
204
212
|
|
|
205
|
-
@dataclass
|
|
206
|
-
class DataPlaneInfo:
|
|
207
|
-
authorization_details: Optional[str] = None
|
|
208
|
-
"""Authorization details as a string."""
|
|
209
|
-
|
|
210
|
-
endpoint_url: Optional[str] = None
|
|
211
|
-
"""The URL of the endpoint for this operation in the dataplane."""
|
|
212
|
-
|
|
213
|
-
def as_dict(self) -> dict:
|
|
214
|
-
"""Serializes the DataPlaneInfo into a dictionary suitable for use as a JSON request body."""
|
|
215
|
-
body = {}
|
|
216
|
-
if self.authorization_details is not None: body['authorization_details'] = self.authorization_details
|
|
217
|
-
if self.endpoint_url is not None: body['endpoint_url'] = self.endpoint_url
|
|
218
|
-
return body
|
|
219
|
-
|
|
220
|
-
def as_shallow_dict(self) -> dict:
|
|
221
|
-
"""Serializes the DataPlaneInfo into a shallow dictionary of its immediate attributes."""
|
|
222
|
-
body = {}
|
|
223
|
-
if self.authorization_details is not None: body['authorization_details'] = self.authorization_details
|
|
224
|
-
if self.endpoint_url is not None: body['endpoint_url'] = self.endpoint_url
|
|
225
|
-
return body
|
|
226
|
-
|
|
227
|
-
@classmethod
|
|
228
|
-
def from_dict(cls, d: Dict[str, any]) -> DataPlaneInfo:
|
|
229
|
-
"""Deserializes the DataPlaneInfo from a dictionary."""
|
|
230
|
-
return cls(authorization_details=d.get('authorization_details', None),
|
|
231
|
-
endpoint_url=d.get('endpoint_url', None))
|
|
232
|
-
|
|
233
|
-
|
|
234
213
|
@dataclass
|
|
235
214
|
class DeleteCustomAppIntegrationOutput:
|
|
236
215
|
|
|
@@ -297,8 +276,13 @@ class FederationPolicy:
|
|
|
297
276
|
"""Description of the federation policy."""
|
|
298
277
|
|
|
299
278
|
name: Optional[str] = None
|
|
300
|
-
"""
|
|
301
|
-
|
|
279
|
+
"""Resource name for the federation policy. Example values include
|
|
280
|
+
`accounts/<account-id>/federationPolicies/my-federation-policy` for Account Federation Policies,
|
|
281
|
+
and
|
|
282
|
+
`accounts/<account-id>/servicePrincipals/<service-principal-id>/federationPolicies/my-federation-policy`
|
|
283
|
+
for Service Principal Federation Policies. Typically an output parameter, which does not need to
|
|
284
|
+
be specified in create or update requests. If specified in a request, must match the value in
|
|
285
|
+
the request URL."""
|
|
302
286
|
|
|
303
287
|
oidc_policy: Optional[OidcFederationPolicy] = None
|
|
304
288
|
"""Specifies the policy to use for validating OIDC claims in your federated tokens."""
|
|
@@ -370,6 +354,10 @@ class GetCustomAppIntegrationOutput:
|
|
|
370
354
|
token_access_policy: Optional[TokenAccessPolicy] = None
|
|
371
355
|
"""Token access policy"""
|
|
372
356
|
|
|
357
|
+
user_authorized_scopes: Optional[List[str]] = None
|
|
358
|
+
"""Scopes that will need to be consented by end user to mint the access token. If the user does not
|
|
359
|
+
authorize the access token will not be minted. Must be a subset of scopes."""
|
|
360
|
+
|
|
373
361
|
def as_dict(self) -> dict:
|
|
374
362
|
"""Serializes the GetCustomAppIntegrationOutput into a dictionary suitable for use as a JSON request body."""
|
|
375
363
|
body = {}
|
|
@@ -383,6 +371,8 @@ class GetCustomAppIntegrationOutput:
|
|
|
383
371
|
if self.redirect_urls: body['redirect_urls'] = [v for v in self.redirect_urls]
|
|
384
372
|
if self.scopes: body['scopes'] = [v for v in self.scopes]
|
|
385
373
|
if self.token_access_policy: body['token_access_policy'] = self.token_access_policy.as_dict()
|
|
374
|
+
if self.user_authorized_scopes:
|
|
375
|
+
body['user_authorized_scopes'] = [v for v in self.user_authorized_scopes]
|
|
386
376
|
return body
|
|
387
377
|
|
|
388
378
|
def as_shallow_dict(self) -> dict:
|
|
@@ -398,6 +388,7 @@ class GetCustomAppIntegrationOutput:
|
|
|
398
388
|
if self.redirect_urls: body['redirect_urls'] = self.redirect_urls
|
|
399
389
|
if self.scopes: body['scopes'] = self.scopes
|
|
400
390
|
if self.token_access_policy: body['token_access_policy'] = self.token_access_policy
|
|
391
|
+
if self.user_authorized_scopes: body['user_authorized_scopes'] = self.user_authorized_scopes
|
|
401
392
|
return body
|
|
402
393
|
|
|
403
394
|
@classmethod
|
|
@@ -412,7 +403,8 @@ class GetCustomAppIntegrationOutput:
|
|
|
412
403
|
name=d.get('name', None),
|
|
413
404
|
redirect_urls=d.get('redirect_urls', None),
|
|
414
405
|
scopes=d.get('scopes', None),
|
|
415
|
-
token_access_policy=_from_dict(d, 'token_access_policy', TokenAccessPolicy)
|
|
406
|
+
token_access_policy=_from_dict(d, 'token_access_policy', TokenAccessPolicy),
|
|
407
|
+
user_authorized_scopes=d.get('user_authorized_scopes', None))
|
|
416
408
|
|
|
417
409
|
|
|
418
410
|
@dataclass
|
|
@@ -815,15 +807,26 @@ class UpdateCustomAppIntegration:
|
|
|
815
807
|
redirect_urls: Optional[List[str]] = None
|
|
816
808
|
"""List of OAuth redirect urls to be updated in the custom OAuth app integration"""
|
|
817
809
|
|
|
810
|
+
scopes: Optional[List[str]] = None
|
|
811
|
+
"""List of OAuth scopes to be updated in the custom OAuth app integration, similar to redirect URIs
|
|
812
|
+
this will fully replace the existing values instead of appending"""
|
|
813
|
+
|
|
818
814
|
token_access_policy: Optional[TokenAccessPolicy] = None
|
|
819
815
|
"""Token access policy to be updated in the custom OAuth app integration"""
|
|
820
816
|
|
|
817
|
+
user_authorized_scopes: Optional[List[str]] = None
|
|
818
|
+
"""Scopes that will need to be consented by end user to mint the access token. If the user does not
|
|
819
|
+
authorize the access token will not be minted. Must be a subset of scopes."""
|
|
820
|
+
|
|
821
821
|
def as_dict(self) -> dict:
|
|
822
822
|
"""Serializes the UpdateCustomAppIntegration into a dictionary suitable for use as a JSON request body."""
|
|
823
823
|
body = {}
|
|
824
824
|
if self.integration_id is not None: body['integration_id'] = self.integration_id
|
|
825
825
|
if self.redirect_urls: body['redirect_urls'] = [v for v in self.redirect_urls]
|
|
826
|
+
if self.scopes: body['scopes'] = [v for v in self.scopes]
|
|
826
827
|
if self.token_access_policy: body['token_access_policy'] = self.token_access_policy.as_dict()
|
|
828
|
+
if self.user_authorized_scopes:
|
|
829
|
+
body['user_authorized_scopes'] = [v for v in self.user_authorized_scopes]
|
|
827
830
|
return body
|
|
828
831
|
|
|
829
832
|
def as_shallow_dict(self) -> dict:
|
|
@@ -831,7 +834,9 @@ class UpdateCustomAppIntegration:
|
|
|
831
834
|
body = {}
|
|
832
835
|
if self.integration_id is not None: body['integration_id'] = self.integration_id
|
|
833
836
|
if self.redirect_urls: body['redirect_urls'] = self.redirect_urls
|
|
837
|
+
if self.scopes: body['scopes'] = self.scopes
|
|
834
838
|
if self.token_access_policy: body['token_access_policy'] = self.token_access_policy
|
|
839
|
+
if self.user_authorized_scopes: body['user_authorized_scopes'] = self.user_authorized_scopes
|
|
835
840
|
return body
|
|
836
841
|
|
|
837
842
|
@classmethod
|
|
@@ -839,7 +844,9 @@ class UpdateCustomAppIntegration:
|
|
|
839
844
|
"""Deserializes the UpdateCustomAppIntegration from a dictionary."""
|
|
840
845
|
return cls(integration_id=d.get('integration_id', None),
|
|
841
846
|
redirect_urls=d.get('redirect_urls', None),
|
|
842
|
-
|
|
847
|
+
scopes=d.get('scopes', None),
|
|
848
|
+
token_access_policy=_from_dict(d, 'token_access_policy', TokenAccessPolicy),
|
|
849
|
+
user_authorized_scopes=d.get('user_authorized_scopes', None))
|
|
843
850
|
|
|
844
851
|
|
|
845
852
|
@dataclass
|
|
@@ -961,11 +968,14 @@ class AccountFederationPolicyAPI:
|
|
|
961
968
|
|
|
962
969
|
:param policy: :class:`FederationPolicy` (optional)
|
|
963
970
|
:param policy_id: str (optional)
|
|
964
|
-
The identifier for the federation policy.
|
|
971
|
+
The identifier for the federation policy. The identifier must contain only lowercase alphanumeric
|
|
972
|
+
characters, numbers, hyphens, and slashes. If unspecified, the id will be assigned by Databricks.
|
|
965
973
|
|
|
966
974
|
:returns: :class:`FederationPolicy`
|
|
967
975
|
"""
|
|
968
976
|
body = policy.as_dict()
|
|
977
|
+
query = {}
|
|
978
|
+
if policy_id is not None: query['policy_id'] = policy_id
|
|
969
979
|
headers = {'Accept': 'application/json', 'Content-Type': 'application/json', }
|
|
970
980
|
|
|
971
981
|
res = self._api.do('POST',
|
|
@@ -979,6 +989,7 @@ class AccountFederationPolicyAPI:
|
|
|
979
989
|
"""Delete account federation policy.
|
|
980
990
|
|
|
981
991
|
:param policy_id: str
|
|
992
|
+
The identifier for the federation policy.
|
|
982
993
|
|
|
983
994
|
|
|
984
995
|
"""
|
|
@@ -993,6 +1004,7 @@ class AccountFederationPolicyAPI:
|
|
|
993
1004
|
"""Get account federation policy.
|
|
994
1005
|
|
|
995
1006
|
:param policy_id: str
|
|
1007
|
+
The identifier for the federation policy.
|
|
996
1008
|
|
|
997
1009
|
:returns: :class:`FederationPolicy`
|
|
998
1010
|
"""
|
|
@@ -1035,21 +1047,26 @@ class AccountFederationPolicyAPI:
|
|
|
1035
1047
|
|
|
1036
1048
|
def update(self,
|
|
1037
1049
|
policy_id: str,
|
|
1038
|
-
update_mask: str,
|
|
1039
1050
|
*,
|
|
1040
|
-
policy: Optional[FederationPolicy] = None
|
|
1051
|
+
policy: Optional[FederationPolicy] = None,
|
|
1052
|
+
update_mask: Optional[str] = None) -> FederationPolicy:
|
|
1041
1053
|
"""Update account federation policy.
|
|
1042
1054
|
|
|
1043
1055
|
:param policy_id: str
|
|
1044
|
-
|
|
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).
|
|
1056
|
+
The identifier for the federation policy.
|
|
1048
1057
|
:param policy: :class:`FederationPolicy` (optional)
|
|
1058
|
+
:param update_mask: str (optional)
|
|
1059
|
+
The field mask specifies which fields of the policy to update. To specify multiple fields in the
|
|
1060
|
+
field mask, use comma as the separator (no space). The special value '*' indicates that all fields
|
|
1061
|
+
should be updated (full replacement). If unspecified, all fields that are set in the policy provided
|
|
1062
|
+
in the update request will overwrite the corresponding fields in the existing policy. Example value:
|
|
1063
|
+
'description,oidc_policy.audiences'.
|
|
1049
1064
|
|
|
1050
1065
|
:returns: :class:`FederationPolicy`
|
|
1051
1066
|
"""
|
|
1052
1067
|
body = policy.as_dict()
|
|
1068
|
+
query = {}
|
|
1069
|
+
if update_mask is not None: query['update_mask'] = update_mask
|
|
1053
1070
|
headers = {'Accept': 'application/json', 'Content-Type': 'application/json', }
|
|
1054
1071
|
|
|
1055
1072
|
res = self._api.do('PATCH',
|
|
@@ -1073,7 +1090,8 @@ class CustomAppIntegrationAPI:
|
|
|
1073
1090
|
name: Optional[str] = None,
|
|
1074
1091
|
redirect_urls: Optional[List[str]] = None,
|
|
1075
1092
|
scopes: Optional[List[str]] = None,
|
|
1076
|
-
token_access_policy: Optional[TokenAccessPolicy] = None
|
|
1093
|
+
token_access_policy: Optional[TokenAccessPolicy] = None,
|
|
1094
|
+
user_authorized_scopes: Optional[List[str]] = None) -> CreateCustomAppIntegrationOutput:
|
|
1077
1095
|
"""Create Custom OAuth App Integration.
|
|
1078
1096
|
|
|
1079
1097
|
Create Custom OAuth App Integration.
|
|
@@ -1091,6 +1109,9 @@ class CustomAppIntegrationAPI:
|
|
|
1091
1109
|
profile, email.
|
|
1092
1110
|
:param token_access_policy: :class:`TokenAccessPolicy` (optional)
|
|
1093
1111
|
Token access policy
|
|
1112
|
+
:param user_authorized_scopes: List[str] (optional)
|
|
1113
|
+
Scopes that will need to be consented by end user to mint the access token. If the user does not
|
|
1114
|
+
authorize the access token will not be minted. Must be a subset of scopes.
|
|
1094
1115
|
|
|
1095
1116
|
:returns: :class:`CreateCustomAppIntegrationOutput`
|
|
1096
1117
|
"""
|
|
@@ -1100,6 +1121,8 @@ class CustomAppIntegrationAPI:
|
|
|
1100
1121
|
if redirect_urls is not None: body['redirect_urls'] = [v for v in redirect_urls]
|
|
1101
1122
|
if scopes is not None: body['scopes'] = [v for v in scopes]
|
|
1102
1123
|
if token_access_policy is not None: body['token_access_policy'] = token_access_policy.as_dict()
|
|
1124
|
+
if user_authorized_scopes is not None:
|
|
1125
|
+
body['user_authorized_scopes'] = [v for v in user_authorized_scopes]
|
|
1103
1126
|
headers = {'Accept': 'application/json', 'Content-Type': 'application/json', }
|
|
1104
1127
|
|
|
1105
1128
|
res = self._api.do('POST',
|
|
@@ -1183,7 +1206,9 @@ class CustomAppIntegrationAPI:
|
|
|
1183
1206
|
integration_id: str,
|
|
1184
1207
|
*,
|
|
1185
1208
|
redirect_urls: Optional[List[str]] = None,
|
|
1186
|
-
|
|
1209
|
+
scopes: Optional[List[str]] = None,
|
|
1210
|
+
token_access_policy: Optional[TokenAccessPolicy] = None,
|
|
1211
|
+
user_authorized_scopes: Optional[List[str]] = None):
|
|
1187
1212
|
"""Updates Custom OAuth App Integration.
|
|
1188
1213
|
|
|
1189
1214
|
Updates an existing custom OAuth App Integration. You can retrieve the custom OAuth app integration
|
|
@@ -1192,14 +1217,23 @@ class CustomAppIntegrationAPI:
|
|
|
1192
1217
|
:param integration_id: str
|
|
1193
1218
|
:param redirect_urls: List[str] (optional)
|
|
1194
1219
|
List of OAuth redirect urls to be updated in the custom OAuth app integration
|
|
1220
|
+
:param scopes: List[str] (optional)
|
|
1221
|
+
List of OAuth scopes to be updated in the custom OAuth app integration, similar to redirect URIs
|
|
1222
|
+
this will fully replace the existing values instead of appending
|
|
1195
1223
|
:param token_access_policy: :class:`TokenAccessPolicy` (optional)
|
|
1196
1224
|
Token access policy to be updated in the custom OAuth app integration
|
|
1225
|
+
:param user_authorized_scopes: List[str] (optional)
|
|
1226
|
+
Scopes that will need to be consented by end user to mint the access token. If the user does not
|
|
1227
|
+
authorize the access token will not be minted. Must be a subset of scopes.
|
|
1197
1228
|
|
|
1198
1229
|
|
|
1199
1230
|
"""
|
|
1200
1231
|
body = {}
|
|
1201
1232
|
if redirect_urls is not None: body['redirect_urls'] = [v for v in redirect_urls]
|
|
1233
|
+
if scopes is not None: body['scopes'] = [v for v in scopes]
|
|
1202
1234
|
if token_access_policy is not None: body['token_access_policy'] = token_access_policy.as_dict()
|
|
1235
|
+
if user_authorized_scopes is not None:
|
|
1236
|
+
body['user_authorized_scopes'] = [v for v in user_authorized_scopes]
|
|
1203
1237
|
headers = {'Accept': 'application/json', 'Content-Type': 'application/json', }
|
|
1204
1238
|
|
|
1205
1239
|
self._api.do(
|
|
@@ -1433,11 +1467,14 @@ class ServicePrincipalFederationPolicyAPI:
|
|
|
1433
1467
|
The service principal id for the federation policy.
|
|
1434
1468
|
:param policy: :class:`FederationPolicy` (optional)
|
|
1435
1469
|
:param policy_id: str (optional)
|
|
1436
|
-
The identifier for the federation policy.
|
|
1470
|
+
The identifier for the federation policy. The identifier must contain only lowercase alphanumeric
|
|
1471
|
+
characters, numbers, hyphens, and slashes. If unspecified, the id will be assigned by Databricks.
|
|
1437
1472
|
|
|
1438
1473
|
:returns: :class:`FederationPolicy`
|
|
1439
1474
|
"""
|
|
1440
1475
|
body = policy.as_dict()
|
|
1476
|
+
query = {}
|
|
1477
|
+
if policy_id is not None: query['policy_id'] = policy_id
|
|
1441
1478
|
headers = {'Accept': 'application/json', 'Content-Type': 'application/json', }
|
|
1442
1479
|
|
|
1443
1480
|
res = self._api.do(
|
|
@@ -1454,6 +1491,7 @@ class ServicePrincipalFederationPolicyAPI:
|
|
|
1454
1491
|
:param service_principal_id: int
|
|
1455
1492
|
The service principal id for the federation policy.
|
|
1456
1493
|
:param policy_id: str
|
|
1494
|
+
The identifier for the federation policy.
|
|
1457
1495
|
|
|
1458
1496
|
|
|
1459
1497
|
"""
|
|
@@ -1471,6 +1509,7 @@ class ServicePrincipalFederationPolicyAPI:
|
|
|
1471
1509
|
:param service_principal_id: int
|
|
1472
1510
|
The service principal id for the federation policy.
|
|
1473
1511
|
:param policy_id: str
|
|
1512
|
+
The identifier for the federation policy.
|
|
1474
1513
|
|
|
1475
1514
|
:returns: :class:`FederationPolicy`
|
|
1476
1515
|
"""
|
|
@@ -1519,23 +1558,28 @@ class ServicePrincipalFederationPolicyAPI:
|
|
|
1519
1558
|
def update(self,
|
|
1520
1559
|
service_principal_id: int,
|
|
1521
1560
|
policy_id: str,
|
|
1522
|
-
update_mask: str,
|
|
1523
1561
|
*,
|
|
1524
|
-
policy: Optional[FederationPolicy] = None
|
|
1562
|
+
policy: Optional[FederationPolicy] = None,
|
|
1563
|
+
update_mask: Optional[str] = None) -> FederationPolicy:
|
|
1525
1564
|
"""Update service principal federation policy.
|
|
1526
1565
|
|
|
1527
1566
|
:param service_principal_id: int
|
|
1528
1567
|
The service principal id for the federation policy.
|
|
1529
1568
|
:param policy_id: str
|
|
1530
|
-
|
|
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).
|
|
1569
|
+
The identifier for the federation policy.
|
|
1534
1570
|
:param policy: :class:`FederationPolicy` (optional)
|
|
1571
|
+
:param update_mask: str (optional)
|
|
1572
|
+
The field mask specifies which fields of the policy to update. To specify multiple fields in the
|
|
1573
|
+
field mask, use comma as the separator (no space). The special value '*' indicates that all fields
|
|
1574
|
+
should be updated (full replacement). If unspecified, all fields that are set in the policy provided
|
|
1575
|
+
in the update request will overwrite the corresponding fields in the existing policy. Example value:
|
|
1576
|
+
'description,oidc_policy.audiences'.
|
|
1535
1577
|
|
|
1536
1578
|
:returns: :class:`FederationPolicy`
|
|
1537
1579
|
"""
|
|
1538
1580
|
body = policy.as_dict()
|
|
1581
|
+
query = {}
|
|
1582
|
+
if update_mask is not None: query['update_mask'] = update_mask
|
|
1539
1583
|
headers = {'Accept': 'application/json', 'Content-Type': 'application/json', }
|
|
1540
1584
|
|
|
1541
1585
|
res = self._api.do(
|
|
@@ -85,6 +85,14 @@ class CreatePipeline:
|
|
|
85
85
|
restart_window: Optional[RestartWindow] = None
|
|
86
86
|
"""Restart window of this pipeline."""
|
|
87
87
|
|
|
88
|
+
run_as: Optional[RunAs] = None
|
|
89
|
+
"""Write-only setting, available only in Create/Update calls. Specifies the user or service
|
|
90
|
+
principal that the pipeline runs as. If not specified, the pipeline runs as the user who created
|
|
91
|
+
the pipeline.
|
|
92
|
+
|
|
93
|
+
Only `user_name` or `service_principal_name` can be specified. If both are specified, an error
|
|
94
|
+
is thrown."""
|
|
95
|
+
|
|
88
96
|
schema: Optional[str] = None
|
|
89
97
|
"""The default schema (database) where tables are read from or published to. The presence of this
|
|
90
98
|
field implies that the pipeline is in direct publishing mode."""
|
|
@@ -126,6 +134,7 @@ class CreatePipeline:
|
|
|
126
134
|
if self.notifications: body['notifications'] = [v.as_dict() for v in self.notifications]
|
|
127
135
|
if self.photon is not None: body['photon'] = self.photon
|
|
128
136
|
if self.restart_window: body['restart_window'] = self.restart_window.as_dict()
|
|
137
|
+
if self.run_as: body['run_as'] = self.run_as.as_dict()
|
|
129
138
|
if self.schema is not None: body['schema'] = self.schema
|
|
130
139
|
if self.serverless is not None: body['serverless'] = self.serverless
|
|
131
140
|
if self.storage is not None: body['storage'] = self.storage
|
|
@@ -156,6 +165,7 @@ class CreatePipeline:
|
|
|
156
165
|
if self.notifications: body['notifications'] = self.notifications
|
|
157
166
|
if self.photon is not None: body['photon'] = self.photon
|
|
158
167
|
if self.restart_window: body['restart_window'] = self.restart_window
|
|
168
|
+
if self.run_as: body['run_as'] = self.run_as
|
|
159
169
|
if self.schema is not None: body['schema'] = self.schema
|
|
160
170
|
if self.serverless is not None: body['serverless'] = self.serverless
|
|
161
171
|
if self.storage is not None: body['storage'] = self.storage
|
|
@@ -186,6 +196,7 @@ class CreatePipeline:
|
|
|
186
196
|
notifications=_repeated_dict(d, 'notifications', Notifications),
|
|
187
197
|
photon=d.get('photon', None),
|
|
188
198
|
restart_window=_from_dict(d, 'restart_window', RestartWindow),
|
|
199
|
+
run_as=_from_dict(d, 'run_as', RunAs),
|
|
189
200
|
schema=d.get('schema', None),
|
|
190
201
|
serverless=d.get('serverless', None),
|
|
191
202
|
storage=d.get('storage', None),
|
|
@@ -277,6 +288,19 @@ class DataPlaneId:
|
|
|
277
288
|
return cls(instance=d.get('instance', None), seq_no=d.get('seq_no', None))
|
|
278
289
|
|
|
279
290
|
|
|
291
|
+
class DayOfWeek(Enum):
|
|
292
|
+
"""Days of week in which the restart is allowed to happen (within a five-hour window starting at
|
|
293
|
+
start_hour). If not specified all days of the week will be used."""
|
|
294
|
+
|
|
295
|
+
FRIDAY = 'FRIDAY'
|
|
296
|
+
MONDAY = 'MONDAY'
|
|
297
|
+
SATURDAY = 'SATURDAY'
|
|
298
|
+
SUNDAY = 'SUNDAY'
|
|
299
|
+
THURSDAY = 'THURSDAY'
|
|
300
|
+
TUESDAY = 'TUESDAY'
|
|
301
|
+
WEDNESDAY = 'WEDNESDAY'
|
|
302
|
+
|
|
303
|
+
|
|
280
304
|
@dataclass
|
|
281
305
|
class DeletePipelineResponse:
|
|
282
306
|
|
|
@@ -373,6 +397,14 @@ class EditPipeline:
|
|
|
373
397
|
restart_window: Optional[RestartWindow] = None
|
|
374
398
|
"""Restart window of this pipeline."""
|
|
375
399
|
|
|
400
|
+
run_as: Optional[RunAs] = None
|
|
401
|
+
"""Write-only setting, available only in Create/Update calls. Specifies the user or service
|
|
402
|
+
principal that the pipeline runs as. If not specified, the pipeline runs as the user who created
|
|
403
|
+
the pipeline.
|
|
404
|
+
|
|
405
|
+
Only `user_name` or `service_principal_name` can be specified. If both are specified, an error
|
|
406
|
+
is thrown."""
|
|
407
|
+
|
|
376
408
|
schema: Optional[str] = None
|
|
377
409
|
"""The default schema (database) where tables are read from or published to. The presence of this
|
|
378
410
|
field implies that the pipeline is in direct publishing mode."""
|
|
@@ -416,6 +448,7 @@ class EditPipeline:
|
|
|
416
448
|
if self.photon is not None: body['photon'] = self.photon
|
|
417
449
|
if self.pipeline_id is not None: body['pipeline_id'] = self.pipeline_id
|
|
418
450
|
if self.restart_window: body['restart_window'] = self.restart_window.as_dict()
|
|
451
|
+
if self.run_as: body['run_as'] = self.run_as.as_dict()
|
|
419
452
|
if self.schema is not None: body['schema'] = self.schema
|
|
420
453
|
if self.serverless is not None: body['serverless'] = self.serverless
|
|
421
454
|
if self.storage is not None: body['storage'] = self.storage
|
|
@@ -448,6 +481,7 @@ class EditPipeline:
|
|
|
448
481
|
if self.photon is not None: body['photon'] = self.photon
|
|
449
482
|
if self.pipeline_id is not None: body['pipeline_id'] = self.pipeline_id
|
|
450
483
|
if self.restart_window: body['restart_window'] = self.restart_window
|
|
484
|
+
if self.run_as: body['run_as'] = self.run_as
|
|
451
485
|
if self.schema is not None: body['schema'] = self.schema
|
|
452
486
|
if self.serverless is not None: body['serverless'] = self.serverless
|
|
453
487
|
if self.storage is not None: body['storage'] = self.storage
|
|
@@ -479,6 +513,7 @@ class EditPipeline:
|
|
|
479
513
|
photon=d.get('photon', None),
|
|
480
514
|
pipeline_id=d.get('pipeline_id', None),
|
|
481
515
|
restart_window=_from_dict(d, 'restart_window', RestartWindow),
|
|
516
|
+
run_as=_from_dict(d, 'run_as', RunAs),
|
|
482
517
|
schema=d.get('schema', None),
|
|
483
518
|
serverless=d.get('serverless', None),
|
|
484
519
|
storage=d.get('storage', None),
|
|
@@ -2105,7 +2140,7 @@ class RestartWindow:
|
|
|
2105
2140
|
"""An integer between 0 and 23 denoting the start hour for the restart window in the 24-hour day.
|
|
2106
2141
|
Continuous pipeline restart is triggered only within a five-hour window starting at this hour."""
|
|
2107
2142
|
|
|
2108
|
-
days_of_week: Optional[List[
|
|
2143
|
+
days_of_week: Optional[List[DayOfWeek]] = None
|
|
2109
2144
|
"""Days of week in which the restart is allowed to happen (within a five-hour window starting at
|
|
2110
2145
|
start_hour). If not specified all days of the week will be used."""
|
|
2111
2146
|
|
|
@@ -2133,22 +2168,48 @@ class RestartWindow:
|
|
|
2133
2168
|
@classmethod
|
|
2134
2169
|
def from_dict(cls, d: Dict[str, any]) -> RestartWindow:
|
|
2135
2170
|
"""Deserializes the RestartWindow from a dictionary."""
|
|
2136
|
-
return cls(days_of_week=_repeated_enum(d, 'days_of_week',
|
|
2171
|
+
return cls(days_of_week=_repeated_enum(d, 'days_of_week', DayOfWeek),
|
|
2137
2172
|
start_hour=d.get('start_hour', None),
|
|
2138
2173
|
time_zone_id=d.get('time_zone_id', None))
|
|
2139
2174
|
|
|
2140
2175
|
|
|
2141
|
-
|
|
2142
|
-
|
|
2143
|
-
|
|
2176
|
+
@dataclass
|
|
2177
|
+
class RunAs:
|
|
2178
|
+
"""Write-only setting, available only in Create/Update calls. Specifies the user or service
|
|
2179
|
+
principal that the pipeline runs as. If not specified, the pipeline runs as the user who created
|
|
2180
|
+
the pipeline.
|
|
2181
|
+
|
|
2182
|
+
Only `user_name` or `service_principal_name` can be specified. If both are specified, an error
|
|
2183
|
+
is thrown."""
|
|
2144
2184
|
|
|
2145
|
-
|
|
2146
|
-
|
|
2147
|
-
|
|
2148
|
-
|
|
2149
|
-
|
|
2150
|
-
|
|
2151
|
-
|
|
2185
|
+
service_principal_name: Optional[str] = None
|
|
2186
|
+
"""Application ID of an active service principal. Setting this field requires the
|
|
2187
|
+
`servicePrincipal/user` role."""
|
|
2188
|
+
|
|
2189
|
+
user_name: Optional[str] = None
|
|
2190
|
+
"""The email of an active workspace user. Users can only set this field to their own email."""
|
|
2191
|
+
|
|
2192
|
+
def as_dict(self) -> dict:
|
|
2193
|
+
"""Serializes the RunAs into a dictionary suitable for use as a JSON request body."""
|
|
2194
|
+
body = {}
|
|
2195
|
+
if self.service_principal_name is not None:
|
|
2196
|
+
body['service_principal_name'] = self.service_principal_name
|
|
2197
|
+
if self.user_name is not None: body['user_name'] = self.user_name
|
|
2198
|
+
return body
|
|
2199
|
+
|
|
2200
|
+
def as_shallow_dict(self) -> dict:
|
|
2201
|
+
"""Serializes the RunAs into a shallow dictionary of its immediate attributes."""
|
|
2202
|
+
body = {}
|
|
2203
|
+
if self.service_principal_name is not None:
|
|
2204
|
+
body['service_principal_name'] = self.service_principal_name
|
|
2205
|
+
if self.user_name is not None: body['user_name'] = self.user_name
|
|
2206
|
+
return body
|
|
2207
|
+
|
|
2208
|
+
@classmethod
|
|
2209
|
+
def from_dict(cls, d: Dict[str, any]) -> RunAs:
|
|
2210
|
+
"""Deserializes the RunAs from a dictionary."""
|
|
2211
|
+
return cls(service_principal_name=d.get('service_principal_name', None),
|
|
2212
|
+
user_name=d.get('user_name', None))
|
|
2152
2213
|
|
|
2153
2214
|
|
|
2154
2215
|
@dataclass
|
|
@@ -2791,6 +2852,7 @@ class PipelinesAPI:
|
|
|
2791
2852
|
notifications: Optional[List[Notifications]] = None,
|
|
2792
2853
|
photon: Optional[bool] = None,
|
|
2793
2854
|
restart_window: Optional[RestartWindow] = None,
|
|
2855
|
+
run_as: Optional[RunAs] = None,
|
|
2794
2856
|
schema: Optional[str] = None,
|
|
2795
2857
|
serverless: Optional[bool] = None,
|
|
2796
2858
|
storage: Optional[str] = None,
|
|
@@ -2843,6 +2905,12 @@ class PipelinesAPI:
|
|
|
2843
2905
|
Whether Photon is enabled for this pipeline.
|
|
2844
2906
|
:param restart_window: :class:`RestartWindow` (optional)
|
|
2845
2907
|
Restart window of this pipeline.
|
|
2908
|
+
:param run_as: :class:`RunAs` (optional)
|
|
2909
|
+
Write-only setting, available only in Create/Update calls. Specifies the user or service principal
|
|
2910
|
+
that the pipeline runs as. If not specified, the pipeline runs as the user who created the pipeline.
|
|
2911
|
+
|
|
2912
|
+
Only `user_name` or `service_principal_name` can be specified. If both are specified, an error is
|
|
2913
|
+
thrown.
|
|
2846
2914
|
:param schema: str (optional)
|
|
2847
2915
|
The default schema (database) where tables are read from or published to. The presence of this field
|
|
2848
2916
|
implies that the pipeline is in direct publishing mode.
|
|
@@ -2879,6 +2947,7 @@ class PipelinesAPI:
|
|
|
2879
2947
|
if notifications is not None: body['notifications'] = [v.as_dict() for v in notifications]
|
|
2880
2948
|
if photon is not None: body['photon'] = photon
|
|
2881
2949
|
if restart_window is not None: body['restart_window'] = restart_window.as_dict()
|
|
2950
|
+
if run_as is not None: body['run_as'] = run_as.as_dict()
|
|
2882
2951
|
if schema is not None: body['schema'] = schema
|
|
2883
2952
|
if serverless is not None: body['serverless'] = serverless
|
|
2884
2953
|
if storage is not None: body['storage'] = storage
|
|
@@ -3213,6 +3282,7 @@ class PipelinesAPI:
|
|
|
3213
3282
|
notifications: Optional[List[Notifications]] = None,
|
|
3214
3283
|
photon: Optional[bool] = None,
|
|
3215
3284
|
restart_window: Optional[RestartWindow] = None,
|
|
3285
|
+
run_as: Optional[RunAs] = None,
|
|
3216
3286
|
schema: Optional[str] = None,
|
|
3217
3287
|
serverless: Optional[bool] = None,
|
|
3218
3288
|
storage: Optional[str] = None,
|
|
@@ -3268,6 +3338,12 @@ class PipelinesAPI:
|
|
|
3268
3338
|
Whether Photon is enabled for this pipeline.
|
|
3269
3339
|
:param restart_window: :class:`RestartWindow` (optional)
|
|
3270
3340
|
Restart window of this pipeline.
|
|
3341
|
+
:param run_as: :class:`RunAs` (optional)
|
|
3342
|
+
Write-only setting, available only in Create/Update calls. Specifies the user or service principal
|
|
3343
|
+
that the pipeline runs as. If not specified, the pipeline runs as the user who created the pipeline.
|
|
3344
|
+
|
|
3345
|
+
Only `user_name` or `service_principal_name` can be specified. If both are specified, an error is
|
|
3346
|
+
thrown.
|
|
3271
3347
|
:param schema: str (optional)
|
|
3272
3348
|
The default schema (database) where tables are read from or published to. The presence of this field
|
|
3273
3349
|
implies that the pipeline is in direct publishing mode.
|
|
@@ -3304,6 +3380,7 @@ class PipelinesAPI:
|
|
|
3304
3380
|
if notifications is not None: body['notifications'] = [v.as_dict() for v in notifications]
|
|
3305
3381
|
if photon is not None: body['photon'] = photon
|
|
3306
3382
|
if restart_window is not None: body['restart_window'] = restart_window.as_dict()
|
|
3383
|
+
if run_as is not None: body['run_as'] = run_as.as_dict()
|
|
3307
3384
|
if schema is not None: body['schema'] = schema
|
|
3308
3385
|
if serverless is not None: body['serverless'] = serverless
|
|
3309
3386
|
if storage is not None: body['storage'] = storage
|