Documentation ¶
Index ¶
- Variables
- type Alert
- type AlertListItemDTO
- type AlertNotification
- type AlertNotificationState
- type AlertNotificationStateType
- type AlertStateInfoDTO
- type AlertStateType
- type CreateAlertNotificationCommand
- type DeleteAlertNotificationCommand
- type DeleteAlertNotificationWithUidCommand
- type ExecutionErrorOption
- type GetAlertByIdQuery
- type GetAlertNotificationUidQuery
- type GetAlertNotificationsQuery
- type GetAlertNotificationsWithUidQuery
- type GetAlertNotificationsWithUidToSendQuery
- type GetAlertStatesForDashboardQuery
- type GetAlertsQuery
- type GetAllAlertNotificationsQuery
- type GetAllAlertsQuery
- type GetOrCreateNotificationStateQuery
- type NoDataOption
- type PauseAlertCommand
- type PauseAllAlertCommand
- type SetAlertNotificationStateToCompleteCommand
- type SetAlertNotificationStateToPendingCommand
- type SetAlertStateCommand
- type UpdateAlertNotificationCommand
- type UpdateAlertNotificationWithUidCommand
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrCannotChangeStateOnPausedAlert = fmt.Errorf("cannot change state on pause alert") ErrRequiresNewState = fmt.Errorf("update alert state requires a new state") )
View Source
var ( ErrAlertNotificationNotFound = errors.New("alert notification not found") ErrNotificationFrequencyNotFound = errors.New("notification frequency not specified") ErrAlertNotificationStateVersionConflict = errors.New("alert notification state update version conflict") ErrAlertNotificationFailedGenerateUniqueUid = errors.New("failed to generate unique alert notification uid") ErrAlertNotificationFailedTranslateUniqueID = errors.New("failed to translate Notification Id to Uid") ErrAlertNotificationWithSameNameExists = errors.New("alert notification with same name already exists") ErrAlertNotificationWithSameUIDExists = errors.New("alert notification with same uid already exists") )
View Source
var ( AlertNotificationStatePending = AlertNotificationStateType("pending") AlertNotificationStateCompleted = AlertNotificationStateType("completed") AlertNotificationStateUnknown = AlertNotificationStateType("unknown") )
Functions ¶
This section is empty.
Types ¶
type Alert ¶
type Alert struct { ID int64 `xorm:"pk autoincr 'id'"` Version int64 OrgID int64 `xorm:"org_id"` DashboardID int64 `xorm:"dashboard_id"` PanelID int64 `xorm:"panel_id"` Name string Message string Severity string // Unused State AlertStateType Handler int64 // Unused Silenced bool ExecutionError string Frequency int64 For time.Duration EvalData *simplejson.Json NewStateDate time.Time StateChanges int64 Created time.Time Updated time.Time Settings *simplejson.Json }
swagger:model LegacyAlert
func (*Alert) ContainsUpdates ¶
func (*Alert) GetTagsFromSettings ¶
func (*Alert) ValidDashboardPanel ¶
type AlertListItemDTO ¶
type AlertListItemDTO struct { ID int64 `json:"id" xorm:"id"` DashboardID int64 `json:"dashboardId" xorm:"dashboard_id"` DashboardUID string `json:"dashboardUid" xorm:"dashboard_uid"` DashboardSlug string `json:"dashboardSlug"` PanelID int64 `json:"panelId" xorm:"panel_id"` Name string `json:"name"` State AlertStateType `json:"state"` NewStateDate time.Time `json:"newStateDate"` EvalDate time.Time `json:"evalDate"` EvalData *simplejson.Json `json:"evalData"` ExecutionError string `json:"executionError"` URL string `json:"url" xorm:"url"` }
type AlertNotification ¶
type AlertNotification struct { ID int64 `json:"id" xorm:"pk autoincr 'id'"` UID string `json:"-" xorm:"uid"` OrgID int64 `json:"-" xorm:"org_id"` Name string `json:"name"` Type string `json:"type"` SendReminder bool `json:"sendReminder"` DisableResolveMessage bool `json:"disableResolveMessage"` Frequency time.Duration `json:"frequency"` IsDefault bool `json:"isDefault"` Settings *simplejson.Json `json:"settings"` SecureSettings map[string][]byte `json:"secureSettings"` Created time.Time `json:"created"` Updated time.Time `json:"updated"` }
type AlertNotificationState ¶
type AlertNotificationStateType ¶
type AlertNotificationStateType string
type AlertStateInfoDTO ¶
type AlertStateType ¶
type AlertStateType string
const ( AlertStateNoData AlertStateType = "no_data" AlertStatePaused AlertStateType = "paused" AlertStateAlerting AlertStateType = "alerting" AlertStateOK AlertStateType = "ok" AlertStatePending AlertStateType = "pending" AlertStateUnknown AlertStateType = "unknown" )
func (AlertStateType) IsValid ¶
func (s AlertStateType) IsValid() bool
type CreateAlertNotificationCommand ¶
type CreateAlertNotificationCommand struct { UID string `json:"uid"` Name string `json:"name" binding:"Required"` Type string `json:"type" binding:"Required"` SendReminder bool `json:"sendReminder"` DisableResolveMessage bool `json:"disableResolveMessage"` Frequency string `json:"frequency"` IsDefault bool `json:"isDefault"` Settings *simplejson.Json `json:"settings"` SecureSettings map[string]string `json:"secureSettings"` OrgID int64 `json:"-"` EncryptedSecureSettings map[string][]byte `json:"-"` }
type ExecutionErrorOption ¶
type ExecutionErrorOption string
const ( ExecutionErrorSetOk ExecutionErrorOption = "ok" ExecutionErrorSetAlerting ExecutionErrorOption = "alerting" ExecutionErrorKeepState ExecutionErrorOption = "keep_state" )
func (ExecutionErrorOption) IsValid ¶
func (s ExecutionErrorOption) IsValid() bool
func (ExecutionErrorOption) ToAlertState ¶
func (s ExecutionErrorOption) ToAlertState() AlertStateType
type GetAlertByIdQuery ¶
type GetAlertByIdQuery struct {
ID int64 `xorm:"id"`
}
type GetAlertsQuery ¶
type GetAlertsQuery struct { OrgID int64 `xorm:"org_id"` State []string DashboardIDs []int64 `xorm:"dashboard_ids"` PanelID int64 `xorm:"panel_id"` Limit int64 Query string User *user.SignedInUser }
Queries
type GetAllAlertNotificationsQuery ¶
type GetAllAlertNotificationsQuery struct {
OrgID int64
}
type GetAllAlertsQuery ¶
type GetAllAlertsQuery struct{}
type NoDataOption ¶
type NoDataOption string
const ( NoDataSetOK NoDataOption = "ok" NoDataSetNoData NoDataOption = "no_data" NoDataKeepState NoDataOption = "keep_state" NoDataSetAlerting NoDataOption = "alerting" )
func (NoDataOption) IsValid ¶
func (s NoDataOption) IsValid() bool
func (NoDataOption) ToAlertState ¶
func (s NoDataOption) ToAlertState() AlertStateType
type PauseAlertCommand ¶
type PauseAllAlertCommand ¶
type SetAlertStateCommand ¶
type SetAlertStateCommand struct { AlertID int64 `xorm:"alert_id"` OrgID int64 `xorm:"org_id"` State AlertStateType Error string EvalData *simplejson.Json }
type UpdateAlertNotificationCommand ¶
type UpdateAlertNotificationCommand struct { ID int64 `json:"id" binding:"Required"` UID string `json:"uid"` Name string `json:"name" binding:"Required"` Type string `json:"type" binding:"Required"` SendReminder bool `json:"sendReminder"` DisableResolveMessage bool `json:"disableResolveMessage"` Frequency string `json:"frequency"` IsDefault bool `json:"isDefault"` Settings *simplejson.Json `json:"settings" binding:"Required"` SecureSettings map[string]string `json:"secureSettings"` OrgID int64 `json:"-"` EncryptedSecureSettings map[string][]byte `json:"-"` }
type UpdateAlertNotificationWithUidCommand ¶
type UpdateAlertNotificationWithUidCommand struct { UID string `json:"-"` NewUID string `json:"uid"` Name string `json:"name" binding:"Required"` Type string `json:"type" binding:"Required"` SendReminder bool `json:"sendReminder"` DisableResolveMessage bool `json:"disableResolveMessage"` Frequency string `json:"frequency"` IsDefault bool `json:"isDefault"` Settings *simplejson.Json `json:"settings" binding:"Required"` SecureSettings map[string]string `json:"secureSettings"` OrgID int64 `json:"-"` }
Click to show internal directories.
Click to hide internal directories.