@@ -34,7 +34,7 @@ import {
3434 sendRequest ,
3535 APIMonitorError ,
3636} from './request' ;
37- import { generateURL } from './utils' ;
37+ import { build_proxy_settings , generateURL } from './utils' ;
3838
3939// Default batch size for bulk put / delete
4040export const BATCH_SIZE = parseInt ( process . env . CHUNK_SIZE ) || 250 ;
@@ -57,6 +57,7 @@ export async function bulkPutMonitors(
5757 method : 'PUT' ,
5858 auth : options . auth ,
5959 body : JSON . stringify ( { monitors : schemas } ) ,
60+ proxyAgent : build_proxy_settings ( options . proxy_uri , options . proxy_token ) ,
6061 } ) ;
6162
6263 const { failedMonitors } = resp ;
@@ -103,6 +104,7 @@ const fetchMonitors = async (options: PushOptions, afterKey?: string) => {
103104 url,
104105 method : 'GET' ,
105106 auth : options . auth ,
107+ proxyAgent : build_proxy_settings ( options . proxy_uri , options . proxy_token ) ,
106108 } ) ;
107109 return {
108110 afterKey : resp . after_key ,
@@ -124,6 +126,7 @@ export async function bulkDeleteMonitors(
124126 method : 'DELETE' ,
125127 auth : options . auth ,
126128 body : JSON . stringify ( { monitors : monitorIDs } ) ,
129+ proxyAgent : build_proxy_settings ( options . proxy_uri , options . proxy_token ) ,
127130 } ) ;
128131}
129132
@@ -138,6 +141,7 @@ export async function getVersion(options: PushOptions) {
138141 url : generateURL ( options , 'status' ) ,
139142 method : 'GET' ,
140143 auth : options . auth ,
144+ proxyAgent : build_proxy_settings ( options ?. proxy_uri , options ?. proxy_token ) ,
141145 } ) ;
142146
143147 return data . kibana . version ;
@@ -169,6 +173,7 @@ export async function createMonitorsLegacy({
169173 method : 'PUT' ,
170174 auth : options . auth ,
171175 body : JSON . stringify ( schema ) ,
176+ proxyAgent : build_proxy_settings ( options . proxy_uri , options . proxy_token ) ,
172177 } ) ;
173178
174179 const resBody = await handleError ( statusCode , url , body ) ;
0 commit comments