[Alerting]: Alertmanager API implementation (#32174)

* 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>
This commit is contained in:
Sofia Papagiannaki
2021-03-31 23:00:56 +03:00
committed by GitHub
co-authored by gotjosh Ganesh Vernekar
parent b0ffcfd558
commit a5e95823b2
21 changed files with 948 additions and 972 deletions
+15
View File
@@ -482,3 +482,18 @@ func (j *Json) MustUint64(args ...uint64) uint64 {
return def
}
// MarshalYAML implements yaml.Marshaller.
func (j *Json) MarshalYAML() (interface{}, error) {
return j.data, nil
}
// UnmarshalYAML implements yaml.Unmarshaller.
func (j *Json) UnmarshalYAML(unmarshal func(interface{}) error) error {
var data interface{}
if err := unmarshal(&data); err != nil {
return err
}
j.data = data
return nil
}