Alerting: Add database table for persisting alerting configuration (#32042)

* Alerting: Add database table for persisting alerting configuration

* Fix the linter

* Address review comments

* Don't split templates and configuration

It is already bundled together as part of a of the API so might as well
marshall it directly.
This commit is contained in:
gotjosh
2021-03-18 18:12:28 +00:00
committed by GitHub
parent 6c7f0fece8
commit cc74b1fe46
5 changed files with 73 additions and 0 deletions

View File

@@ -0,0 +1,20 @@
package models
import "time"
// 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"`
UpdatedAt time.Time `xorm:"updated"`
}
// GetLatestAlertmanagerConfigurationQuery is the query to get the latest alertmanager configuration.
type GetLatestAlertmanagerConfigurationQuery struct {
ID int64
Result *AlertConfiguration
}