grafana-notifiers.ts 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378
  1. import { NotifierDTO } from 'app/types';
  2. export const grafanaNotifiersMock: NotifierDTO[] = [
  3. {
  4. type: 'teams',
  5. name: 'Microsoft Teams',
  6. heading: 'Teams settings',
  7. description: 'Sends notifications using Incoming Webhook connector to Microsoft Teams',
  8. info: '',
  9. options: [
  10. {
  11. element: 'input',
  12. inputType: 'text',
  13. label: 'URL',
  14. description: '',
  15. placeholder: 'Teams incoming webhook url',
  16. propertyName: 'url',
  17. selectOptions: null,
  18. showWhen: { field: '', is: '' },
  19. required: true,
  20. validationRule: '',
  21. secure: false,
  22. dependsOn: '',
  23. },
  24. ],
  25. },
  26. {
  27. type: 'hipchat',
  28. name: 'HipChat',
  29. heading: 'HipChat settings',
  30. description: 'Sends notifications uto a HipChat Room',
  31. info: '',
  32. options: [
  33. {
  34. element: 'input',
  35. inputType: 'text',
  36. label: 'Hip Chat Url',
  37. description: '',
  38. placeholder: 'HipChat URL (ex https://grafana.hipchat.com)',
  39. propertyName: 'url',
  40. selectOptions: null,
  41. showWhen: { field: '', is: '' },
  42. required: true,
  43. validationRule: '',
  44. secure: false,
  45. dependsOn: '',
  46. },
  47. {
  48. element: 'input',
  49. inputType: 'text',
  50. label: 'API Key',
  51. description: '',
  52. placeholder: 'HipChat API Key',
  53. propertyName: 'apiKey',
  54. selectOptions: null,
  55. showWhen: { field: '', is: '' },
  56. required: true,
  57. validationRule: '',
  58. secure: false,
  59. dependsOn: '',
  60. },
  61. {
  62. element: 'input',
  63. inputType: 'text',
  64. label: 'Room ID',
  65. description: '',
  66. placeholder: '',
  67. propertyName: 'roomid',
  68. selectOptions: null,
  69. showWhen: { field: '', is: '' },
  70. required: false,
  71. validationRule: '',
  72. secure: false,
  73. dependsOn: '',
  74. },
  75. ],
  76. },
  77. {
  78. type: 'webhook',
  79. name: 'webhook',
  80. heading: 'Webhook settings',
  81. description: 'Sends HTTP POST request to a URL',
  82. info: '',
  83. options: [
  84. {
  85. element: 'input',
  86. inputType: 'text',
  87. label: 'Url',
  88. description: '',
  89. placeholder: '',
  90. propertyName: 'url',
  91. selectOptions: null,
  92. showWhen: { field: '', is: '' },
  93. required: true,
  94. validationRule: '',
  95. secure: false,
  96. dependsOn: '',
  97. },
  98. {
  99. element: 'select',
  100. inputType: '',
  101. label: 'Http Method',
  102. description: '',
  103. placeholder: '',
  104. propertyName: 'httpMethod',
  105. selectOptions: [
  106. { value: 'POST', label: 'POST' },
  107. { value: 'PUT', label: 'PUT' },
  108. ],
  109. showWhen: { field: '', is: '' },
  110. required: false,
  111. validationRule: '',
  112. secure: false,
  113. dependsOn: '',
  114. },
  115. {
  116. element: 'input',
  117. inputType: 'text',
  118. label: 'Username',
  119. description: '',
  120. placeholder: '',
  121. propertyName: 'username',
  122. selectOptions: null,
  123. showWhen: { field: '', is: '' },
  124. required: false,
  125. validationRule: '',
  126. secure: false,
  127. dependsOn: '',
  128. },
  129. {
  130. element: 'input',
  131. inputType: 'password',
  132. label: 'Password',
  133. description: '',
  134. placeholder: '',
  135. propertyName: 'password',
  136. selectOptions: null,
  137. showWhen: { field: '', is: '' },
  138. required: false,
  139. validationRule: '',
  140. secure: true,
  141. dependsOn: '',
  142. },
  143. ],
  144. },
  145. {
  146. type: 'prometheus-alertmanager',
  147. name: 'Prometheus Alertmanager',
  148. heading: 'Alertmanager settings',
  149. description: 'Sends alert to Prometheus Alertmanager',
  150. info: '',
  151. options: [
  152. {
  153. element: 'input',
  154. inputType: 'text',
  155. label: 'Url',
  156. description:
  157. 'As specified in Alertmanager documentation, do not specify a load balancer here. Enter all your Alertmanager URLs comma-separated.',
  158. placeholder: 'http://localhost:9093',
  159. propertyName: 'url',
  160. selectOptions: null,
  161. showWhen: { field: '', is: '' },
  162. required: true,
  163. validationRule: '',
  164. secure: false,
  165. dependsOn: '',
  166. },
  167. {
  168. element: 'input',
  169. inputType: 'text',
  170. label: 'Basic Auth User',
  171. description: '',
  172. placeholder: '',
  173. propertyName: 'basicAuthUser',
  174. selectOptions: null,
  175. showWhen: { field: '', is: '' },
  176. required: false,
  177. validationRule: '',
  178. secure: false,
  179. dependsOn: '',
  180. },
  181. {
  182. element: 'input',
  183. inputType: 'password',
  184. label: 'Basic Auth Password',
  185. description: '',
  186. placeholder: '',
  187. propertyName: 'basicAuthPassword',
  188. selectOptions: null,
  189. showWhen: { field: '', is: '' },
  190. required: false,
  191. validationRule: '',
  192. secure: true,
  193. dependsOn: '',
  194. },
  195. ],
  196. },
  197. {
  198. type: 'email',
  199. name: 'Email',
  200. heading: 'Email settings',
  201. description: 'Sends notifications using Grafana server configured SMTP settings',
  202. info: '',
  203. options: [
  204. {
  205. element: 'checkbox',
  206. inputType: '',
  207. label: 'Single email',
  208. description: 'Send a single email to all recipients',
  209. placeholder: '',
  210. propertyName: 'singleEmail',
  211. selectOptions: null,
  212. showWhen: { field: '', is: '' },
  213. required: false,
  214. validationRule: '',
  215. secure: false,
  216. dependsOn: '',
  217. },
  218. {
  219. element: 'textarea',
  220. inputType: '',
  221. label: 'Addresses',
  222. description: 'You can enter multiple email addresses using a ";" separator',
  223. placeholder: '',
  224. propertyName: 'addresses',
  225. selectOptions: null,
  226. showWhen: { field: '', is: '' },
  227. required: true,
  228. validationRule: '',
  229. secure: false,
  230. dependsOn: '',
  231. },
  232. ],
  233. },
  234. {
  235. type: 'slack',
  236. name: 'Slack',
  237. heading: 'Slack settings',
  238. description: 'Sends notifications to Slack',
  239. info: '',
  240. options: [
  241. {
  242. element: 'input',
  243. inputType: 'text',
  244. label: 'Recipient',
  245. description:
  246. 'Specify channel or user, use #channel-name, @username (has to be all lowercase, no whitespace), or user/channel Slack ID - required unless you provide a webhook',
  247. placeholder: '',
  248. propertyName: 'recipient',
  249. selectOptions: null,
  250. showWhen: { field: '', is: '' },
  251. required: true,
  252. validationRule: '',
  253. secure: false,
  254. dependsOn: 'secureSettings.url',
  255. },
  256. {
  257. element: 'input',
  258. inputType: 'text',
  259. label: 'Token',
  260. description: 'Provide a Slack API token (starts with "xoxb") - required unless you provide a webhook',
  261. placeholder: '',
  262. propertyName: 'token',
  263. selectOptions: null,
  264. showWhen: { field: '', is: '' },
  265. required: true,
  266. validationRule: '',
  267. secure: true,
  268. dependsOn: 'secureSettings.url',
  269. },
  270. {
  271. element: 'input',
  272. inputType: 'text',
  273. label: 'Username',
  274. description: "Set the username for the bot's message",
  275. placeholder: '',
  276. propertyName: 'username',
  277. selectOptions: null,
  278. showWhen: { field: '', is: '' },
  279. required: false,
  280. validationRule: '',
  281. secure: false,
  282. dependsOn: '',
  283. },
  284. {
  285. element: 'input',
  286. inputType: 'text',
  287. label: 'Icon emoji',
  288. description: "Provide an emoji to use as the icon for the bot's message. Overrides the icon URL.",
  289. placeholder: '',
  290. propertyName: 'iconEmoji',
  291. selectOptions: null,
  292. showWhen: { field: '', is: '' },
  293. required: false,
  294. validationRule: '',
  295. secure: false,
  296. dependsOn: '',
  297. },
  298. {
  299. element: 'input',
  300. inputType: 'text',
  301. label: 'Icon URL',
  302. description: "Provide a URL to an image to use as the icon for the bot's message",
  303. placeholder: '',
  304. propertyName: 'iconUrl',
  305. selectOptions: null,
  306. showWhen: { field: '', is: '' },
  307. required: false,
  308. validationRule: '',
  309. secure: false,
  310. dependsOn: '',
  311. },
  312. {
  313. element: 'input',
  314. inputType: 'text',
  315. label: 'Mention Users',
  316. description:
  317. "Mention one or more users (comma separated) when notifying in a channel, by ID (you can copy this from the user's Slack profile)",
  318. placeholder: '',
  319. propertyName: 'mentionUsers',
  320. selectOptions: null,
  321. showWhen: { field: '', is: '' },
  322. required: false,
  323. validationRule: '',
  324. secure: false,
  325. dependsOn: '',
  326. },
  327. {
  328. element: 'input',
  329. inputType: 'text',
  330. label: 'Mention Groups',
  331. description:
  332. "Mention one or more groups (comma separated) when notifying in a channel (you can copy this from the group's Slack profile URL)",
  333. placeholder: '',
  334. propertyName: 'mentionGroups',
  335. selectOptions: null,
  336. showWhen: { field: '', is: '' },
  337. required: false,
  338. validationRule: '',
  339. secure: false,
  340. dependsOn: '',
  341. },
  342. {
  343. element: 'select',
  344. inputType: '',
  345. label: 'Mention Channel',
  346. description: 'Mention whole channel or just active members when notifying',
  347. placeholder: '',
  348. propertyName: 'mentionChannel',
  349. selectOptions: [
  350. { value: '', label: 'Disabled' },
  351. { value: 'here', label: 'Every active channel member' },
  352. { value: 'channel', label: 'Every channel member' },
  353. ],
  354. showWhen: { field: '', is: '' },
  355. required: false,
  356. validationRule: '',
  357. secure: false,
  358. dependsOn: '',
  359. },
  360. {
  361. element: 'input',
  362. inputType: 'text',
  363. label: 'Webhook URL',
  364. description:
  365. "Optionally provide a Slack incoming webhook URL for sending messages, in this case the token isn't necessary",
  366. placeholder: 'Slack incoming webhook URL',
  367. propertyName: 'url',
  368. selectOptions: null,
  369. showWhen: { field: '', is: '' },
  370. required: true,
  371. validationRule: '',
  372. secure: true,
  373. dependsOn: 'token',
  374. },
  375. ],
  376. },
  377. ];