Skip to content

Commit 9fdd41c

Browse files
committed
fixed kql dash functions
1 parent 2575f03 commit 9fdd41c

File tree

2 files changed

+13
-10
lines changed

2 files changed

+13
-10
lines changed

src/sempy_labs/__init__.py

+10
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
from sempy_labs._kql_dashboards import (
2+
list_kql_dashboards,
3+
create_kql_dashboard,
4+
delete_kql_dashboard,
5+
create_workspace_montiring_dashboard,
6+
)
17
from sempy_labs._graphQL import (
28
list_graphql_apis,
39
create_graphql_api,
@@ -511,4 +517,8 @@
511517
"delta_analyzer",
512518
# "dax_perf_test",
513519
# "dax_perf_test_bulk",
520+
"list_kql_dashboards",
521+
"create_kql_dashboard",
522+
"delete_kql_dashboard",
523+
"create_workspace_montiring_dashboard",
514524
]

src/sempy_labs/_kql_dashboards.py

+3-10
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
_base_api,
88
_create_dataframe,
99
_conv_b64,
10+
generate_guid,
1011
)
1112
from uuid import UUID
1213
import requests
@@ -90,25 +91,17 @@ def create_kql_dashboard(
9091
payload["description"] = description
9192

9293
if content:
93-
# platform_payload = ''
9494
payload["definition"] = {
9595
"format": None,
9696
"parts": [
9797
{
9898
"path": "RealTimeDashboard.json",
99-
"payload": content,
99+
"payload": _conv_b64(content),
100100
"payloadType": "InlineBase64",
101101
},
102-
# {
103-
# "path": ".platform",
104-
# "payload": platform_payload,
105-
# "payloadType": "InlineBase64"
106-
# }
107102
],
108103
}
109104

110-
payload = _conv_b64(payload)
111-
112105
_base_api(
113106
request=f"v1/workspaces/{workspace_id}/kqlDashboards",
114107
method="post",
@@ -165,7 +158,7 @@ def create_workspace_montiring_dashboard(
165158
"clusterUri": cluster_uri,
166159
"database": database_id,
167160
"name": db_name,
168-
"id": "b7d7ce56-c612-4d4f-ab1a-1a6f6212efd0",
161+
"id": generate_guid(),
169162
"workspace": workspace_id,
170163
}
171164
]

0 commit comments

Comments
 (0)