mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
AlertingNG: Add a global registry for notification channels (#32781)
Signed-off-by: Ganesh Vernekar <ganeshvern@gmail.com>
This commit is contained in:
parent
f345459441
commit
b1c84c795f
@ -25,6 +25,7 @@ import (
|
||||
|
||||
"github.com/grafana/grafana/pkg/infra/log"
|
||||
"github.com/grafana/grafana/pkg/registry"
|
||||
"github.com/grafana/grafana/pkg/services/alerting"
|
||||
ngmodels "github.com/grafana/grafana/pkg/services/ngalert/models"
|
||||
"github.com/grafana/grafana/pkg/services/ngalert/notifier/channels"
|
||||
"github.com/grafana/grafana/pkg/services/ngalert/store"
|
||||
@ -305,3 +306,29 @@ func timeoutFunc(d time.Duration) time.Duration {
|
||||
}
|
||||
return d + waitFunc()
|
||||
}
|
||||
|
||||
// GetAvailableNotifiers returns the metadata of all the notification channels that can be configured.
|
||||
func (am *Alertmanager) GetAvailableNotifiers() []*alerting.NotifierPlugin {
|
||||
return []*alerting.NotifierPlugin{
|
||||
{
|
||||
Type: "email",
|
||||
Name: "Email",
|
||||
Description: "Sends notifications using Grafana server configured SMTP settings",
|
||||
Heading: "Email settings",
|
||||
Options: []alerting.NotifierOption{
|
||||
{
|
||||
Label: "Single email",
|
||||
Description: "Send a single email to all recipients",
|
||||
Element: alerting.ElementTypeCheckbox,
|
||||
PropertyName: "singleEmail",
|
||||
}, {
|
||||
Label: "Addresses",
|
||||
Description: "You can enter multiple email addresses using a \";\" separator",
|
||||
Element: alerting.ElementTypeTextArea,
|
||||
PropertyName: "addresses",
|
||||
Required: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user