You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+34-4Lines changed: 34 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -248,16 +248,46 @@ In general my focus inside this project is to implement and deliver old and new
248
248
- Reload LDAP provisioning configuration
249
249
- Rotate data encryption keys
250
250
251
+
### Service Account
252
+
- Search service accounts
253
+
- Create a service account
254
+
- Get service account by id
255
+
- Update a service account
256
+
- Get service account token by id
257
+
- Create service account token by id
258
+
- Delete service account by id
259
+
260
+
### RBAC
261
+
- Get status
262
+
- Get all roles
263
+
- Get role
264
+
- Create role
265
+
- Update role
266
+
- Delete role
267
+
- Get user assigned roles
268
+
- Get user assigned permissions
269
+
- Add user role assignment
270
+
- Update user role assignment
271
+
- Remove user role assignment
272
+
- Get service account assigned roles
273
+
- Get service account assigned permissions
274
+
- Add service account role assignment
275
+
- Update service account role assignment
276
+
- Remove service account role assignment
277
+
- Get team assigned roles
278
+
- Add team role assignment
279
+
- Update team role assignment
280
+
- Remove team role assignment
281
+
- Reset basic roles to their default
282
+
251
283
## Feature timeline
252
284
253
285
The following table describes the plan to implement the rest of the Grafana API functionality. Please, open an issue and vote them up, if you prefer a faster implementation of an API functionality.
254
286
255
287
| API endpoint group | Implementation week | Maintainer | PR | State |
-`uid` _str_ - Specify the optional uid of the role (default None)
392
+
-`global_role` _bool_ - Specify the if the role isglobalornot. If set to False, the default org id of the authenticated user will be used from the request (default False)
393
+
-`version` _int_ - Specify the optional version of the role (default None)
394
+
-`description` _str_ - Specify the optional description of the role (default None)
395
+
-`display_name` _str_ - Specify the optional display_name of the role (default None)
396
+
-`group` _str_ - Specify the optional org group of the role (default None)
397
+
-`hidden` _bool_ - Specify whether the role is hidden ornot. If set to True, then the role does not show in the role picker. It will not be listed by API endpoints unless explicitly specified (default False)
398
+
-`permissions` _list_ - Specify the optional permissions of the role as a list of the RolePermission objects (default None)
Copy file name to clipboardExpand all lines: src/grafana_api/model.py
+40Lines changed: 40 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -42,6 +42,8 @@ class APIEndpoints(Enum):
42
42
ORG_PREFERENCES=f"{api_prefix}/org/preferences"
43
43
ANNOTATIONS=f"{api_prefix}/annotations"
44
44
ADMIN=f"{api_prefix}/admin"
45
+
SERVICE_ACCOUNTS=f"{api_prefix}/serviceaccounts"
46
+
RBAC=f"{api_prefix}/access-control"
45
47
46
48
47
49
classRequestsMethods(Enum):
@@ -383,3 +385,41 @@ class GlobalUser(NamedTuple):
383
385
login: str
384
386
password: str
385
387
org_id: int=None
388
+
389
+
390
+
classCustomRole(NamedTuple):
391
+
"""The class includes all necessary variables to generate a custom role object
392
+
393
+
Args:
394
+
name (str): Specify the name of the role
395
+
uid (str): Specify the optional uid of the role (default None)
396
+
global_role (bool): Specify the if the role is global or not. If set to False, the default org id of the authenticated user will be used from the request (default False)
397
+
version (int): Specify the optional version of the role (default None)
398
+
description (str): Specify the optional description of the role (default None)
399
+
display_name (str): Specify the optional display_name of the role (default None)
400
+
group (str): Specify the optional org group of the role (default None)
401
+
hidden (bool): Specify whether the role is hidden or not. If set to True, then the role does not show in the role picker. It will not be listed by API endpoints unless explicitly specified (default False)
402
+
permissions (list): Specify the optional permissions of the role as a list of the RolePermission objects (default None)
403
+
"""
404
+
405
+
name: str
406
+
uid: str=None
407
+
global_role: bool=False
408
+
version: int=None
409
+
description: str=None
410
+
display_name: str=None
411
+
group: str=None
412
+
hidden: bool=False
413
+
permissions: list=None
414
+
415
+
416
+
classRolePermission(NamedTuple):
417
+
"""The class includes all necessary variables to generate a role permission object
418
+
419
+
Args:
420
+
action (str): Specify the custom role action definition
421
+
scope (str): Specify the scope definition. If not present, no scope will be mapped to the permission (default None)
0 commit comments