Files
grafana/pkg/services/ngalert/models/alertmanager.go
T
Grot (@grafanabot) 7eda7945d3 Alerting: Fix notification channel migration and handle case when Alertmanager default configuration is absent (#35086) (#35246)
* Fix dashboard alert and nootifier migration for MySQL

* Fix POSTing Alertmanager configuration if no current configuration exists

in case the default configuration has not be stored yet
or has failed to get stored

* Change CreatedAt field type

(cherry picked from commit 15c55b0115)

Co-authored-by: Sofia Papagiannaki <papagian@users.noreply.github.com>
2021-06-04 16:41:28 +03:00

30 lines
852 B
Go

package models
const AlertConfigurationVersion = 1
// AlertConfiguration represents a single version of the Alerting Engine Configuration.
type AlertConfiguration struct {
ID int64 `xorm:"pk autoincr 'id'"`
AlertmanagerConfiguration string
ConfigurationVersion string
CreatedAt int64 `xorm:"created"`
Default bool
}
// GetLatestAlertmanagerConfigurationQuery is the query to get the latest alertmanager configuration.
type GetLatestAlertmanagerConfigurationQuery struct {
Result *AlertConfiguration
}
// SaveAlertmanagerConfigurationCmd is the command to save an alertmanager configuration.
type SaveAlertmanagerConfigurationCmd struct {
AlertmanagerConfiguration string
ConfigurationVersion string
Default bool
}
type DeleteAlertmanagerConfigurationCmd struct {
ID int64
}