mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -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
|
}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// webhookMessage defines the JSON object send to webhook endpoints.
|
// WebhookMessage defines the JSON object send to webhook endpoints.
|
||||||
type webhookMessage struct {
|
type WebhookMessage struct {
|
||||||
*ExtendedData
|
*ExtendedData
|
||||||
|
|
||||||
// The protocol version.
|
// The protocol version.
|
||||||
@ -161,7 +161,7 @@ func (wn *WebhookNotifier) Notify(ctx context.Context, as ...*types.Alert) (bool
|
|||||||
},
|
},
|
||||||
as...)
|
as...)
|
||||||
|
|
||||||
msg := &webhookMessage{
|
msg := &WebhookMessage{
|
||||||
Version: "1",
|
Version: "1",
|
||||||
ExtendedData: data,
|
ExtendedData: data,
|
||||||
GroupKey: groupKey.String(),
|
GroupKey: groupKey.String(),
|
||||||
|
@ -31,7 +31,7 @@ func TestWebhookNotifier(t *testing.T) {
|
|||||||
settings string
|
settings string
|
||||||
alerts []*types.Alert
|
alerts []*types.Alert
|
||||||
|
|
||||||
expMsg *webhookMessage
|
expMsg *WebhookMessage
|
||||||
expUrl string
|
expUrl string
|
||||||
expUsername string
|
expUsername string
|
||||||
expPassword string
|
expPassword string
|
||||||
@ -53,7 +53,7 @@ func TestWebhookNotifier(t *testing.T) {
|
|||||||
},
|
},
|
||||||
expUrl: "http://localhost/test",
|
expUrl: "http://localhost/test",
|
||||||
expHttpMethod: "POST",
|
expHttpMethod: "POST",
|
||||||
expMsg: &webhookMessage{
|
expMsg: &WebhookMessage{
|
||||||
ExtendedData: &ExtendedData{
|
ExtendedData: &ExtendedData{
|
||||||
Receiver: "my_receiver",
|
Receiver: "my_receiver",
|
||||||
Status: "firing",
|
Status: "firing",
|
||||||
@ -126,7 +126,7 @@ func TestWebhookNotifier(t *testing.T) {
|
|||||||
expHttpMethod: "PUT",
|
expHttpMethod: "PUT",
|
||||||
expUsername: "user1",
|
expUsername: "user1",
|
||||||
expPassword: "mysecret",
|
expPassword: "mysecret",
|
||||||
expMsg: &webhookMessage{
|
expMsg: &WebhookMessage{
|
||||||
ExtendedData: &ExtendedData{
|
ExtendedData: &ExtendedData{
|
||||||
Receiver: "my_receiver",
|
Receiver: "my_receiver",
|
||||||
Status: "firing",
|
Status: "firing",
|
||||||
@ -191,7 +191,7 @@ func TestWebhookNotifier(t *testing.T) {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
expMsg: &webhookMessage{
|
expMsg: &WebhookMessage{
|
||||||
ExtendedData: &ExtendedData{
|
ExtendedData: &ExtendedData{
|
||||||
Receiver: "my_receiver",
|
Receiver: "my_receiver",
|
||||||
Status: "firing",
|
Status: "firing",
|
||||||
|
Loading…
Reference in New Issue
Block a user