Hi Team,
I wanted to monitor the custom extension endpoints availability. There could be nearly 400 endpoints.
With the help of API we can get the list of all endpoint along with their state like OK or ERROR.
I’m trying to achieve it by using HTTP monitor. However, first part of code itself is failing to get the output. Below is the code snippet.
let responseBody = response.getResponseBody();
let jsonData = JSON.parse(responseBody);
let output = jsonData.filter(x => x.state== "ERROR_UNKNOWN");
let output1 = JSON.stringify(jsonData);
api.info(output1);
Input data would be like below,
{"states":[{"pluginId":"custom.plugin","version":"0.10","endpointId":"49562969167943889","state":"DISABLED","stateDescription":"","timestamp":1672122740061,"hostId":null,"processId":null},{"pluginId":"custom.plugin","version":"0.10","endpointId":"-5366867616866670749","state":"OK","stateDescription":"","timestamp":1672122740061,"hostId":null,"processId":null},{"pluginId":"custom.plugin","version":"0.10","endpointId":"-7117888994516915630","state":"ERROR_UNKNOWN","stateDescription":"Authentication failed.","timestamp":1672122746065,"hostId":null,"processId":null},{"pluginId":"custom.plugin","version":"0.10","endpointId":"-3595606123279855614","state":"DISABLED","stateDescription":"","timestamp":1672122740061,"hostId":null,"processId":null}]}
Has anybody done it successfully. Please suggest.
Regards,
AK