databricks-sdk 0.22.0__py3-none-any.whl → 0.24.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/service/_internal.py +5 -0
- databricks/sdk/service/catalog.py +40 -23
- databricks/sdk/service/dashboards.py +83 -0
- databricks/sdk/service/files.py +25 -12
- databricks/sdk/service/iam.py +3 -0
- databricks/sdk/service/jobs.py +621 -316
- databricks/sdk/service/serving.py +60 -54
- databricks/sdk/service/sharing.py +22 -3
- databricks/sdk/service/vectorsearch.py +8 -1
- databricks/sdk/service/workspace.py +50 -10
- databricks/sdk/version.py +1 -1
- {databricks_sdk-0.22.0.dist-info → databricks_sdk-0.24.0.dist-info}/METADATA +1 -1
- {databricks_sdk-0.22.0.dist-info → databricks_sdk-0.24.0.dist-info}/RECORD +17 -17
- {databricks_sdk-0.22.0.dist-info → databricks_sdk-0.24.0.dist-info}/LICENSE +0 -0
- {databricks_sdk-0.22.0.dist-info → databricks_sdk-0.24.0.dist-info}/NOTICE +0 -0
- {databricks_sdk-0.22.0.dist-info → databricks_sdk-0.24.0.dist-info}/WHEEL +0 -0
- {databricks_sdk-0.22.0.dist-info → databricks_sdk-0.24.0.dist-info}/top_level.txt +0 -0
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import datetime
|
|
2
|
+
import urllib.parse
|
|
2
3
|
from typing import Callable, Dict, Generic, Optional, Type, TypeVar
|
|
3
4
|
|
|
4
5
|
|
|
@@ -38,6 +39,10 @@ def _repeated_enum(d: Dict[str, any], field: str, cls: Type) -> any:
|
|
|
38
39
|
return res
|
|
39
40
|
|
|
40
41
|
|
|
42
|
+
def _escape_multi_segment_path_parameter(param: str) -> str:
|
|
43
|
+
return urllib.parse.quote(param)
|
|
44
|
+
|
|
45
|
+
|
|
41
46
|
ReturnType = TypeVar('ReturnType')
|
|
42
47
|
|
|
43
48
|
|
|
@@ -275,7 +275,24 @@ class AssignResponse:
|
|
|
275
275
|
|
|
276
276
|
|
|
277
277
|
@dataclass
|
|
278
|
-
class
|
|
278
|
+
class AwsIamRoleRequest:
|
|
279
|
+
role_arn: str
|
|
280
|
+
"""The Amazon Resource Name (ARN) of the AWS IAM role for S3 data access."""
|
|
281
|
+
|
|
282
|
+
def as_dict(self) -> dict:
|
|
283
|
+
"""Serializes the AwsIamRoleRequest into a dictionary suitable for use as a JSON request body."""
|
|
284
|
+
body = {}
|
|
285
|
+
if self.role_arn is not None: body['role_arn'] = self.role_arn
|
|
286
|
+
return body
|
|
287
|
+
|
|
288
|
+
@classmethod
|
|
289
|
+
def from_dict(cls, d: Dict[str, any]) -> AwsIamRoleRequest:
|
|
290
|
+
"""Deserializes the AwsIamRoleRequest from a dictionary."""
|
|
291
|
+
return cls(role_arn=d.get('role_arn', None))
|
|
292
|
+
|
|
293
|
+
|
|
294
|
+
@dataclass
|
|
295
|
+
class AwsIamRoleResponse:
|
|
279
296
|
role_arn: str
|
|
280
297
|
"""The Amazon Resource Name (ARN) of the AWS IAM role for S3 data access."""
|
|
281
298
|
|
|
@@ -287,7 +304,7 @@ class AwsIamRole:
|
|
|
287
304
|
that is going to assume the AWS IAM role."""
|
|
288
305
|
|
|
289
306
|
def as_dict(self) -> dict:
|
|
290
|
-
"""Serializes the
|
|
307
|
+
"""Serializes the AwsIamRoleResponse into a dictionary suitable for use as a JSON request body."""
|
|
291
308
|
body = {}
|
|
292
309
|
if self.external_id is not None: body['external_id'] = self.external_id
|
|
293
310
|
if self.role_arn is not None: body['role_arn'] = self.role_arn
|
|
@@ -295,8 +312,8 @@ class AwsIamRole:
|
|
|
295
312
|
return body
|
|
296
313
|
|
|
297
314
|
@classmethod
|
|
298
|
-
def from_dict(cls, d: Dict[str, any]) ->
|
|
299
|
-
"""Deserializes the
|
|
315
|
+
def from_dict(cls, d: Dict[str, any]) -> AwsIamRoleResponse:
|
|
316
|
+
"""Deserializes the AwsIamRoleResponse from a dictionary."""
|
|
300
317
|
return cls(external_id=d.get('external_id', None),
|
|
301
318
|
role_arn=d.get('role_arn', None),
|
|
302
319
|
unity_catalog_iam_arn=d.get('unity_catalog_iam_arn', None))
|
|
@@ -1434,7 +1451,7 @@ class CreateStorageCredential:
|
|
|
1434
1451
|
name: str
|
|
1435
1452
|
"""The credential name. The name must be unique within the metastore."""
|
|
1436
1453
|
|
|
1437
|
-
aws_iam_role: Optional[
|
|
1454
|
+
aws_iam_role: Optional[AwsIamRoleRequest] = None
|
|
1438
1455
|
"""The AWS IAM role configuration."""
|
|
1439
1456
|
|
|
1440
1457
|
azure_managed_identity: Optional[AzureManagedIdentity] = None
|
|
@@ -1477,7 +1494,7 @@ class CreateStorageCredential:
|
|
|
1477
1494
|
@classmethod
|
|
1478
1495
|
def from_dict(cls, d: Dict[str, any]) -> CreateStorageCredential:
|
|
1479
1496
|
"""Deserializes the CreateStorageCredential from a dictionary."""
|
|
1480
|
-
return cls(aws_iam_role=_from_dict(d, 'aws_iam_role',
|
|
1497
|
+
return cls(aws_iam_role=_from_dict(d, 'aws_iam_role', AwsIamRoleRequest),
|
|
1481
1498
|
azure_managed_identity=_from_dict(d, 'azure_managed_identity', AzureManagedIdentity),
|
|
1482
1499
|
azure_service_principal=_from_dict(d, 'azure_service_principal', AzureServicePrincipal),
|
|
1483
1500
|
cloudflare_api_token=_from_dict(d, 'cloudflare_api_token', CloudflareApiToken),
|
|
@@ -4187,7 +4204,7 @@ class SseEncryptionDetailsAlgorithm(Enum):
|
|
|
4187
4204
|
|
|
4188
4205
|
@dataclass
|
|
4189
4206
|
class StorageCredentialInfo:
|
|
4190
|
-
aws_iam_role: Optional[
|
|
4207
|
+
aws_iam_role: Optional[AwsIamRoleResponse] = None
|
|
4191
4208
|
"""The AWS IAM role configuration."""
|
|
4192
4209
|
|
|
4193
4210
|
azure_managed_identity: Optional[AzureManagedIdentity] = None
|
|
@@ -4262,7 +4279,7 @@ class StorageCredentialInfo:
|
|
|
4262
4279
|
@classmethod
|
|
4263
4280
|
def from_dict(cls, d: Dict[str, any]) -> StorageCredentialInfo:
|
|
4264
4281
|
"""Deserializes the StorageCredentialInfo from a dictionary."""
|
|
4265
|
-
return cls(aws_iam_role=_from_dict(d, 'aws_iam_role',
|
|
4282
|
+
return cls(aws_iam_role=_from_dict(d, 'aws_iam_role', AwsIamRoleResponse),
|
|
4266
4283
|
azure_managed_identity=_from_dict(d, 'azure_managed_identity', AzureManagedIdentity),
|
|
4267
4284
|
azure_service_principal=_from_dict(d, 'azure_service_principal', AzureServicePrincipal),
|
|
4268
4285
|
cloudflare_api_token=_from_dict(d, 'cloudflare_api_token', CloudflareApiToken),
|
|
@@ -5160,7 +5177,7 @@ class UpdateSchema:
|
|
|
5160
5177
|
|
|
5161
5178
|
@dataclass
|
|
5162
5179
|
class UpdateStorageCredential:
|
|
5163
|
-
aws_iam_role: Optional[
|
|
5180
|
+
aws_iam_role: Optional[AwsIamRoleRequest] = None
|
|
5164
5181
|
"""The AWS IAM role configuration."""
|
|
5165
5182
|
|
|
5166
5183
|
azure_managed_identity: Optional[AzureManagedIdentity] = None
|
|
@@ -5218,7 +5235,7 @@ class UpdateStorageCredential:
|
|
|
5218
5235
|
@classmethod
|
|
5219
5236
|
def from_dict(cls, d: Dict[str, any]) -> UpdateStorageCredential:
|
|
5220
5237
|
"""Deserializes the UpdateStorageCredential from a dictionary."""
|
|
5221
|
-
return cls(aws_iam_role=_from_dict(d, 'aws_iam_role',
|
|
5238
|
+
return cls(aws_iam_role=_from_dict(d, 'aws_iam_role', AwsIamRoleRequest),
|
|
5222
5239
|
azure_managed_identity=_from_dict(d, 'azure_managed_identity', AzureManagedIdentity),
|
|
5223
5240
|
azure_service_principal=_from_dict(d, 'azure_service_principal', AzureServicePrincipal),
|
|
5224
5241
|
cloudflare_api_token=_from_dict(d, 'cloudflare_api_token', CloudflareApiToken),
|
|
@@ -5326,7 +5343,7 @@ class UpdateWorkspaceBindingsParameters:
|
|
|
5326
5343
|
|
|
5327
5344
|
@dataclass
|
|
5328
5345
|
class ValidateStorageCredential:
|
|
5329
|
-
aws_iam_role: Optional[
|
|
5346
|
+
aws_iam_role: Optional[AwsIamRoleRequest] = None
|
|
5330
5347
|
"""The AWS IAM role configuration."""
|
|
5331
5348
|
|
|
5332
5349
|
azure_managed_identity: Optional[AzureManagedIdentity] = None
|
|
@@ -5374,7 +5391,7 @@ class ValidateStorageCredential:
|
|
|
5374
5391
|
@classmethod
|
|
5375
5392
|
def from_dict(cls, d: Dict[str, any]) -> ValidateStorageCredential:
|
|
5376
5393
|
"""Deserializes the ValidateStorageCredential from a dictionary."""
|
|
5377
|
-
return cls(aws_iam_role=_from_dict(d, 'aws_iam_role',
|
|
5394
|
+
return cls(aws_iam_role=_from_dict(d, 'aws_iam_role', AwsIamRoleRequest),
|
|
5378
5395
|
azure_managed_identity=_from_dict(d, 'azure_managed_identity', AzureManagedIdentity),
|
|
5379
5396
|
azure_service_principal=_from_dict(d, 'azure_service_principal', AzureServicePrincipal),
|
|
5380
5397
|
cloudflare_api_token=_from_dict(d, 'cloudflare_api_token', CloudflareApiToken),
|
|
@@ -6903,7 +6920,7 @@ class LakehouseMonitorsAPI:
|
|
|
6903
6920
|
if schedule is not None: body['schedule'] = schedule.as_dict()
|
|
6904
6921
|
if skip_builtin_dashboard is not None: body['skip_builtin_dashboard'] = skip_builtin_dashboard
|
|
6905
6922
|
if slicing_exprs is not None: body['slicing_exprs'] = [v for v in slicing_exprs]
|
|
6906
|
-
if snapshot is not None: body['snapshot'] = snapshot
|
|
6923
|
+
if snapshot is not None: body['snapshot'] = snapshot.as_dict()
|
|
6907
6924
|
if time_series is not None: body['time_series'] = time_series.as_dict()
|
|
6908
6925
|
if warehouse_id is not None: body['warehouse_id'] = warehouse_id
|
|
6909
6926
|
headers = {'Accept': 'application/json', 'Content-Type': 'application/json', }
|
|
@@ -7108,7 +7125,7 @@ class LakehouseMonitorsAPI:
|
|
|
7108
7125
|
if output_schema_name is not None: body['output_schema_name'] = output_schema_name
|
|
7109
7126
|
if schedule is not None: body['schedule'] = schedule.as_dict()
|
|
7110
7127
|
if slicing_exprs is not None: body['slicing_exprs'] = [v for v in slicing_exprs]
|
|
7111
|
-
if snapshot is not None: body['snapshot'] = snapshot
|
|
7128
|
+
if snapshot is not None: body['snapshot'] = snapshot.as_dict()
|
|
7112
7129
|
if time_series is not None: body['time_series'] = time_series.as_dict()
|
|
7113
7130
|
headers = {'Accept': 'application/json', 'Content-Type': 'application/json', }
|
|
7114
7131
|
|
|
@@ -8061,7 +8078,7 @@ class StorageCredentialsAPI:
|
|
|
8061
8078
|
def create(self,
|
|
8062
8079
|
name: str,
|
|
8063
8080
|
*,
|
|
8064
|
-
aws_iam_role: Optional[
|
|
8081
|
+
aws_iam_role: Optional[AwsIamRoleRequest] = None,
|
|
8065
8082
|
azure_managed_identity: Optional[AzureManagedIdentity] = None,
|
|
8066
8083
|
azure_service_principal: Optional[AzureServicePrincipal] = None,
|
|
8067
8084
|
cloudflare_api_token: Optional[CloudflareApiToken] = None,
|
|
@@ -8075,7 +8092,7 @@ class StorageCredentialsAPI:
|
|
|
8075
8092
|
|
|
8076
8093
|
:param name: str
|
|
8077
8094
|
The credential name. The name must be unique within the metastore.
|
|
8078
|
-
:param aws_iam_role: :class:`
|
|
8095
|
+
:param aws_iam_role: :class:`AwsIamRoleRequest` (optional)
|
|
8079
8096
|
The AWS IAM role configuration.
|
|
8080
8097
|
:param azure_managed_identity: :class:`AzureManagedIdentity` (optional)
|
|
8081
8098
|
The Azure managed identity configuration.
|
|
@@ -8103,7 +8120,7 @@ class StorageCredentialsAPI:
|
|
|
8103
8120
|
if cloudflare_api_token is not None: body['cloudflare_api_token'] = cloudflare_api_token.as_dict()
|
|
8104
8121
|
if comment is not None: body['comment'] = comment
|
|
8105
8122
|
if databricks_gcp_service_account is not None:
|
|
8106
|
-
body['databricks_gcp_service_account'] = databricks_gcp_service_account
|
|
8123
|
+
body['databricks_gcp_service_account'] = databricks_gcp_service_account.as_dict()
|
|
8107
8124
|
if name is not None: body['name'] = name
|
|
8108
8125
|
if read_only is not None: body['read_only'] = read_only
|
|
8109
8126
|
if skip_validation is not None: body['skip_validation'] = skip_validation
|
|
@@ -8195,7 +8212,7 @@ class StorageCredentialsAPI:
|
|
|
8195
8212
|
def update(self,
|
|
8196
8213
|
name: str,
|
|
8197
8214
|
*,
|
|
8198
|
-
aws_iam_role: Optional[
|
|
8215
|
+
aws_iam_role: Optional[AwsIamRoleRequest] = None,
|
|
8199
8216
|
azure_managed_identity: Optional[AzureManagedIdentity] = None,
|
|
8200
8217
|
azure_service_principal: Optional[AzureServicePrincipal] = None,
|
|
8201
8218
|
cloudflare_api_token: Optional[CloudflareApiToken] = None,
|
|
@@ -8212,7 +8229,7 @@ class StorageCredentialsAPI:
|
|
|
8212
8229
|
|
|
8213
8230
|
:param name: str
|
|
8214
8231
|
Name of the storage credential.
|
|
8215
|
-
:param aws_iam_role: :class:`
|
|
8232
|
+
:param aws_iam_role: :class:`AwsIamRoleRequest` (optional)
|
|
8216
8233
|
The AWS IAM role configuration.
|
|
8217
8234
|
:param azure_managed_identity: :class:`AzureManagedIdentity` (optional)
|
|
8218
8235
|
The Azure managed identity configuration.
|
|
@@ -8246,7 +8263,7 @@ class StorageCredentialsAPI:
|
|
|
8246
8263
|
if cloudflare_api_token is not None: body['cloudflare_api_token'] = cloudflare_api_token.as_dict()
|
|
8247
8264
|
if comment is not None: body['comment'] = comment
|
|
8248
8265
|
if databricks_gcp_service_account is not None:
|
|
8249
|
-
body['databricks_gcp_service_account'] = databricks_gcp_service_account
|
|
8266
|
+
body['databricks_gcp_service_account'] = databricks_gcp_service_account.as_dict()
|
|
8250
8267
|
if force is not None: body['force'] = force
|
|
8251
8268
|
if new_name is not None: body['new_name'] = new_name
|
|
8252
8269
|
if owner is not None: body['owner'] = owner
|
|
@@ -8262,7 +8279,7 @@ class StorageCredentialsAPI:
|
|
|
8262
8279
|
|
|
8263
8280
|
def validate(self,
|
|
8264
8281
|
*,
|
|
8265
|
-
aws_iam_role: Optional[
|
|
8282
|
+
aws_iam_role: Optional[AwsIamRoleRequest] = None,
|
|
8266
8283
|
azure_managed_identity: Optional[AzureManagedIdentity] = None,
|
|
8267
8284
|
azure_service_principal: Optional[AzureServicePrincipal] = None,
|
|
8268
8285
|
cloudflare_api_token: Optional[CloudflareApiToken] = None,
|
|
@@ -8283,7 +8300,7 @@ class StorageCredentialsAPI:
|
|
|
8283
8300
|
The caller must be a metastore admin or the storage credential owner or have the
|
|
8284
8301
|
**CREATE_EXTERNAL_LOCATION** privilege on the metastore and the storage credential.
|
|
8285
8302
|
|
|
8286
|
-
:param aws_iam_role: :class:`
|
|
8303
|
+
:param aws_iam_role: :class:`AwsIamRoleRequest` (optional)
|
|
8287
8304
|
The AWS IAM role configuration.
|
|
8288
8305
|
:param azure_managed_identity: :class:`AzureManagedIdentity` (optional)
|
|
8289
8306
|
The Azure managed identity configuration.
|
|
@@ -8312,7 +8329,7 @@ class StorageCredentialsAPI:
|
|
|
8312
8329
|
body['azure_service_principal'] = azure_service_principal.as_dict()
|
|
8313
8330
|
if cloudflare_api_token is not None: body['cloudflare_api_token'] = cloudflare_api_token.as_dict()
|
|
8314
8331
|
if databricks_gcp_service_account is not None:
|
|
8315
|
-
body['databricks_gcp_service_account'] = databricks_gcp_service_account
|
|
8332
|
+
body['databricks_gcp_service_account'] = databricks_gcp_service_account.as_dict()
|
|
8316
8333
|
if external_location_name is not None: body['external_location_name'] = external_location_name
|
|
8317
8334
|
if read_only is not None: body['read_only'] = read_only
|
|
8318
8335
|
if storage_credential_name is not None: body['storage_credential_name'] = storage_credential_name
|
|
@@ -117,6 +117,33 @@ class LifecycleState(Enum):
|
|
|
117
117
|
TRASHED = 'TRASHED'
|
|
118
118
|
|
|
119
119
|
|
|
120
|
+
@dataclass
|
|
121
|
+
class MigrateDashboardRequest:
|
|
122
|
+
source_dashboard_id: str
|
|
123
|
+
"""UUID of the dashboard to be migrated."""
|
|
124
|
+
|
|
125
|
+
display_name: Optional[str] = None
|
|
126
|
+
"""Display name for the new Lakeview dashboard."""
|
|
127
|
+
|
|
128
|
+
parent_path: Optional[str] = None
|
|
129
|
+
"""The workspace path of the folder to contain the migrated Lakeview dashboard."""
|
|
130
|
+
|
|
131
|
+
def as_dict(self) -> dict:
|
|
132
|
+
"""Serializes the MigrateDashboardRequest into a dictionary suitable for use as a JSON request body."""
|
|
133
|
+
body = {}
|
|
134
|
+
if self.display_name is not None: body['display_name'] = self.display_name
|
|
135
|
+
if self.parent_path is not None: body['parent_path'] = self.parent_path
|
|
136
|
+
if self.source_dashboard_id is not None: body['source_dashboard_id'] = self.source_dashboard_id
|
|
137
|
+
return body
|
|
138
|
+
|
|
139
|
+
@classmethod
|
|
140
|
+
def from_dict(cls, d: Dict[str, any]) -> MigrateDashboardRequest:
|
|
141
|
+
"""Deserializes the MigrateDashboardRequest from a dictionary."""
|
|
142
|
+
return cls(display_name=d.get('display_name', None),
|
|
143
|
+
parent_path=d.get('parent_path', None),
|
|
144
|
+
source_dashboard_id=d.get('source_dashboard_id', None))
|
|
145
|
+
|
|
146
|
+
|
|
120
147
|
@dataclass
|
|
121
148
|
class PublishRequest:
|
|
122
149
|
dashboard_id: Optional[str] = None
|
|
@@ -191,6 +218,20 @@ class TrashDashboardResponse:
|
|
|
191
218
|
return cls()
|
|
192
219
|
|
|
193
220
|
|
|
221
|
+
@dataclass
|
|
222
|
+
class UnpublishDashboardResponse:
|
|
223
|
+
|
|
224
|
+
def as_dict(self) -> dict:
|
|
225
|
+
"""Serializes the UnpublishDashboardResponse into a dictionary suitable for use as a JSON request body."""
|
|
226
|
+
body = {}
|
|
227
|
+
return body
|
|
228
|
+
|
|
229
|
+
@classmethod
|
|
230
|
+
def from_dict(cls, d: Dict[str, any]) -> UnpublishDashboardResponse:
|
|
231
|
+
"""Deserializes the UnpublishDashboardResponse from a dictionary."""
|
|
232
|
+
return cls()
|
|
233
|
+
|
|
234
|
+
|
|
194
235
|
@dataclass
|
|
195
236
|
class UpdateDashboardRequest:
|
|
196
237
|
dashboard_id: Optional[str] = None
|
|
@@ -300,6 +341,33 @@ class LakeviewAPI:
|
|
|
300
341
|
res = self._api.do('GET', f'/api/2.0/lakeview/dashboards/{dashboard_id}/published', headers=headers)
|
|
301
342
|
return PublishedDashboard.from_dict(res)
|
|
302
343
|
|
|
344
|
+
def migrate(self,
|
|
345
|
+
source_dashboard_id: str,
|
|
346
|
+
*,
|
|
347
|
+
display_name: Optional[str] = None,
|
|
348
|
+
parent_path: Optional[str] = None) -> Dashboard:
|
|
349
|
+
"""Migrate dashboard.
|
|
350
|
+
|
|
351
|
+
Migrates a classic SQL dashboard to Lakeview.
|
|
352
|
+
|
|
353
|
+
:param source_dashboard_id: str
|
|
354
|
+
UUID of the dashboard to be migrated.
|
|
355
|
+
:param display_name: str (optional)
|
|
356
|
+
Display name for the new Lakeview dashboard.
|
|
357
|
+
:param parent_path: str (optional)
|
|
358
|
+
The workspace path of the folder to contain the migrated Lakeview dashboard.
|
|
359
|
+
|
|
360
|
+
:returns: :class:`Dashboard`
|
|
361
|
+
"""
|
|
362
|
+
body = {}
|
|
363
|
+
if display_name is not None: body['display_name'] = display_name
|
|
364
|
+
if parent_path is not None: body['parent_path'] = parent_path
|
|
365
|
+
if source_dashboard_id is not None: body['source_dashboard_id'] = source_dashboard_id
|
|
366
|
+
headers = {'Accept': 'application/json', 'Content-Type': 'application/json', }
|
|
367
|
+
|
|
368
|
+
res = self._api.do('POST', '/api/2.0/lakeview/dashboards/migrate', body=body, headers=headers)
|
|
369
|
+
return Dashboard.from_dict(res)
|
|
370
|
+
|
|
303
371
|
def publish(self,
|
|
304
372
|
dashboard_id: str,
|
|
305
373
|
*,
|
|
@@ -345,6 +413,21 @@ class LakeviewAPI:
|
|
|
345
413
|
|
|
346
414
|
self._api.do('DELETE', f'/api/2.0/lakeview/dashboards/{dashboard_id}', headers=headers)
|
|
347
415
|
|
|
416
|
+
def unpublish(self, dashboard_id: str):
|
|
417
|
+
"""Unpublish dashboard.
|
|
418
|
+
|
|
419
|
+
Unpublish the dashboard.
|
|
420
|
+
|
|
421
|
+
:param dashboard_id: str
|
|
422
|
+
UUID identifying the dashboard to be published.
|
|
423
|
+
|
|
424
|
+
|
|
425
|
+
"""
|
|
426
|
+
|
|
427
|
+
headers = {'Accept': 'application/json', }
|
|
428
|
+
|
|
429
|
+
self._api.do('DELETE', f'/api/2.0/lakeview/dashboards/{dashboard_id}/published', headers=headers)
|
|
430
|
+
|
|
348
431
|
def update(self,
|
|
349
432
|
dashboard_id: str,
|
|
350
433
|
*,
|
databricks/sdk/service/files.py
CHANGED
|
@@ -6,7 +6,7 @@ import logging
|
|
|
6
6
|
from dataclasses import dataclass
|
|
7
7
|
from typing import BinaryIO, Dict, Iterator, List, Optional
|
|
8
8
|
|
|
9
|
-
from ._internal import _repeated_dict
|
|
9
|
+
from ._internal import _escape_multi_segment_path_parameter, _repeated_dict
|
|
10
10
|
|
|
11
11
|
_LOG = logging.getLogger('databricks.sdk')
|
|
12
12
|
|
|
@@ -789,7 +789,9 @@ class FilesAPI:
|
|
|
789
789
|
|
|
790
790
|
headers = {}
|
|
791
791
|
|
|
792
|
-
self._api.do('PUT',
|
|
792
|
+
self._api.do('PUT',
|
|
793
|
+
f'/api/2.0/fs/directories{_escape_multi_segment_path_parameter(directory_path)}',
|
|
794
|
+
headers=headers)
|
|
793
795
|
|
|
794
796
|
def delete(self, file_path: str):
|
|
795
797
|
"""Delete a file.
|
|
@@ -804,7 +806,9 @@ class FilesAPI:
|
|
|
804
806
|
|
|
805
807
|
headers = {}
|
|
806
808
|
|
|
807
|
-
self._api.do('DELETE',
|
|
809
|
+
self._api.do('DELETE',
|
|
810
|
+
f'/api/2.0/fs/files{_escape_multi_segment_path_parameter(file_path)}',
|
|
811
|
+
headers=headers)
|
|
808
812
|
|
|
809
813
|
def delete_directory(self, directory_path: str):
|
|
810
814
|
"""Delete a directory.
|
|
@@ -822,7 +826,9 @@ class FilesAPI:
|
|
|
822
826
|
|
|
823
827
|
headers = {}
|
|
824
828
|
|
|
825
|
-
self._api.do('DELETE',
|
|
829
|
+
self._api.do('DELETE',
|
|
830
|
+
f'/api/2.0/fs/directories{_escape_multi_segment_path_parameter(directory_path)}',
|
|
831
|
+
headers=headers)
|
|
826
832
|
|
|
827
833
|
def download(self, file_path: str) -> DownloadResponse:
|
|
828
834
|
"""Download a file.
|
|
@@ -839,7 +845,7 @@ class FilesAPI:
|
|
|
839
845
|
headers = {'Accept': 'application/octet-stream', }
|
|
840
846
|
response_headers = ['content-length', 'content-type', 'last-modified', ]
|
|
841
847
|
res = self._api.do('GET',
|
|
842
|
-
f'/api/2.0/fs/files{file_path}',
|
|
848
|
+
f'/api/2.0/fs/files{_escape_multi_segment_path_parameter(file_path)}',
|
|
843
849
|
headers=headers,
|
|
844
850
|
response_headers=response_headers,
|
|
845
851
|
raw=True)
|
|
@@ -864,7 +870,9 @@ class FilesAPI:
|
|
|
864
870
|
|
|
865
871
|
headers = {}
|
|
866
872
|
|
|
867
|
-
self._api.do('HEAD',
|
|
873
|
+
self._api.do('HEAD',
|
|
874
|
+
f'/api/2.0/fs/directories{_escape_multi_segment_path_parameter(directory_path)}',
|
|
875
|
+
headers=headers)
|
|
868
876
|
|
|
869
877
|
def get_metadata(self, file_path: str) -> GetMetadataResponse:
|
|
870
878
|
"""Get file metadata.
|
|
@@ -880,7 +888,7 @@ class FilesAPI:
|
|
|
880
888
|
headers = {}
|
|
881
889
|
response_headers = ['content-length', 'content-type', 'last-modified', ]
|
|
882
890
|
res = self._api.do('HEAD',
|
|
883
|
-
f'/api/2.0/fs/files{file_path}',
|
|
891
|
+
f'/api/2.0/fs/files{_escape_multi_segment_path_parameter(file_path)}',
|
|
884
892
|
headers=headers,
|
|
885
893
|
response_headers=response_headers)
|
|
886
894
|
return GetMetadataResponse.from_dict(res)
|
|
@@ -924,10 +932,11 @@ class FilesAPI:
|
|
|
924
932
|
headers = {'Accept': 'application/json', }
|
|
925
933
|
|
|
926
934
|
while True:
|
|
927
|
-
json = self._api.do(
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
935
|
+
json = self._api.do(
|
|
936
|
+
'GET',
|
|
937
|
+
f'/api/2.0/fs/directories{_escape_multi_segment_path_parameter(directory_path)}',
|
|
938
|
+
query=query,
|
|
939
|
+
headers=headers)
|
|
931
940
|
if 'contents' in json:
|
|
932
941
|
for v in json['contents']:
|
|
933
942
|
yield DirectoryEntry.from_dict(v)
|
|
@@ -956,4 +965,8 @@ class FilesAPI:
|
|
|
956
965
|
if overwrite is not None: query['overwrite'] = overwrite
|
|
957
966
|
headers = {'Content-Type': 'application/octet-stream', }
|
|
958
967
|
|
|
959
|
-
self._api.do('PUT',
|
|
968
|
+
self._api.do('PUT',
|
|
969
|
+
f'/api/2.0/fs/files{_escape_multi_segment_path_parameter(file_path)}',
|
|
970
|
+
query=query,
|
|
971
|
+
headers=headers,
|
|
972
|
+
data=contents)
|
databricks/sdk/service/iam.py
CHANGED
|
@@ -2590,6 +2590,9 @@ class PermissionsAPI:
|
|
|
2590
2590
|
For the mapping of the required permissions for specific actions or abilities and other important
|
|
2591
2591
|
information, see [Access Control].
|
|
2592
2592
|
|
|
2593
|
+
Note that to manage access control on service principals, use **[Account Access Control
|
|
2594
|
+
Proxy](:service:accountaccesscontrolproxy)**.
|
|
2595
|
+
|
|
2593
2596
|
[Access Control]: https://docs.databricks.com/security/auth-authz/access-control/index.html"""
|
|
2594
2597
|
|
|
2595
2598
|
def __init__(self, api_client):
|