mirror of
https://github.com/grafana/grafana.git
synced 2025-01-27 16:57:14 -06:00
Fixes 48972 - Exposes channels.WebhookMessage (#56140)
This commit is contained in:
parent
45edce90d3
commit
26bb139470
@ -123,8 +123,8 @@ func buildWebhookNotifier(factoryConfig FactoryConfig) (*WebhookNotifier, error)
|
||||
}, nil
|
||||
}
|
||||
|
||||
// webhookMessage defines the JSON object send to webhook endpoints.
|
||||
type webhookMessage struct {
|
||||
// WebhookMessage defines the JSON object send to webhook endpoints.
|
||||
type WebhookMessage struct {
|
||||
*ExtendedData
|
||||
|
||||
// The protocol version.
|
||||
@ -161,7 +161,7 @@ func (wn *WebhookNotifier) Notify(ctx context.Context, as ...*types.Alert) (bool
|
||||
},
|
||||
as...)
|
||||
|
||||
msg := &webhookMessage{
|
||||
msg := &WebhookMessage{
|
||||
Version: "1",
|
||||
ExtendedData: data,
|
||||
GroupKey: groupKey.String(),
|
||||
|
@ -31,7 +31,7 @@ func TestWebhookNotifier(t *testing.T) {
|
||||
settings string
|
||||
alerts []*types.Alert
|
||||
|
||||
expMsg *webhookMessage
|
||||
expMsg *WebhookMessage
|
||||
expUrl string
|
||||
expUsername string
|
||||
expPassword string
|
||||
@ -53,7 +53,7 @@ func TestWebhookNotifier(t *testing.T) {
|
||||
},
|
||||
expUrl: "http://localhost/test",
|
||||
expHttpMethod: "POST",
|
||||
expMsg: &webhookMessage{
|
||||
expMsg: &WebhookMessage{
|
||||
ExtendedData: &ExtendedData{
|
||||
Receiver: "my_receiver",
|
||||
Status: "firing",
|
||||
@ -126,7 +126,7 @@ func TestWebhookNotifier(t *testing.T) {
|
||||
expHttpMethod: "PUT",
|
||||
expUsername: "user1",
|
||||
expPassword: "mysecret",
|
||||
expMsg: &webhookMessage{
|
||||
expMsg: &WebhookMessage{
|
||||
ExtendedData: &ExtendedData{
|
||||
Receiver: "my_receiver",
|
||||
Status: "firing",
|
||||
@ -191,7 +191,7 @@ func TestWebhookNotifier(t *testing.T) {
|
||||
},
|
||||
},
|
||||
},
|
||||
expMsg: &webhookMessage{
|
||||
expMsg: &WebhookMessage{
|
||||
ExtendedData: &ExtendedData{
|
||||
Receiver: "my_receiver",
|
||||
Status: "firing",
|
||||
|
Loading…
Reference in New Issue
Block a user