feat(alerting): renamed scheduler to handler
This commit is contained in:
@@ -69,7 +69,7 @@ func (e *DashAlertExtractor) GetAlerts() ([]*m.Alert, error) {
|
||||
PanelId: panel.Get("id").MustInt64(),
|
||||
Id: jsonAlert.Get("id").MustInt64(),
|
||||
Name: jsonAlert.Get("name").MustString(),
|
||||
Scheduler: jsonAlert.Get("scheduler").MustInt64(),
|
||||
Handler: jsonAlert.Get("handler").MustInt64(),
|
||||
Enabled: jsonAlert.Get("enabled").MustBool(),
|
||||
Description: jsonAlert.Get("description").MustString(),
|
||||
}
|
||||
|
||||
@@ -39,7 +39,7 @@ func TestAlertRuleExtraction(t *testing.T) {
|
||||
"alert": {
|
||||
"name": "name1",
|
||||
"description": "desc1",
|
||||
"scheduler": 1,
|
||||
"handler": 1,
|
||||
"enabled": true,
|
||||
"critical": {
|
||||
"level": 20,
|
||||
@@ -74,7 +74,7 @@ func TestAlertRuleExtraction(t *testing.T) {
|
||||
"alert": {
|
||||
"name": "name2",
|
||||
"description": "desc2",
|
||||
"scheduler": 0,
|
||||
"handler": 0,
|
||||
"enabled": true,
|
||||
"critical": {
|
||||
"level": 20,
|
||||
@@ -197,9 +197,9 @@ func TestAlertRuleExtraction(t *testing.T) {
|
||||
So(v.Description, ShouldNotBeEmpty)
|
||||
}
|
||||
|
||||
Convey("should extract scheduler property", func() {
|
||||
So(alerts[0].Scheduler, ShouldEqual, 1)
|
||||
So(alerts[1].Scheduler, ShouldEqual, 0)
|
||||
Convey("should extract handler property", func() {
|
||||
So(alerts[0].Handler, ShouldEqual, 1)
|
||||
So(alerts[1].Handler, ShouldEqual, 0)
|
||||
})
|
||||
|
||||
Convey("should extract panel idc", func() {
|
||||
|
||||
@@ -17,7 +17,7 @@ func addAlertMigrations(mg *Migrator) {
|
||||
{Name: "description", Type: DB_NVarchar, Length: 255, Nullable: false},
|
||||
{Name: "state", Type: DB_NVarchar, Length: 255, Nullable: false},
|
||||
{Name: "settings", Type: DB_Text, Nullable: false},
|
||||
{Name: "scheduler", Type: DB_BigInt, Nullable: false},
|
||||
{Name: "handler", Type: DB_BigInt, Nullable: false},
|
||||
{Name: "enabled", Type: DB_Bool, Nullable: false},
|
||||
{Name: "created", Type: DB_DateTime, Nullable: false},
|
||||
{Name: "updated", Type: DB_DateTime, Nullable: false},
|
||||
|
||||
Reference in New Issue
Block a user