semantic-link-labs 0.9.1__py3-none-any.whl → 0.9.2__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of semantic-link-labs might be problematic. Click here for more details.
- {semantic_link_labs-0.9.1.dist-info → semantic_link_labs-0.9.2.dist-info}/METADATA +66 -8
- {semantic_link_labs-0.9.1.dist-info → semantic_link_labs-0.9.2.dist-info}/RECORD +82 -75
- sempy_labs/__init__.py +14 -12
- sempy_labs/_capacities.py +120 -142
- sempy_labs/_capacity_migration.py +61 -94
- sempy_labs/_clear_cache.py +9 -8
- sempy_labs/_connections.py +72 -105
- sempy_labs/_data_pipelines.py +47 -49
- sempy_labs/_dataflows.py +45 -51
- sempy_labs/_dax.py +228 -6
- sempy_labs/_delta_analyzer.py +303 -0
- sempy_labs/_deployment_pipelines.py +72 -66
- sempy_labs/_environments.py +39 -36
- sempy_labs/_eventhouses.py +35 -35
- sempy_labs/_eventstreams.py +38 -39
- sempy_labs/_external_data_shares.py +29 -42
- sempy_labs/_gateways.py +57 -101
- sempy_labs/_generate_semantic_model.py +22 -30
- sempy_labs/_git.py +46 -66
- sempy_labs/_graphQL.py +95 -0
- sempy_labs/_helper_functions.py +175 -30
- sempy_labs/_job_scheduler.py +47 -59
- sempy_labs/_kql_databases.py +27 -34
- sempy_labs/_kql_querysets.py +23 -30
- sempy_labs/_list_functions.py +262 -164
- sempy_labs/_managed_private_endpoints.py +52 -47
- sempy_labs/_mirrored_databases.py +110 -134
- sempy_labs/_mirrored_warehouses.py +13 -13
- sempy_labs/_ml_experiments.py +36 -36
- sempy_labs/_ml_models.py +37 -38
- sempy_labs/_model_dependencies.py +2 -0
- sempy_labs/_notebooks.py +28 -29
- sempy_labs/_one_lake_integration.py +2 -0
- sempy_labs/_query_scale_out.py +63 -81
- sempy_labs/_refresh_semantic_model.py +12 -14
- sempy_labs/_spark.py +54 -79
- sempy_labs/_sql.py +7 -11
- sempy_labs/_vertipaq.py +8 -3
- sempy_labs/_warehouses.py +30 -33
- sempy_labs/_workloads.py +15 -20
- sempy_labs/_workspace_identity.py +13 -17
- sempy_labs/_workspaces.py +49 -48
- sempy_labs/admin/__init__.py +2 -0
- sempy_labs/admin/_basic_functions.py +244 -281
- sempy_labs/admin/_domains.py +188 -103
- sempy_labs/admin/_external_data_share.py +26 -31
- sempy_labs/admin/_git.py +17 -22
- sempy_labs/admin/_items.py +34 -48
- sempy_labs/admin/_scanner.py +20 -13
- sempy_labs/directlake/_directlake_schema_compare.py +2 -0
- sempy_labs/directlake/_dl_helper.py +10 -11
- sempy_labs/directlake/_generate_shared_expression.py +4 -5
- sempy_labs/directlake/_get_directlake_lakehouse.py +1 -0
- sempy_labs/directlake/_list_directlake_model_calc_tables.py +1 -0
- sempy_labs/directlake/_show_unsupported_directlake_objects.py +2 -0
- sempy_labs/directlake/_warm_cache.py +2 -0
- sempy_labs/graph/__init__.py +33 -0
- sempy_labs/graph/_groups.py +402 -0
- sempy_labs/graph/_teams.py +113 -0
- sempy_labs/graph/_users.py +191 -0
- sempy_labs/lakehouse/__init__.py +4 -0
- sempy_labs/lakehouse/_get_lakehouse_columns.py +10 -10
- sempy_labs/lakehouse/_get_lakehouse_tables.py +14 -20
- sempy_labs/lakehouse/_lakehouse.py +101 -4
- sempy_labs/lakehouse/_shortcuts.py +42 -20
- sempy_labs/migration/__init__.py +4 -0
- sempy_labs/migration/_direct_lake_to_import.py +66 -0
- sempy_labs/migration/_migrate_calctables_to_lakehouse.py +1 -0
- sempy_labs/migration/_migrate_calctables_to_semantic_model.py +1 -0
- sempy_labs/migration/_migrate_model_objects_to_semantic_model.py +1 -0
- sempy_labs/migration/_migrate_tables_columns_to_semantic_model.py +2 -0
- sempy_labs/report/_download_report.py +8 -13
- sempy_labs/report/_generate_report.py +49 -46
- sempy_labs/report/_paginated.py +20 -26
- sempy_labs/report/_report_functions.py +50 -45
- sempy_labs/report/_report_list_functions.py +2 -0
- sempy_labs/report/_report_rebind.py +6 -10
- sempy_labs/report/_reportwrapper.py +187 -220
- sempy_labs/tom/_model.py +8 -5
- {semantic_link_labs-0.9.1.dist-info → semantic_link_labs-0.9.2.dist-info}/LICENSE +0 -0
- {semantic_link_labs-0.9.1.dist-info → semantic_link_labs-0.9.2.dist-info}/WHEEL +0 -0
- {semantic_link_labs-0.9.1.dist-info → semantic_link_labs-0.9.2.dist-info}/top_level.txt +0 -0
sempy_labs/_capacities.py
CHANGED
|
@@ -5,9 +5,17 @@ import sempy_labs._icons as icons
|
|
|
5
5
|
from sempy.fabric.exceptions import FabricHTTPException
|
|
6
6
|
import requests
|
|
7
7
|
import pandas as pd
|
|
8
|
-
from sempy_labs._authentication import
|
|
8
|
+
from sempy_labs._authentication import (
|
|
9
|
+
_get_headers,
|
|
10
|
+
ServicePrincipalTokenProvider,
|
|
11
|
+
)
|
|
9
12
|
from uuid import UUID
|
|
10
|
-
from sempy_labs._helper_functions import
|
|
13
|
+
from sempy_labs._helper_functions import (
|
|
14
|
+
_is_valid_uuid,
|
|
15
|
+
_update_dataframe_datatypes,
|
|
16
|
+
_base_api,
|
|
17
|
+
_create_dataframe,
|
|
18
|
+
)
|
|
11
19
|
import sempy_labs._authentication as auth
|
|
12
20
|
|
|
13
21
|
|
|
@@ -213,12 +221,13 @@ def create_fabric_capacity(
|
|
|
213
221
|
|
|
214
222
|
def list_vcores() -> pd.DataFrame:
|
|
215
223
|
|
|
216
|
-
|
|
224
|
+
columns = {
|
|
225
|
+
"Total Purchased Cores": "int",
|
|
226
|
+
"Available Cores": "int",
|
|
227
|
+
}
|
|
228
|
+
df = _create_dataframe(columns=columns)
|
|
217
229
|
|
|
218
|
-
|
|
219
|
-
response = client.get("capacities/vcores")
|
|
220
|
-
if response.status_code != 200:
|
|
221
|
-
FabricHTTPException(response)
|
|
230
|
+
response = _base_api(request="capacities/vcores")
|
|
222
231
|
response_json = response.json()
|
|
223
232
|
new_data = {
|
|
224
233
|
"Total Purchased Cores": response_json.get("totalPurchasedCores"),
|
|
@@ -226,8 +235,7 @@ def list_vcores() -> pd.DataFrame:
|
|
|
226
235
|
}
|
|
227
236
|
df = pd.concat([df, pd.DataFrame(new_data, index=[0])], ignore_index=True)
|
|
228
237
|
|
|
229
|
-
|
|
230
|
-
df[int_cols] = df[int_cols].astype(int)
|
|
238
|
+
_update_dataframe_datatypes(dataframe=df, column_map=columns)
|
|
231
239
|
|
|
232
240
|
return df
|
|
233
241
|
|
|
@@ -237,11 +245,8 @@ def get_capacity_resource_governance(capacity_name: str):
|
|
|
237
245
|
dfC = fabric.list_capacities()
|
|
238
246
|
dfC_filt = dfC[dfC["Display Name"] == capacity_name]
|
|
239
247
|
capacity_id = dfC_filt["Id"].iloc[0].upper()
|
|
240
|
-
client = fabric.PowerBIRestClient()
|
|
241
|
-
response = client.get(f"capacities/{capacity_id}/resourceGovernance")
|
|
242
248
|
|
|
243
|
-
|
|
244
|
-
FabricHTTPException(response)
|
|
249
|
+
response = _base_api(request=f"capacities/{capacity_id}/resourceGovernance")
|
|
245
250
|
|
|
246
251
|
return response.json()["workloadSettings"]
|
|
247
252
|
|
|
@@ -408,11 +413,7 @@ def delete_premium_capacity(capacity_name: str):
|
|
|
408
413
|
)
|
|
409
414
|
capacity_id = dfC_filt["Id"].iloc[0].upper()
|
|
410
415
|
|
|
411
|
-
|
|
412
|
-
response = client.delete(f"capacities/{capacity_id}")
|
|
413
|
-
|
|
414
|
-
if response.status_code != 204:
|
|
415
|
-
raise FabricHTTPException(response)
|
|
416
|
+
_base_api(request=f"capacities/{capacity_id}", method="delete", status_codes=204)
|
|
416
417
|
|
|
417
418
|
print(f"{icons.green_dot} The '{capacity_name}' capacity has been deleted.")
|
|
418
419
|
|
|
@@ -681,13 +682,15 @@ def list_skus_for_capacity(
|
|
|
681
682
|
A pandas dataframe showing a list of eligible SKUs for a Microsoft Fabric resource.
|
|
682
683
|
"""
|
|
683
684
|
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
685
|
+
columns = {
|
|
686
|
+
"Resource Type": "string",
|
|
687
|
+
"Sku": "string",
|
|
688
|
+
"Sku Tier": "string",
|
|
689
|
+
}
|
|
690
|
+
df = _create_dataframe(columns=columns)
|
|
687
691
|
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
raise FabricHTTPException(response)
|
|
692
|
+
url = f"https://management.azure.com/subscriptions/{azure_subscription_id}/resourceGroups/{resource_group}/providers/Microsoft.Fabric/capacities/{capacity}/skus?api-version=2023-11-01"
|
|
693
|
+
response = _base_api(request=url, client="azure")
|
|
691
694
|
|
|
692
695
|
for v in response.json().get("value", []):
|
|
693
696
|
sku = v.get("sku", {})
|
|
@@ -724,13 +727,14 @@ def list_skus(
|
|
|
724
727
|
A pandas dataframe showing a list of eligible SKUs for Microsoft Fabric resource provider.
|
|
725
728
|
"""
|
|
726
729
|
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
+
columns = {
|
|
731
|
+
"Sku": "string",
|
|
732
|
+
"Locations": "str",
|
|
733
|
+
}
|
|
734
|
+
df = _create_dataframe(columns=columns)
|
|
730
735
|
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
raise FabricHTTPException(response)
|
|
736
|
+
url = f"https://management.azure.com/subscriptions/{azure_subscription_id}/providers/Microsoft.Fabric/skus?api-version=2023-11-01"
|
|
737
|
+
response = _base_api(request=url, client="azure")
|
|
734
738
|
|
|
735
739
|
for v in response.json().get("value", []):
|
|
736
740
|
new_data = {
|
|
@@ -758,26 +762,22 @@ def list_subscriptions() -> pd.DataFrame:
|
|
|
758
762
|
A pandas dataframe showing a list of all subscriptions for a tenant.
|
|
759
763
|
"""
|
|
760
764
|
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
)
|
|
775
|
-
url = "https://management.azure.com/subscriptions?api-version=2022-12-01"
|
|
776
|
-
headers = _get_headers(token_provider=auth.token_provider.get(), audience="azure")
|
|
765
|
+
columns = {
|
|
766
|
+
"Subscription Id": "string",
|
|
767
|
+
"Subscription Name": "string",
|
|
768
|
+
"Tenant Id": "string",
|
|
769
|
+
"State": "string",
|
|
770
|
+
"Location Placement Id": "string",
|
|
771
|
+
"Quota Id": "string",
|
|
772
|
+
"Spending Limit": "string",
|
|
773
|
+
"Authorization Source": "string",
|
|
774
|
+
"Managed by Tenants": "string",
|
|
775
|
+
"Tags": "string",
|
|
776
|
+
}
|
|
777
|
+
df = _create_dataframe(columns=columns)
|
|
777
778
|
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
raise FabricHTTPException(response)
|
|
779
|
+
url = "https://management.azure.com/subscriptions?api-version=2022-12-01"
|
|
780
|
+
response = _base_api(request=url, client="azure")
|
|
781
781
|
|
|
782
782
|
for v in response.json().get("value", []):
|
|
783
783
|
policy = v.get("subscriptionPolicies", {})
|
|
@@ -820,27 +820,23 @@ def get_subscription(azure_subscription_id: str) -> pd.DataFrame:
|
|
|
820
820
|
A pandas dataframe showing details of a specific subscription.
|
|
821
821
|
"""
|
|
822
822
|
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
)
|
|
837
|
-
url = f"https://management.azure.com/subscriptions/{azure_subscription_id}?api-version=2022-12-01"
|
|
838
|
-
headers = _get_headers(token_provider=auth.token_provider.get(), audience="azure")
|
|
823
|
+
columns = {
|
|
824
|
+
"Subscription Id": "string",
|
|
825
|
+
"Subscription Name": "string",
|
|
826
|
+
"Tenant Id": "string",
|
|
827
|
+
"State": "string",
|
|
828
|
+
"Location Placement Id": "string",
|
|
829
|
+
"Quota Id": "string",
|
|
830
|
+
"Spending Limit": "string",
|
|
831
|
+
"Authorization Source": "string",
|
|
832
|
+
"Managed by Tenants": "string",
|
|
833
|
+
"Tags": "string",
|
|
834
|
+
}
|
|
835
|
+
df = _create_dataframe(columns=columns)
|
|
839
836
|
|
|
840
|
-
|
|
841
|
-
if response.status_code != 200:
|
|
842
|
-
raise FabricHTTPException(response)
|
|
837
|
+
url = f"https://management.azure.com/subscriptions/{azure_subscription_id}?api-version=2022-12-01"
|
|
843
838
|
|
|
839
|
+
response = _base_api(request=url, client="azure")
|
|
844
840
|
v = response.json()
|
|
845
841
|
policy = v.get("subscriptionPolicies", {})
|
|
846
842
|
tenants = v.get("managedByTenants")
|
|
@@ -898,24 +894,21 @@ def list_tenants() -> pd.DataFrame:
|
|
|
898
894
|
A pandas dataframe showing a list of all tenants for your account.
|
|
899
895
|
"""
|
|
900
896
|
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
897
|
+
columns = {
|
|
898
|
+
"Tenant Id": "string",
|
|
899
|
+
"Tenant Name": "string",
|
|
900
|
+
"Country Code": "string",
|
|
901
|
+
"Domains": "string",
|
|
902
|
+
"Tenant Category": "string",
|
|
903
|
+
"Default Domain": "string",
|
|
904
|
+
"Tenant Type": "string",
|
|
905
|
+
"Tenant Branding Logo Url": "string",
|
|
906
|
+
}
|
|
907
|
+
df = _create_dataframe(columns=columns)
|
|
908
|
+
|
|
913
909
|
url = "https://management.azure.com/tenants?api-version=2022-12-01"
|
|
914
|
-
headers = _get_headers(token_provider=auth.token_provider.get(), audience="azure")
|
|
915
910
|
|
|
916
|
-
response =
|
|
917
|
-
if response.status_code != 200:
|
|
918
|
-
raise FabricHTTPException(response)
|
|
911
|
+
response = _base_api(request=url, client="azure")
|
|
919
912
|
|
|
920
913
|
for v in response.json().get("value", []):
|
|
921
914
|
d = v.get("domains")
|
|
@@ -958,16 +951,19 @@ def create_or_update_resource_group(
|
|
|
958
951
|
The name of the region.
|
|
959
952
|
"""
|
|
960
953
|
|
|
961
|
-
headers = _get_headers(auth.token_provider.get(), audience="azure")
|
|
962
954
|
url = f"https://management.azure.com/subscriptions/{azure_subscription_id}/resourcegroups/{resource_group}?api-version=2021-04-01"
|
|
963
955
|
|
|
964
956
|
payload = {
|
|
965
957
|
"location": region,
|
|
966
958
|
}
|
|
967
959
|
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
960
|
+
_base_api(
|
|
961
|
+
request=url,
|
|
962
|
+
client="azure",
|
|
963
|
+
method="put",
|
|
964
|
+
payload=payload,
|
|
965
|
+
status_codes=[200, 201],
|
|
966
|
+
)
|
|
971
967
|
|
|
972
968
|
print(
|
|
973
969
|
f"{icons.green_dot} The '{resource_group}' resource group has been created/updated."
|
|
@@ -1000,7 +996,6 @@ def create_storage_account(
|
|
|
1000
996
|
The name of the region.
|
|
1001
997
|
"""
|
|
1002
998
|
|
|
1003
|
-
headers = _get_headers(auth.token_provider.get(), audience="azure")
|
|
1004
999
|
url = f"https://management.azure.com/subscriptions/{azure_subscription_id}/resourceGroups/{resource_group}/providers/Microsoft.Storage/storageAccounts/{storage_account}?api-version=2018-02-01"
|
|
1005
1000
|
|
|
1006
1001
|
payload = {
|
|
@@ -1009,10 +1004,7 @@ def create_storage_account(
|
|
|
1009
1004
|
"location": region,
|
|
1010
1005
|
}
|
|
1011
1006
|
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
if response.status_code != 200:
|
|
1015
|
-
raise FabricHTTPException(response)
|
|
1007
|
+
_base_api(request=url, client="azure", method="put", payload=payload)
|
|
1016
1008
|
|
|
1017
1009
|
print(
|
|
1018
1010
|
f"{icons.green_dot} The '{storage_account}' storage account has been created."
|
|
@@ -1044,8 +1036,6 @@ def list_storage_accounts(
|
|
|
1044
1036
|
A pandas dataframe showing a list of all storage accounts within the subscription (or resource group).
|
|
1045
1037
|
"""
|
|
1046
1038
|
|
|
1047
|
-
headers = _get_headers(auth.token_provider.get(), audience="azure")
|
|
1048
|
-
|
|
1049
1039
|
url = f"https://management.azure.com/subscriptions/{azure_subscription_id}"
|
|
1050
1040
|
|
|
1051
1041
|
if resource_group is not None:
|
|
@@ -1053,35 +1043,32 @@ def list_storage_accounts(
|
|
|
1053
1043
|
|
|
1054
1044
|
url += "/providers/Microsoft.Storage/storageAccounts?api-version=2023-05-01"
|
|
1055
1045
|
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
)
|
|
1081
|
-
response = requests.get(url, headers=headers)
|
|
1046
|
+
columns = {
|
|
1047
|
+
"Storage Account Id": "string",
|
|
1048
|
+
"Storage Account Name": "string",
|
|
1049
|
+
"Kind": "string",
|
|
1050
|
+
"Location": "string",
|
|
1051
|
+
"Sku Name": "string",
|
|
1052
|
+
"Sku Tier": "string",
|
|
1053
|
+
"Is HNS Enabled": "bool",
|
|
1054
|
+
"Creation Time": "datetime",
|
|
1055
|
+
"Web Endpoint": "string",
|
|
1056
|
+
"DFS Endpoint": "string",
|
|
1057
|
+
"Blob Endpoint": "string",
|
|
1058
|
+
"File Endpoint": "string",
|
|
1059
|
+
"Queue Endpoint": "string",
|
|
1060
|
+
"Table Endpoint": "string",
|
|
1061
|
+
"Primary Location": "string",
|
|
1062
|
+
"Provisioning State": "string",
|
|
1063
|
+
"Secondary Location": "string",
|
|
1064
|
+
"Status of Primary": "string",
|
|
1065
|
+
"Status of Secondary": "string",
|
|
1066
|
+
"Supports HTTPS Traffic Only": "bool",
|
|
1067
|
+
"Tags": "string",
|
|
1068
|
+
}
|
|
1069
|
+
df = _create_dataframe(columns=columns)
|
|
1082
1070
|
|
|
1083
|
-
|
|
1084
|
-
raise FabricHTTPException(response)
|
|
1071
|
+
response = _base_api(request=url, client="azure")
|
|
1085
1072
|
|
|
1086
1073
|
for v in response.json().get("value", []):
|
|
1087
1074
|
p = v.get("properties", {})
|
|
@@ -1111,9 +1098,7 @@ def list_storage_accounts(
|
|
|
1111
1098
|
|
|
1112
1099
|
df = pd.concat([df, pd.DataFrame(new_data, index=[0])], ignore_index=True)
|
|
1113
1100
|
|
|
1114
|
-
|
|
1115
|
-
df[bool_cols] = df[bool_cols].astype(bool)
|
|
1116
|
-
df["Creation Time"] = pd.to_datetime(df["Creation Time"])
|
|
1101
|
+
_update_dataframe_datatypes(dataframe=df, column_map=columns)
|
|
1117
1102
|
|
|
1118
1103
|
return df
|
|
1119
1104
|
|
|
@@ -1142,13 +1127,9 @@ def check_resource_group_existence(
|
|
|
1142
1127
|
True/False indicating if the resource group exists or not.
|
|
1143
1128
|
"""
|
|
1144
1129
|
|
|
1145
|
-
headers = _get_headers(auth.token_provider.get(), audience="azure")
|
|
1146
1130
|
url = f"https://management.azure.com/subscriptions/{azure_subscription_id}/resourceGroups/{resource_group}?api-version=2021-04-01"
|
|
1147
1131
|
|
|
1148
|
-
response =
|
|
1149
|
-
|
|
1150
|
-
if response.status_code not in [200, 204, 404]:
|
|
1151
|
-
raise FabricHTTPException(response)
|
|
1132
|
+
response = _base_api(request=url, client="azure", status_codes=[200, 204, 404])
|
|
1152
1133
|
|
|
1153
1134
|
if response.status_code == 200:
|
|
1154
1135
|
return True
|
|
@@ -1184,7 +1165,6 @@ def list_resource_groups(
|
|
|
1184
1165
|
A pandas dataframe showing a list of all resource groups within the subscription.
|
|
1185
1166
|
"""
|
|
1186
1167
|
|
|
1187
|
-
headers = _get_headers(auth.token_provider.get(), audience="azure")
|
|
1188
1168
|
url = f"https://management.azure.com/subscriptions/{azure_subscription_id}/resourceGroups?"
|
|
1189
1169
|
|
|
1190
1170
|
if filter is not None:
|
|
@@ -1194,11 +1174,14 @@ def list_resource_groups(
|
|
|
1194
1174
|
|
|
1195
1175
|
url += "api-version=2021-04-01"
|
|
1196
1176
|
|
|
1197
|
-
|
|
1198
|
-
|
|
1177
|
+
columns = {
|
|
1178
|
+
"Resource Group Name": "string",
|
|
1179
|
+
"Location": "string",
|
|
1180
|
+
"Tags": "string",
|
|
1181
|
+
}
|
|
1182
|
+
df = _create_dataframe(columns=columns)
|
|
1199
1183
|
|
|
1200
|
-
|
|
1201
|
-
raise FabricHTTPException(response)
|
|
1184
|
+
response = _base_api(request=url, client="azure")
|
|
1202
1185
|
|
|
1203
1186
|
for v in response.json().get("value", []):
|
|
1204
1187
|
new_data = {
|
|
@@ -1238,13 +1221,8 @@ def get_resource_group(azure_subscription_id: str, resource_group: str) -> pd.Da
|
|
|
1238
1221
|
A pandas dataframe showing details of a specific resource group.
|
|
1239
1222
|
"""
|
|
1240
1223
|
|
|
1241
|
-
headers = _get_headers(auth.token_provider.get(), audience="azure")
|
|
1242
1224
|
url = f"https://management.azure.com/subscriptions/{azure_subscription_id}/resourceGroups/{resource_group}?api-version=2021-04-01"
|
|
1243
|
-
|
|
1244
|
-
response = requests.get(url, headers=headers)
|
|
1245
|
-
|
|
1246
|
-
if response.status_code != 200:
|
|
1247
|
-
raise FabricHTTPException(response)
|
|
1225
|
+
response = _base_api(request=url, client="azure")
|
|
1248
1226
|
|
|
1249
1227
|
v = response.json()
|
|
1250
1228
|
new_data = {
|