Skip to content

Commit

Permalink
feat: add reactivate notification rules command
Browse files Browse the repository at this point in the history
  • Loading branch information
sbgap committed Mar 15, 2024
1 parent 3c430cd commit bdf2dcd
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
3 changes: 3 additions & 0 deletions alertaclient/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -495,6 +495,9 @@ def housekeeping(self, expired_delete_hours=None, info_delete_hours=None):
def escalate(self):
self.http.session.get(self.http.endpoint + '/escalate', auth=self.http.auth, timeout=self.http.timeout)

def reactivate_notification_rules(self):
self.http.session.get(self.http.endpoint + '/notificationrules/reactivate', auth=self.http.auth, timeout=self.http.timeout)


class ApiKeyAuth(AuthBase):

Expand Down
9 changes: 9 additions & 0 deletions alertaclient/commands/cmd_reactivate_notification_rules.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import click


@click.command('reactivate_notitification_rules', short_help='Reactivate inactive notification rules after reactivate time is up')
@click.pass_obj
def cli(obj):
"""Trigger reactivation of notification rules"""
client = obj['client']
client.reactivate_notification_rules()

0 comments on commit bdf2dcd

Please sign in to comment.