Skip to content

Commit

Permalink
Add API method get_alertrules_all
Browse files Browse the repository at this point in the history
Added REST API wrapper for v1/provisioning/alert-rules.
  • Loading branch information
harish422 authored and amotl committed Jul 30, 2023
1 parent 07bbe2a commit 5238707
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

* Add missing argument `dashboard_uid` to `get_annotation` method.
Thanks, @nikita-b.
* Add API method `get_alertrules_all`. Thanks, @harish422.


## 3.5.0 (2022-12-07)
Expand Down
9 changes: 9 additions & 0 deletions grafana_client/elements/alertingprovisioning.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,15 @@ def __init__(self, client):
super(AlertingProvisioning, self).__init__(client)
self.client = client

def get_alertrules_all(self):
"""
Gets all alert rules
@return:
"""
get_alertrules_all_path = "/v1/provisioning/alert-rules"
r = self.client.GET(get_alertrules_all_path)
return r

Check warning on line 16 in grafana_client/elements/alertingprovisioning.py

View check run for this annotation

Codecov / codecov/patch

grafana_client/elements/alertingprovisioning.py#L14-L16

Added lines #L14 - L16 were not covered by tests

def get_alertrule(self, alertrule_uid):
"""
Expand Down

0 comments on commit 5238707

Please sign in to comment.