2021-03-18 18:12:28 +00:00
|
|
|
package models
|
|
|
|
|
|
|
|
|
|
import "time"
|
|
|
|
|
|
2021-03-31 23:00:56 +03:00
|
|
|
const AlertConfigurationVersion = 1
|
|
|
|
|
|
2021-03-18 18:12:28 +00:00
|
|
|
// AlertConfiguration represents a single version of the Alerting Engine Configuration.
|
|
|
|
|
type AlertConfiguration struct {
|
|
|
|
|
ID int64 `xorm:"pk autoincr 'id'"`
|
|
|
|
|
|
|
|
|
|
AlertmanagerConfiguration string
|
|
|
|
|
ConfigurationVersion string
|
|
|
|
|
CreatedAt time.Time `xorm:"created"`
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// GetLatestAlertmanagerConfigurationQuery is the query to get the latest alertmanager configuration.
|
|
|
|
|
type GetLatestAlertmanagerConfigurationQuery struct {
|
2021-03-31 23:00:56 +03:00
|
|
|
Result *AlertConfiguration
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// GetAlertmanagerConfigurationQuery is the query to get the latest alertmanager configuration.
|
|
|
|
|
type GetAlertmanagerConfigurationQuery struct {
|
2021-03-18 18:12:28 +00:00
|
|
|
ID int64
|
|
|
|
|
|
|
|
|
|
Result *AlertConfiguration
|
|
|
|
|
}
|
2021-03-31 23:00:56 +03:00
|
|
|
|
|
|
|
|
// SaveAlertmanagerConfigurationCmd is the command to save an alertmanager configuration.
|
|
|
|
|
type SaveAlertmanagerConfigurationCmd struct {
|
|
|
|
|
AlertmanagerConfiguration string
|
|
|
|
|
ConfigurationVersion string
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type DeleteAlertmanagerConfigurationCmd struct {
|
|
|
|
|
ID int64
|
|
|
|
|
}
|