msfabricpysdkcore 0.1.7__py3-none-any.whl → 0.2.1__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: msfabricpysdkcore
3
- Version: 0.1.7
3
+ Version: 0.2.1
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
@@ -10,9 +10,9 @@ Classifier: Operating System :: OS Independent
10
10
  Requires-Python: >=3.10
11
11
  Description-Content-Type: text/markdown
12
12
  License-File: LICENSE
13
- Requires-Dist: requests >=2.30.0
14
- Requires-Dist: azure-identity >=1.15.0
15
- Requires-Dist: msal >=1.28.0
13
+ Requires-Dist: requests>=2.30.0
14
+ Requires-Dist: azure-identity>=1.15.0
15
+ Requires-Dist: msal>=1.28.0
16
16
 
17
17
  # Python SDK for Microsoft Fabric
18
18
 
@@ -43,11 +43,14 @@ See the latest release notes [here](releasenotes/release_notes.md).
43
43
  Currently it supports all Core APIs, Admin APIs, all item specific CRUD APIs and Azure Resource Management APIs for Fabric capacities, i.e.:
44
44
  - Core APIs
45
45
  - [Capacities](#working-with-capacities)
46
+ - [Connections](#connections)
46
47
  - [Deployment Pipelines](#deployment-pipelines)
47
48
  - [External Data Shares](#external-data-shares)
49
+ - [Gateways](#gateways)
48
50
  - [Git](#working-with-git)
49
51
  - [Items](#working-with-items)
50
52
  - [Job Scheduler](#working-with-job-scheduler)
53
+ - [Managed Private Endpoints](#managed-private-endpoints)
51
54
  - [Long Running Operations](#long-running-operations)
52
55
  - [OneLakeDataAccessSecurity](#one-lake-data-access-security)
53
56
  - [OneLakeShortcuts](#working-with-one-lake-shortcuts)
@@ -225,6 +228,86 @@ ws.unassign_from_capacity()
225
228
 
226
229
  # List capacities
227
230
  fc.list_capacities()
231
+ ```
232
+ ### Connections
233
+
234
+ ```python
235
+
236
+ # Add connection role assignment
237
+ principal = {"id" : "755f273c-98f8-408c-a886-691794938bd8",
238
+ "type" : "ServicePrincipal"}
239
+
240
+ add_role_assi = fc.add_connection_role_assignment(connection_id="id", principal=principal, role='User')
241
+
242
+ # Create Connection
243
+ display_name = "ContosoCloudConnection" + datetime_str
244
+
245
+ cr = {"connectivityType": "ShareableCloud",
246
+ "displayName": display_name,
247
+ "connectionDetails": {
248
+ 'type': "SQL",
249
+ 'creationMethod': 'SQL',
250
+ "parameters": [
251
+ {
252
+ "dataType": "Text",
253
+ "name": "server",
254
+ "value": "server_name.database.windows.net"
255
+ },
256
+ {
257
+ "dataType": "Text",
258
+ "name": "database",
259
+ "value": "database_name"
260
+ }
261
+ ]},
262
+ 'privacyLevel': 'Organizational',
263
+ 'credentialDetails': {'credentials':{'credentialType': 'Basic',
264
+ 'userName': 'supercoolusername',
265
+ 'password': 'StrongPassword123!'},
266
+ 'singleSignOnType': 'None',
267
+ 'connectionEncryption': 'NotEncrypted',
268
+ 'skipTestConnection': False}
269
+ }
270
+
271
+ connection = fc.create_connection(connection_request=cr)
272
+
273
+ # Delete connection
274
+ status_code = fc.delete_connection(connection_id="id")
275
+
276
+ # Delete connection role assignment
277
+ status_code = fc.delete_connection_role_assignment(connection_id="id",
278
+ connection_role_assignment_id="role_assi_id")
279
+
280
+ # Get Connection
281
+ connection2 = fc.get_connection(connection_name="display_name")
282
+
283
+ # Get connection role assignment
284
+ role_assi = fc.get_connection_role_assignment(connection_id="id",
285
+ connection_role_assignment_id="role_assi_id")
286
+
287
+ # List connection role assignments
288
+ role_assis = fc.list_connection_role_assignments(connection_id="id")
289
+
290
+ # List Connections
291
+ connections = fc.list_connections()
292
+
293
+ # List supported connection types
294
+ supported_methods = fc.list_supported_connection_types(gateway_id='gw_id',
295
+ show_all_creation_methods=True)
296
+
297
+ # Update connection
298
+ cr = {
299
+ "connectivityType": "ShareableCloud",
300
+ "displayName": f"sqlserver{datetime_str}"
301
+ }
302
+
303
+ updated_connection = fc.update_connection(connection_id="id", connection_request=cr)
304
+
305
+ # Update connection role assignment
306
+ role_assi = fc.update_connection_role_assignment(connection_id="id",
307
+ connection_role_assignment_id="role_assi_id",
308
+ role='UserWithReshare')
309
+
310
+
228
311
  ```
229
312
 
230
313
  ### Deployment Pipelines
@@ -318,12 +401,18 @@ item = fc.get_item(workspace_id="workspace_id", item_id="item_id")
318
401
  # or
319
402
  item = ws.get_item(item_id="item_id")
320
403
 
404
+ # Get item definition
405
+ response = fc.get_item_definition(workspace_id="123123", item_id="123123", type = "Notebook")
321
406
 
322
407
  # List items
323
408
  item_list = fc.list_items(workspace_id="workspace_id")
324
409
  # or
325
410
  item_list = ws.list_items()
326
411
 
412
+ # List item connections
413
+ connections = fc.list_item_connections(workspace_id = '6a3',
414
+ item_id = '1bcc876')
415
+
327
416
 
328
417
  # Update an item
329
418
  fc.update_item(workspace_id="workspace_id", item_id="item_id" display_name="new_item_name", description = None, return_item=True)
@@ -332,6 +421,9 @@ ws.update_item(item_id="item_id", display_name="new_item_name", description = No
332
421
  # or
333
422
  item.update(display_name="new_item_name", description = None, return_item=True)
334
423
 
424
+ # Update item definition
425
+ response = fc.update_item_definition(workspace_id="dasf",
426
+ item_id="fsdsd", definition=definition)
335
427
 
336
428
  # Delete an item
337
429
  fc.delete_item(workspace_id="workspace_id", item_id="item_id")
@@ -342,6 +434,70 @@ item.delete()
342
434
 
343
435
  ```
344
436
 
437
+ ### Gateways
438
+
439
+ ```python
440
+
441
+ # Add gateway role assignment
442
+ principal = {"id" : "75dsbd8",
443
+ "type" : "ServicePrincipal"}
444
+ new_ras = fc.add_gateway_role_assignment(gateway_id="gw['id']", principal=principal, role='ConnectionCreator')
445
+
446
+ # Create a gateway
447
+ display_name = 'fabricvnet-123123' + datetime_str
448
+ gwr = {'displayName': display_name,
449
+ 'capacityId': '33saf79',
450
+ 'virtualNetworkAzureResource': {'virtualNetworkName': 'fabricvnet',
451
+ 'subnetName': 'default3',
452
+ 'resourceGroupName': 'fabricdemo',
453
+ 'subscriptionId': 'cfgf8'},
454
+ 'inactivityMinutesBeforeSleep': 30,
455
+ 'numberOfMemberGateways': 2,
456
+ 'type': 'VirtualNetwork'}
457
+
458
+ gw = fc.create_gateway(gateway_request=gwr)
459
+
460
+ # Delete gateway
461
+ resp_code = fc.delete_gateway(gateway_id= "gateway_id")
462
+
463
+ # Delete gateway role assignment
464
+ resp_code = fc.delete_gateway_role_assignment(gateway_id=gw['id'], gateway_role_assignment_id=new_ras['id'])
465
+
466
+ # Get gateway
467
+ gw_ = fc.get_gateway(gateway_id=gw["id"])
468
+
469
+ # Get gateway role assignment
470
+ new_ras_ = fc.get_gateway_role_assignment(gateway_id=gw['id'], gateway_role_assignment_id=new_ras['id'])
471
+
472
+ # List gateway members
473
+ gw_members = fc.list_gateway_members(gateway_id="gw_id")
474
+
475
+ # List gateway role assignments
476
+ ras = fc.list_gateway_role_assignments(gateway_id=gw['id'])
477
+
478
+ # list gateways
479
+ gateways = fc.list_gateways()
480
+
481
+ # Update gateway
482
+ gwr = {
483
+ "type": "OnPremises",
484
+ "displayName": "new_name",
485
+ "loadBalancingSetting": "Failover",
486
+ "allowCloudConnectionRefresh": False,
487
+ "allowCustomConnectors": False
488
+ }
489
+
490
+ gw_ = fc.update_gateway(gateway_id="gateway_id", gateway_request="gwr")
491
+
492
+ # Update gateway member
493
+ gw_member = fc.update_gateway_member(gateway_id = "gw_id", gateway_member_id = "gateway_member_id",
494
+ display_name="display_name_member", enabled=True)
495
+
496
+ # Update gateway role assignment
497
+ new_ras = fc.update_gateway_role_assignment(gateway_id= gw['id'], gateway_role_assignment_id=new_ras['id'], role='Admin')
498
+
499
+ ```
500
+
345
501
  ### Working with Git
346
502
 
347
503
  ```python
@@ -380,6 +536,11 @@ fc.git_get_status(workspace_id="workspaceid")
380
536
  # or
381
537
  ws.git_get_status()
382
538
 
539
+ # Get my credentials
540
+ git_credentials = fc.get_my_git_credentials(workspace_id="123123")
541
+
542
+ # Update my credentials
543
+ fc.update_my_git_credentials(workspace_id = "1232", git_credentials={"source": "Automatic"})
383
544
 
384
545
  # Update from git
385
546
  fc.update_from_git(workspace_id="workspaceid", remote_commit_hash="commit_hash",
@@ -455,6 +616,21 @@ ws.delete_shortcut(item_id="item_id",
455
616
  item.delete_shortcut(path="path",
456
617
  name="name")
457
618
 
619
+ # List shortcuts of an item
620
+
621
+ fc.list_shortcuts(workspace_id="workspace_id",
622
+ item_id="item_id",
623
+ # optional parent_path="Tables"
624
+ )
625
+
626
+ # or
627
+ ws.list_shortcuts(item_id="item_id",
628
+ # optional parent_path="Tables"
629
+ )
630
+
631
+ # or
632
+ item.list_shortcuts(parent_path="Tables")
633
+
458
634
  ```
459
635
 
460
636
 
@@ -470,7 +646,7 @@ ws.run_on_demand_item_job(item_id="item_id", job_type="RunNotebook", execution_d
470
646
  item.run_on_demand_item_job(job_type="RunNotebook", execution_data = None)
471
647
 
472
648
  # Other job types are e.g.:
473
- jobType=Pipeline
649
+ jobType="Pipeline"
474
650
 
475
651
 
476
652
  # Get an item job instance
@@ -487,6 +663,34 @@ ws.cancel_item_job_instance(item_id="item_id", job_instance_id="job_instance_id"
487
663
  # or
488
664
  item.cancel_item_job_instance(job_instance_id="job_instance_id")
489
665
 
666
+ # List item job instances
667
+ job_instances = fc.list_item_job_instances(workspace_id="workspace_id",
668
+ item_id="item_id")
669
+
670
+ # Create item schedule
671
+ configuration = {'type': 'Daily',
672
+ 'startDateTime': '2024-11-21T00:00:00',
673
+ 'endDateTime': '2028-11-08T23:59:00',
674
+ 'localTimeZoneId': 'Romance Standard Time',
675
+ 'times': ['15:39']}
676
+
677
+ schedule = fc.create_item_schedule(workspace_id="1232", item_id="1232", job_type="sparkjob", configuration=configuration, enabled=True)
678
+
679
+ # Delete item schedule
680
+ fc.delete_item_schedule(workspace_id="1232", item_id="1232", schedule_id="schedule_id", job_type="sparkjob")
681
+
682
+ # Get item schedule
683
+ schedule_check = fc.get_item_schedule(workspace_id="1232", item_id="1232",
684
+ schedule_id="schedule_id", job_type="sparkjob")
685
+
686
+ # Update item schedule
687
+ schedule_new = fc.update_item_schedule(workspace_id="1232", item_id="1232",
688
+ schedule_id="schedule_id", job_type="sparkjob", configuration=configuration, enabled=False)
689
+
690
+ # List item schedules
691
+ list_schedules = fc.list_item_schedules(workspace_id="1232", item_id="1232", job_type="sparkjob")
692
+
693
+
490
694
  ```
491
695
 
492
696
 
@@ -506,6 +710,32 @@ results = fc.get_operation_results(operation_id)
506
710
 
507
711
  ```
508
712
 
713
+ ### Managed Private Endpoints
714
+
715
+ ```python
716
+ from msfabricpysdkcore import FabricClientCore
717
+
718
+ fc = FabricClientCore()
719
+
720
+ # Create a workspace managed private endpoint
721
+ mpe = fc.create_workspace_managed_private_endpoint(workspace_id='535fb',
722
+ name = 'testmpe',
723
+ target_private_link_resource_id = '/subscriptions/c78/resourceGroups/fabricdemo/providers/Microsoft.Storage/storageAccounts/pu39',
724
+ target_subresource_type = 'dfs',
725
+ request_message = 'testmessage')
726
+
727
+ # Delete workspace managed private endpoint
728
+ status_code = fc.delete_workspace_managed_private_endpoint(workspace_id='53b',
729
+ managed_private_endpoint_id="mpeid")
730
+
731
+ # Get workspace managed private endpoint
732
+ mpe2 = fc.get_workspace_managed_private_endpoint(workspace_id='5355fb',
733
+ managed_private_endpoint_id="mpeid")
734
+
735
+ # List workspace managed private endpoints
736
+ mpes = fc.list_workspace_managed_private_endpoints(workspace_id='53b')
737
+ ```
738
+
509
739
  ### One Lake Data Access Security
510
740
 
511
741
  ```python
@@ -552,18 +782,22 @@ from msfabricpysdkcore import FabricClientAdmin
552
782
 
553
783
  fca = FabricClientAdmin()
554
784
 
555
-
556
- # List workspaces
557
- ws = fca.list_workspaces(name="testworkspace")[0]
558
-
559
785
  # Get workspace
560
786
  ws = fca.get_workspace(workspace_id="workspace_id")
561
787
 
562
- # Get workspace access details
788
+ # List git connectsions
789
+ git_connections = fca.discover_git_connections()
563
790
 
791
+ # List workspace access details
564
792
  ws_access = fca.list_workspace_access_details("workspace_id")
565
- # or
566
- ws_access = ws.list_access_details()
793
+
794
+ # List workspaces
795
+ ws = fca.list_workspaces(name="testworkspace")[0]
796
+
797
+ # Restore workspace
798
+ fca.restore_workspace(workspace_id = "213123",
799
+ new_workspace_admin_principal={"id": "081adiaj3", "type":"User"},
800
+ new_workspace_name = "Contoso Workspace")
567
801
  ```
568
802
 
569
803
  ### Admin API for Users
@@ -1,28 +1,28 @@
1
1
  msfabricpysdkcore/__init__.py,sha256=ObRW5Q8IMqrvA6VH6zXSv3n01AzRCGjn5RojJXAR6VE,208
2
2
  msfabricpysdkcore/admin_item.py,sha256=9L09Kb7kn7JW0bqVu1qPOMT6oHLduX4Q5_qhVJZTLxQ,3290
3
3
  msfabricpysdkcore/admin_workspace.py,sha256=umNnIF8sf5Y8BDgfQdfG6sOZrQQc7RJINL9j8DPnm3c,3180
4
- msfabricpysdkcore/adminapi.py,sha256=90OcFVXYhv6wf3bQCwspbw-NRxVugrgACkyru-h79MU,26188
4
+ msfabricpysdkcore/adminapi.py,sha256=usvPhIecOSCLvkJJ0Q5_4XUWenJGFoxb2EpF6ooDPNI,27245
5
5
  msfabricpysdkcore/auth.py,sha256=Y9YUDqoArvkD7rLnbQvNBnCXqHJtw6PDRUHMx0CVMT0,4330
6
6
  msfabricpysdkcore/capacity.py,sha256=Q_2-XrZtdf9F67fY0qU3D0ocEOGQq4KtIXAv9dXjQhI,1761
7
7
  msfabricpysdkcore/client.py,sha256=KpHREbfzQRRighyJzyES3COZP3raK0C1-WhxGd07LHU,7890
8
- msfabricpysdkcore/coreapi.py,sha256=6d4sB36Ib-SJzo_qTOvBWKaEJd2ofqmMYWJUGiQsv0Q,132298
8
+ msfabricpysdkcore/coreapi.py,sha256=yRat_IA3kGBdpP0uaRhjfEZ25aAcxHLVY6b7gvoHCFg,177345
9
9
  msfabricpysdkcore/deployment_pipeline.py,sha256=2d7BqRPgfBiAlQOP4UfYLmFMM8xonSjPkJKhevIKGEY,5756
10
10
  msfabricpysdkcore/domain.py,sha256=92IVvZ3jXHIT1a0zlTPD7uoQX6TcBBE_Y_b4dScxHSU,6949
11
11
  msfabricpysdkcore/environment.py,sha256=4k2Le1mAQIrfcpNc3n1DbgdCzAldGTSTCbiDQGk0DlA,2784
12
12
  msfabricpysdkcore/fabric_azure_capacity.py,sha256=7JxMp9weiKG_mDjlRK-88oIXr0kdG0pzv-Ouycf3fus,2808
13
13
  msfabricpysdkcore/fabric_azure_client.py,sha256=I7Z0Y8Xy_esQcPaXgPL7EAkQmoQkAklJO4hxk_90dno,10722
14
- msfabricpysdkcore/item.py,sha256=3ixgRDTmrKXw82xl1MkaaOQ2986s2_DFEJQeUkKPcEU,6376
15
- msfabricpysdkcore/job_instance.py,sha256=HXSUVoE4XaG2Ic5RYZ1Mx3ymiIarHDAnyjaXXY4Aj74,2381
14
+ msfabricpysdkcore/item.py,sha256=xMbIdITQ8Ii1-8hnvR7M4mUXPpCmsUL2tlKBxT-wEsE,8900
15
+ msfabricpysdkcore/job_instance.py,sha256=rtZp-OpuzfdMiQyuQLum38lgcfSZJTr3s9sECZglcWg,2389
16
16
  msfabricpysdkcore/lakehouse.py,sha256=yIrzatWM9emPn-Y54Cg_ZdAydIWjxrpK65jIQ4SClgE,1703
17
17
  msfabricpysdkcore/long_running_operation.py,sha256=XTlsueSZKVFICxhx99geEQ6btZFlFb8-lssigmQ9c6Y,2133
18
18
  msfabricpysdkcore/onelakeshortcut.py,sha256=H02wR6Z86qTEJOwVRMKz1Ou3K88Y9pfJa91vizjprvo,1661
19
- msfabricpysdkcore/otheritems.py,sha256=rkIbF-LxUUZh0ZDqFiWeutMeIsBXw_R8UUCglIifWBQ,12024
19
+ msfabricpysdkcore/otheritems.py,sha256=6Gqx2w7VWRq6G7qOCkmhmUha5f52WZQ3jPA5A0HzwZc,15355
20
20
  msfabricpysdkcore/spark_custom_pool.py,sha256=YsEULaQG-FO507aPIb-4kk93ZWBmDZj6fbOEHYoyxHE,3188
21
- msfabricpysdkcore/workspace.py,sha256=7ZOt8ovlUOfusQ-avl4OOgMueN1XAp7AXdfpzAhXh3s,40428
21
+ msfabricpysdkcore/workspace.py,sha256=oiZADyl5VTRKtIGivcBU0kWUTVYKJEyHvrYauVEjbRU,49965
22
22
  msfabricpysdkcore/util/__init__.py,sha256=p-1dC4AurfKdIUppNVlRCIcmwHBTURqfgIwxcie3fEA,50
23
23
  msfabricpysdkcore/util/logger.py,sha256=XXdeaqI-BhXZgacChKrWP88TPU4FTWvS8L0YWjCT54A,1166
24
- msfabricpysdkcore-0.1.7.dist-info/LICENSE,sha256=1NrGuF-zOmzbwzk3iI6lsP9koyDeKO1B0-8OD_tTvOQ,1156
25
- msfabricpysdkcore-0.1.7.dist-info/METADATA,sha256=TgGknkrcwJMfUWsw6ouYoDgY3MAXpqDd70T4kHYMycA,23382
26
- msfabricpysdkcore-0.1.7.dist-info/WHEEL,sha256=cVxcB9AmuTcXqmwrtPhNK88dr7IR_b6qagTj0UvIEbY,91
27
- msfabricpysdkcore-0.1.7.dist-info/top_level.txt,sha256=3iRonu6ptDGQN4Yl6G76XGM7xbFNsskiEHW-P2gMQGY,18
28
- msfabricpysdkcore-0.1.7.dist-info/RECORD,,
24
+ msfabricpysdkcore-0.2.1.dist-info/LICENSE,sha256=1NrGuF-zOmzbwzk3iI6lsP9koyDeKO1B0-8OD_tTvOQ,1156
25
+ msfabricpysdkcore-0.2.1.dist-info/METADATA,sha256=WmhOfDyrAtkQSTxeN0QeEgqoQtR7lJAfQvxsiDpzZ5A,32114
26
+ msfabricpysdkcore-0.2.1.dist-info/WHEEL,sha256=PZUExdf71Ui_so67QXpySuHtCi3-J3wvF4ORK6k_S8U,91
27
+ msfabricpysdkcore-0.2.1.dist-info/top_level.txt,sha256=3iRonu6ptDGQN4Yl6G76XGM7xbFNsskiEHW-P2gMQGY,18
28
+ msfabricpysdkcore-0.2.1.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (74.1.2)
2
+ Generator: setuptools (75.6.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5