mirror of
https://github.com/grafana/grafana.git
synced 2025-02-14 09:33:34 -06:00
* Add validation for grafana recipient * Alertmanager API implementation (WIP) * Fix encoding/decoding receiver settings from/to YAML * Save templates together with the configuration * update POST to apply latest config * Alertmanager service enabled by the ngalert toggle * Silence API integration with Alertmanager * Apply suggestions from code review Co-authored-by: gotjosh <josue@grafana.com> Co-authored-by: Ganesh Vernekar <15064823+codesome@users.noreply.github.com>
37 lines
993 B
Go
37 lines
993 B
Go
package models
|
|
|
|
import "time"
|
|
|
|
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 time.Time `xorm:"created"`
|
|
}
|
|
|
|
// GetLatestAlertmanagerConfigurationQuery is the query to get the latest alertmanager configuration.
|
|
type GetLatestAlertmanagerConfigurationQuery struct {
|
|
Result *AlertConfiguration
|
|
}
|
|
|
|
// GetAlertmanagerConfigurationQuery is the query to get the latest alertmanager configuration.
|
|
type GetAlertmanagerConfigurationQuery struct {
|
|
ID int64
|
|
|
|
Result *AlertConfiguration
|
|
}
|
|
|
|
// SaveAlertmanagerConfigurationCmd is the command to save an alertmanager configuration.
|
|
type SaveAlertmanagerConfigurationCmd struct {
|
|
AlertmanagerConfiguration string
|
|
ConfigurationVersion string
|
|
}
|
|
|
|
type DeleteAlertmanagerConfigurationCmd struct {
|
|
ID int64
|
|
}
|