File tree Expand file tree Collapse file tree 9 files changed +949
-48
lines changed
legacy/plugins/actions/server/builtin_action_types
test/alerting_api_integration
common/fixtures/plugins/actions
security_and_spaces/tests/actions Expand file tree Collapse file tree 9 files changed +949
-48
lines changed Original file line number Diff line number Diff line change @@ -10,10 +10,12 @@ import { actionType as serverLogActionType } from './server_log';
1010import { actionType as slackActionType } from './slack' ;
1111import { actionType as emailActionType } from './email' ;
1212import { actionType as indexActionType } from './es_index' ;
13+ import { actionType as pagerDutyActionType } from './pagerduty' ;
1314
1415export function registerBuiltInActionTypes ( actionTypeRegistry : ActionTypeRegistry ) {
1516 actionTypeRegistry . register ( serverLogActionType ) ;
1617 actionTypeRegistry . register ( slackActionType ) ;
1718 actionTypeRegistry . register ( emailActionType ) ;
1819 actionTypeRegistry . register ( indexActionType ) ;
20+ actionTypeRegistry . register ( pagerDutyActionType ) ;
1921}
Original file line number Diff line number Diff line change 1+ /*
2+ * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
3+ * or more contributor license agreements. Licensed under the Elastic License;
4+ * you may not use this file except in compliance with the Elastic License.
5+ */
6+
7+ import axios , { AxiosResponse } from 'axios' ;
8+ import { Services } from '../../types' ;
9+
10+ interface PostPagerdutyOptions {
11+ apiUrl : string ;
12+ data : any ;
13+ headers : Record < string , string > ;
14+ services : Services ;
15+ }
16+
17+ // post an event to pagerduty
18+ export async function postPagerduty ( options : PostPagerdutyOptions ) : Promise < AxiosResponse > {
19+ const { apiUrl, data, headers } = options ;
20+ const axiosOptions = {
21+ headers,
22+ validateStatus : ( ) => true ,
23+ } ;
24+
25+ return axios . post ( apiUrl , data , axiosOptions ) ;
26+ }
You can’t perform that action at this time.
0 commit comments