msfabricpysdkcore 0.2.3__py3-none-any.whl → 0.2.4__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.
@@ -152,6 +152,16 @@ class Workspace:
152
152
  return self.core_client.update_workspace_role_assignment(workspace_id=self.id, role=role, workspace_role_assignment_id=workspace_role_assignment_id)
153
153
 
154
154
 
155
+ # Tags
156
+
157
+ def apply_tags(self, item_id, tags):
158
+ """Apply tags to an item in a workspace"""
159
+ return self.core_client.apply_tags(workspace_id=self.id, item_id=item_id, tags=tags)
160
+
161
+ def unapply_tags(self, item_id, tags):
162
+ """Unapply tags from an item in a workspace"""
163
+ return self.core_client.unapply_tags(workspace_id=self.id, item_id=item_id, tags=tags)
164
+
155
165
  # External Data Shares
156
166
 
157
167
  # create
@@ -174,6 +184,75 @@ class Workspace:
174
184
  def revoke_external_data_share(self, item_id, external_data_share_id):
175
185
  return self.core_client.revoke_external_data_share(workspace_id=self.id, item_id=item_id, external_data_share_id=external_data_share_id)
176
186
 
187
+ # Folders
188
+ # Folders
189
+ # POST https://api.fabric.microsoft.com/v1/workspaces/{workspaceId}/folders
190
+ def create_folder(self, display_name, parent_folder_id = None):
191
+ """Create a folder
192
+ Args:
193
+ workspace_id (str): The ID of the workspace
194
+ display_name (str): The display name of the folder
195
+ parent_folder_id (str): The ID of the parent folder
196
+ Returns:
197
+ dict: The folder
198
+ """
199
+ return self.core_client.create_folder(workspace_id=self.id, display_name=display_name, parent_folder_id=parent_folder_id)
200
+
201
+ # DELETE https://api.fabric.microsoft.com/v1/workspaces/{workspaceId}/folders/{folderId}
202
+ def delete_folder(self, folder_id):
203
+ """Delete a folder
204
+ Args:
205
+ workspace_id (str): The ID of the workspace
206
+ folder_id (str): The ID of the folder
207
+ Returns:
208
+ int: The status code of the response
209
+ """
210
+ return self.core_client.delete_folder(workspace_id=self.id, folder_id=folder_id)
211
+
212
+ # GET https://api.fabric.microsoft.com/v1/workspaces/{workspaceId}/folders/{folderId}
213
+ def get_folder(self, folder_id):
214
+ """Get a folder
215
+ Args:
216
+ workspace_id (str): The ID of the workspace
217
+ folder_id (str): The ID of the folder
218
+ Returns:
219
+ dict: The folder
220
+ """
221
+ return self.core_client.get_folder(workspace_id=self.id, folder_id=folder_id)
222
+
223
+ # GET https://api.fabric.microsoft.com/v1/workspaces/{workspaceId}/folders
224
+ def list_folders(self):
225
+ """List folders in a workspace
226
+ Args:
227
+ workspace_id (str): The ID of the workspace
228
+ Returns:
229
+ list: A list of folders
230
+ """
231
+ return self.core_client.list_folders(workspace_id=self.id)
232
+
233
+ # POST https://api.fabric.microsoft.com/v1/workspaces/{workspaceId}/folders/{folderId}/move
234
+ def move_folder(self, folder_id, target_folder_id = None):
235
+ """Move a folder
236
+ Args:
237
+ workspace_id (str): The ID of the workspace
238
+ folder_id (str): The ID of the folder
239
+ target_folder_id (str): The ID of the target folder
240
+ Returns:
241
+ dict: The moved folder
242
+ """
243
+ return self.core_client.move_folder(workspace_id=self.id, folder_id=folder_id, target_folder_id=target_folder_id)
244
+
245
+ # PATCH https://api.fabric.microsoft.com/v1/workspaces/{workspaceId}/folders/{folderId}
246
+ def update_folder(self, folder_id, display_name = None):
247
+ """Update a folder
248
+ Args:
249
+ workspace_id (str): The ID of the workspace
250
+ folder_id (str): The ID of the folder
251
+ display_name (str): The new display name of the folder
252
+ Returns:
253
+ dict: The updated folder
254
+ """
255
+ return self.core_client.update_folder(workspace_id=self.id, folder_id=folder_id, display_name=display_name)
177
256
 
178
257
  # Item specific operations
179
258
 
