feat(alerting): removes pause per datasource

This commit is contained in:
bergquist
2016-12-19 13:24:45 +01:00
parent 6b9db0c0c5
commit ecdf1888c4
11 changed files with 83 additions and 65 deletions

View File

@@ -3,6 +3,8 @@ package models
import (
"time"
"fmt"
"github.com/grafana/grafana/pkg/components/simplejson"
)
@@ -31,6 +33,10 @@ const (
ExecutionErrorKeepState ExecutionErrorOption = "keep_state"
)
var (
ErrCannotChangeStateOnPausedAlert error = fmt.Errorf("Cannot change state on pause alert")
)
func (s AlertStateType) IsValid() bool {
return s == AlertStateOK || s == AlertStateNoData || s == AlertStatePaused || s == AlertStatePending
}
@@ -138,6 +144,11 @@ type PauseAlertCommand struct {
Paused bool
}
type PauseAllAlertCommand struct {
ResultCount int64
Paused bool
}
type SetAlertStateCommand struct {
AlertId int64
OrgId int64