Skip to content

Commit 513eee4

Browse files
chintalamotl
authored andcommitted
Implement teams read endpoints for user and actual user.
1 parent 7f5712c commit 513eee4

File tree

2 files changed

+34
-0
lines changed

2 files changed

+34
-0
lines changed

grafana_client/elements/_async/user.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,15 @@ async def get_user_organisations(self, user_id):
8585
get_user_organisations_path = "/users/%s/orgs" % user_id
8686
return await self.client.GET(get_user_organisations_path)
8787

88+
async def get_user_teams(self, user_id):
89+
"""
90+
91+
:param user_id:
92+
:return:
93+
"""
94+
get_user_teams_path = "/users/%s/teams" % user_id
95+
return await self.client.GET(get_user_teams_path)
96+
8897

8998
class User(Base):
9099
def __init__(self, client):
@@ -145,6 +154,14 @@ async def get_actual_user_organisations(self):
145154
get_actual_user_organisations_path = "/user/orgs"
146155
return await self.client.GET(get_actual_user_organisations_path)
147156

157+
async def get_actual_user_teams(self):
158+
"""
159+
160+
:return:
161+
"""
162+
get_actual_user_teams_path = "/user/teams"
163+
return await self.client.GET(get_actual_user_teams_path)
164+
148165
async def star_actual_user_dashboard(self, dashboard_id):
149166
"""
150167

grafana_client/elements/user.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,15 @@ def get_user_organisations(self, user_id):
8585
get_user_organisations_path = "/users/%s/orgs" % user_id
8686
return self.client.GET(get_user_organisations_path)
8787

88+
def get_user_teams(self, user_id):
89+
"""
90+
91+
:param user_id:
92+
:return:
93+
"""
94+
get_user_teams_path = "/users/%s/teams" % user_id
95+
return self.client.GET(get_user_teams_path)
96+
8897

8998
class User(Base):
9099
def __init__(self, client):
@@ -145,6 +154,14 @@ def get_actual_user_organisations(self):
145154
get_actual_user_organisations_path = "/user/orgs"
146155
return self.client.GET(get_actual_user_organisations_path)
147156

157+
def get_actual_user_teams(self):
158+
"""
159+
160+
:return:
161+
"""
162+
get_actual_user_teams_path = "/user/teams"
163+
return self.client.GET(get_actual_user_teams_path)
164+
148165
def star_actual_user_dashboard(self, dashboard_id):
149166
"""
150167

0 commit comments

Comments
 (0)