mirror of
https://github.com/prometheus/alertmanager
synced 2025-01-09 23:39:36 +00:00
Decode routeOpts from block
This commit is contained in:
parent
3b166e89e7
commit
c22599858a
@ -83,8 +83,15 @@ unwrapWithDefault default val =
|
||||
|
||||
blockDecoder : Json.Decoder Block
|
||||
blockDecoder =
|
||||
Json.map Block
|
||||
Json.map2 Block
|
||||
(field "alerts" <| Json.list alertDecoder)
|
||||
(field "routeOpts" routeOptsDecoder)
|
||||
|
||||
|
||||
routeOptsDecoder : Json.Decoder RouteOpts
|
||||
routeOptsDecoder =
|
||||
Json.map RouteOpts
|
||||
(field "receiver" Json.string)
|
||||
|
||||
|
||||
alertDecoder : Json.Decoder Alert
|
||||
|
@ -51,7 +51,13 @@ type alias Alert =
|
||||
|
||||
|
||||
type alias Block =
|
||||
{ alerts : List Alert }
|
||||
{ alerts : List Alert
|
||||
, routeOpts : RouteOpts
|
||||
}
|
||||
|
||||
|
||||
type alias RouteOpts =
|
||||
{ receiver : String }
|
||||
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user