Skip to content

Commit

Permalink
FIX API DELETE /api/teams/:teamId/groups?groupId=external-group-id
Browse files Browse the repository at this point in the history
Fix incorrect API call parameter : It returned always 404.
  • Loading branch information
Gilles Hamel authored and amotl committed Mar 7, 2024
1 parent b26438f commit c1dc3f7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion grafana_client/elements/team.py
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,6 @@ def remove_team_external_group(self, team_id, group_id):
:param group_id:
:return:
"""
team_group_path = "/teams/%s/groups/%s" % (team_id, group_id)
team_group_path = "/teams/%s/groups?groupId=%s" % (team_id, group_id)
r = self.client.DELETE(team_group_path)
return r
4 changes: 2 additions & 2 deletions test/elements/test_team.py
Original file line number Diff line number Diff line change
Expand Up @@ -327,8 +327,8 @@ def test_add_team_external_group(self, m):
@requests_mock.Mocker()
def test_remove_team_external_group(self, m):
m.delete(
"http://localhost/api/teams/42/groups/1",
"http://localhost/api/teams/42/groups?groupId=a_external_group",
json={"message": "Team group removed"},
)
r = self.grafana.teams.remove_team_external_group("42", "1")
r = self.grafana.teams.remove_team_external_group("42", "a_external_group")
self.assertEqual(r["message"], "Team group removed")

0 comments on commit c1dc3f7

Please sign in to comment.