2021-03-18 18:12:28 +00:00
|
|
|
package models
|
|
|
|
|
|
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
|
2022-03-23 09:31:46 +01:00
|
|
|
ConfigurationHash string
|
2021-03-18 18:12:28 +00:00
|
|
|
ConfigurationVersion string
|
2021-06-04 15:52:41 +03:00
|
|
|
CreatedAt int64 `xorm:"created"`
|
2021-05-14 19:49:54 +01:00
|
|
|
Default bool
|
2021-08-12 16:04:09 +03:00
|
|
|
OrgID int64 `xorm:"org_id"`
|
2021-03-18 18:12:28 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// GetLatestAlertmanagerConfigurationQuery is the query to get the latest alertmanager configuration.
|
|
|
|
|
type GetLatestAlertmanagerConfigurationQuery struct {
|
2021-08-12 16:04:09 +03:00
|
|
|
OrgID int64
|
2021-03-31 23:00:56 +03:00
|
|
|
Result *AlertConfiguration
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// SaveAlertmanagerConfigurationCmd is the command to save an alertmanager configuration.
|
|
|
|
|
type SaveAlertmanagerConfigurationCmd struct {
|
|
|
|
|
AlertmanagerConfiguration string
|
2022-03-23 09:31:46 +01:00
|
|
|
FetchedConfigurationHash string
|
2021-03-31 23:00:56 +03:00
|
|
|
ConfigurationVersion string
|
2021-05-14 19:49:54 +01:00
|
|
|
Default bool
|
2021-08-12 16:04:09 +03:00
|
|
|
OrgID int64
|
2021-03-31 23:00:56 +03:00
|
|
|
}
|