aboutsummaryrefslogtreecommitdiffstats
path: root/arthur/apis/grafana/teams.py
diff options
context:
space:
mode:
Diffstat (limited to 'arthur/apis/grafana/teams.py')
-rw-r--r--arthur/apis/grafana/teams.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/arthur/apis/grafana/teams.py b/arthur/apis/grafana/teams.py
index e641d84..5d582b5 100644
--- a/arthur/apis/grafana/teams.py
+++ b/arthur/apis/grafana/teams.py
@@ -35,6 +35,18 @@ async def add_user_to_team(
return await response.json()
+async def remove_user_from_team(
+ user_id: int,
+ team_id: int,
+ session: aiohttp.ClientSession,
+) -> dict[str, str]:
+ """AdRemove a Grafana user from a team."""
+ endpoint = CONFIG.grafana_url + f"/api/teams/{team_id}/members/{user_id}"
+ async with session.delete(endpoint, headers=AUTH_HEADER) as response:
+ response.raise_for_status()
+ return await response.json()
+
+
async def get_all_users(session: aiohttp.ClientSession) -> list[dict[str, str]]:
"""Get a grafana users."""
endpoint = CONFIG.grafana_url + "/api/org/users/lookup"