|
|
@@ -3,16 +3,18 @@ package models
|
|
|
import (
|
|
|
"time"
|
|
|
|
|
|
+ "github.com/grafana/grafana/pkg/components/simplejson"
|
|
|
"github.com/grafana/grafana/pkg/services/alerting/alertstates"
|
|
|
)
|
|
|
|
|
|
type AlertState struct {
|
|
|
- Id int64 `json:"-"`
|
|
|
- OrgId int64 `json:"-"`
|
|
|
- AlertId int64 `json:"alertId"`
|
|
|
- NewState string `json:"newState"`
|
|
|
- Created time.Time `json:"created"`
|
|
|
- Info string `json:"info"`
|
|
|
+ Id int64 `json:"-"`
|
|
|
+ OrgId int64 `json:"-"`
|
|
|
+ AlertId int64 `json:"alertId"`
|
|
|
+ NewState string `json:"newState"`
|
|
|
+ Created time.Time `json:"created"`
|
|
|
+ Info string `json:"info"`
|
|
|
+ TriggeredAlerts *simplejson.Json `json:"triggeredAlerts"`
|
|
|
}
|
|
|
|
|
|
func (this *UpdateAlertStateCommand) IsValidState() bool {
|
|
|
@@ -27,10 +29,11 @@ func (this *UpdateAlertStateCommand) IsValidState() bool {
|
|
|
// Commands
|
|
|
|
|
|
type UpdateAlertStateCommand struct {
|
|
|
- AlertId int64 `json:"alertId" binding:"Required"`
|
|
|
- OrgId int64 `json:"orgId" binding:"Required"`
|
|
|
- NewState string `json:"newState" binding:"Required"`
|
|
|
- Info string `json:"info"`
|
|
|
+ AlertId int64 `json:"alertId" binding:"Required"`
|
|
|
+ OrgId int64 `json:"orgId" binding:"Required"`
|
|
|
+ NewState string `json:"newState" binding:"Required"`
|
|
|
+ Info string `json:"info"`
|
|
|
+ TriggeredAlerts *simplejson.Json `json:"triggeredAlerts"`
|
|
|
|
|
|
Result *Alert
|
|
|
}
|