@@ -344,6 +423,112 @@ class Workspace:
344
423
  def list_mirrored_warehouses(self):
345
424
  return self.core_client.list_mirrored_warehouses(workspace_id=self.id)
346
425
 
426
+ # copy jobs
427
+
428
+ def create_copy_job(self, display_name, definition = None, description = None):
429
+ """Create a copy job in a workspace
430
+ Args:
431
+ display_name (str): The display name of the copy job
432
+ definition (dict): The definition of the copy job
433
+ description (str): The description of the copy job
434
+ Returns:
435
+ dict: The created copy job
436
+ """
437
+ return self.core_client.create_copy_job(workspace_id=self.id,
438
+ display_name=display_name,
439
+ definition=definition,
440
+ description=description)
441
+
442
+ def delete_copy_job(self, copy_job_id):
443
+ """Delete a copy job from a workspace
444
+ Args:
445
+ copy_job_id (str): The ID of the copy job
446
+ Returns:
447
+ int: The status code of the response
448
+ """
449
+ return self.core_client.delete_copy_job(workspace_id=self.id, copy_job_id=copy_job_id)
450
+
451
+ def get_copy_job(self, copy_job_id = None, copy_job_name = None):
452
+ """Get a copy job from a workspace
453
+ Args:
454
+ copy_job_id (str): The ID of the copy job
455
+ copy_job_name (str): The name of the copy job
456
+ Returns:
457
+ CopyJob: The copy job object
458
+ """
459
+ from msfabricpysdkcore.otheritems import CopyJob
460
+
461
+ return self.core_client.get_copy_job(workspace_id=self.id, copy_job_id=copy_job_id, copy_job_name=copy_job_name)
462
+
463
+ def get_copy_job_definition(self, copy_job_id, format = None):
464
+ """Get the definition of an copy job
465
+ Args:
466
+ copy_job_id (str): The ID of the copy job
467
+ format (str): The format of the definition
468
+ Returns:
469
+ dict: The copy job definition
470
+ """
471
+ return self.core_client.get_copy_job_definition(workspace_id=self.id, copy_job_id=copy_job_id, format=format)
472
+
473
+ def list_copy_jobs(self, with_properties = False):
474
+ """List copy jobs in a workspace
475
+ Args:
476
+ with_properties (bool): Whether to include properties in the response
477
+ Returns:
478
+ list: The list of copy jobs
479
+ """
480
+ return self.core_client.list_copy_jobs(workspace_id=self.id, with_properties=with_properties)
481
+
482
+ def update_copy_job(self, copy_job_id, display_name = None, description = None):
483
+ """Update a copy job in a workspace
484
+ Args:
485
+ copy_job_id (str): The ID of the copy job
486
+ display_name (str): The display name of the copy job
487
+ description (str): The description of the copy job
488
+ Returns:
489
+ dict: The updated copy job
490
+ """
491
+ return self.core_client.update_copy_job(workspace_id=self.id, copy_job_id=copy_job_id,
492
+ display_name=display_name, description=description)
493
+
494
+
495
+ def update_copy_job_definition(self, copy_job_id, definition, update_metadata = None):
496
+ """Update the definition of a copy job in a workspace
497
+ Args:
498
+ copy_job_id (str): The ID of the copy job
499
+ definition (dict): The new definition of the copy job
500
+ update_metadata (bool): Whether to update the metadata
501
+ Returns:
502
+ dict: The updated copy job
503
+ """
504
+ return self.core_client.update_copy_job_definition(workspace_id=self.id, copy_job_id=copy_job_id,
505
+ definition=definition, update_metadata=update_metadata)
506
+
507
+ # dataflows
508
+ def create_dataflow(self, display_name, definition = None, description = None):
509
+ return self.core_client.create_dataflow(workspace_id=self.id, display_name=display_name,
510
+ definition=definition, description=description)
511
+
512
+ def delete_dataflow(self, dataflow_id):
513
+ return self.core_client.delete_dataflow(workspace_id=self.id, dataflow_id=dataflow_id)
514
+
515
+ def get_dataflow(self, dataflow_id = None, dataflow_name = None):
516
+ return self.core_client.get_dataflow(workspace_id=self.id, dataflow_id=dataflow_id, dataflow_name=dataflow_name)
517
+
518
+ def get_dataflow_definition(self, dataflow_id, format = None):
519
+ return self.core_client.get_dataflow_definition(workspace_id=self.id, dataflow_id=dataflow_id, format=format)
520
+
521
+ def list_dataflows(self, with_properties = False):
522
+ return self.core_client.list_dataflows(workspace_id=self.id, with_properties=with_properties)
523
+
524
+ def update_dataflow(self, dataflow_id, display_name = None, description = None):
525
+ return self.core_client.update_dataflow(workspace_id=self.id, dataflow_id=dataflow_id,
526
+ display_name=display_name, description=description)
527
+
528
+ def update_dataflow_definition(self, dataflow_id, definition, update_metadata = None):
529
+ return self.core_client.update_dataflow_definition(workspace_id=self.id, dataflow_id=dataflow_id,
530
+ definition=definition, update_metadata=update_metadata)
531
+
347
532
  # datapipelines
