-
Notifications
You must be signed in to change notification settings - Fork 2
/
index.html
52 lines (47 loc) · 2.03 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
<html>
<head>
<title>Delete Worspaces</title>
<link rel="stylesheet" href="DeleteWS.css">
</head>
<body>
<div class="form-input">
<form id="form-input">
<label for="token">Bearer token. get it here <a href="https://docs.microsoft.com/en-us/rest/api/power-bi/admin/groups-get-groups-as-admin" target="_blank" rel="noopener noreferrer">Microsoft API Docs</a> It will expire after one hour </label>
<input type="text" id="token" name="token" placeholder="Your token without bearer text">
<label for="url">API URL. Change the parameter for desired output, $top, $skip, $filter</label>
<input type="text" id="url" name="url" value="https://api.powerbi.com/v1.0/myorg/admin/groups?$expand=reports,datasets,dashboards,dataflows,workbooks&$filter=(state ne 'Deleted') and (type eq 'Workspace')&$top=5000&$skip=0">
<label for="email">Email. Will give admin access to workspace. leave empty if account has permission to delete workspaces. </label>
<input type="text" id="email" name="email" placeholder="Email or leave empty" value="username@domain.com">
<input type="submit" value="Submit">
</form>
</div>
<ul class="ws-groups">
<li id="ws-count">
Number of workspaces
</li>
<li id="ws-empty">
Number of empty workspaces
</li>
<li id="ws-deleted">
Number of deleted workspaces
</li>
</ul>
<div class="list-groups">
<table>
<tr>
<th>Workspace
<button id="deleteAll">Delete All Empty</button>
</th>
<th>Type</th>
<th>State</th>
<th>Number of reports</th>
<th>Number of datasets</th>
<th>Number of dataflows</th>
<th>Number of dashboards</th>
<th>Number of workbooks</th>
</tr>
</table>
</div>
<script src="DeleteWSAPICall.js"></script>
</body>
</html>