Add "for" param for alerts, Grafana 6.X

This parametr sets a grace period during which no notifications
are set.
This commit is contained in:
Piotrek Olchawa 2019-05-05 21:48:31 +02:00
parent f9c5a2944c
commit 42941c5b06
2 changed files with 10 additions and 0 deletions

View File

@ -2,6 +2,14 @@
Changelog
=========
0.5.3 (2019-05-05)
==================
Changes
-------
* Add ``for`` parameter for alerts on Grafana 6.X
0.5.2 (2018-07-19)
==================

View File

@ -835,6 +835,7 @@ class Alert(object):
handler = attr.ib(default=1)
noDataState = attr.ib(default=STATE_NO_DATA)
notifications = attr.ib(default=attr.Factory(list))
gracePeriod = attr.ib(default='5m')
def to_json_data(self):
return {
@ -846,6 +847,7 @@ class Alert(object):
"name": self.name,
"noDataState": self.noDataState,
"notifications": self.notifications,
"for": self.gracePeriod,
}