mirror of
https://github.com/grafana/grafana.git
synced 2025-08-02 06:32:15 +08:00

* update alerting module * use NotificationsConfiguration * update to use opts and configure new fields * use TenantID instead of orgId
19 lines
391 B
Go
19 lines
391 B
Go
package notifier
|
|
|
|
import (
|
|
"encoding/json"
|
|
"fmt"
|
|
|
|
api "github.com/grafana/grafana/pkg/services/ngalert/api/tooling/definitions"
|
|
)
|
|
|
|
func Load(rawConfig []byte) (*api.PostableUserConfig, error) {
|
|
cfg := &api.PostableUserConfig{}
|
|
|
|
if err := json.Unmarshal(rawConfig, cfg); err != nil {
|
|
return nil, fmt.Errorf("unable to parse Alertmanager configuration: %w", err)
|
|
}
|
|
|
|
return cfg, nil
|
|
}
|