databricks-sdk 0.57.0__py3-none-any.whl → 0.59.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 +38 -9
- databricks/sdk/service/aibuilder.py +0 -163
- databricks/sdk/service/apps.py +53 -49
- databricks/sdk/service/billing.py +62 -223
- databricks/sdk/service/catalog.py +3052 -3707
- databricks/sdk/service/cleanrooms.py +5 -54
- databricks/sdk/service/compute.py +579 -2715
- databricks/sdk/service/dashboards.py +108 -317
- databricks/sdk/service/database.py +603 -122
- databricks/sdk/service/files.py +2 -218
- databricks/sdk/service/iam.py +19 -298
- databricks/sdk/service/jobs.py +77 -1263
- databricks/sdk/service/marketplace.py +3 -575
- databricks/sdk/service/ml.py +816 -2734
- databricks/sdk/service/oauth2.py +122 -238
- databricks/sdk/service/pipelines.py +133 -724
- databricks/sdk/service/provisioning.py +36 -757
- databricks/sdk/service/qualitymonitorv2.py +0 -18
- databricks/sdk/service/serving.py +37 -583
- databricks/sdk/service/settings.py +282 -1768
- databricks/sdk/service/sharing.py +6 -478
- databricks/sdk/service/sql.py +129 -1696
- databricks/sdk/service/vectorsearch.py +0 -410
- databricks/sdk/service/workspace.py +252 -727
- databricks/sdk/version.py +1 -1
- {databricks_sdk-0.57.0.dist-info → databricks_sdk-0.59.0.dist-info}/METADATA +1 -1
- {databricks_sdk-0.57.0.dist-info → databricks_sdk-0.59.0.dist-info}/RECORD +31 -31
- {databricks_sdk-0.57.0.dist-info → databricks_sdk-0.59.0.dist-info}/WHEEL +0 -0
- {databricks_sdk-0.57.0.dist-info → databricks_sdk-0.59.0.dist-info}/licenses/LICENSE +0 -0
- {databricks_sdk-0.57.0.dist-info → databricks_sdk-0.59.0.dist-info}/licenses/NOTICE +0 -0
- {databricks_sdk-0.57.0.dist-info → databricks_sdk-0.59.0.dist-info}/top_level.txt +0 -0
|
@@ -17,6 +17,9 @@ _LOG = logging.getLogger("databricks.sdk")
|
|
|
17
17
|
|
|
18
18
|
@dataclass
|
|
19
19
|
class AclItem:
|
|
20
|
+
"""An item representing an ACL rule applied to the given principal (user or group) on the
|
|
21
|
+
associated scope point."""
|
|
22
|
+
|
|
20
23
|
principal: str
|
|
21
24
|
"""The principal in which the permission is applied."""
|
|
22
25
|
|
|
@@ -48,6 +51,7 @@ class AclItem:
|
|
|
48
51
|
|
|
49
52
|
|
|
50
53
|
class AclPermission(Enum):
|
|
54
|
+
"""The ACL permission levels for Secret ACLs applied to secret scopes."""
|
|
51
55
|
|
|
52
56
|
MANAGE = "MANAGE"
|
|
53
57
|
READ = "READ"
|
|
@@ -56,6 +60,8 @@ class AclPermission(Enum):
|
|
|
56
60
|
|
|
57
61
|
@dataclass
|
|
58
62
|
class AzureKeyVaultSecretScopeMetadata:
|
|
63
|
+
"""The metadata of the Azure KeyVault for a secret scope of type `AZURE_KEYVAULT`"""
|
|
64
|
+
|
|
59
65
|
resource_id: str
|
|
60
66
|
"""The resource id of the azure KeyVault that user wants to associate the scope with."""
|
|
61
67
|
|
|
@@ -86,58 +92,6 @@ class AzureKeyVaultSecretScopeMetadata:
|
|
|
86
92
|
return cls(dns_name=d.get("dns_name", None), resource_id=d.get("resource_id", None))
|
|
87
93
|
|
|
88
94
|
|
|
89
|
-
@dataclass
|
|
90
|
-
class CreateCredentialsRequest:
|
|
91
|
-
git_provider: str
|
|
92
|
-
"""Git provider. This field is case-insensitive. The available Git providers are `gitHub`,
|
|
93
|
-
`bitbucketCloud`, `gitLab`, `azureDevOpsServices`, `gitHubEnterprise`, `bitbucketServer`,
|
|
94
|
-
`gitLabEnterpriseEdition` and `awsCodeCommit`."""
|
|
95
|
-
|
|
96
|
-
git_username: Optional[str] = None
|
|
97
|
-
"""The username or email provided with your Git provider account, depending on which provider you
|
|
98
|
-
are using. For GitHub, GitHub Enterprise Server, or Azure DevOps Services, either email or
|
|
99
|
-
username may be used. For GitLab, GitLab Enterprise Edition, email must be used. For AWS
|
|
100
|
-
CodeCommit, BitBucket or BitBucket Server, username must be used. For all other providers please
|
|
101
|
-
see your provider's Personal Access Token authentication documentation to see what is supported."""
|
|
102
|
-
|
|
103
|
-
personal_access_token: Optional[str] = None
|
|
104
|
-
"""The personal access token used to authenticate to the corresponding Git provider. For certain
|
|
105
|
-
providers, support may exist for other types of scoped access tokens. [Learn more].
|
|
106
|
-
|
|
107
|
-
[Learn more]: https://docs.databricks.com/repos/get-access-tokens-from-git-provider.html"""
|
|
108
|
-
|
|
109
|
-
def as_dict(self) -> dict:
|
|
110
|
-
"""Serializes the CreateCredentialsRequest into a dictionary suitable for use as a JSON request body."""
|
|
111
|
-
body = {}
|
|
112
|
-
if self.git_provider is not None:
|
|
113
|
-
body["git_provider"] = self.git_provider
|
|
114
|
-
if self.git_username is not None:
|
|
115
|
-
body["git_username"] = self.git_username
|
|
116
|
-
if self.personal_access_token is not None:
|
|
117
|
-
body["personal_access_token"] = self.personal_access_token
|
|
118
|
-
return body
|
|
119
|
-
|
|
120
|
-
def as_shallow_dict(self) -> dict:
|
|
121
|
-
"""Serializes the CreateCredentialsRequest into a shallow dictionary of its immediate attributes."""
|
|
122
|
-
body = {}
|
|
123
|
-
if self.git_provider is not None:
|
|
124
|
-
body["git_provider"] = self.git_provider
|
|
125
|
-
if self.git_username is not None:
|
|
126
|
-
body["git_username"] = self.git_username
|
|
127
|
-
if self.personal_access_token is not None:
|
|
128
|
-
body["personal_access_token"] = self.personal_access_token
|
|
129
|
-
return body
|
|
130
|
-
|
|
131
|
-
@classmethod
|
|
132
|
-
def from_dict(cls, d: Dict[str, Any]) -> CreateCredentialsRequest:
|
|
133
|
-
"""Deserializes the CreateCredentialsRequest from a dictionary."""
|
|
134
|
-
return cls(
|
|
135
|
-
git_provider=d.get("git_provider", None),
|
|
136
|
-
git_username=d.get("git_username", None),
|
|
137
|
-
personal_access_token=d.get("personal_access_token", None),
|
|
138
|
-
)
|
|
139
|
-
|
|
140
|
-
|
|
141
95
|
@dataclass
|
|
142
96
|
class CreateCredentialsResponse:
|
|
143
97
|
credential_id: int
|
|
@@ -150,6 +104,12 @@ class CreateCredentialsResponse:
|
|
|
150
104
|
"""The username or email provided with your Git provider account and associated with the
|
|
151
105
|
credential."""
|
|
152
106
|
|
|
107
|
+
is_default_for_provider: Optional[bool] = None
|
|
108
|
+
"""if the credential is the default for the given provider"""
|
|
109
|
+
|
|
110
|
+
name: Optional[str] = None
|
|
111
|
+
"""the name of the git credential, used for identification and ease of lookup"""
|
|
112
|
+
|
|
153
113
|
def as_dict(self) -> dict:
|
|
154
114
|
"""Serializes the CreateCredentialsResponse into a dictionary suitable for use as a JSON request body."""
|
|
155
115
|
body = {}
|
|
@@ -159,6 +119,10 @@ class CreateCredentialsResponse:
|
|
|
159
119
|
body["git_provider"] = self.git_provider
|
|
160
120
|
if self.git_username is not None:
|
|
161
121
|
body["git_username"] = self.git_username
|
|
122
|
+
if self.is_default_for_provider is not None:
|
|
123
|
+
body["is_default_for_provider"] = self.is_default_for_provider
|
|
124
|
+
if self.name is not None:
|
|
125
|
+
body["name"] = self.name
|
|
162
126
|
return body
|
|
163
127
|
|
|
164
128
|
def as_shallow_dict(self) -> dict:
|
|
@@ -170,6 +134,10 @@ class CreateCredentialsResponse:
|
|
|
170
134
|
body["git_provider"] = self.git_provider
|
|
171
135
|
if self.git_username is not None:
|
|
172
136
|
body["git_username"] = self.git_username
|
|
137
|
+
if self.is_default_for_provider is not None:
|
|
138
|
+
body["is_default_for_provider"] = self.is_default_for_provider
|
|
139
|
+
if self.name is not None:
|
|
140
|
+
body["name"] = self.name
|
|
173
141
|
return body
|
|
174
142
|
|
|
175
143
|
@classmethod
|
|
@@ -179,61 +147,8 @@ class CreateCredentialsResponse:
|
|
|
179
147
|
credential_id=d.get("credential_id", None),
|
|
180
148
|
git_provider=d.get("git_provider", None),
|
|
181
149
|
git_username=d.get("git_username", None),
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
@dataclass
|
|
186
|
-
class CreateRepoRequest:
|
|
187
|
-
url: str
|
|
188
|
-
"""URL of the Git repository to be linked."""
|
|
189
|
-
|
|
190
|
-
provider: str
|
|
191
|
-
"""Git provider. This field is case-insensitive. The available Git providers are `gitHub`,
|
|
192
|
-
`bitbucketCloud`, `gitLab`, `azureDevOpsServices`, `gitHubEnterprise`, `bitbucketServer`,
|
|
193
|
-
`gitLabEnterpriseEdition` and `awsCodeCommit`."""
|
|
194
|
-
|
|
195
|
-
path: Optional[str] = None
|
|
196
|
-
"""Desired path for the repo in the workspace. Almost any path in the workspace can be chosen. If
|
|
197
|
-
repo is created in `/Repos`, path must be in the format `/Repos/{folder}/{repo-name}`."""
|
|
198
|
-
|
|
199
|
-
sparse_checkout: Optional[SparseCheckout] = None
|
|
200
|
-
"""If specified, the repo will be created with sparse checkout enabled. You cannot enable/disable
|
|
201
|
-
sparse checkout after the repo is created."""
|
|
202
|
-
|
|
203
|
-
def as_dict(self) -> dict:
|
|
204
|
-
"""Serializes the CreateRepoRequest into a dictionary suitable for use as a JSON request body."""
|
|
205
|
-
body = {}
|
|
206
|
-
if self.path is not None:
|
|
207
|
-
body["path"] = self.path
|
|
208
|
-
if self.provider is not None:
|
|
209
|
-
body["provider"] = self.provider
|
|
210
|
-
if self.sparse_checkout:
|
|
211
|
-
body["sparse_checkout"] = self.sparse_checkout.as_dict()
|
|
212
|
-
if self.url is not None:
|
|
213
|
-
body["url"] = self.url
|
|
214
|
-
return body
|
|
215
|
-
|
|
216
|
-
def as_shallow_dict(self) -> dict:
|
|
217
|
-
"""Serializes the CreateRepoRequest into a shallow dictionary of its immediate attributes."""
|
|
218
|
-
body = {}
|
|
219
|
-
if self.path is not None:
|
|
220
|
-
body["path"] = self.path
|
|
221
|
-
if self.provider is not None:
|
|
222
|
-
body["provider"] = self.provider
|
|
223
|
-
if self.sparse_checkout:
|
|
224
|
-
body["sparse_checkout"] = self.sparse_checkout
|
|
225
|
-
if self.url is not None:
|
|
226
|
-
body["url"] = self.url
|
|
227
|
-
return body
|
|
228
|
-
|
|
229
|
-
@classmethod
|
|
230
|
-
def from_dict(cls, d: Dict[str, Any]) -> CreateRepoRequest:
|
|
231
|
-
"""Deserializes the CreateRepoRequest from a dictionary."""
|
|
232
|
-
return cls(
|
|
233
|
-
path=d.get("path", None),
|
|
234
|
-
provider=d.get("provider", None),
|
|
235
|
-
sparse_checkout=_from_dict(d, "sparse_checkout", SparseCheckout),
|
|
236
|
-
url=d.get("url", None),
|
|
150
|
+
is_default_for_provider=d.get("is_default_for_provider", None),
|
|
151
|
+
name=d.get("name", None),
|
|
237
152
|
)
|
|
238
153
|
|
|
239
154
|
|
|
@@ -312,57 +227,6 @@ class CreateRepoResponse:
|
|
|
312
227
|
)
|
|
313
228
|
|
|
314
229
|
|
|
315
|
-
@dataclass
|
|
316
|
-
class CreateScope:
|
|
317
|
-
scope: str
|
|
318
|
-
"""Scope name requested by the user. Scope names are unique."""
|
|
319
|
-
|
|
320
|
-
backend_azure_keyvault: Optional[AzureKeyVaultSecretScopeMetadata] = None
|
|
321
|
-
"""The metadata for the secret scope if the type is `AZURE_KEYVAULT`"""
|
|
322
|
-
|
|
323
|
-
initial_manage_principal: Optional[str] = None
|
|
324
|
-
"""The principal that is initially granted `MANAGE` permission to the created scope."""
|
|
325
|
-
|
|
326
|
-
scope_backend_type: Optional[ScopeBackendType] = None
|
|
327
|
-
"""The backend type the scope will be created with. If not specified, will default to `DATABRICKS`"""
|
|
328
|
-
|
|
329
|
-
def as_dict(self) -> dict:
|
|
330
|
-
"""Serializes the CreateScope into a dictionary suitable for use as a JSON request body."""
|
|
331
|
-
body = {}
|
|
332
|
-
if self.backend_azure_keyvault:
|
|
333
|
-
body["backend_azure_keyvault"] = self.backend_azure_keyvault.as_dict()
|
|
334
|
-
if self.initial_manage_principal is not None:
|
|
335
|
-
body["initial_manage_principal"] = self.initial_manage_principal
|
|
336
|
-
if self.scope is not None:
|
|
337
|
-
body["scope"] = self.scope
|
|
338
|
-
if self.scope_backend_type is not None:
|
|
339
|
-
body["scope_backend_type"] = self.scope_backend_type.value
|
|
340
|
-
return body
|
|
341
|
-
|
|
342
|
-
def as_shallow_dict(self) -> dict:
|
|
343
|
-
"""Serializes the CreateScope into a shallow dictionary of its immediate attributes."""
|
|
344
|
-
body = {}
|
|
345
|
-
if self.backend_azure_keyvault:
|
|
346
|
-
body["backend_azure_keyvault"] = self.backend_azure_keyvault
|
|
347
|
-
if self.initial_manage_principal is not None:
|
|
348
|
-
body["initial_manage_principal"] = self.initial_manage_principal
|
|
349
|
-
if self.scope is not None:
|
|
350
|
-
body["scope"] = self.scope
|
|
351
|
-
if self.scope_backend_type is not None:
|
|
352
|
-
body["scope_backend_type"] = self.scope_backend_type
|
|
353
|
-
return body
|
|
354
|
-
|
|
355
|
-
@classmethod
|
|
356
|
-
def from_dict(cls, d: Dict[str, Any]) -> CreateScope:
|
|
357
|
-
"""Deserializes the CreateScope from a dictionary."""
|
|
358
|
-
return cls(
|
|
359
|
-
backend_azure_keyvault=_from_dict(d, "backend_azure_keyvault", AzureKeyVaultSecretScopeMetadata),
|
|
360
|
-
initial_manage_principal=d.get("initial_manage_principal", None),
|
|
361
|
-
scope=d.get("scope", None),
|
|
362
|
-
scope_backend_type=_enum(d, "scope_backend_type", ScopeBackendType),
|
|
363
|
-
)
|
|
364
|
-
|
|
365
|
-
|
|
366
230
|
@dataclass
|
|
367
231
|
class CreateScopeResponse:
|
|
368
232
|
def as_dict(self) -> dict:
|
|
@@ -393,6 +257,12 @@ class CredentialInfo:
|
|
|
393
257
|
"""The username or email provided with your Git provider account and associated with the
|
|
394
258
|
credential."""
|
|
395
259
|
|
|
260
|
+
is_default_for_provider: Optional[bool] = None
|
|
261
|
+
"""if the credential is the default for the given provider"""
|
|
262
|
+
|
|
263
|
+
name: Optional[str] = None
|
|
264
|
+
"""the name of the git credential, used for identification and ease of lookup"""
|
|
265
|
+
|
|
396
266
|
def as_dict(self) -> dict:
|
|
397
267
|
"""Serializes the CredentialInfo into a dictionary suitable for use as a JSON request body."""
|
|
398
268
|
body = {}
|
|
@@ -402,6 +272,10 @@ class CredentialInfo:
|
|
|
402
272
|
body["git_provider"] = self.git_provider
|
|
403
273
|
if self.git_username is not None:
|
|
404
274
|
body["git_username"] = self.git_username
|
|
275
|
+
if self.is_default_for_provider is not None:
|
|
276
|
+
body["is_default_for_provider"] = self.is_default_for_provider
|
|
277
|
+
if self.name is not None:
|
|
278
|
+
body["name"] = self.name
|
|
405
279
|
return body
|
|
406
280
|
|
|
407
281
|
def as_shallow_dict(self) -> dict:
|
|
@@ -413,6 +287,10 @@ class CredentialInfo:
|
|
|
413
287
|
body["git_provider"] = self.git_provider
|
|
414
288
|
if self.git_username is not None:
|
|
415
289
|
body["git_username"] = self.git_username
|
|
290
|
+
if self.is_default_for_provider is not None:
|
|
291
|
+
body["is_default_for_provider"] = self.is_default_for_provider
|
|
292
|
+
if self.name is not None:
|
|
293
|
+
body["name"] = self.name
|
|
416
294
|
return body
|
|
417
295
|
|
|
418
296
|
@classmethod
|
|
@@ -422,75 +300,11 @@ class CredentialInfo:
|
|
|
422
300
|
credential_id=d.get("credential_id", None),
|
|
423
301
|
git_provider=d.get("git_provider", None),
|
|
424
302
|
git_username=d.get("git_username", None),
|
|
303
|
+
is_default_for_provider=d.get("is_default_for_provider", None),
|
|
304
|
+
name=d.get("name", None),
|
|
425
305
|
)
|
|
426
306
|
|
|
427
307
|
|
|
428
|
-
@dataclass
|
|
429
|
-
class Delete:
|
|
430
|
-
path: str
|
|
431
|
-
"""The absolute path of the notebook or directory."""
|
|
432
|
-
|
|
433
|
-
recursive: Optional[bool] = None
|
|
434
|
-
"""The flag that specifies whether to delete the object recursively. It is `false` by default.
|
|
435
|
-
Please note this deleting directory is not atomic. If it fails in the middle, some of objects
|
|
436
|
-
under this directory may be deleted and cannot be undone."""
|
|
437
|
-
|
|
438
|
-
def as_dict(self) -> dict:
|
|
439
|
-
"""Serializes the Delete into a dictionary suitable for use as a JSON request body."""
|
|
440
|
-
body = {}
|
|
441
|
-
if self.path is not None:
|
|
442
|
-
body["path"] = self.path
|
|
443
|
-
if self.recursive is not None:
|
|
444
|
-
body["recursive"] = self.recursive
|
|
445
|
-
return body
|
|
446
|
-
|
|
447
|
-
def as_shallow_dict(self) -> dict:
|
|
448
|
-
"""Serializes the Delete into a shallow dictionary of its immediate attributes."""
|
|
449
|
-
body = {}
|
|
450
|
-
if self.path is not None:
|
|
451
|
-
body["path"] = self.path
|
|
452
|
-
if self.recursive is not None:
|
|
453
|
-
body["recursive"] = self.recursive
|
|
454
|
-
return body
|
|
455
|
-
|
|
456
|
-
@classmethod
|
|
457
|
-
def from_dict(cls, d: Dict[str, Any]) -> Delete:
|
|
458
|
-
"""Deserializes the Delete from a dictionary."""
|
|
459
|
-
return cls(path=d.get("path", None), recursive=d.get("recursive", None))
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
@dataclass
|
|
463
|
-
class DeleteAcl:
|
|
464
|
-
scope: str
|
|
465
|
-
"""The name of the scope to remove permissions from."""
|
|
466
|
-
|
|
467
|
-
principal: str
|
|
468
|
-
"""The principal to remove an existing ACL from."""
|
|
469
|
-
|
|
470
|
-
def as_dict(self) -> dict:
|
|
471
|
-
"""Serializes the DeleteAcl into a dictionary suitable for use as a JSON request body."""
|
|
472
|
-
body = {}
|
|
473
|
-
if self.principal is not None:
|
|
474
|
-
body["principal"] = self.principal
|
|
475
|
-
if self.scope is not None:
|
|
476
|
-
body["scope"] = self.scope
|
|
477
|
-
return body
|
|
478
|
-
|
|
479
|
-
def as_shallow_dict(self) -> dict:
|
|
480
|
-
"""Serializes the DeleteAcl into a shallow dictionary of its immediate attributes."""
|
|
481
|
-
body = {}
|
|
482
|
-
if self.principal is not None:
|
|
483
|
-
body["principal"] = self.principal
|
|
484
|
-
if self.scope is not None:
|
|
485
|
-
body["scope"] = self.scope
|
|
486
|
-
return body
|
|
487
|
-
|
|
488
|
-
@classmethod
|
|
489
|
-
def from_dict(cls, d: Dict[str, Any]) -> DeleteAcl:
|
|
490
|
-
"""Deserializes the DeleteAcl from a dictionary."""
|
|
491
|
-
return cls(principal=d.get("principal", None), scope=d.get("scope", None))
|
|
492
|
-
|
|
493
|
-
|
|
494
308
|
@dataclass
|
|
495
309
|
class DeleteAclResponse:
|
|
496
310
|
def as_dict(self) -> dict:
|
|
@@ -563,31 +377,6 @@ class DeleteResponse:
|
|
|
563
377
|
return cls()
|
|
564
378
|
|
|
565
379
|
|
|
566
|
-
@dataclass
|
|
567
|
-
class DeleteScope:
|
|
568
|
-
scope: str
|
|
569
|
-
"""Name of the scope to delete."""
|
|
570
|
-
|
|
571
|
-
def as_dict(self) -> dict:
|
|
572
|
-
"""Serializes the DeleteScope into a dictionary suitable for use as a JSON request body."""
|
|
573
|
-
body = {}
|
|
574
|
-
if self.scope is not None:
|
|
575
|
-
body["scope"] = self.scope
|
|
576
|
-
return body
|
|
577
|
-
|
|
578
|
-
def as_shallow_dict(self) -> dict:
|
|
579
|
-
"""Serializes the DeleteScope into a shallow dictionary of its immediate attributes."""
|
|
580
|
-
body = {}
|
|
581
|
-
if self.scope is not None:
|
|
582
|
-
body["scope"] = self.scope
|
|
583
|
-
return body
|
|
584
|
-
|
|
585
|
-
@classmethod
|
|
586
|
-
def from_dict(cls, d: Dict[str, Any]) -> DeleteScope:
|
|
587
|
-
"""Deserializes the DeleteScope from a dictionary."""
|
|
588
|
-
return cls(scope=d.get("scope", None))
|
|
589
|
-
|
|
590
|
-
|
|
591
380
|
@dataclass
|
|
592
381
|
class DeleteScopeResponse:
|
|
593
382
|
def as_dict(self) -> dict:
|
|
@@ -606,38 +395,6 @@ class DeleteScopeResponse:
|
|
|
606
395
|
return cls()
|
|
607
396
|
|
|
608
397
|
|
|
609
|
-
@dataclass
|
|
610
|
-
class DeleteSecret:
|
|
611
|
-
scope: str
|
|
612
|
-
"""The name of the scope that contains the secret to delete."""
|
|
613
|
-
|
|
614
|
-
key: str
|
|
615
|
-
"""Name of the secret to delete."""
|
|
616
|
-
|
|
617
|
-
def as_dict(self) -> dict:
|
|
618
|
-
"""Serializes the DeleteSecret into a dictionary suitable for use as a JSON request body."""
|
|
619
|
-
body = {}
|
|
620
|
-
if self.key is not None:
|
|
621
|
-
body["key"] = self.key
|
|
622
|
-
if self.scope is not None:
|
|
623
|
-
body["scope"] = self.scope
|
|
624
|
-
return body
|
|
625
|
-
|
|
626
|
-
def as_shallow_dict(self) -> dict:
|
|
627
|
-
"""Serializes the DeleteSecret into a shallow dictionary of its immediate attributes."""
|
|
628
|
-
body = {}
|
|
629
|
-
if self.key is not None:
|
|
630
|
-
body["key"] = self.key
|
|
631
|
-
if self.scope is not None:
|
|
632
|
-
body["scope"] = self.scope
|
|
633
|
-
return body
|
|
634
|
-
|
|
635
|
-
@classmethod
|
|
636
|
-
def from_dict(cls, d: Dict[str, Any]) -> DeleteSecret:
|
|
637
|
-
"""Deserializes the DeleteSecret from a dictionary."""
|
|
638
|
-
return cls(key=d.get("key", None), scope=d.get("scope", None))
|
|
639
|
-
|
|
640
|
-
|
|
641
398
|
@dataclass
|
|
642
399
|
class DeleteSecretResponse:
|
|
643
400
|
def as_dict(self) -> dict:
|
|
@@ -716,6 +473,12 @@ class GetCredentialsResponse:
|
|
|
716
473
|
"""The username or email provided with your Git provider account and associated with the
|
|
717
474
|
credential."""
|
|
718
475
|
|
|
476
|
+
is_default_for_provider: Optional[bool] = None
|
|
477
|
+
"""if the credential is the default for the given provider"""
|
|
478
|
+
|
|
479
|
+
name: Optional[str] = None
|
|
480
|
+
"""the name of the git credential, used for identification and ease of lookup"""
|
|
481
|
+
|
|
719
482
|
def as_dict(self) -> dict:
|
|
720
483
|
"""Serializes the GetCredentialsResponse into a dictionary suitable for use as a JSON request body."""
|
|
721
484
|
body = {}
|
|
@@ -725,6 +488,10 @@ class GetCredentialsResponse:
|
|
|
725
488
|
body["git_provider"] = self.git_provider
|
|
726
489
|
if self.git_username is not None:
|
|
727
490
|
body["git_username"] = self.git_username
|
|
491
|
+
if self.is_default_for_provider is not None:
|
|
492
|
+
body["is_default_for_provider"] = self.is_default_for_provider
|
|
493
|
+
if self.name is not None:
|
|
494
|
+
body["name"] = self.name
|
|
728
495
|
return body
|
|
729
496
|
|
|
730
497
|
def as_shallow_dict(self) -> dict:
|
|
@@ -736,6 +503,10 @@ class GetCredentialsResponse:
|
|
|
736
503
|
body["git_provider"] = self.git_provider
|
|
737
504
|
if self.git_username is not None:
|
|
738
505
|
body["git_username"] = self.git_username
|
|
506
|
+
if self.is_default_for_provider is not None:
|
|
507
|
+
body["is_default_for_provider"] = self.is_default_for_provider
|
|
508
|
+
if self.name is not None:
|
|
509
|
+
body["name"] = self.name
|
|
739
510
|
return body
|
|
740
511
|
|
|
741
512
|
@classmethod
|
|
@@ -745,6 +516,8 @@ class GetCredentialsResponse:
|
|
|
745
516
|
credential_id=d.get("credential_id", None),
|
|
746
517
|
git_provider=d.get("git_provider", None),
|
|
747
518
|
git_username=d.get("git_username", None),
|
|
519
|
+
is_default_for_provider=d.get("is_default_for_provider", None),
|
|
520
|
+
name=d.get("name", None),
|
|
748
521
|
)
|
|
749
522
|
|
|
750
523
|
|
|
@@ -905,80 +678,6 @@ class GetWorkspaceObjectPermissionLevelsResponse:
|
|
|
905
678
|
return cls(permission_levels=_repeated_dict(d, "permission_levels", WorkspaceObjectPermissionsDescription))
|
|
906
679
|
|
|
907
680
|
|
|
908
|
-
@dataclass
|
|
909
|
-
class Import:
|
|
910
|
-
path: str
|
|
911
|
-
"""The absolute path of the object or directory. Importing a directory is only supported for the
|
|
912
|
-
`DBC` and `SOURCE` formats."""
|
|
913
|
-
|
|
914
|
-
content: Optional[str] = None
|
|
915
|
-
"""The base64-encoded content. This has a limit of 10 MB.
|
|
916
|
-
|
|
917
|
-
If the limit (10MB) is exceeded, exception with error code **MAX_NOTEBOOK_SIZE_EXCEEDED** is
|
|
918
|
-
thrown. This parameter might be absent, and instead a posted file is used."""
|
|
919
|
-
|
|
920
|
-
format: Optional[ImportFormat] = None
|
|
921
|
-
"""This specifies the format of the file to be imported.
|
|
922
|
-
|
|
923
|
-
The value is case sensitive.
|
|
924
|
-
|
|
925
|
-
- `AUTO`: The item is imported depending on an analysis of the item's extension and the header
|
|
926
|
-
content provided in the request. If the item is imported as a notebook, then the item's
|
|
927
|
-
extension is automatically removed. - `SOURCE`: The notebook or directory is imported as source
|
|
928
|
-
code. - `HTML`: The notebook is imported as an HTML file. - `JUPYTER`: The notebook is imported
|
|
929
|
-
as a Jupyter/IPython Notebook file. - `DBC`: The notebook is imported in Databricks archive
|
|
930
|
-
format. Required for directories. - `R_MARKDOWN`: The notebook is imported from R Markdown
|
|
931
|
-
format."""
|
|
932
|
-
|
|
933
|
-
language: Optional[Language] = None
|
|
934
|
-
"""The language of the object. This value is set only if the object type is `NOTEBOOK`."""
|
|
935
|
-
|
|
936
|
-
overwrite: Optional[bool] = None
|
|
937
|
-
"""The flag that specifies whether to overwrite existing object. It is `false` by default. For
|
|
938
|
-
`DBC` format, `overwrite` is not supported since it may contain a directory."""
|
|
939
|
-
|
|
940
|
-
def as_dict(self) -> dict:
|
|
941
|
-
"""Serializes the Import into a dictionary suitable for use as a JSON request body."""
|
|
942
|
-
body = {}
|
|
943
|
-
if self.content is not None:
|
|
944
|
-
body["content"] = self.content
|
|
945
|
-
if self.format is not None:
|
|
946
|
-
body["format"] = self.format.value
|
|
947
|
-
if self.language is not None:
|
|
948
|
-
body["language"] = self.language.value
|
|
949
|
-
if self.overwrite is not None:
|
|
950
|
-
body["overwrite"] = self.overwrite
|
|
951
|
-
if self.path is not None:
|
|
952
|
-
body["path"] = self.path
|
|
953
|
-
return body
|
|
954
|
-
|
|
955
|
-
def as_shallow_dict(self) -> dict:
|
|
956
|
-
"""Serializes the Import into a shallow dictionary of its immediate attributes."""
|
|
957
|
-
body = {}
|
|
958
|
-
if self.content is not None:
|
|
959
|
-
body["content"] = self.content
|
|
960
|
-
if self.format is not None:
|
|
961
|
-
body["format"] = self.format
|
|
962
|
-
if self.language is not None:
|
|
963
|
-
body["language"] = self.language
|
|
964
|
-
if self.overwrite is not None:
|
|
965
|
-
body["overwrite"] = self.overwrite
|
|
966
|
-
if self.path is not None:
|
|
967
|
-
body["path"] = self.path
|
|
968
|
-
return body
|
|
969
|
-
|
|
970
|
-
@classmethod
|
|
971
|
-
def from_dict(cls, d: Dict[str, Any]) -> Import:
|
|
972
|
-
"""Deserializes the Import from a dictionary."""
|
|
973
|
-
return cls(
|
|
974
|
-
content=d.get("content", None),
|
|
975
|
-
format=_enum(d, "format", ImportFormat),
|
|
976
|
-
language=_enum(d, "language", Language),
|
|
977
|
-
overwrite=d.get("overwrite", None),
|
|
978
|
-
path=d.get("path", None),
|
|
979
|
-
)
|
|
980
|
-
|
|
981
|
-
|
|
982
681
|
class ImportFormat(Enum):
|
|
983
682
|
"""The format for workspace import and export."""
|
|
984
683
|
|
|
@@ -1176,32 +875,6 @@ class ListSecretsResponse:
|
|
|
1176
875
|
return cls(secrets=_repeated_dict(d, "secrets", SecretMetadata))
|
|
1177
876
|
|
|
1178
877
|
|
|
1179
|
-
@dataclass
|
|
1180
|
-
class Mkdirs:
|
|
1181
|
-
path: str
|
|
1182
|
-
"""The absolute path of the directory. If the parent directories do not exist, it will also create
|
|
1183
|
-
them. If the directory already exists, this command will do nothing and succeed."""
|
|
1184
|
-
|
|
1185
|
-
def as_dict(self) -> dict:
|
|
1186
|
-
"""Serializes the Mkdirs into a dictionary suitable for use as a JSON request body."""
|
|
1187
|
-
body = {}
|
|
1188
|
-
if self.path is not None:
|
|
1189
|
-
body["path"] = self.path
|
|
1190
|
-
return body
|
|
1191
|
-
|
|
1192
|
-
def as_shallow_dict(self) -> dict:
|
|
1193
|
-
"""Serializes the Mkdirs into a shallow dictionary of its immediate attributes."""
|
|
1194
|
-
body = {}
|
|
1195
|
-
if self.path is not None:
|
|
1196
|
-
body["path"] = self.path
|
|
1197
|
-
return body
|
|
1198
|
-
|
|
1199
|
-
@classmethod
|
|
1200
|
-
def from_dict(cls, d: Dict[str, Any]) -> Mkdirs:
|
|
1201
|
-
"""Deserializes the Mkdirs from a dictionary."""
|
|
1202
|
-
return cls(path=d.get("path", None))
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
878
|
@dataclass
|
|
1206
879
|
class MkdirsResponse:
|
|
1207
880
|
def as_dict(self) -> dict:
|
|
@@ -1320,49 +993,6 @@ class ObjectType(Enum):
|
|
|
1320
993
|
REPO = "REPO"
|
|
1321
994
|
|
|
1322
995
|
|
|
1323
|
-
@dataclass
|
|
1324
|
-
class PutAcl:
|
|
1325
|
-
scope: str
|
|
1326
|
-
"""The name of the scope to apply permissions to."""
|
|
1327
|
-
|
|
1328
|
-
principal: str
|
|
1329
|
-
"""The principal in which the permission is applied."""
|
|
1330
|
-
|
|
1331
|
-
permission: AclPermission
|
|
1332
|
-
"""The permission level applied to the principal."""
|
|
1333
|
-
|
|
1334
|
-
def as_dict(self) -> dict:
|
|
1335
|
-
"""Serializes the PutAcl into a dictionary suitable for use as a JSON request body."""
|
|
1336
|
-
body = {}
|
|
1337
|
-
if self.permission is not None:
|
|
1338
|
-
body["permission"] = self.permission.value
|
|
1339
|
-
if self.principal is not None:
|
|
1340
|
-
body["principal"] = self.principal
|
|
1341
|
-
if self.scope is not None:
|
|
1342
|
-
body["scope"] = self.scope
|
|
1343
|
-
return body
|
|
1344
|
-
|
|
1345
|
-
def as_shallow_dict(self) -> dict:
|
|
1346
|
-
"""Serializes the PutAcl into a shallow dictionary of its immediate attributes."""
|
|
1347
|
-
body = {}
|
|
1348
|
-
if self.permission is not None:
|
|
1349
|
-
body["permission"] = self.permission
|
|
1350
|
-
if self.principal is not None:
|
|
1351
|
-
body["principal"] = self.principal
|
|
1352
|
-
if self.scope is not None:
|
|
1353
|
-
body["scope"] = self.scope
|
|
1354
|
-
return body
|
|
1355
|
-
|
|
1356
|
-
@classmethod
|
|
1357
|
-
def from_dict(cls, d: Dict[str, Any]) -> PutAcl:
|
|
1358
|
-
"""Deserializes the PutAcl from a dictionary."""
|
|
1359
|
-
return cls(
|
|
1360
|
-
permission=_enum(d, "permission", AclPermission),
|
|
1361
|
-
principal=d.get("principal", None),
|
|
1362
|
-
scope=d.get("scope", None),
|
|
1363
|
-
)
|
|
1364
|
-
|
|
1365
|
-
|
|
1366
996
|
@dataclass
|
|
1367
997
|
class PutAclResponse:
|
|
1368
998
|
def as_dict(self) -> dict:
|
|
@@ -1381,57 +1011,6 @@ class PutAclResponse:
|
|
|
1381
1011
|
return cls()
|
|
1382
1012
|
|
|
1383
1013
|
|
|
1384
|
-
@dataclass
|
|
1385
|
-
class PutSecret:
|
|
1386
|
-
scope: str
|
|
1387
|
-
"""The name of the scope to which the secret will be associated with."""
|
|
1388
|
-
|
|
1389
|
-
key: str
|
|
1390
|
-
"""A unique name to identify the secret."""
|
|
1391
|
-
|
|
1392
|
-
bytes_value: Optional[str] = None
|
|
1393
|
-
"""If specified, value will be stored as bytes."""
|
|
1394
|
-
|
|
1395
|
-
string_value: Optional[str] = None
|
|
1396
|
-
"""If specified, note that the value will be stored in UTF-8 (MB4) form."""
|
|
1397
|
-
|
|
1398
|
-
def as_dict(self) -> dict:
|
|
1399
|
-
"""Serializes the PutSecret into a dictionary suitable for use as a JSON request body."""
|
|
1400
|
-
body = {}
|
|
1401
|
-
if self.bytes_value is not None:
|
|
1402
|
-
body["bytes_value"] = self.bytes_value
|
|
1403
|
-
if self.key is not None:
|
|
1404
|
-
body["key"] = self.key
|
|
1405
|
-
if self.scope is not None:
|
|
1406
|
-
body["scope"] = self.scope
|
|
1407
|
-
if self.string_value is not None:
|
|
1408
|
-
body["string_value"] = self.string_value
|
|
1409
|
-
return body
|
|
1410
|
-
|
|
1411
|
-
def as_shallow_dict(self) -> dict:
|
|
1412
|
-
"""Serializes the PutSecret into a shallow dictionary of its immediate attributes."""
|
|
1413
|
-
body = {}
|
|
1414
|
-
if self.bytes_value is not None:
|
|
1415
|
-
body["bytes_value"] = self.bytes_value
|
|
1416
|
-
if self.key is not None:
|
|
1417
|
-
body["key"] = self.key
|
|
1418
|
-
if self.scope is not None:
|
|
1419
|
-
body["scope"] = self.scope
|
|
1420
|
-
if self.string_value is not None:
|
|
1421
|
-
body["string_value"] = self.string_value
|
|
1422
|
-
return body
|
|
1423
|
-
|
|
1424
|
-
@classmethod
|
|
1425
|
-
def from_dict(cls, d: Dict[str, Any]) -> PutSecret:
|
|
1426
|
-
"""Deserializes the PutSecret from a dictionary."""
|
|
1427
|
-
return cls(
|
|
1428
|
-
bytes_value=d.get("bytes_value", None),
|
|
1429
|
-
key=d.get("key", None),
|
|
1430
|
-
scope=d.get("scope", None),
|
|
1431
|
-
string_value=d.get("string_value", None),
|
|
1432
|
-
)
|
|
1433
|
-
|
|
1434
|
-
|
|
1435
1014
|
@dataclass
|
|
1436
1015
|
class PutSecretResponse:
|
|
1437
1016
|
def as_dict(self) -> dict:
|
|
@@ -1456,7 +1035,6 @@ class RepoAccessControlRequest:
|
|
|
1456
1035
|
"""name of the group"""
|
|
1457
1036
|
|
|
1458
1037
|
permission_level: Optional[RepoPermissionLevel] = None
|
|
1459
|
-
"""Permission level"""
|
|
1460
1038
|
|
|
1461
1039
|
service_principal_name: Optional[str] = None
|
|
1462
1040
|
"""application ID of a service principal"""
|
|
@@ -1644,7 +1222,6 @@ class RepoPermission:
|
|
|
1644
1222
|
inherited_from_object: Optional[List[str]] = None
|
|
1645
1223
|
|
|
1646
1224
|
permission_level: Optional[RepoPermissionLevel] = None
|
|
1647
|
-
"""Permission level"""
|
|
1648
1225
|
|
|
1649
1226
|
def as_dict(self) -> dict:
|
|
1650
1227
|
"""Serializes the RepoPermission into a dictionary suitable for use as a JSON request body."""
|
|
@@ -1732,7 +1309,6 @@ class RepoPermissionsDescription:
|
|
|
1732
1309
|
description: Optional[str] = None
|
|
1733
1310
|
|
|
1734
1311
|
permission_level: Optional[RepoPermissionLevel] = None
|
|
1735
|
-
"""Permission level"""
|
|
1736
1312
|
|
|
1737
1313
|
def as_dict(self) -> dict:
|
|
1738
1314
|
"""Serializes the RepoPermissionsDescription into a dictionary suitable for use as a JSON request body."""
|
|
@@ -1760,41 +1336,9 @@ class RepoPermissionsDescription:
|
|
|
1760
1336
|
)
|
|
1761
1337
|
|
|
1762
1338
|
|
|
1763
|
-
@dataclass
|
|
1764
|
-
class RepoPermissionsRequest:
|
|
1765
|
-
access_control_list: Optional[List[RepoAccessControlRequest]] = None
|
|
1766
|
-
|
|
1767
|
-
repo_id: Optional[str] = None
|
|
1768
|
-
"""The repo for which to get or manage permissions."""
|
|
1769
|
-
|
|
1770
|
-
def as_dict(self) -> dict:
|
|
1771
|
-
"""Serializes the RepoPermissionsRequest into a dictionary suitable for use as a JSON request body."""
|
|
1772
|
-
body = {}
|
|
1773
|
-
if self.access_control_list:
|
|
1774
|
-
body["access_control_list"] = [v.as_dict() for v in self.access_control_list]
|
|
1775
|
-
if self.repo_id is not None:
|
|
1776
|
-
body["repo_id"] = self.repo_id
|
|
1777
|
-
return body
|
|
1778
|
-
|
|
1779
|
-
def as_shallow_dict(self) -> dict:
|
|
1780
|
-
"""Serializes the RepoPermissionsRequest into a shallow dictionary of its immediate attributes."""
|
|
1781
|
-
body = {}
|
|
1782
|
-
if self.access_control_list:
|
|
1783
|
-
body["access_control_list"] = self.access_control_list
|
|
1784
|
-
if self.repo_id is not None:
|
|
1785
|
-
body["repo_id"] = self.repo_id
|
|
1786
|
-
return body
|
|
1787
|
-
|
|
1788
|
-
@classmethod
|
|
1789
|
-
def from_dict(cls, d: Dict[str, Any]) -> RepoPermissionsRequest:
|
|
1790
|
-
"""Deserializes the RepoPermissionsRequest from a dictionary."""
|
|
1791
|
-
return cls(
|
|
1792
|
-
access_control_list=_repeated_dict(d, "access_control_list", RepoAccessControlRequest),
|
|
1793
|
-
repo_id=d.get("repo_id", None),
|
|
1794
|
-
)
|
|
1795
|
-
|
|
1796
|
-
|
|
1797
1339
|
class ScopeBackendType(Enum):
|
|
1340
|
+
"""The types of secret scope backends in the Secret Manager. Azure KeyVault backed secret scopes
|
|
1341
|
+
will be supported in a later release."""
|
|
1798
1342
|
|
|
1799
1343
|
AZURE_KEYVAULT = "AZURE_KEYVAULT"
|
|
1800
1344
|
DATABRICKS = "DATABRICKS"
|
|
@@ -1802,6 +1346,9 @@ class ScopeBackendType(Enum):
|
|
|
1802
1346
|
|
|
1803
1347
|
@dataclass
|
|
1804
1348
|
class SecretMetadata:
|
|
1349
|
+
"""The metadata about a secret. Returned when listing secrets. Does not contain the actual secret
|
|
1350
|
+
value."""
|
|
1351
|
+
|
|
1805
1352
|
key: Optional[str] = None
|
|
1806
1353
|
"""A unique name to identify the secret."""
|
|
1807
1354
|
|
|
@@ -1834,11 +1381,15 @@ class SecretMetadata:
|
|
|
1834
1381
|
|
|
1835
1382
|
@dataclass
|
|
1836
1383
|
class SecretScope:
|
|
1384
|
+
"""An organizational resource for storing secrets. Secret scopes can be different types
|
|
1385
|
+
(Databricks-managed, Azure KeyVault backed, etc), and ACLs can be applied to control permissions
|
|
1386
|
+
for all secrets within a scope."""
|
|
1387
|
+
|
|
1837
1388
|
backend_type: Optional[ScopeBackendType] = None
|
|
1838
1389
|
"""The type of secret scope backend."""
|
|
1839
1390
|
|
|
1840
1391
|
keyvault_metadata: Optional[AzureKeyVaultSecretScopeMetadata] = None
|
|
1841
|
-
"""The metadata for the secret scope if the type is
|
|
1392
|
+
"""The metadata for the secret scope if the type is ``AZURE_KEYVAULT``"""
|
|
1842
1393
|
|
|
1843
1394
|
name: Optional[str] = None
|
|
1844
1395
|
"""A unique name to identify the secret scope."""
|
|
@@ -1933,66 +1484,6 @@ class SparseCheckoutUpdate:
|
|
|
1933
1484
|
return cls(patterns=d.get("patterns", None))
|
|
1934
1485
|
|
|
1935
1486
|
|
|
1936
|
-
@dataclass
|
|
1937
|
-
class UpdateCredentialsRequest:
|
|
1938
|
-
git_provider: str
|
|
1939
|
-
"""Git provider. This field is case-insensitive. The available Git providers are `gitHub`,
|
|
1940
|
-
`bitbucketCloud`, `gitLab`, `azureDevOpsServices`, `gitHubEnterprise`, `bitbucketServer`,
|
|
1941
|
-
`gitLabEnterpriseEdition` and `awsCodeCommit`."""
|
|
1942
|
-
|
|
1943
|
-
credential_id: Optional[int] = None
|
|
1944
|
-
"""The ID for the corresponding credential to access."""
|
|
1945
|
-
|
|
1946
|
-
git_username: Optional[str] = None
|
|
1947
|
-
"""The username or email provided with your Git provider account, depending on which provider you
|
|
1948
|
-
are using. For GitHub, GitHub Enterprise Server, or Azure DevOps Services, either email or
|
|
1949
|
-
username may be used. For GitLab, GitLab Enterprise Edition, email must be used. For AWS
|
|
1950
|
-
CodeCommit, BitBucket or BitBucket Server, username must be used. For all other providers please
|
|
1951
|
-
see your provider's Personal Access Token authentication documentation to see what is supported."""
|
|
1952
|
-
|
|
1953
|
-
personal_access_token: Optional[str] = None
|
|
1954
|
-
"""The personal access token used to authenticate to the corresponding Git provider. For certain
|
|
1955
|
-
providers, support may exist for other types of scoped access tokens. [Learn more].
|
|
1956
|
-
|
|
1957
|
-
[Learn more]: https://docs.databricks.com/repos/get-access-tokens-from-git-provider.html"""
|
|
1958
|
-
|
|
1959
|
-
def as_dict(self) -> dict:
|
|
1960
|
-
"""Serializes the UpdateCredentialsRequest into a dictionary suitable for use as a JSON request body."""
|
|
1961
|
-
body = {}
|
|
1962
|
-
if self.credential_id is not None:
|
|
1963
|
-
body["credential_id"] = self.credential_id
|
|
1964
|
-
if self.git_provider is not None:
|
|
1965
|
-
body["git_provider"] = self.git_provider
|
|
1966
|
-
if self.git_username is not None:
|
|
1967
|
-
body["git_username"] = self.git_username
|
|
1968
|
-
if self.personal_access_token is not None:
|
|
1969
|
-
body["personal_access_token"] = self.personal_access_token
|
|
1970
|
-
return body
|
|
1971
|
-
|
|
1972
|
-
def as_shallow_dict(self) -> dict:
|
|
1973
|
-
"""Serializes the UpdateCredentialsRequest into a shallow dictionary of its immediate attributes."""
|
|
1974
|
-
body = {}
|
|
1975
|
-
if self.credential_id is not None:
|
|
1976
|
-
body["credential_id"] = self.credential_id
|
|
1977
|
-
if self.git_provider is not None:
|
|
1978
|
-
body["git_provider"] = self.git_provider
|
|
1979
|
-
if self.git_username is not None:
|
|
1980
|
-
body["git_username"] = self.git_username
|
|
1981
|
-
if self.personal_access_token is not None:
|
|
1982
|
-
body["personal_access_token"] = self.personal_access_token
|
|
1983
|
-
return body
|
|
1984
|
-
|
|
1985
|
-
@classmethod
|
|
1986
|
-
def from_dict(cls, d: Dict[str, Any]) -> UpdateCredentialsRequest:
|
|
1987
|
-
"""Deserializes the UpdateCredentialsRequest from a dictionary."""
|
|
1988
|
-
return cls(
|
|
1989
|
-
credential_id=d.get("credential_id", None),
|
|
1990
|
-
git_provider=d.get("git_provider", None),
|
|
1991
|
-
git_username=d.get("git_username", None),
|
|
1992
|
-
personal_access_token=d.get("personal_access_token", None),
|
|
1993
|
-
)
|
|
1994
|
-
|
|
1995
|
-
|
|
1996
1487
|
@dataclass
|
|
1997
1488
|
class UpdateCredentialsResponse:
|
|
1998
1489
|
def as_dict(self) -> dict:
|
|
@@ -2011,60 +1502,6 @@ class UpdateCredentialsResponse:
|
|
|
2011
1502
|
return cls()
|
|
2012
1503
|
|
|
2013
1504
|
|
|
2014
|
-
@dataclass
|
|
2015
|
-
class UpdateRepoRequest:
|
|
2016
|
-
branch: Optional[str] = None
|
|
2017
|
-
"""Branch that the local version of the repo is checked out to."""
|
|
2018
|
-
|
|
2019
|
-
repo_id: Optional[int] = None
|
|
2020
|
-
"""ID of the Git folder (repo) object in the workspace."""
|
|
2021
|
-
|
|
2022
|
-
sparse_checkout: Optional[SparseCheckoutUpdate] = None
|
|
2023
|
-
"""If specified, update the sparse checkout settings. The update will fail if sparse checkout is
|
|
2024
|
-
not enabled for the repo."""
|
|
2025
|
-
|
|
2026
|
-
tag: Optional[str] = None
|
|
2027
|
-
"""Tag that the local version of the repo is checked out to. Updating the repo to a tag puts the
|
|
2028
|
-
repo in a detached HEAD state. Before committing new changes, you must update the repo to a
|
|
2029
|
-
branch instead of the detached HEAD."""
|
|
2030
|
-
|
|
2031
|
-
def as_dict(self) -> dict:
|
|
2032
|
-
"""Serializes the UpdateRepoRequest into a dictionary suitable for use as a JSON request body."""
|
|
2033
|
-
body = {}
|
|
2034
|
-
if self.branch is not None:
|
|
2035
|
-
body["branch"] = self.branch
|
|
2036
|
-
if self.repo_id is not None:
|
|
2037
|
-
body["repo_id"] = self.repo_id
|
|
2038
|
-
if self.sparse_checkout:
|
|
2039
|
-
body["sparse_checkout"] = self.sparse_checkout.as_dict()
|
|
2040
|
-
if self.tag is not None:
|
|
2041
|
-
body["tag"] = self.tag
|
|
2042
|
-
return body
|
|
2043
|
-
|
|
2044
|
-
def as_shallow_dict(self) -> dict:
|
|
2045
|
-
"""Serializes the UpdateRepoRequest into a shallow dictionary of its immediate attributes."""
|
|
2046
|
-
body = {}
|
|
2047
|
-
if self.branch is not None:
|
|
2048
|
-
body["branch"] = self.branch
|
|
2049
|
-
if self.repo_id is not None:
|
|
2050
|
-
body["repo_id"] = self.repo_id
|
|
2051
|
-
if self.sparse_checkout:
|
|
2052
|
-
body["sparse_checkout"] = self.sparse_checkout
|
|
2053
|
-
if self.tag is not None:
|
|
2054
|
-
body["tag"] = self.tag
|
|
2055
|
-
return body
|
|
2056
|
-
|
|
2057
|
-
@classmethod
|
|
2058
|
-
def from_dict(cls, d: Dict[str, Any]) -> UpdateRepoRequest:
|
|
2059
|
-
"""Deserializes the UpdateRepoRequest from a dictionary."""
|
|
2060
|
-
return cls(
|
|
2061
|
-
branch=d.get("branch", None),
|
|
2062
|
-
repo_id=d.get("repo_id", None),
|
|
2063
|
-
sparse_checkout=_from_dict(d, "sparse_checkout", SparseCheckoutUpdate),
|
|
2064
|
-
tag=d.get("tag", None),
|
|
2065
|
-
)
|
|
2066
|
-
|
|
2067
|
-
|
|
2068
1505
|
@dataclass
|
|
2069
1506
|
class UpdateRepoResponse:
|
|
2070
1507
|
def as_dict(self) -> dict:
|
|
@@ -2089,7 +1526,6 @@ class WorkspaceObjectAccessControlRequest:
|
|
|
2089
1526
|
"""name of the group"""
|
|
2090
1527
|
|
|
2091
1528
|
permission_level: Optional[WorkspaceObjectPermissionLevel] = None
|
|
2092
|
-
"""Permission level"""
|
|
2093
1529
|
|
|
2094
1530
|
service_principal_name: Optional[str] = None
|
|
2095
1531
|
"""application ID of a service principal"""
|
|
@@ -2200,7 +1636,6 @@ class WorkspaceObjectPermission:
|
|
|
2200
1636
|
inherited_from_object: Optional[List[str]] = None
|
|
2201
1637
|
|
|
2202
1638
|
permission_level: Optional[WorkspaceObjectPermissionLevel] = None
|
|
2203
|
-
"""Permission level"""
|
|
2204
1639
|
|
|
2205
1640
|
def as_dict(self) -> dict:
|
|
2206
1641
|
"""Serializes the WorkspaceObjectPermission into a dictionary suitable for use as a JSON request body."""
|
|
@@ -2288,7 +1723,6 @@ class WorkspaceObjectPermissionsDescription:
|
|
|
2288
1723
|
description: Optional[str] = None
|
|
2289
1724
|
|
|
2290
1725
|
permission_level: Optional[WorkspaceObjectPermissionLevel] = None
|
|
2291
|
-
"""Permission level"""
|
|
2292
1726
|
|
|
2293
1727
|
def as_dict(self) -> dict:
|
|
2294
1728
|
"""Serializes the WorkspaceObjectPermissionsDescription into a dictionary suitable for use as a JSON request body."""
|
|
@@ -2317,48 +1751,6 @@ class WorkspaceObjectPermissionsDescription:
|
|
|
2317
1751
|
)
|
|
2318
1752
|
|
|
2319
1753
|
|
|
2320
|
-
@dataclass
|
|
2321
|
-
class WorkspaceObjectPermissionsRequest:
|
|
2322
|
-
access_control_list: Optional[List[WorkspaceObjectAccessControlRequest]] = None
|
|
2323
|
-
|
|
2324
|
-
workspace_object_id: Optional[str] = None
|
|
2325
|
-
"""The workspace object for which to get or manage permissions."""
|
|
2326
|
-
|
|
2327
|
-
workspace_object_type: Optional[str] = None
|
|
2328
|
-
"""The workspace object type for which to get or manage permissions."""
|
|
2329
|
-
|
|
2330
|
-
def as_dict(self) -> dict:
|
|
2331
|
-
"""Serializes the WorkspaceObjectPermissionsRequest into a dictionary suitable for use as a JSON request body."""
|
|
2332
|
-
body = {}
|
|
2333
|
-
if self.access_control_list:
|
|
2334
|
-
body["access_control_list"] = [v.as_dict() for v in self.access_control_list]
|
|
2335
|
-
if self.workspace_object_id is not None:
|
|
2336
|
-
body["workspace_object_id"] = self.workspace_object_id
|
|
2337
|
-
if self.workspace_object_type is not None:
|
|
2338
|
-
body["workspace_object_type"] = self.workspace_object_type
|
|
2339
|
-
return body
|
|
2340
|
-
|
|
2341
|
-
def as_shallow_dict(self) -> dict:
|
|
2342
|
-
"""Serializes the WorkspaceObjectPermissionsRequest into a shallow dictionary of its immediate attributes."""
|
|
2343
|
-
body = {}
|
|
2344
|
-
if self.access_control_list:
|
|
2345
|
-
body["access_control_list"] = self.access_control_list
|
|
2346
|
-
if self.workspace_object_id is not None:
|
|
2347
|
-
body["workspace_object_id"] = self.workspace_object_id
|
|
2348
|
-
if self.workspace_object_type is not None:
|
|
2349
|
-
body["workspace_object_type"] = self.workspace_object_type
|
|
2350
|
-
return body
|
|
2351
|
-
|
|
2352
|
-
@classmethod
|
|
2353
|
-
def from_dict(cls, d: Dict[str, Any]) -> WorkspaceObjectPermissionsRequest:
|
|
2354
|
-
"""Deserializes the WorkspaceObjectPermissionsRequest from a dictionary."""
|
|
2355
|
-
return cls(
|
|
2356
|
-
access_control_list=_repeated_dict(d, "access_control_list", WorkspaceObjectAccessControlRequest),
|
|
2357
|
-
workspace_object_id=d.get("workspace_object_id", None),
|
|
2358
|
-
workspace_object_type=d.get("workspace_object_type", None),
|
|
2359
|
-
)
|
|
2360
|
-
|
|
2361
|
-
|
|
2362
1754
|
class GitCredentialsAPI:
|
|
2363
1755
|
"""Registers personal access token for Databricks to do operations on behalf of the user.
|
|
2364
1756
|
|
|
@@ -2370,7 +1762,13 @@ class GitCredentialsAPI:
|
|
|
2370
1762
|
self._api = api_client
|
|
2371
1763
|
|
|
2372
1764
|
def create(
|
|
2373
|
-
self,
|
|
1765
|
+
self,
|
|
1766
|
+
git_provider: str,
|
|
1767
|
+
*,
|
|
1768
|
+
git_username: Optional[str] = None,
|
|
1769
|
+
is_default_for_provider: Optional[bool] = None,
|
|
1770
|
+
name: Optional[str] = None,
|
|
1771
|
+
personal_access_token: Optional[str] = None,
|
|
2374
1772
|
) -> CreateCredentialsResponse:
|
|
2375
1773
|
"""Creates a Git credential entry for the user. Only one Git credential per user is supported, so any
|
|
2376
1774
|
attempts to create credentials if an entry already exists will fail. Use the PATCH endpoint to update
|
|
@@ -2386,6 +1784,10 @@ class GitCredentialsAPI:
|
|
|
2386
1784
|
be used. For GitLab, GitLab Enterprise Edition, email must be used. For AWS CodeCommit, BitBucket or
|
|
2387
1785
|
BitBucket Server, username must be used. For all other providers please see your provider's Personal
|
|
2388
1786
|
Access Token authentication documentation to see what is supported.
|
|
1787
|
+
:param is_default_for_provider: bool (optional)
|
|
1788
|
+
if the credential is the default for the given provider
|
|
1789
|
+
:param name: str (optional)
|
|
1790
|
+
the name of the git credential, used for identification and ease of lookup
|
|
2389
1791
|
:param personal_access_token: str (optional)
|
|
2390
1792
|
The personal access token used to authenticate to the corresponding Git provider. For certain
|
|
2391
1793
|
providers, support may exist for other types of scoped access tokens. [Learn more].
|
|
@@ -2399,6 +1801,10 @@ class GitCredentialsAPI:
|
|
|
2399
1801
|
body["git_provider"] = git_provider
|
|
2400
1802
|
if git_username is not None:
|
|
2401
1803
|
body["git_username"] = git_username
|
|
1804
|
+
if is_default_for_provider is not None:
|
|
1805
|
+
body["is_default_for_provider"] = is_default_for_provider
|
|
1806
|
+
if name is not None:
|
|
1807
|
+
body["name"] = name
|
|
2402
1808
|
if personal_access_token is not None:
|
|
2403
1809
|
body["personal_access_token"] = personal_access_token
|
|
2404
1810
|
headers = {
|
|
@@ -2443,6 +1849,7 @@ class GitCredentialsAPI:
|
|
|
2443
1849
|
def list(self) -> Iterator[CredentialInfo]:
|
|
2444
1850
|
"""Lists the calling user's Git credentials. One credential per user is supported.
|
|
2445
1851
|
|
|
1852
|
+
|
|
2446
1853
|
:returns: Iterator over :class:`CredentialInfo`
|
|
2447
1854
|
"""
|
|
2448
1855
|
|
|
@@ -2460,6 +1867,8 @@ class GitCredentialsAPI:
|
|
|
2460
1867
|
git_provider: str,
|
|
2461
1868
|
*,
|
|
2462
1869
|
git_username: Optional[str] = None,
|
|
1870
|
+
is_default_for_provider: Optional[bool] = None,
|
|
1871
|
+
name: Optional[str] = None,
|
|
2463
1872
|
personal_access_token: Optional[str] = None,
|
|
2464
1873
|
):
|
|
2465
1874
|
"""Updates the specified Git credential.
|
|
@@ -2476,6 +1885,10 @@ class GitCredentialsAPI:
|
|
|
2476
1885
|
be used. For GitLab, GitLab Enterprise Edition, email must be used. For AWS CodeCommit, BitBucket or
|
|
2477
1886
|
BitBucket Server, username must be used. For all other providers please see your provider's Personal
|
|
2478
1887
|
Access Token authentication documentation to see what is supported.
|
|
1888
|
+
:param is_default_for_provider: bool (optional)
|
|
1889
|
+
if the credential is the default for the given provider
|
|
1890
|
+
:param name: str (optional)
|
|
1891
|
+
the name of the git credential, used for identification and ease of lookup
|
|
2479
1892
|
:param personal_access_token: str (optional)
|
|
2480
1893
|
The personal access token used to authenticate to the corresponding Git provider. For certain
|
|
2481
1894
|
providers, support may exist for other types of scoped access tokens. [Learn more].
|
|
@@ -2489,6 +1902,10 @@ class GitCredentialsAPI:
|
|
|
2489
1902
|
body["git_provider"] = git_provider
|
|
2490
1903
|
if git_username is not None:
|
|
2491
1904
|
body["git_username"] = git_username
|
|
1905
|
+
if is_default_for_provider is not None:
|
|
1906
|
+
body["is_default_for_provider"] = is_default_for_provider
|
|
1907
|
+
if name is not None:
|
|
1908
|
+
body["name"] = name
|
|
2492
1909
|
if personal_access_token is not None:
|
|
2493
1910
|
body["personal_access_token"] = personal_access_token
|
|
2494
1911
|
headers = {
|
|
@@ -2754,17 +2171,47 @@ class SecretsAPI:
|
|
|
2754
2171
|
initial_manage_principal: Optional[str] = None,
|
|
2755
2172
|
scope_backend_type: Optional[ScopeBackendType] = None,
|
|
2756
2173
|
):
|
|
2757
|
-
"""
|
|
2174
|
+
"""Creates a new secret scope.
|
|
2175
|
+
|
|
2176
|
+
The scope name must consist of alphanumeric characters, dashes, underscores, and periods, and may not
|
|
2758
2177
|
exceed 128 characters.
|
|
2759
2178
|
|
|
2179
|
+
Example request:
|
|
2180
|
+
|
|
2181
|
+
.. code::
|
|
2182
|
+
|
|
2183
|
+
{ "scope": "my-simple-databricks-scope", "initial_manage_principal": "users" "scope_backend_type":
|
|
2184
|
+
"databricks|azure_keyvault", # below is only required if scope type is azure_keyvault
|
|
2185
|
+
"backend_azure_keyvault": { "resource_id":
|
|
2186
|
+
"/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/xxxx/providers/Microsoft.KeyVault/vaults/xxxx",
|
|
2187
|
+
"tenant_id": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", "dns_name": "https://xxxx.vault.azure.net/", } }
|
|
2188
|
+
|
|
2189
|
+
If ``initial_manage_principal`` is specified, the initial ACL applied to the scope is applied to the
|
|
2190
|
+
supplied principal (user or group) with ``MANAGE`` permissions. The only supported principal for this
|
|
2191
|
+
option is the group ``users``, which contains all users in the workspace. If
|
|
2192
|
+
``initial_manage_principal`` is not specified, the initial ACL with ``MANAGE`` permission applied to
|
|
2193
|
+
the scope is assigned to the API request issuer's user identity.
|
|
2194
|
+
|
|
2195
|
+
If ``scope_backend_type`` is ``azure_keyvault``, a secret scope is created with secrets from a given
|
|
2196
|
+
Azure KeyVault. The caller must provide the keyvault_resource_id and the tenant_id for the key vault.
|
|
2197
|
+
If ``scope_backend_type`` is ``databricks`` or is unspecified, an empty secret scope is created and
|
|
2198
|
+
stored in Databricks's own storage.
|
|
2199
|
+
|
|
2200
|
+
Throws ``RESOURCE_ALREADY_EXISTS`` if a scope with the given name already exists. Throws
|
|
2201
|
+
``RESOURCE_LIMIT_EXCEEDED`` if maximum number of scopes in the workspace is exceeded. Throws
|
|
2202
|
+
``INVALID_PARAMETER_VALUE`` if the scope name is invalid. Throws ``BAD_REQUEST`` if request violated
|
|
2203
|
+
constraints. Throws ``CUSTOMER_UNAUTHORIZED`` if normal user attempts to create a scope with name
|
|
2204
|
+
reserved for databricks internal usage. Throws ``UNAUTHENTICATED`` if unable to verify user access
|
|
2205
|
+
permission on Azure KeyVault
|
|
2206
|
+
|
|
2760
2207
|
:param scope: str
|
|
2761
2208
|
Scope name requested by the user. Scope names are unique.
|
|
2762
2209
|
:param backend_azure_keyvault: :class:`AzureKeyVaultSecretScopeMetadata` (optional)
|
|
2763
|
-
The metadata for the secret scope if the type is
|
|
2210
|
+
The metadata for the secret scope if the type is ``AZURE_KEYVAULT``
|
|
2764
2211
|
:param initial_manage_principal: str (optional)
|
|
2765
|
-
The principal that is initially granted
|
|
2212
|
+
The principal that is initially granted ``MANAGE`` permission to the created scope.
|
|
2766
2213
|
:param scope_backend_type: :class:`ScopeBackendType` (optional)
|
|
2767
|
-
The backend type the scope will be created with. If not specified, will default to
|
|
2214
|
+
The backend type the scope will be created with. If not specified, will default to ``DATABRICKS``
|
|
2768
2215
|
|
|
2769
2216
|
|
|
2770
2217
|
"""
|
|
@@ -2778,7 +2225,6 @@ class SecretsAPI:
|
|
|
2778
2225
|
if scope_backend_type is not None:
|
|
2779
2226
|
body["scope_backend_type"] = scope_backend_type.value
|
|
2780
2227
|
headers = {
|
|
2781
|
-
"Accept": "application/json",
|
|
2782
2228
|
"Content-Type": "application/json",
|
|
2783
2229
|
}
|
|
2784
2230
|
|
|
@@ -2787,9 +2233,17 @@ class SecretsAPI:
|
|
|
2787
2233
|
def delete_acl(self, scope: str, principal: str):
|
|
2788
2234
|
"""Deletes the given ACL on the given scope.
|
|
2789
2235
|
|
|
2790
|
-
Users must have the
|
|
2791
|
-
|
|
2792
|
-
|
|
2236
|
+
Users must have the ``MANAGE`` permission to invoke this API.
|
|
2237
|
+
|
|
2238
|
+
Example request:
|
|
2239
|
+
|
|
2240
|
+
.. code::
|
|
2241
|
+
|
|
2242
|
+
{ "scope": "my-secret-scope", "principal": "data-scientists" }
|
|
2243
|
+
|
|
2244
|
+
Throws ``RESOURCE_DOES_NOT_EXIST`` if no such secret scope, principal, or ACL exists. Throws
|
|
2245
|
+
``PERMISSION_DENIED`` if the user does not have permission to make this API call. Throws
|
|
2246
|
+
``INVALID_PARAMETER_VALUE`` if the permission or principal is invalid.
|
|
2793
2247
|
|
|
2794
2248
|
:param scope: str
|
|
2795
2249
|
The name of the scope to remove permissions from.
|
|
@@ -2804,7 +2258,6 @@ class SecretsAPI:
|
|
|
2804
2258
|
if scope is not None:
|
|
2805
2259
|
body["scope"] = scope
|
|
2806
2260
|
headers = {
|
|
2807
|
-
"Accept": "application/json",
|
|
2808
2261
|
"Content-Type": "application/json",
|
|
2809
2262
|
}
|
|
2810
2263
|
|
|
@@ -2813,8 +2266,15 @@ class SecretsAPI:
|
|
|
2813
2266
|
def delete_scope(self, scope: str):
|
|
2814
2267
|
"""Deletes a secret scope.
|
|
2815
2268
|
|
|
2816
|
-
|
|
2817
|
-
|
|
2269
|
+
Example request:
|
|
2270
|
+
|
|
2271
|
+
.. code::
|
|
2272
|
+
|
|
2273
|
+
{ "scope": "my-secret-scope" }
|
|
2274
|
+
|
|
2275
|
+
Throws ``RESOURCE_DOES_NOT_EXIST`` if the scope does not exist. Throws ``PERMISSION_DENIED`` if the
|
|
2276
|
+
user does not have permission to make this API call. Throws ``BAD_REQUEST`` if system user attempts to
|
|
2277
|
+
delete internal secret scope.
|
|
2818
2278
|
|
|
2819
2279
|
:param scope: str
|
|
2820
2280
|
Name of the scope to delete.
|
|
@@ -2825,18 +2285,25 @@ class SecretsAPI:
|
|
|
2825
2285
|
if scope is not None:
|
|
2826
2286
|
body["scope"] = scope
|
|
2827
2287
|
headers = {
|
|
2828
|
-
"Accept": "application/json",
|
|
2829
2288
|
"Content-Type": "application/json",
|
|
2830
2289
|
}
|
|
2831
2290
|
|
|
2832
2291
|
self._api.do("POST", "/api/2.0/secrets/scopes/delete", body=body, headers=headers)
|
|
2833
2292
|
|
|
2834
2293
|
def delete_secret(self, scope: str, key: str):
|
|
2835
|
-
"""Deletes the secret stored in this secret scope. You must have
|
|
2836
|
-
|
|
2294
|
+
"""Deletes the secret stored in this secret scope. You must have ``WRITE`` or ``MANAGE`` permission on
|
|
2295
|
+
the Secret Scope.
|
|
2296
|
+
|
|
2297
|
+
Example request:
|
|
2837
2298
|
|
|
2838
|
-
|
|
2839
|
-
|
|
2299
|
+
.. code::
|
|
2300
|
+
|
|
2301
|
+
{ "scope": "my-secret-scope", "key": "my-secret-key" }
|
|
2302
|
+
|
|
2303
|
+
Throws ``RESOURCE_DOES_NOT_EXIST`` if no such secret scope or secret exists. Throws
|
|
2304
|
+
``PERMISSION_DENIED`` if the user does not have permission to make this API call. Throws
|
|
2305
|
+
``BAD_REQUEST`` if system user attempts to delete an internal secret, or request is made against Azure
|
|
2306
|
+
KeyVault backed scope.
|
|
2840
2307
|
|
|
2841
2308
|
:param scope: str
|
|
2842
2309
|
The name of the scope that contains the secret to delete.
|
|
@@ -2858,11 +2325,19 @@ class SecretsAPI:
|
|
|
2858
2325
|
self._api.do("POST", "/api/2.0/secrets/delete", body=body, headers=headers)
|
|
2859
2326
|
|
|
2860
2327
|
def get_acl(self, scope: str, principal: str) -> AclItem:
|
|
2861
|
-
"""
|
|
2862
|
-
permission to invoke this API.
|
|
2328
|
+
"""Describes the details about the given ACL, such as the group and permission.
|
|
2863
2329
|
|
|
2864
|
-
|
|
2865
|
-
|
|
2330
|
+
Users must have the ``MANAGE`` permission to invoke this API.
|
|
2331
|
+
|
|
2332
|
+
Example response:
|
|
2333
|
+
|
|
2334
|
+
.. code::
|
|
2335
|
+
|
|
2336
|
+
{ "principal": "data-scientists", "permission": "READ" }
|
|
2337
|
+
|
|
2338
|
+
Throws ``RESOURCE_DOES_NOT_EXIST`` if no such secret scope exists. Throws ``PERMISSION_DENIED`` if the
|
|
2339
|
+
user does not have permission to make this API call. Throws ``INVALID_PARAMETER_VALUE`` if the
|
|
2340
|
+
permission or principal is invalid.
|
|
2866
2341
|
|
|
2867
2342
|
:param scope: str
|
|
2868
2343
|
The name of the scope to fetch ACL information from.
|
|
@@ -2885,20 +2360,35 @@ class SecretsAPI:
|
|
|
2885
2360
|
return AclItem.from_dict(res)
|
|
2886
2361
|
|
|
2887
2362
|
def get_secret(self, scope: str, key: str) -> GetSecretResponse:
|
|
2888
|
-
"""Gets
|
|
2363
|
+
"""Gets a secret for a given key and scope. This API can only be called from the DBUtils interface. Users
|
|
2364
|
+
need the READ permission to make this call.
|
|
2889
2365
|
|
|
2890
|
-
|
|
2366
|
+
Example response:
|
|
2367
|
+
|
|
2368
|
+
.. code::
|
|
2369
|
+
|
|
2370
|
+
{ "key": "my-string-key", "value": <bytes of the secret value> }
|
|
2891
2371
|
|
|
2892
2372
|
Note that the secret value returned is in bytes. The interpretation of the bytes is determined by the
|
|
2893
2373
|
caller in DBUtils and the type the data is decoded into.
|
|
2894
2374
|
|
|
2895
|
-
Throws ``
|
|
2896
|
-
``
|
|
2375
|
+
Throws ``RESOURCE_DOES_NOT_EXIST`` if no such secret or secret scope exists. Throws
|
|
2376
|
+
``PERMISSION_DENIED`` if the user does not have permission to make this API call.
|
|
2377
|
+
|
|
2378
|
+
Note: This is explicitly an undocumented API. It also doesn't need to be supported for the /preview
|
|
2379
|
+
prefix, because it's not a customer-facing API (i.e. only used for DBUtils SecretUtils to fetch
|
|
2380
|
+
secrets).
|
|
2381
|
+
|
|
2382
|
+
Throws ``RESOURCE_DOES_NOT_EXIST`` if no such secret scope or secret exists. Throws ``BAD_REQUEST`` if
|
|
2383
|
+
normal user calls get secret outside of a notebook. AKV specific errors: Throws
|
|
2384
|
+
``INVALID_PARAMETER_VALUE`` if secret name is not alphanumeric or too long. Throws
|
|
2385
|
+
``PERMISSION_DENIED`` if secret manager cannot access AKV with 403 error Throws ``MALFORMED_REQUEST``
|
|
2386
|
+
if secret manager cannot access AKV with any other 4xx error
|
|
2897
2387
|
|
|
2898
2388
|
:param scope: str
|
|
2899
|
-
The name of the scope
|
|
2389
|
+
The name of the scope that contains the secret.
|
|
2900
2390
|
:param key: str
|
|
2901
|
-
|
|
2391
|
+
Name of the secret to fetch value information.
|
|
2902
2392
|
|
|
2903
2393
|
:returns: :class:`GetSecretResponse`
|
|
2904
2394
|
"""
|
|
@@ -2916,9 +2406,18 @@ class SecretsAPI:
|
|
|
2916
2406
|
return GetSecretResponse.from_dict(res)
|
|
2917
2407
|
|
|
2918
2408
|
def list_acls(self, scope: str) -> Iterator[AclItem]:
|
|
2919
|
-
"""
|
|
2409
|
+
"""Lists the ACLs set on the given scope.
|
|
2410
|
+
|
|
2411
|
+
Users must have the ``MANAGE`` permission to invoke this API.
|
|
2412
|
+
|
|
2413
|
+
Example response:
|
|
2414
|
+
|
|
2415
|
+
.. code::
|
|
2920
2416
|
|
|
2921
|
-
|
|
2417
|
+
{ "acls": [{ "principal": "admins", "permission": "MANAGE" },{ "principal": "data-scientists",
|
|
2418
|
+
"permission": "READ" }] }
|
|
2419
|
+
|
|
2420
|
+
Throws ``RESOURCE_DOES_NOT_EXIST`` if no such secret scope exists. Throws ``PERMISSION_DENIED`` if the
|
|
2922
2421
|
user does not have permission to make this API call.
|
|
2923
2422
|
|
|
2924
2423
|
:param scope: str
|
|
@@ -2941,7 +2440,15 @@ class SecretsAPI:
|
|
|
2941
2440
|
def list_scopes(self) -> Iterator[SecretScope]:
|
|
2942
2441
|
"""Lists all secret scopes available in the workspace.
|
|
2943
2442
|
|
|
2944
|
-
|
|
2443
|
+
Example response:
|
|
2444
|
+
|
|
2445
|
+
.. code::
|
|
2446
|
+
|
|
2447
|
+
{ "scopes": [{ "name": "my-databricks-scope", "backend_type": "DATABRICKS" },{ "name": "mount-points",
|
|
2448
|
+
"backend_type": "DATABRICKS" }] }
|
|
2449
|
+
|
|
2450
|
+
Throws ``PERMISSION_DENIED`` if the user does not have permission to make this API call.
|
|
2451
|
+
|
|
2945
2452
|
|
|
2946
2453
|
:returns: Iterator over :class:`SecretScope`
|
|
2947
2454
|
"""
|
|
@@ -2958,9 +2465,17 @@ class SecretsAPI:
|
|
|
2958
2465
|
"""Lists the secret keys that are stored at this scope. This is a metadata-only operation; secret data
|
|
2959
2466
|
cannot be retrieved using this API. Users need the READ permission to make this call.
|
|
2960
2467
|
|
|
2961
|
-
|
|
2962
|
-
|
|
2963
|
-
|
|
2468
|
+
Example response:
|
|
2469
|
+
|
|
2470
|
+
.. code::
|
|
2471
|
+
|
|
2472
|
+
{ "secrets": [ { "key": "my-string-key"", "last_updated_timestamp": "1520467595000" }, { "key":
|
|
2473
|
+
"my-byte-key", "last_updated_timestamp": "1520467595000" }, ] }
|
|
2474
|
+
|
|
2475
|
+
The lastUpdatedTimestamp returned is in milliseconds since epoch.
|
|
2476
|
+
|
|
2477
|
+
Throws ``RESOURCE_DOES_NOT_EXIST`` if no such secret scope exists. Throws ``PERMISSION_DENIED`` if the
|
|
2478
|
+
user does not have permission to make this API call.
|
|
2964
2479
|
|
|
2965
2480
|
:param scope: str
|
|
2966
2481
|
The name of the scope to list secrets within.
|
|
@@ -2980,14 +2495,12 @@ class SecretsAPI:
|
|
|
2980
2495
|
return parsed if parsed is not None else []
|
|
2981
2496
|
|
|
2982
2497
|
def put_acl(self, scope: str, principal: str, permission: AclPermission):
|
|
2983
|
-
"""Creates or overwrites the
|
|
2984
|
-
group
|
|
2498
|
+
"""Creates or overwrites the ACL associated with the given principal (user or group) on the specified
|
|
2499
|
+
scope point. In general, a user or group will use the most powerful permission available to them, and
|
|
2500
|
+
permissions are ordered as follows:
|
|
2985
2501
|
|
|
2986
|
-
|
|
2987
|
-
|
|
2988
|
-
|
|
2989
|
-
* `MANAGE` - Allowed to change ACLs, and read and write to this secret scope. * `WRITE` - Allowed to
|
|
2990
|
-
read and write to this secret scope. * `READ` - Allowed to read this secret scope and list what
|
|
2502
|
+
* ``MANAGE`` - Allowed to change ACLs, and read and write to this secret scope. * ``WRITE`` - Allowed
|
|
2503
|
+
to read and write to this secret scope. * ``READ`` - Allowed to read this secret scope and list what
|
|
2991
2504
|
secrets are available.
|
|
2992
2505
|
|
|
2993
2506
|
Note that in general, secret values can only be read from within a command on a cluster (for example,
|
|
@@ -2995,15 +2508,21 @@ class SecretsAPI:
|
|
|
2995
2508
|
However, the user's permission will be applied based on who is executing the command, and they must
|
|
2996
2509
|
have at least READ permission.
|
|
2997
2510
|
|
|
2998
|
-
Users must have the
|
|
2511
|
+
Users must have the ``MANAGE`` permission to invoke this API.
|
|
2512
|
+
|
|
2513
|
+
Example request:
|
|
2514
|
+
|
|
2515
|
+
.. code::
|
|
2516
|
+
|
|
2517
|
+
{ "scope": "my-secret-scope", "principal": "data-scientists", "permission": "READ" }
|
|
2999
2518
|
|
|
3000
2519
|
The principal is a user or group name corresponding to an existing Databricks principal to be granted
|
|
3001
2520
|
or revoked access.
|
|
3002
2521
|
|
|
3003
|
-
Throws
|
|
3004
|
-
permission for the principal already exists. Throws
|
|
3005
|
-
principal is invalid. Throws
|
|
3006
|
-
call.
|
|
2522
|
+
Throws ``RESOURCE_DOES_NOT_EXIST`` if no such secret scope exists. Throws ``RESOURCE_ALREADY_EXISTS``
|
|
2523
|
+
if a permission for the principal already exists. Throws ``INVALID_PARAMETER_VALUE`` if the permission
|
|
2524
|
+
or principal is invalid. Throws ``PERMISSION_DENIED`` if the user does not have permission to make
|
|
2525
|
+
this API call.
|
|
3007
2526
|
|
|
3008
2527
|
:param scope: str
|
|
3009
2528
|
The name of the scope to apply permissions to.
|
|
@@ -3022,7 +2541,6 @@ class SecretsAPI:
|
|
|
3022
2541
|
if scope is not None:
|
|
3023
2542
|
body["scope"] = scope
|
|
3024
2543
|
headers = {
|
|
3025
|
-
"Accept": "application/json",
|
|
3026
2544
|
"Content-Type": "application/json",
|
|
3027
2545
|
}
|
|
3028
2546
|
|
|
@@ -3033,19 +2551,27 @@ class SecretsAPI:
|
|
|
3033
2551
|
):
|
|
3034
2552
|
"""Inserts a secret under the provided scope with the given name. If a secret already exists with the
|
|
3035
2553
|
same name, this command overwrites the existing secret's value. The server encrypts the secret using
|
|
3036
|
-
the secret scope's encryption settings before storing it.
|
|
2554
|
+
the secret scope's encryption settings before storing it. You must have ``WRITE`` or ``MANAGE``
|
|
2555
|
+
permission on the secret scope.
|
|
2556
|
+
|
|
2557
|
+
The secret key must consist of alphanumeric characters, dashes, underscores, and periods, and cannot
|
|
2558
|
+
exceed 128 characters. The maximum allowed secret value size is 128 KB. The maximum number of secrets
|
|
2559
|
+
in a given scope is 1000.
|
|
3037
2560
|
|
|
3038
|
-
|
|
3039
|
-
|
|
3040
|
-
|
|
2561
|
+
Example request:
|
|
2562
|
+
|
|
2563
|
+
.. code::
|
|
2564
|
+
|
|
2565
|
+
{ "scope": "my-databricks-scope", "key": "my-string-key", "string_value": "foobar" }
|
|
3041
2566
|
|
|
3042
2567
|
The input fields "string_value" or "bytes_value" specify the type of the secret, which will determine
|
|
3043
2568
|
the value returned when the secret value is requested. Exactly one must be specified.
|
|
3044
2569
|
|
|
3045
|
-
Throws
|
|
3046
|
-
maximum number of secrets in scope is exceeded. Throws
|
|
3047
|
-
|
|
3048
|
-
API call.
|
|
2570
|
+
Throws ``RESOURCE_DOES_NOT_EXIST`` if no such secret scope exists. Throws ``RESOURCE_LIMIT_EXCEEDED``
|
|
2571
|
+
if maximum number of secrets in scope is exceeded. Throws ``INVALID_PARAMETER_VALUE`` if the request
|
|
2572
|
+
parameters are invalid. Throws ``PERMISSION_DENIED`` if the user does not have permission to make this
|
|
2573
|
+
API call. Throws ``MALFORMED_REQUEST`` if request is incorrectly formatted or conflicting. Throws
|
|
2574
|
+
``BAD_REQUEST`` if request is made against Azure KeyVault backed scope.
|
|
3049
2575
|
|
|
3050
2576
|
:param scope: str
|
|
3051
2577
|
The name of the scope to which the secret will be associated with.
|
|
@@ -3068,7 +2594,6 @@ class SecretsAPI:
|
|
|
3068
2594
|
if string_value is not None:
|
|
3069
2595
|
body["string_value"] = string_value
|
|
3070
2596
|
headers = {
|
|
3071
|
-
"Accept": "application/json",
|
|
3072
2597
|
"Content-Type": "application/json",
|
|
3073
2598
|
}
|
|
3074
2599
|
|