feat(alerting): started reworking notifications
This commit is contained in:
@@ -7,34 +7,31 @@ import (
|
||||
)
|
||||
|
||||
type AlertNotification struct {
|
||||
Id int64 `json:"id"`
|
||||
OrgId int64 `json:"-"`
|
||||
Name string `json:"name"`
|
||||
Type string `json:"type"`
|
||||
AlwaysExecute bool `json:"alwaysExecute"`
|
||||
Settings *simplejson.Json `json:"settings"`
|
||||
Created time.Time `json:"created"`
|
||||
Updated time.Time `json:"updated"`
|
||||
Id int64 `json:"id"`
|
||||
OrgId int64 `json:"-"`
|
||||
Name string `json:"name"`
|
||||
Type string `json:"type"`
|
||||
Settings *simplejson.Json `json:"settings"`
|
||||
Created time.Time `json:"created"`
|
||||
Updated time.Time `json:"updated"`
|
||||
}
|
||||
|
||||
type CreateAlertNotificationCommand struct {
|
||||
Name string `json:"name" binding:"Required"`
|
||||
Type string `json:"type" binding:"Required"`
|
||||
AlwaysExecute bool `json:"alwaysExecute"`
|
||||
OrgID int64 `json:"-"`
|
||||
Settings *simplejson.Json `json:"settings"`
|
||||
Name string `json:"name" binding:"Required"`
|
||||
Type string `json:"type" binding:"Required"`
|
||||
Settings *simplejson.Json `json:"settings"`
|
||||
|
||||
OrgId int64 `json:"-"`
|
||||
Result *AlertNotification
|
||||
}
|
||||
|
||||
type UpdateAlertNotificationCommand struct {
|
||||
Id int64 `json:"id" binding:"Required"`
|
||||
Name string `json:"name" binding:"Required"`
|
||||
Type string `json:"type" binding:"Required"`
|
||||
AlwaysExecute bool `json:"alwaysExecute"`
|
||||
OrgID int64 `json:"-"`
|
||||
Settings *simplejson.Json `json:"settings" binding:"Required"`
|
||||
Id int64 `json:"id" binding:"Required"`
|
||||
Name string `json:"name" binding:"Required"`
|
||||
Type string `json:"type" binding:"Required"`
|
||||
Settings *simplejson.Json `json:"settings" binding:"Required"`
|
||||
|
||||
OrgId int64 `json:"-"`
|
||||
Result *AlertNotification
|
||||
}
|
||||
|
||||
@@ -43,12 +40,11 @@ type DeleteAlertNotificationCommand struct {
|
||||
OrgId int64
|
||||
}
|
||||
|
||||
type GetAlertNotificationQuery struct {
|
||||
Name string
|
||||
Id int64
|
||||
Ids []int64
|
||||
OrgID int64
|
||||
IncludeAlwaysExecute bool
|
||||
type GetAlertNotificationsQuery struct {
|
||||
Name string
|
||||
Id int64
|
||||
Ids []int64
|
||||
OrgId int64
|
||||
|
||||
Result []*AlertNotification
|
||||
}
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
package models
|
||||
|
||||
import (
|
||||
"time"
|
||||
|
||||
"github.com/grafana/grafana/pkg/components/simplejson"
|
||||
)
|
||||
|
||||
type AnnotationType string
|
||||
|
||||
type AnnotationEvent struct {
|
||||
Id int64
|
||||
OrgId int64
|
||||
Type AnnotationType
|
||||
Title string
|
||||
Text string
|
||||
AlertId int64
|
||||
UserId int64
|
||||
Timestamp time.Time
|
||||
|
||||
Data *simplejson.Json
|
||||
}
|
||||
Reference in New Issue
Block a user