348
533
 
349
534
  def create_data_pipeline(self, display_name, definition = None, description = None):
@@ -357,6 +542,9 @@ class Workspace:
357
542
  return self.core_client.get_data_pipeline(workspace_id=self.id, data_pipeline_id=data_pipeline_id,
358
543
  data_pipeline_name=data_pipeline_name)
359
544
 
545
+ def get_data_pipeline_definition(self, data_pipeline_id, format = None):
546
+ return self.core_client.get_data_pipeline_definition(workspace_id=self.id, data_pipeline_id=data_pipeline_id, format=format)
547
+
360
548
  def delete_data_pipeline(self, data_pipeline_id):
361
549
  return self.core_client.delete_data_pipeline(workspace_id=self.id, data_pipeline_id=data_pipeline_id)
362
550
 
@@ -364,6 +552,10 @@ class Workspace:
364
552
  return self.core_client.update_data_pipeline(workspace_id=self.id, data_pipeline_id=data_pipeline_id,
365
553
  display_name=display_name, description=description)
366
554
 
555
+ def update_data_pipeline_definition(self, data_pipeline_id, definition, update_metadata = None):
556
+ return self.core_client.update_data_pipeline_definition(workspace_id=self.id, data_pipeline_id=data_pipeline_id,
557
+ definition=definition, update_metadata=update_metadata)
558
+
367
559
  # environments
368
560
 
369
561
  def list_environments(self, with_properties = False):
@@ -492,6 +684,60 @@ class Workspace:
492
684
  return self.core_client.update_eventstream_definition(workspace_id=self.id, eventstream_id=eventstream_id,
493
685
  definition=definition, update_metadata=update_metadata)
494
686
 
687
+ # eventstream topology
688
+ def get_eventstream_destination(self, eventstream_id, destination_id):
689
+ """Get the destination of an eventstream in a workspace"""
690
+ return self.core_client.get_eventstream_destination(workspace_id=self.id, eventstream_id=eventstream_id, destination_id=destination_id)
691
+
692
+ def get_eventstream_destination_connection(self, eventstream_id, destination_id):
693
+ """Get the connection of a destination in an eventstream in a workspace"""
694
+ return self.core_client.get_eventstream_destination_connection(workspace_id=self.id, eventstream_id=eventstream_id,
695
+ destination_id=destination_id)
696
+
697
+ def get_eventstream_source(self, eventstream_id, source_id):
698
+ """Get the source of an eventstream in a workspace"""
699
+ return self.core_client.get_eventstream_source(workspace_id=self.id, eventstream_id=eventstream_id, source_id=source_id)
700
+
701
+ def get_eventstream_source_connection(self, eventstream_id, source_id):
702
+ """Get the connection of a source in an eventstream in a workspace"""
703
+ return self.core_client.get_eventstream_source_connection(workspace_id=self.id, eventstream_id=eventstream_id,
704
+ source_id=source_id)
705
+
706
+ def get_eventstream_topology(self, eventstream_id):
707
+ """Get the topology of an eventstream in a workspace"""
708
+ return self.core_client.get_eventstream_topology(workspace_id=self.id, eventstream_id=eventstream_id)
709
+
710
+ def pause_eventstream(self, eventstream_id):
711
+ """Pause an eventstream in a workspace"""
712
+ return self.core_client.pause_eventstream(workspace_id=self.id, eventstream_id=eventstream_id)
713
+
714
+ def pause_eventstream_destination(self, eventstream_id, destination_id):
715
+ """Pause a destination in an eventstream in a workspace"""
716
+ return self.core_client.pause_eventstream_destination(workspace_id=self.id, eventstream_id=eventstream_id,
717
+ destination_id=destination_id)
718
+
719
+ def pause_eventstream_source(self, eventstream_id, source_id):
720
+ """Pause a source in an eventstream in a workspace"""
721
+ return self.core_client.pause_eventstream_source(workspace_id=self.id, eventstream_id=eventstream_id,
722
+ source_id=source_id)
723
+
724
+ def resume_eventstream(self, eventstream_id, start_type, custom_start_date_time = None):
725
+ """Resume an eventstream in a workspace"""
726
+ return self.core_client.resume_eventstream(workspace_id=self.id, eventstream_id=eventstream_id, start_type=start_type,
727
+ custom_start_date_time=custom_start_date_time)
728
+
729
+ def resume_eventstream_destination(self, eventstream_id, destination_id, start_type, custom_start_date_time = None):
730
+ """Resume a destination in an eventstream in a workspace"""
731
+ return self.core_client.resume_eventstream_destination(workspace_id=self.id, eventstream_id=eventstream_id,
732
+ destination_id=destination_id, start_type=start_type,
733
+ custom_start_date_time=custom_start_date_time)
734
+
735
+ def resume_eventstream_source(self, eventstream_id, source_id, start_type, custom_start_date_time = None):
736
+ """Resume a source in an eventstream in a workspace"""
737
+ return self.core_client.resume_eventstream_source(workspace_id=self.id, eventstream_id=eventstream_id,
738
+ source_id=source_id, start_type=start_type,
739
+ custom_start_date_time=custom_start_date_time)
740
+
495
741
  # graphQLapis
