comparison mod_pubsub_alertmanager/mod_pubsub_alertmanager.lua @ 4620:9b253cce7d88

mod_pubsub_alertmanager: Allow configuring template for <body> rendering
author Kim Alvefur <zash@zash.se>
date Fri, 16 Jul 2021 12:26:55 +0200
parents b11001bd915d
children ebc2c099a11b
comparison
equal deleted inserted replaced
4619:b11001bd915d 4620:9b253cce7d88
55 end 55 end
56 end 56 end
57 return 202; 57 return 202;
58 end 58 end
59 59
60 local template = [[ 60 local template = module:get_option_string("alertmanager_body_template", [[
61 *ALARM!* 61 *ALARM!*
62 Status: {status} 62 Status: {status}
63 Starts at: {startsAt}{endsAt& 63 Starts at: {startsAt}{endsAt&
64 Ends at: {endsAt}} 64 Ends at: {endsAt}}
65 Labels: {labels% 65 Labels: {labels%
66 {idx}: {item}} 66 {idx}: {item}}
67 Annotations: {annotations% 67 Annotations: {annotations%
68 {idx}: {item}} 68 {idx}: {item}}
69 ]] 69 ]]);
70 70
71 module:hook("pubsub-summary/urn:uuid:e3bec775-c607-4e9b-9a3f-94de1316d861:v4", function(event) 71 module:hook("pubsub-summary/urn:uuid:e3bec775-c607-4e9b-9a3f-94de1316d861:v4", function(event)
72 local payload = event.payload; 72 local payload = event.payload;
73 73
74 local data = { 74 local data = {