msfabricpysdkcore 0.2.8__py3-none-any.whl → 0.2.10__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.
- msfabricpysdkcore/adminapi.py +52 -14
- msfabricpysdkcore/client.py +2 -0
- msfabricpysdkcore/coreapi.py +906 -40
- msfabricpysdkcore/domain.py +36 -5
- msfabricpysdkcore/item.py +5 -0
- msfabricpysdkcore/lakehouse.py +45 -1
- msfabricpysdkcore/otheritems.py +216 -1
- msfabricpysdkcore/tests/test_anomaly_detector.py +60 -0
- msfabricpysdkcore/tests/test_dataflows.py +13 -0
- msfabricpysdkcore/tests/test_maps.py +60 -0
- msfabricpysdkcore/tests/test_sql_endpoint.py +12 -6
- msfabricpysdkcore/tests/test_warehouses.py +55 -0
- msfabricpysdkcore/tests/test_workspaces_capacities.py +12 -0
- msfabricpysdkcore/workspace.py +482 -9
- {msfabricpysdkcore-0.2.8.dist-info → msfabricpysdkcore-0.2.10.dist-info}/METADATA +81 -5
- {msfabricpysdkcore-0.2.8.dist-info → msfabricpysdkcore-0.2.10.dist-info}/RECORD +19 -17
- {msfabricpysdkcore-0.2.8.dist-info → msfabricpysdkcore-0.2.10.dist-info}/WHEEL +0 -0
- {msfabricpysdkcore-0.2.8.dist-info → msfabricpysdkcore-0.2.10.dist-info}/licenses/LICENSE +0 -0
- {msfabricpysdkcore-0.2.8.dist-info → msfabricpysdkcore-0.2.10.dist-info}/top_level.txt +0 -0
msfabricpysdkcore/workspace.py
CHANGED
@@ -104,7 +104,13 @@ class Workspace:
|
|
104
104
|
int: The status code of the response"""
|
105
105
|
return self.core_client.deprovision_identity(workspace_id=self.id)
|
106
106
|
|
107
|
-
|
107
|
+
def get_network_communication_policy(self):
|
108
|
+
"""Get the network communication policy for the workspace
|
109
|
+
Returns:
|
110
|
+
dict: The network communication policy
|
111
|
+
"""
|
112
|
+
return self.core_client.get_network_communication_policy(workspace_id=self.id)
|
113
|
+
|
108
114
|
def get_role_assignment(self, workspace_role_assignment_id):
|
109
115
|
"""Get a role assignment from the workspace
|
110
116
|
Args:
|
@@ -325,6 +331,9 @@ class Workspace:
|
|
325
331
|
def create_shortcut(self, item_id, path, name, target):
|
326
332
|
return self.core_client.create_shortcut(workspace_id=self.id, item_id=item_id,
|
327
333
|
path=path, name=name, target=target)
|
334
|
+
|
335
|
+
def create_shortcuts_bulk(self, item_id, create_shortcut_requests):
|
336
|
+
return self.core_client.create_shortcuts_bulk(workspace_id=self.id, item_id=item_id, create_shortcut_requests=create_shortcut_requests)
|
328
337
|
|
329
338
|
def delete_shortcut(self, item_id, path, name):
|
330
339
|
return self.core_client.delete_shortcut(self.id, item_id, path=path, name=name)
|
@@ -372,9 +381,9 @@ class Workspace:
|
|
372
381
|
return self.core_client.commit_to_git(workspace_id=self.id, mode=mode, comment=comment,
|
373
382
|
items=items, workspace_head=workspace_head)
|
374
383
|
|
375
|
-
|
376
|
-
|
377
|
-
|
384
|
+
def git_connect(self, git_provider_details, my_git_credentials):
|
385
|
+
return self.core_client.git_connect(workspace_id=self.id, git_provider_details=git_provider_details,
|
386
|
+
my_git_credentials=my_git_credentials)
|
378
387
|
|
379
388
|
def git_disconnect(self):
|
380
389
|
return self.core_client.git_disconnect(workspace_id=self.id)
|
@@ -396,8 +405,8 @@ class Workspace:
|
|
396
405
|
conflict_resolution=conflict_resolution,
|
397
406
|
options=options, workspace_head=workspace_head)
|
398
407
|
|
399
|
-
def update_my_git_credentials(self,
|
400
|
-
return self.core_client.update_my_git_credentials(workspace_id=self.id,
|
408
|
+
def update_my_git_credentials(self, source, connection_id = None):
|
409
|
+
return self.core_client.update_my_git_credentials(workspace_id=self.id, source=source, connection_id=connection_id)
|
401
410
|
|
402
411
|
# Managed Private Endpoints:
|
403
412
|
|
@@ -439,9 +448,6 @@ class Workspace:
|
|
439
448
|
|
440
449
|
def list_datamarts(self):
|
441
450
|
return self.core_client.list_datamarts(workspace_id=self.id)
|
442
|
-
|
443
|
-
def list_sql_endpoints(self):
|
444
|
-
return self.core_client.list_sql_endpoints(workspace_id=self.id)
|
445
451
|
|
446
452
|
def list_mirrored_warehouses(self):
|
447
453
|
return self.core_client.list_mirrored_warehouses(workspace_id=self.id)
|
@@ -473,6 +479,84 @@ class Workspace:
|
|
473
479
|
return self.core_client.update_apache_airflow_job_definition(workspace_id=self.id, apache_airflow_job_id=apache_airflow_job_id,
|
474
480
|
definition=definition, update_metadata=update_metadata)
|
475
481
|
|
482
|
+
# anomaly detectors
|
483
|
+
def create_anomaly_detector(self, display_name, definition = None, description = None, folder_id = None):
|
484
|
+
"""Create an anomaly detector in the workspace
|
485
|
+
Args:
|
486
|
+
display_name (str): The display name of the anomaly detector
|
487
|
+
definition (dict): The definition of the anomaly detector
|
488
|
+
description (str): The description of the anomaly detector
|
489
|
+
folder_id (str): The ID of the folder to create the anomaly detector in
|
490
|
+
Returns:
|
491
|
+
AnomalyDetector: The created anomaly detector object
|
492
|
+
"""
|
493
|
+
return self.core_client.create_anomaly_detector(workspace_id=self.id, display_name=display_name, description=description,
|
494
|
+
definition=definition, folder_id=folder_id)
|
495
|
+
|
496
|
+
def delete_anomaly_detector(self, anomaly_detector_id):
|
497
|
+
"""Delete an anomaly detector from the workspace
|
498
|
+
Args:
|
499
|
+
anomaly_detector_id (str): The ID of the anomaly detector
|
500
|
+
Returns:
|
501
|
+
int: The status code of the response
|
502
|
+
"""
|
503
|
+
return self.core_client.delete_anomaly_detector(workspace_id=self.id, anomaly_detector_id=anomaly_detector_id)
|
504
|
+
|
505
|
+
def get_anomaly_detector(self, anomaly_detector_id = None, anomaly_detector_name = None):
|
506
|
+
"""Get an anomaly detector from the workspace
|
507
|
+
Args:
|
508
|
+
anomaly_detector_id (str): The ID of the anomaly detector
|
509
|
+
anomaly_detector_name (str): The name of the anomaly detector
|
510
|
+
Returns:
|
511
|
+
AnomalyDetector: The anomaly detector object
|
512
|
+
"""
|
513
|
+
return self.core_client.get_anomaly_detector(workspace_id=self.id, anomaly_detector_id=anomaly_detector_id,
|
514
|
+
anomaly_detector_name=anomaly_detector_name)
|
515
|
+
|
516
|
+
def get_anomaly_detector_definition(self, anomaly_detector_id, format = None):
|
517
|
+
"""Get the definition of an anomaly detector
|
518
|
+
Args:
|
519
|
+
anomaly_detector_id (str): The ID of the anomaly detector
|
520
|
+
format (str): The format of the definition
|
521
|
+
Returns:
|
522
|
+
dict: The anomaly detector definition
|
523
|
+
"""
|
524
|
+
return self.core_client.get_anomaly_detector_definition(workspace_id=self.id, anomaly_detector_id=anomaly_detector_id, format=format)
|
525
|
+
|
526
|
+
def list_anomaly_detectors(self, with_properties = False):
|
527
|
+
"""List anomaly detectors in the workspace
|
528
|
+
Args:
|
529
|
+
with_properties (bool): Whether to get the item object with properties
|
530
|
+
Returns:
|
531
|
+
list: The list of anomaly detectors
|
532
|
+
"""
|
533
|
+
return self.core_client.list_anomaly_detectors(workspace_id=self.id, with_properties=with_properties)
|
534
|
+
|
535
|
+
def update_anomaly_detector(self, anomaly_detector_id, display_name = None, description = None, return_item=False):
|
536
|
+
"""Update an anomaly detector in the workspace
|
537
|
+
Args:
|
538
|
+
anomaly_detector_id (str): The ID of the anomaly detector
|
539
|
+
display_name (str): The display name of the anomaly detector
|
540
|
+
description (str): The description of the anomaly detector
|
541
|
+
return_item (bool): Whether to return the item object
|
542
|
+
Returns:
|
543
|
+
dict: The updated anomaly detector or AnomalyDetector object if return_item is True
|
544
|
+
"""
|
545
|
+
return self.core_client.update_anomaly_detector(workspace_id=self.id, anomaly_detector_id=anomaly_detector_id,
|
546
|
+
display_name=display_name, description=description, return_item=return_item)
|
547
|
+
|
548
|
+
def update_anomaly_detector_definition(self, anomaly_detector_id, definition, update_metadata = None):
|
549
|
+
"""Update the definition of an anomaly detector
|
550
|
+
Args:
|
551
|
+
anomaly_detector_id (str): The ID of the anomaly detector
|
552
|
+
definition (dict): The definition of the anomaly detector
|
553
|
+
update_metadata (bool): Whether to update the metadata
|
554
|
+
Returns:
|
555
|
+
dict: The updated anomaly detector definition
|
556
|
+
"""
|
557
|
+
return self.core_client.update_anomaly_detector_definition(workspace_id=self.id, anomaly_detector_id=anomaly_detector_id,
|
558
|
+
definition=definition, update_metadata=update_metadata)
|
559
|
+
|
476
560
|
# copy jobs
|
477
561
|
|
478
562
|
def create_copy_job(self, display_name, definition = None, description = None):
|
@@ -562,6 +646,9 @@ class Workspace:
|
|
562
646
|
def delete_dataflow(self, dataflow_id):
|
563
647
|
return self.core_client.delete_dataflow(workspace_id=self.id, dataflow_id=dataflow_id)
|
564
648
|
|
649
|
+
def discover_dataflow_parameters(self, dataflow_id):
|
650
|
+
return self.core_client.discover_dataflow_parameters(workspace_id=self.id, dataflow_id=dataflow_id)
|
651
|
+
|
565
652
|
def get_dataflow(self, dataflow_id = None, dataflow_name = None):
|
566
653
|
return self.core_client.get_dataflow(workspace_id=self.id, dataflow_id=dataflow_id, dataflow_name=dataflow_name)
|
567
654
|
|
@@ -1052,6 +1139,53 @@ class Workspace:
|
|
1052
1139
|
"""Get a lakehouse livy session from a workspace"""
|
1053
1140
|
return self.core_client.get_lakehouse_livy_session(workspace_id=self.id, lakehouse_id=lakehouse_id, livy_id=livy_id)
|
1054
1141
|
|
1142
|
+
def create_refresh_materialized_lake_view_schedule(self, lakehouse_id, enabled, configuration):
|
1143
|
+
"""Create a refresh materialized lake view schedule
|
1144
|
+
Args:
|
1145
|
+
lakehouse_id (str): The ID of the lakehouse
|
1146
|
+
enabled (bool): Whether the schedule is enabled
|
1147
|
+
configuration (dict): The configuration of the schedule
|
1148
|
+
Returns:
|
1149
|
+
dict: The created schedule
|
1150
|
+
"""
|
1151
|
+
return self.core_client.create_refresh_materialized_lake_view_schedule(workspace_id=self.id, lakehouse_id=lakehouse_id,
|
1152
|
+
enabled=enabled, configuration=configuration)
|
1153
|
+
|
1154
|
+
def delete_refresh_materialized_lake_view_schedule(self, lakehouse_id, schedule_id):
|
1155
|
+
"""Delete a refresh materialized lake view schedule
|
1156
|
+
Args:
|
1157
|
+
lakehouse_id (str): The ID of the lakehouse
|
1158
|
+
schedule_id (str): The ID of the schedule
|
1159
|
+
Returns:
|
1160
|
+
int: The status code of the response
|
1161
|
+
"""
|
1162
|
+
return self.core_client.delete_refresh_materialized_lake_view_schedule(workspace_id=self.id, lakehouse_id=lakehouse_id,
|
1163
|
+
schedule_id=schedule_id)
|
1164
|
+
|
1165
|
+
def run_on_demand_refresh_materialized_lake_view(self, lakehouse_id, job_type="RefreshMaterializedLakeViews"):
|
1166
|
+
"""Run refresh materialized lake view
|
1167
|
+
Args:
|
1168
|
+
lakehouse_id (str): The ID of the lakehouse
|
1169
|
+
job_type (str): The job type
|
1170
|
+
Returns:
|
1171
|
+
dict: The operation result or response value
|
1172
|
+
"""
|
1173
|
+
return self.core_client.run_on_demand_refresh_materialized_lake_view(workspace_id=self.id, lakehouse_id=lakehouse_id, job_type=job_type)
|
1174
|
+
|
1175
|
+
def update_refresh_materialized_lake_view_schedule(self, lakehouse_id, schedule_id, enabled, configuration):
|
1176
|
+
"""Update a refresh materialized lake view schedule
|
1177
|
+
Args:
|
1178
|
+
lakehouse_id (str): The ID of the lakehouse
|
1179
|
+
schedule_id (str): The ID of the schedule
|
1180
|
+
enabled (bool): Whether the schedule is enabled
|
1181
|
+
configuration (dict): The configuration of the schedule
|
1182
|
+
Returns:
|
1183
|
+
dict: The updated schedule
|
1184
|
+
"""
|
1185
|
+
return self.core_client.update_refresh_materialized_lake_view_schedule(workspace_id=self.id, lakehouse_id=lakehouse_id,
|
1186
|
+
schedule_id=schedule_id, enabled=enabled,
|
1187
|
+
configuration=configuration)
|
1188
|
+
|
1055
1189
|
# mirroredDatabases
|
1056
1190
|
|
1057
1191
|
def create_mirrored_database(self, display_name, description = None, definition = None):
|
@@ -1136,6 +1270,197 @@ class Workspace:
|
|
1136
1270
|
"""Update an ml model in a workspace"""
|
1137
1271
|
return self.core_client.update_ml_model(workspace_id=self.id, ml_model_id=ml_model_id, display_name=display_name, description=description)
|
1138
1272
|
|
1273
|
+
def activate_ml_model_endpoint_version(self, model_id, name, wait_for_completion = False):
|
1274
|
+
"""Activate an ml model endpoint version
|
1275
|
+
Args:
|
1276
|
+
model_id (str): The ID of the ml model
|
1277
|
+
name (str): The name of the endpoint version
|
1278
|
+
wait_for_completion (bool): Whether to wait for the operation to complete
|
1279
|
+
Returns:
|
1280
|
+
dict: The activated endpoint version
|
1281
|
+
"""
|
1282
|
+
|
1283
|
+
return self.core_client.activate_ml_model_endpoint_version(workspace_id=self.id, model_id=model_id, name=name, wait_for_completion=wait_for_completion)
|
1284
|
+
|
1285
|
+
def deactivate_all_ml_model_endpoint_versions(self, model_id, wait_for_completion = False):
|
1286
|
+
"""Deactivate all ml model endpoint versions
|
1287
|
+
Args:
|
1288
|
+
model_id (str): The ID of the ml model
|
1289
|
+
wait_for_completion (bool): Whether to wait for the operation to complete
|
1290
|
+
Returns:
|
1291
|
+
Response: The operation result
|
1292
|
+
"""
|
1293
|
+
return self.core_client.deactivate_all_ml_model_endpoint_versions(workspace_id=self.id, model_id=model_id, wait_for_completion=wait_for_completion)
|
1294
|
+
|
1295
|
+
def deactivate_ml_model_endpoint_version(self, model_id, name, wait_for_completion = False):
|
1296
|
+
"""Deactivate an ml model endpoint version
|
1297
|
+
Args:
|
1298
|
+
model_id (str): The ID of the ml model
|
1299
|
+
name (str): The name of the endpoint version
|
1300
|
+
wait_for_completion (bool): Whether to wait for the operation to complete
|
1301
|
+
Returns:
|
1302
|
+
Response: The operation result
|
1303
|
+
"""
|
1304
|
+
return self.core_client.deactivate_ml_model_endpoint_version(workspace_id=self.id,
|
1305
|
+
model_id=model_id, name=name,
|
1306
|
+
wait_for_completion=wait_for_completion)
|
1307
|
+
|
1308
|
+
def get_ml_model_endpoint(self, model_id):
|
1309
|
+
"""Get the ml model endpoint
|
1310
|
+
Args:
|
1311
|
+
model_id (str): The ID of the ml model
|
1312
|
+
Returns:
|
1313
|
+
dict: The ml model endpoint
|
1314
|
+
"""
|
1315
|
+
return self.core_client.get_ml_model_endpoint(workspace_id=self.id, model_id=model_id)
|
1316
|
+
|
1317
|
+
def get_ml_model_endpoint_version(self, model_id, name):
|
1318
|
+
"""Get an ml model endpoint version
|
1319
|
+
Args:
|
1320
|
+
model_id (str): The ID of the ml model
|
1321
|
+
name (str): The name of the endpoint version
|
1322
|
+
Returns:
|
1323
|
+
dict: The ml model endpoint version
|
1324
|
+
"""
|
1325
|
+
return self.core_client.get_ml_model_endpoint_version(workspace_id=self.id, model_id=model_id, name=name)
|
1326
|
+
|
1327
|
+
def list_ml_model_endpoint_versions(self, model_id):
|
1328
|
+
"""List all ml model endpoint versions
|
1329
|
+
Args:
|
1330
|
+
model_id (str): The ID of the ml model
|
1331
|
+
Returns:
|
1332
|
+
list: The list of ml model endpoint versions
|
1333
|
+
"""
|
1334
|
+
return self.core_client.list_ml_model_endpoint_versions(workspace_id=self.id, model_id=model_id)
|
1335
|
+
|
1336
|
+
def score_ml_model_endpoint(self, model_id, inputs, format_type = None, orientation = None):
|
1337
|
+
"""Score an ml model endpoint
|
1338
|
+
Args:
|
1339
|
+
model_id (str): The ID of the ml model
|
1340
|
+
inputs (list): The inputs to score
|
1341
|
+
format_type (str): The format type
|
1342
|
+
orientation (str): The orientation
|
1343
|
+
Returns:
|
1344
|
+
dict: The scoring result
|
1345
|
+
"""
|
1346
|
+
return self.core_client.score_ml_model_endpoint(workspace_id=self.id, model_id=model_id, inputs=inputs,
|
1347
|
+
format_type=format_type, orientation=orientation)
|
1348
|
+
|
1349
|
+
def score_ml_model_endpoint_version(self, model_id, name, inputs, format_type = None, orientation = None):
|
1350
|
+
"""Score an ml model endpoint version
|
1351
|
+
Args:
|
1352
|
+
model_id (str): The ID of the ml model
|
1353
|
+
name (str): The name of the endpoint version
|
1354
|
+
inputs (list): The inputs to score
|
1355
|
+
format_type (str): The format type
|
1356
|
+
orientation (str): The orientation
|
1357
|
+
Returns:
|
1358
|
+
dict: The scoring result
|
1359
|
+
"""
|
1360
|
+
return self.core_client.score_ml_model_endpoint_version(workspace_id=self.id, model_id=model_id, name=name,
|
1361
|
+
inputs=inputs, format_type=format_type, orientation=orientation)
|
1362
|
+
|
1363
|
+
def update_ml_model_endpoint(self, model_id, default_version_assignment_behavior, default_version_name):
|
1364
|
+
"""Update an ml model endpoint
|
1365
|
+
Args:
|
1366
|
+
model_id (str): The ID of the ml model
|
1367
|
+
default_version_assignment_behavior (str): The default version assignment behavior
|
1368
|
+
default_version_name (str): The default version name
|
1369
|
+
Returns:
|
1370
|
+
dict: The updated endpoint
|
1371
|
+
"""
|
1372
|
+
return self.core_client.update_ml_model_endpoint(workspace_id=self.id, model_id=model_id,
|
1373
|
+
default_version_assignment_behavior=default_version_assignment_behavior,
|
1374
|
+
default_version_name=default_version_name)
|
1375
|
+
|
1376
|
+
def update_ml_model_endpoint_version(self, model_id, name, scale_rule):
|
1377
|
+
"""Update an ml model endpoint version
|
1378
|
+
Args:
|
1379
|
+
model_id (str): The ID of the ml model
|
1380
|
+
name (str): The name of the endpoint version
|
1381
|
+
scale_rule (str): The scale rule
|
1382
|
+
Returns:
|
1383
|
+
dict: The updated endpoint version
|
1384
|
+
"""
|
1385
|
+
return self.core_client.update_ml_model_endpoint_version(workspace_id=self.id, model_id=model_id, name=name, scale_rule=scale_rule)
|
1386
|
+
|
1387
|
+
# maps
|
1388
|
+
def create_map(self, display_name, definition = None, description = None, folder_id = None):
|
1389
|
+
"""Create a map in the workspace
|
1390
|
+
Args:
|
1391
|
+
display_name (str): The display name of the map
|
1392
|
+
definition (dict): The definition of the map
|
1393
|
+
description (str): The description of the map
|
1394
|
+
folder_id (str): The ID of the folder to create the map in
|
1395
|
+
Returns:
|
1396
|
+
Map: The created map object
|
1397
|
+
"""
|
1398
|
+
return self.core_client.create_map(workspace_id=self.id, display_name=display_name, description=description,
|
1399
|
+
definition=definition, folder_id=folder_id)
|
1400
|
+
|
1401
|
+
def delete_map(self, map_id):
|
1402
|
+
"""Delete a map from the workspace
|
1403
|
+
Args:
|
1404
|
+
map_id (str): The ID of the map
|
1405
|
+
Returns:
|
1406
|
+
int: The status code of the response
|
1407
|
+
"""
|
1408
|
+
return self.core_client.delete_map(workspace_id=self.id, map_id=map_id)
|
1409
|
+
|
1410
|
+
def get_map(self, map_id = None, map_name = None):
|
1411
|
+
"""Get a map from the workspace
|
1412
|
+
Args:
|
1413
|
+
map_id (str): The ID of the map
|
1414
|
+
map_name (str): The name of the map
|
1415
|
+
Returns:
|
1416
|
+
Map: The map object
|
1417
|
+
"""
|
1418
|
+
return self.core_client.get_map(workspace_id=self.id, map_id=map_id, map_name=map_name)
|
1419
|
+
|
1420
|
+
def get_map_definition(self, map_id, format = None):
|
1421
|
+
"""Get the definition of a map
|
1422
|
+
Args:
|
1423
|
+
map_id (str): The ID of the map
|
1424
|
+
format (str): The format of the definition
|
1425
|
+
Returns:
|
1426
|
+
dict: The map definition
|
1427
|
+
"""
|
1428
|
+
return self.core_client.get_map_definition(workspace_id=self.id, map_id=map_id, format=format)
|
1429
|
+
|
1430
|
+
def list_maps(self, with_properties = False):
|
1431
|
+
"""List maps in the workspace
|
1432
|
+
Args:
|
1433
|
+
with_properties (bool): Whether to get the item object with properties
|
1434
|
+
Returns:
|
1435
|
+
list: The list of maps
|
1436
|
+
"""
|
1437
|
+
return self.core_client.list_maps(workspace_id=self.id, with_properties=with_properties)
|
1438
|
+
|
1439
|
+
def update_map(self, map_id, display_name = None, description = None, return_item=False):
|
1440
|
+
"""Update a map in the workspace
|
1441
|
+
Args:
|
1442
|
+
map_id (str): The ID of the map
|
1443
|
+
display_name (str): The display name of the map
|
1444
|
+
description (str): The description of the map
|
1445
|
+
return_item (bool): Whether to return the item object
|
1446
|
+
Returns:
|
1447
|
+
dict: The updated map or Map object if return_item is True
|
1448
|
+
"""
|
1449
|
+
return self.core_client.update_map(workspace_id=self.id, map_id=map_id,
|
1450
|
+
display_name=display_name, description=description, return_item=return_item)
|
1451
|
+
|
1452
|
+
def update_map_definition(self, map_id, definition, update_metadata = None):
|
1453
|
+
"""Update the definition of a map
|
1454
|
+
Args:
|
1455
|
+
map_id (str): The ID of the map
|
1456
|
+
definition (dict): The definition of the map
|
1457
|
+
update_metadata (bool): Whether to update the metadata
|
1458
|
+
Returns:
|
1459
|
+
dict: The updated map definition
|
1460
|
+
"""
|
1461
|
+
return self.core_client.update_map_definition(workspace_id=self.id, map_id=map_id,
|
1462
|
+
definition=definition, update_metadata=update_metadata)
|
1463
|
+
|
1139
1464
|
# mounted data factory
|
1140
1465
|
|
1141
1466
|
def create_mounted_data_factory(self, display_name, description = None, definition = None):
|
@@ -1282,6 +1607,11 @@ class Workspace:
|
|
1282
1607
|
|
1283
1608
|
# semanticModels
|
1284
1609
|
|
1610
|
+
def bind_semantic_model_connection(self, semantic_model_id, connection_binding):
|
1611
|
+
"""Bind a connection to a semantic model in a workspace"""
|
1612
|
+
return self.core_client.bind_semantic_model_connection(workspace_id=self.id, semantic_model_id=semantic_model_id,
|
1613
|
+
connection_binding=connection_binding)
|
1614
|
+
|
1285
1615
|
def list_semantic_models(self, with_properties = False):
|
1286
1616
|
"""List semantic models in a workspace"""
|
1287
1617
|
return self.core_client.list_semantic_models(workspace_id=self.id, with_properties=with_properties)
|
@@ -1402,11 +1732,35 @@ class Workspace:
|
|
1402
1732
|
return self.core_client.get_spark_job_definition_livy_session(workspace_id=self.id, spark_job_definition_id=spark_job_definition_id, livy_id=livy_id)
|
1403
1733
|
|
1404
1734
|
# sql endpoint
|
1735
|
+
|
1736
|
+
def get_sql_endpoint_connection_string(self, sql_endpoint_id, guest_tenant_id = None, private_link_type = None):
|
1737
|
+
return self.core_client.get_sql_endpoint_connection_string(workspace_id=self.id,
|
1738
|
+
sql_endpoint_id=sql_endpoint_id,
|
1739
|
+
guest_tenant_id=guest_tenant_id,
|
1740
|
+
private_link_type=private_link_type)
|
1741
|
+
|
1742
|
+
def list_sql_endpoints(self):
|
1743
|
+
return self.core_client.list_sql_endpoints(workspace_id=self.id)
|
1744
|
+
|
1405
1745
|
def refresh_sql_endpoint_metadata(self, sql_endpoint_id, preview = True, timeout = None, wait_for_completion = False):
|
1406
1746
|
"""Refresh the metadata of a sql endpoint in a workspace"""
|
1407
1747
|
return self.core_client.refresh_sql_endpoint_metadata(workspace_id=self.id, sql_endpoint_id=sql_endpoint_id,
|
1408
1748
|
preview=preview, timeout=timeout, wait_for_completion=wait_for_completion)
|
1409
1749
|
|
1750
|
+
def get_sql_endpoint_audit_settings(self, sql_endpoint_id):
|
1751
|
+
"""Get the audit settings of a sql endpoint in a workspace"""
|
1752
|
+
return self.core_client.get_sql_endpoint_audit_settings(workspace_id=self.id, sql_endpoint_id=sql_endpoint_id)
|
1753
|
+
|
1754
|
+
def set_sql_endpoint_audit_actions_and_groups(self, sql_endpoint_id, set_audit_actions_and_groups_request):
|
1755
|
+
"""Set the audit settings of a sql endpoint in a workspace"""
|
1756
|
+
return self.core_client.set_sql_endpoint_audit_actions_and_groups(workspace_id=self.id, sql_endpoint_id=sql_endpoint_id,
|
1757
|
+
set_audit_actions_and_groups_request=set_audit_actions_and_groups_request)
|
1758
|
+
|
1759
|
+
def update_sql_endpoint_audit_settings(self, sql_endpoint_id, retention_days, state):
|
1760
|
+
"""Update the audit settings of a sql endpoint in a workspace"""
|
1761
|
+
return self.core_client.update_sql_endpoint_audit_settings(workspace_id=self.id, sql_endpoint_id=sql_endpoint_id,
|
1762
|
+
retention_days=retention_days, state=state)
|
1763
|
+
|
1410
1764
|
# sql databases
|
1411
1765
|
|
1412
1766
|
def create_sql_database(self, display_name, description = None):
|
@@ -1444,6 +1798,11 @@ class Workspace:
|
|
1444
1798
|
"""Get a warehouse from a workspace"""
|
1445
1799
|
return self.core_client.get_warehouse(workspace_id=self.id, warehouse_id=warehouse_id, warehouse_name=warehouse_name)
|
1446
1800
|
|
1801
|
+
def get_warehouse_connection_string(self, warehouse_id, guest_tenant_id = None, private_link_type = None):
|
1802
|
+
"""Get the connection string of a warehouse from a workspace"""
|
1803
|
+
return self.core_client.get_warehouse_connection_string(workspace_id=self.id, warehouse_id=warehouse_id,
|
1804
|
+
guest_tenant_id=guest_tenant_id, private_link_type=private_link_type)
|
1805
|
+
|
1447
1806
|
def delete_warehouse(self, warehouse_id):
|
1448
1807
|
"""Delete a warehouse from a workspace"""
|
1449
1808
|
return self.core_client.delete_warehouse(workspace_id=self.id, warehouse_id=warehouse_id)
|
@@ -1452,6 +1811,120 @@ class Workspace:
|
|
1452
1811
|
"""Update a warehouse in a workspace"""
|
1453
1812
|
return self.core_client.update_warehouse(workspace_id=self.id, warehouse_id=warehouse_id, display_name=display_name, description=description)
|
1454
1813
|
|
1814
|
+
# warehouse restore points
|
1815
|
+
# POST https://api.fabric.microsoft.com/v1/workspaces/{workspaceId}/warehouses/{warehouseId}/restorePoints
|
1816
|
+
def create_warehouse_restore_point(self, warehouse_id, display_name = None, description = None, wait_for_completion = False):
|
1817
|
+
"""Create a restore point for a warehouse
|
1818
|
+
Args:
|
1819
|
+
warehouse_id (str): The ID of the warehouse
|
1820
|
+
display_name (str): The display name of the restore point
|
1821
|
+
description (str): The description of the restore point
|
1822
|
+
wait_for_completion (bool): Whether to wait for the restore point creation to complete
|
1823
|
+
Returns:
|
1824
|
+
dict: The created restore point
|
1825
|
+
"""
|
1826
|
+
return self.core_client.create_warehouse_restore_point(workspace_id=self.id, warehouse_id=warehouse_id,
|
1827
|
+
display_name=display_name, description=description,
|
1828
|
+
wait_for_completion=wait_for_completion)
|
1829
|
+
|
1830
|
+
# DELETE https://api.fabric.microsoft.com/v1/workspaces/{workspaceId}/warehouses/{warehouseId}/restorePoints/{restorePointId}
|
1831
|
+
def delete_warehouse_restore_point(self, warehouse_id, restore_point_id):
|
1832
|
+
"""Delete a restore point for a warehouse
|
1833
|
+
Args:
|
1834
|
+
warehouse_id (str): The ID of the warehouse
|
1835
|
+
restore_point_id (str): The ID of the restore point
|
1836
|
+
Returns:
|
1837
|
+
int: The status code of the response
|
1838
|
+
"""
|
1839
|
+
return self.core_client.delete_warehouse_restore_point(workspace_id=self.id, warehouse_id=warehouse_id,
|
1840
|
+
restore_point_id=restore_point_id)
|
1841
|
+
|
1842
|
+
# GET https://api.fabric.microsoft.com/v1/workspaces/{workspaceId}/warehouses/{warehouseId}/restorePoints/{restorePointId}
|
1843
|
+
def get_warehouse_restore_point(self, warehouse_id, restore_point_id):
|
1844
|
+
"""Get a restore point for a warehouse
|
1845
|
+
Args:
|
1846
|
+
warehouse_id (str): The ID of the warehouse
|
1847
|
+
restore_point_id (str): The ID of the restore point
|
1848
|
+
Returns:
|
1849
|
+
dict: The restore point
|
1850
|
+
"""
|
1851
|
+
return self.core_client.get_warehouse_restore_point(workspace_id=self.id, warehouse_id=warehouse_id,
|
1852
|
+
restore_point_id=restore_point_id)
|
1853
|
+
|
1854
|
+
# GET https://api.fabric.microsoft.com/v1/workspaces/{workspaceId}/warehouses/{warehouseId}/restorePoints?continuationToken={continuationToken}
|
1855
|
+
def list_warehouse_restore_points(self, warehouse_id):
|
1856
|
+
"""List restore points for a warehouse
|
1857
|
+
Args:
|
1858
|
+
warehouse_id (str): The ID of the warehouse
|
1859
|
+
Returns:
|
1860
|
+
list: The list of restore points
|
1861
|
+
"""
|
1862
|
+
return self.core_client.list_warehouse_restore_points(workspace_id=self.id, warehouse_id=warehouse_id)
|
1863
|
+
|
1864
|
+
# POST https://api.fabric.microsoft.com/v1/workspaces/{workspaceId}/warehouses/{warehouseId}/restorePoints/{restorePointId}/restore
|
1865
|
+
def restore_warehouse_to_restore_point(self, warehouse_id, restore_point_id, wait_for_completion = False):
|
1866
|
+
"""Restore a warehouse to a restore point
|
1867
|
+
Args:
|
1868
|
+
warehouse_id (str): The ID of the warehouse
|
1869
|
+
restore_point_id (str): The ID of the restore point
|
1870
|
+
wait_for_completion (bool): Whether to wait for the restore operation to complete
|
1871
|
+
Returns:
|
1872
|
+
response: The response of the restore operation
|
1873
|
+
"""
|
1874
|
+
return self.core_client.restore_warehouse_to_restore_point(workspace_id=self.id, warehouse_id=warehouse_id,
|
1875
|
+
restore_point_id=restore_point_id,
|
1876
|
+
wait_for_completion=wait_for_completion)
|
1877
|
+
|
1878
|
+
# PATCH https://api.fabric.microsoft.com/v1/workspaces/{workspaceId}/warehouses/{warehouseId}/restorePoints/{restorePointId}
|
1879
|
+
def update_warehouse_restore_point(self, warehouse_id, restore_point_id, display_name = None, description = None):
|
1880
|
+
"""Update a restore point for a warehouse
|
1881
|
+
Args:
|
1882
|
+
warehouse_id (str): The ID of the warehouse
|
1883
|
+
restore_point_id (str): The ID of the restore point
|
1884
|
+
display_name (str): The display name of the restore point
|
1885
|
+
description (str): The description of the restore point
|
1886
|
+
Returns:
|
1887
|
+
dict: The updated restore point
|
1888
|
+
"""
|
1889
|
+
return self.core_client.update_warehouse_restore_point(workspace_id=self.id, warehouse_id=warehouse_id,
|
1890
|
+
restore_point_id=restore_point_id,
|
1891
|
+
display_name=display_name, description=description)
|
1892
|
+
|
1893
|
+
# warehouse sql audit settings
|
1894
|
+
# GET https://api.fabric.microsoft.com/v1/workspaces/{workspaceId}/warehouses/{itemId}/settings/sqlAudit
|
1895
|
+
def get_warehouse_sql_audit_settings(self, warehouse_id):
|
1896
|
+
"""Get the audit settings of a warehouse
|
1897
|
+
Args:
|
1898
|
+
warehouse_id (str): The ID of the warehouse
|
1899
|
+
Returns:
|
1900
|
+
dict: The audit settings of the warehouse
|
1901
|
+
"""
|
1902
|
+
|
1903
|
+
return self.get_sql_endpoint_audit_settings(warehouse_id)
|
1904
|
+
|
1905
|
+
def set_warehouse_audit_actions_and_groups(self, warehouse_id, set_audit_actions_and_groups_request):
|
1906
|
+
"""Set the audit actions and groups of a warehouse
|
1907
|
+
Args:
|
1908
|
+
warehouse_id (str): The ID of the warehouse
|
1909
|
+
set_audit_actions_and_groups_request (list): The list of audit actions and groups
|
1910
|
+
Returns:
|
1911
|
+
dict: The updated audit settings of the warehouse
|
1912
|
+
"""
|
1913
|
+
return self.set_sql_endpoint_audit_actions_and_groups(warehouse_id, set_audit_actions_and_groups_request)
|
1914
|
+
|
1915
|
+
def update_warehouse_sql_audit_settings(self, warehouse_id, retention_days, state):
|
1916
|
+
"""Update the audit settings of a warehouse
|
1917
|
+
Args:
|
1918
|
+
warehouse_id (str): The ID of the warehouse
|
1919
|
+
retention_days (int): The number of days to retain the audit logs
|
1920
|
+
state (str): The state of the audit settings
|
1921
|
+
Returns:
|
1922
|
+
dict: The updated audit settings of the warehouse
|
1923
|
+
"""
|
1924
|
+
return self.update_sql_endpoint_audit_settings(warehouse_id, retention_days, state)
|
1925
|
+
|
1926
|
+
|
1927
|
+
|
1455
1928
|
def create_warehouse_snapshot(self, display_name, creation_payload, description = None, folder_id = None):
|
1456
1929
|
return self.core_client.create_warehouse_snapshot(workspace_id=self.id, display_name=display_name,
|
1457
1930
|
creation_payload=creation_payload, description=description,
|