mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Added uid for alert notifications
This commit is contained in:
@@ -8,10 +8,11 @@ import (
|
||||
)
|
||||
|
||||
var (
|
||||
ErrNotificationFrequencyNotFound = errors.New("Notification frequency not specified")
|
||||
ErrAlertNotificationStateNotFound = errors.New("alert notification state not found")
|
||||
ErrAlertNotificationStateVersionConflict = errors.New("alert notification state update version conflict")
|
||||
ErrAlertNotificationStateAlreadyExist = errors.New("alert notification state already exists.")
|
||||
ErrNotificationFrequencyNotFound = errors.New("Notification frequency not specified")
|
||||
ErrAlertNotificationStateNotFound = errors.New("alert notification state not found")
|
||||
ErrAlertNotificationStateVersionConflict = errors.New("alert notification state update version conflict")
|
||||
ErrAlertNotificationStateAlreadyExist = errors.New("alert notification state already exists.")
|
||||
ErrAlertNotificationFailedGenerateUniqueUid = errors.New("Failed to generate unique alert notification uid")
|
||||
)
|
||||
|
||||
type AlertNotificationStateType string
|
||||
@@ -24,6 +25,7 @@ var (
|
||||
|
||||
type AlertNotification struct {
|
||||
Id int64 `json:"id"`
|
||||
Uid string `json:"-"`
|
||||
OrgId int64 `json:"-"`
|
||||
Name string `json:"name"`
|
||||
Type string `json:"type"`
|
||||
@@ -37,6 +39,7 @@ type AlertNotification struct {
|
||||
}
|
||||
|
||||
type CreateAlertNotificationCommand struct {
|
||||
Uid string `json:"-"`
|
||||
Name string `json:"name" binding:"Required"`
|
||||
Type string `json:"type" binding:"Required"`
|
||||
SendReminder bool `json:"sendReminder"`
|
||||
@@ -63,10 +66,28 @@ type UpdateAlertNotificationCommand struct {
|
||||
Result *AlertNotification
|
||||
}
|
||||
|
||||
type UpdateAlertNotificationWithUidCommand struct {
|
||||
Uid string
|
||||
Name string
|
||||
Type string
|
||||
SendReminder bool
|
||||
DisableResolveMessage bool
|
||||
Frequency string
|
||||
IsDefault bool
|
||||
Settings *simplejson.Json
|
||||
|
||||
OrgId int64
|
||||
Result *AlertNotification
|
||||
}
|
||||
|
||||
type DeleteAlertNotificationCommand struct {
|
||||
Id int64
|
||||
OrgId int64
|
||||
}
|
||||
type DeleteAlertNotificationWithUidCommand struct {
|
||||
Uid string
|
||||
OrgId int64
|
||||
}
|
||||
|
||||
type GetAlertNotificationsQuery struct {
|
||||
Name string
|
||||
@@ -76,8 +97,15 @@ type GetAlertNotificationsQuery struct {
|
||||
Result *AlertNotification
|
||||
}
|
||||
|
||||
type GetAlertNotificationsToSendQuery struct {
|
||||
Ids []int64
|
||||
type GetAlertNotificationsWithUidQuery struct {
|
||||
Uid string
|
||||
OrgId int64
|
||||
|
||||
Result *AlertNotification
|
||||
}
|
||||
|
||||
type GetAlertNotificationsWithUidToSendQuery struct {
|
||||
Uids []string
|
||||
OrgId int64
|
||||
|
||||
Result []*AlertNotification
|
||||
|
||||
Reference in New Issue
Block a user