Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add get_rule_group method #108

Merged
merged 2 commits into from
Sep 7, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 21 additions & 1 deletion grafana_client/elements/alertingprovisioning.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,16 +52,36 @@
r = self.client.PUT(update_alertrule_path, json=alertrule, headers=headers)
return r

def update_rule_group_interval(self, folder_uid, group_uid, alertrule_group):
def get_rule_group(self, folder_uid, group_uid):
"""
:param folder_uid:
:param group_uid:
:return:
"""
get_rule_group_path = "/v1/provisioning/folder/%s/rule-groups/%s" % (folder_uid, group_uid)
r = self.client.GET(get_rule_group_path)
return r

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

View check run for this annotation

Codecov / codecov/patch

grafana_client/elements/alertingprovisioning.py#L61-L63

Added lines #L61 - L63 were not covered by tests

def update_rule_group(self, folder_uid, group_uid, alertrule_group):
"""
:param folder_uid:
:param group_uid:
:param alertrule_group:
:return:
"""
update_rule_group_interval_path = "/v1/provisioning/folder/%s/rule-groups/%s" % (folder_uid, group_uid)
r = self.client.PUT(update_rule_group_interval_path, json=alertrule_group)
return r

def update_rule_group_interval(self, folder_uid, group_uid, alertrule_group):
"""
:param folder_uid:
:param group_uid:
:param alertrule_group:
:return:
"""
return self.update_rule_group(folder_uid, group_uid, alertrule_group)

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

View check run for this annotation

Codecov / codecov/patch

grafana_client/elements/alertingprovisioning.py#L83

Added line #L83 was not covered by tests

def delete_alertrule(self, alertrule_uid):
"""
@param alertrule_uid:
Expand Down