grafana/pkg/services/ngalert/provisioning/compat.go
Yuri Tseretyan a8b4a4bb45
Alerting: Update alerting module to 20230418161049-5f374e58cb32 + refactoring (#66622)
* update to alerting 20230418161049-5f374e58cb32
* rename renamed structs in https://github.com/grafana/alerting/pull/73
* update ValidateContactPoint to use BuildReceiverConfiguration
* update logger factory according to changes
* rewrite integration builder
Co-authored-by: Santiago <santiagohernandez.1997@gmail.com>
2023-04-25 13:39:46 -04:00

23 lines
685 B
Go

package provisioning
import (
alertingNotify "github.com/grafana/alerting/notify"
"github.com/grafana/grafana/pkg/services/ngalert/api/tooling/definitions"
)
func EmbeddedContactPointToGrafanaIntegrationConfig(e definitions.EmbeddedContactPoint) (alertingNotify.GrafanaIntegrationConfig, error) {
data, err := e.Settings.MarshalJSON()
if err != nil {
return alertingNotify.GrafanaIntegrationConfig{}, err
}
return alertingNotify.GrafanaIntegrationConfig{
UID: e.UID,
Name: e.Name,
Type: e.Type,
DisableResolveMessage: e.DisableResolveMessage,
Settings: data,
SecureSettings: nil,
}, nil
}