msfabricpysdkcore 0.2.9__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/coreapi.py +857 -36
- msfabricpysdkcore/domain.py +36 -5
- 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 +476 -6
- {msfabricpysdkcore-0.2.9.dist-info → msfabricpysdkcore-0.2.10.dist-info}/METADATA +45 -3
- {msfabricpysdkcore-0.2.9.dist-info → msfabricpysdkcore-0.2.10.dist-info}/RECORD +17 -15
- {msfabricpysdkcore-0.2.9.dist-info → msfabricpysdkcore-0.2.10.dist-info}/WHEEL +0 -0
- {msfabricpysdkcore-0.2.9.dist-info → msfabricpysdkcore-0.2.10.dist-info}/licenses/LICENSE +0 -0
- {msfabricpysdkcore-0.2.9.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:
|
@@ -399,8 +405,8 @@ class Workspace:
|
|
399
405
|
conflict_resolution=conflict_resolution,
|
400
406
|
options=options, workspace_head=workspace_head)
|
401
407
|
|
402
|
-
def update_my_git_credentials(self,
|
403
|
-
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)
|
404
410
|
|
405
411
|
# Managed Private Endpoints:
|
406
412
|
|
@@ -442,9 +448,6 @@ class Workspace:
|
|
442
448
|
|
443
449
|
def list_datamarts(self):
|
444
450
|
return self.core_client.list_datamarts(workspace_id=self.id)
|
445
|
-
|
446
|
-
def list_sql_endpoints(self):
|
447
|
-
return self.core_client.list_sql_endpoints(workspace_id=self.id)
|
448
451
|
|
449
452
|
def list_mirrored_warehouses(self):
|
450
453
|
return self.core_client.list_mirrored_warehouses(workspace_id=self.id)
|
@@ -476,6 +479,84 @@ class Workspace:
|
|
476
479
|
return self.core_client.update_apache_airflow_job_definition(workspace_id=self.id, apache_airflow_job_id=apache_airflow_job_id,
|
477
480
|
definition=definition, update_metadata=update_metadata)
|
478
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
|
+
|
479
560
|
# copy jobs
|
480
561
|
|
481
562
|
def create_copy_job(self, display_name, definition = None, description = None):
|
@@ -565,6 +646,9 @@ class Workspace:
|
|
565
646
|
def delete_dataflow(self, dataflow_id):
|
566
647
|
return self.core_client.delete_dataflow(workspace_id=self.id, dataflow_id=dataflow_id)
|
567
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
|
+
|
568
652
|
def get_dataflow(self, dataflow_id = None, dataflow_name = None):
|
569
653
|
return self.core_client.get_dataflow(workspace_id=self.id, dataflow_id=dataflow_id, dataflow_name=dataflow_name)
|
570
654
|
|
@@ -1055,6 +1139,53 @@ class Workspace:
|
|
1055
1139
|
"""Get a lakehouse livy session from a workspace"""
|
1056
1140
|
return self.core_client.get_lakehouse_livy_session(workspace_id=self.id, lakehouse_id=lakehouse_id, livy_id=livy_id)
|
1057
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
|
+
|
1058
1189
|
# mirroredDatabases
|
1059
1190
|
|
1060
1191
|
def create_mirrored_database(self, display_name, description = None, definition = None):
|
@@ -1139,6 +1270,197 @@ class Workspace:
|
|
1139
1270
|
"""Update an ml model in a workspace"""
|
1140
1271
|
return self.core_client.update_ml_model(workspace_id=self.id, ml_model_id=ml_model_id, display_name=display_name, description=description)
|
1141
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
|
+
|
1142
1464
|
# mounted data factory
|
1143
1465
|
|
1144
1466
|
def create_mounted_data_factory(self, display_name, description = None, definition = None):
|
@@ -1285,6 +1607,11 @@ class Workspace:
|
|
1285
1607
|
|
1286
1608
|
# semanticModels
|
1287
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
|
+
|
1288
1615
|
def list_semantic_models(self, with_properties = False):
|
1289
1616
|
"""List semantic models in a workspace"""
|
1290
1617
|
return self.core_client.list_semantic_models(workspace_id=self.id, with_properties=with_properties)
|
@@ -1405,11 +1732,35 @@ class Workspace:
|
|
1405
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)
|
1406
1733
|
|
1407
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
|
+
|
1408
1745
|
def refresh_sql_endpoint_metadata(self, sql_endpoint_id, preview = True, timeout = None, wait_for_completion = False):
|
1409
1746
|
"""Refresh the metadata of a sql endpoint in a workspace"""
|
1410
1747
|
return self.core_client.refresh_sql_endpoint_metadata(workspace_id=self.id, sql_endpoint_id=sql_endpoint_id,
|
1411
1748
|
preview=preview, timeout=timeout, wait_for_completion=wait_for_completion)
|
1412
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
|
+
|
1413
1764
|
# sql databases
|
1414
1765
|
|
1415
1766
|
def create_sql_database(self, display_name, description = None):
|
@@ -1447,6 +1798,11 @@ class Workspace:
|
|
1447
1798
|
"""Get a warehouse from a workspace"""
|
1448
1799
|
return self.core_client.get_warehouse(workspace_id=self.id, warehouse_id=warehouse_id, warehouse_name=warehouse_name)
|
1449
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
|
+
|
1450
1806
|
def delete_warehouse(self, warehouse_id):
|
1451
1807
|
"""Delete a warehouse from a workspace"""
|
1452
1808
|
return self.core_client.delete_warehouse(workspace_id=self.id, warehouse_id=warehouse_id)
|
@@ -1455,6 +1811,120 @@ class Workspace:
|
|
1455
1811
|
"""Update a warehouse in a workspace"""
|
1456
1812
|
return self.core_client.update_warehouse(workspace_id=self.id, warehouse_id=warehouse_id, display_name=display_name, description=description)
|
1457
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
|
+
|
1458
1928
|
def create_warehouse_snapshot(self, display_name, creation_payload, description = None, folder_id = None):
|
1459
1929
|
return self.core_client.create_warehouse_snapshot(workspace_id=self.id, display_name=display_name,
|
1460
1930
|
creation_payload=creation_payload, description=description,
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: msfabricpysdkcore
|
3
|
-
Version: 0.2.
|
3
|
+
Version: 0.2.10
|
4
4
|
Summary: A Python SDK for Microsoft Fabric
|
5
5
|
Author: Andreas Rederer
|
6
6
|
Project-URL: Homepage, https://github.com/DaSenf1860/ms-fabric-sdk-core
|
@@ -18,10 +18,32 @@ Dynamic: requires-dist
|
|
18
18
|
|
19
19
|
# Python SDK for Microsoft Fabric
|
20
20
|
|
21
|
-
This is a Python SDK for Microsoft Fabric. It is a wrapper around the REST APIs (v1) of Fabric*. It supports all Fabric REST APIs as well as Azure Resource Management APIs for Fabric (as of
|
21
|
+
This is a Python SDK for Microsoft Fabric. It is a wrapper around the REST APIs (v1) of Fabric*. It supports all Fabric REST APIs as well as Azure Resource Management APIs for Fabric (as of October 10, 2025).
|
22
22
|
|
23
23
|

|
24
24
|
|
25
|
+
<a href="https://badgen.net/github/license/DaSenf1860/ms-fabric-sdk-core" target="_blank">
|
26
|
+
<img src="https://badgen.net/github/license/DaSenf1860/ms-fabric-sdk-core" alt="License">
|
27
|
+
</a>
|
28
|
+
<a href="https://badgen.net/github/releases/DaSenf1860/ms-fabric-sdk-core" target="_blank">
|
29
|
+
<img src="https://badgen.net/github/releases/DaSenf1860/ms-fabric-sdk-core" alt="Test">
|
30
|
+
</a>
|
31
|
+
<a href="https://badgen.net/github/contributors/DaSenf1860/ms-fabric-sdk-core" target="_blank">
|
32
|
+
<img src="https://badgen.net/github/contributors/DaSenf1860/ms-fabric-sdk-core" alt="Publish">
|
33
|
+
</a>
|
34
|
+
<a href="https://badgen.net/github/commits/DaSenf1860/ms-fabric-sdk-core" target="_blank">
|
35
|
+
<img src="https://badgen.net/github/commits/DaSenf1860/ms-fabric-sdk-core" alt="Commits">
|
36
|
+
</a>
|
37
|
+
<a href="https://badgen.net/pypi/v/msfabricpysdkcore" target="_blank">
|
38
|
+
<img src="https://badgen.net/pypi/v/msfabricpysdkcore" alt="Package version">
|
39
|
+
</a>
|
40
|
+
<a href="https://badgen.net/pypi/dm/msfabricpysdkcore" target="_blank">
|
41
|
+
<img src="https://badgen.net/pypi/dm/msfabricpysdkcore" alt="Monthly Downloads">
|
42
|
+
</a>
|
43
|
+
|
44
|
+
<p> </p>
|
45
|
+
|
46
|
+
|
25
47
|
The Microsoft Fabric REST APIs are documented [here](https://docs.microsoft.com/en-us/rest/api/fabric/).
|
26
48
|
The Azure Resoure Management APIs for Fabric are documented [here](https://learn.microsoft.com/en-us/rest/api/microsoftfabric/fabric-capacities?view=rest-microsoftfabric-2023-11-01).
|
27
49
|
They are designed to automate your Fabric processes.
|
@@ -211,6 +233,16 @@ print(result["applicationId"]))
|
|
211
233
|
# Deprovision Identity
|
212
234
|
fc.deprovision_identity(workspace_id=ws.id)
|
213
235
|
|
236
|
+
# Get network communication policy
|
237
|
+
policy = fc.get_network_communication_policy(workspace_id=ws.id)
|
238
|
+
|
239
|
+
# Set network communication policy
|
240
|
+
inbound = {'publicAccessRules': {'defaultAction': 'Allow'}}
|
241
|
+
outbound = {'publicAccessRules': {'defaultAction': 'Allow'}}
|
242
|
+
|
243
|
+
resp = fc.set_network_communication_policy(workspace_id=ws.id, inbound=inbound, outbound=outbound)
|
244
|
+
|
245
|
+
|
214
246
|
```
|
215
247
|
|
216
248
|
### Working with capacities
|
@@ -688,7 +720,8 @@ ws.git_get_status()
|
|
688
720
|
git_credentials = fc.get_my_git_credentials(workspace_id="123123")
|
689
721
|
|
690
722
|
# Update my credentials
|
691
|
-
fc.update_my_git_credentials(workspace_id = "1232",
|
723
|
+
fc.update_my_git_credentials(workspace_id = "1232", source = "Automatic")
|
724
|
+
fc.update_my_git_credentials(workspace_id = "1232", source = "ConfiguredConnection", connection_id = "3f2504e0aasdfasdf")
|
692
725
|
|
693
726
|
# Update from git
|
694
727
|
fc.update_from_git(workspace_id="workspaceid", remote_commit_hash="commit_hash",
|
@@ -1199,6 +1232,15 @@ status_code = fca.role_assignments_bulk_unassign(domain.id, "Contributors", [pri
|
|
1199
1232
|
|
1200
1233
|
# Delete domain
|
1201
1234
|
status_code = fca.delete_domain(domain.id)
|
1235
|
+
|
1236
|
+
# List role assignments
|
1237
|
+
resp = fca.list_role_assignments(domain_id=domain.id)
|
1238
|
+
|
1239
|
+
# Sync role assignments to subdomains
|
1240
|
+
resp = fca.sync_role_assignments_to_subdomains(domain_id=domain.id, role="Contributor")
|
1241
|
+
|
1242
|
+
|
1243
|
+
|
1202
1244
|
```
|
1203
1245
|
|
1204
1246
|
### Admin API for External Data Shares
|