496
742
 
497
743
  def create_graphql_api(self, display_name, description = None):
@@ -657,6 +903,14 @@ class Workspace:
657
903
  file_extension=file_extension, format_options=format_options,
658
904
  mode=mode, recursive=recursive, wait_for_completion=wait_for_completion)
659
905
 
906
+ def list_lakehouse_livy_sessions(self, lakehouse_id):
907
+ """List lakehouse livy sessions in a workspace"""
908
+ return self.core_client.list_lakehouse_livy_sessions(workspace_id=self.id, lakehouse_id=lakehouse_id)
909
+
910
+ def get_lakehouse_livy_session(self, lakehouse_id, livy_id):
911
+ """Get a lakehouse livy session from a workspace"""
912
+ return self.core_client.get_lakehouse_livy_session(workspace_id=self.id, lakehouse_id=lakehouse_id, livy_id=livy_id)
913
+
660
914
  # mirroredDatabases
661
915
 
662
916
  def create_mirrored_database(self, display_name, description = None, definition = None):
@@ -806,6 +1060,14 @@ class Workspace:
806
1060
  """Update the definition of a notebook in a workspace"""
807
1061
  return self.core_client.update_notebook_definition(workspace_id=self.id, notebook_id=notebook_id, definition=definition)
808
1062
 
1063
+ def list_notebook_livy_sessions(self, notebook_id):
1064
+ """List notebook livy sessions in a workspace"""
1065
+ return self.core_client.list_notebook_livy_sessions(workspace_id=self.id, notebook_id=notebook_id)
1066
+
1067
+ def get_notebook_livy_session(self, notebook_id, livy_id):
1068
+ """Get a notebook livy session from a workspace"""
1069
+ return self.core_client.get_notebook_livy_session(workspace_id=self.id, notebook_id=notebook_id, livy_id=livy_id)
1070
+
809
1071
  # paginated reports
810
1072
 
811
1073
  def list_paginated_reports(self):
@@ -910,6 +1172,11 @@ class Workspace:
910
1172
  """Update the definition of a semantic model in a workspace"""
911
1173
  return self.core_client.update_semantic_model_definition(workspace_id=self.id, semantic_model_id=semantic_model_id, definition=definition)
912
1174
 
1175
+ # livy sessions
1176
+ def list_livy_sessions(self):
1177
+ """List livy sessions in a workspace"""
1178
+ return self.core_client.list_livy_sessions(workspace_id=self.id)
1179
+
913
1180
  # spark workspace custom pools
914
1181
 
915
1182
  def list_workspace_custom_pools(self):
@@ -985,6 +1252,14 @@ class Workspace:
985
1252
  """Run on demand spark job definition"""
986
1253
  return self.core_client.run_on_demand_spark_job_definition(workspace_id=self.id, spark_job_definition_id=spark_job_definition_id, job_type=job_type)
987
1254
 
