in src/helpers.ts [82:110]
export async function getPodData(request: APIRequestContext) {
const currentTime: number = Date.now();
const startTime: number = currentTime - 86400000;
let response = await request.post('api/metrics/snapshot', {
headers: {
"accept": "application/json",
"Authorization": API_KEY,
"Content-Type": "application/json;charset=UTF-8",
"kbn-xsrf": "true",
"x-elastic-internal-origin": "kibana"
},
data: {
"filterQuery": "",
"metrics": [{ "type": "cpu" }],
"nodeType": "pod",
"sourceId": "default",
"accountId": "",
"region": "",
"groupBy": [],
"timerange": { "interval": "1m", "to": currentTime, "from": startTime, "lookbackSize": 5 },
"includeTimeseries": true,
"dropPartialBuckets": true
}
})
expect(response.status()).toBe(200);
const jsonData = JSON.parse(await response.text());
return jsonData;
}