1255
+ def list_spark_job_definition_livy_sessions(self, spark_job_definition_id):
1256
+ """List spark job definition livy sessions in a workspace"""
1257
+ return self.core_client.list_spark_job_definition_livy_sessions(workspace_id=self.id, spark_job_definition_id=spark_job_definition_id)
1258
+
1259
+ def get_spark_job_definition_livy_session(self, spark_job_definition_id, livy_id):
1260
+ """Get a livy session for a spark job definition from a workspace"""
1261
+ 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)
1262
+
988
1263
  # sql databases
989
1264
 
990
1265
  def create_sql_database(self, display_name, description = None):
@@ -1029,3 +1304,82 @@ class Workspace:
1029
1304
  def update_warehouse(self, warehouse_id, display_name = None, description = None):
1030
1305
  """Update a warehouse in a workspace"""
1031
1306
  return self.core_client.update_warehouse(workspace_id=self.id, warehouse_id=warehouse_id, display_name=display_name, description=description)
1307
+
1308
+ # variable libraries
1309
+
1310
+ def create_variable_library(self, display_name, definition = None, description = None):
1311
+ """Create a variable library in a workspace
1312
+ Args:
1313
+ display_name (str): The display name of the variable library
1314
+ definition (dict): The definition of the variable library
1315
+ description (str): The description of the variable library
1316
+ Returns:
1317
+ VariableLibrary: The created variable library
1318
+ """
1319
+ return self.core_client.create_variable_library(workspace_id=self.id,
1320
+ display_name=display_name,
1321
+ definition=definition,
1322
+ description=description)
1323
+
1324
+ def delete_variable_library(self, variable_library_id):
1325
+ """Delete a variable library from a workspace
1326
+ Args:
1327
+ variable_library_id (str): The ID of the variable library
1328
+ Returns:
1329
+ int: The status code of the response
1330
+ """
1331
+ return self.core_client.delete_variable_library(workspace_id=self.id, variable_library_id=variable_library_id)
1332
+
1333
+ def get_variable_library(self, variable_library_id = None, variable_library_name = None):
1334
+ """Get a variable library from a workspace
1335
+ Args:
1336
+ variable_library_id (str): The ID of the variable library
1337
+ variable_library_name (str): The name of the variable library
1338
+ Returns:
1339
+ VariableLibrary: The variable library object
1340
+ """
1341
+ return self.core_client.get_variable_library(workspace_id=self.id, variable_library_id=variable_library_id, variable_library_name=variable_library_name)
1342
+
1343
+ def get_variable_library_definition(self, variable_library_id, format = None):
1344
+ """Get the definition of a variable library
1345
+ Args:
1346
+ variable_library_id (str): The ID of the variable library
1347
+ format (str): The format of the definition
1348
+ Returns:
1349
+ dict: The variable library definition
1350
+ """
1351
+ return self.core_client.get_variable_library_definition(workspace_id=self.id, variable_library_id=variable_library_id, format=format)
1352
+
1353
+ def list_variable_libraries(self, with_properties = False):
1354
+ """List variable libraries in a workspace
1355
+ Args:
1356
+ with_properties (bool): Whether to include properties in the response
1357
+ Returns:
1358
+ list: The list of variable libraries
1359
+ """
1360
+ return self.core_client.list_variable_libraries(workspace_id=self.id, with_properties=with_properties)
1361
+
1362
+ def update_variable_library(self, variable_library_id, display_name = None, description = None, return_item = False):
1363
+ """Update a variable library in a workspace
1364
+ Args:
1365
+ variable_library_id (str): The ID of the variable library
1366
+ display_name (str): The display name of the variable library
1367
+ description (str): The description of the variable library
1368
+ return_item (bool): Whether to return the updated item
1369
+ Returns:
1370
+ dict: The updated variable library or VariableLibrary object if return_item is True
1371
+ """
1372
+ return self.core_client.update_variable_library(workspace_id=self.id, variable_library_id=variable_library_id,
1373
+ display_name=display_name, description=description, return_item=return_item)
1374
+
1375
+ def update_variable_library_definition(self, variable_library_id, definition, update_metadata = None):
1376
+ """Update the definition of a variable library in a workspace
1377
+ Args:
1378
+ variable_library_id (str): The ID of the variable library
1379
+ definition (dict): The new definition of the variable library
1380
+ update_metadata (bool): Whether to update the metadata
1381
+ Returns:
1382
+ dict: The updated variable library definition
1383
+ """
1384
+ return self.core_client.update_variable_library_definition(workspace_id=self.id, variable_library_id=variable_library_id,
1385
+ definition=definition, update_metadata=update_metadata)