Retrieving Test Data
Using the eG REST API, administrators can retrieve the measurement data collected upon execution of tests across all relevant component types. The table below specifies the parameters that should be used to retrieve the measures of the tests.
URL: http://<eG manager IP:port>/api/eg/analytics/getTestData
Method: POST
Content-Type: application/json
Parameters | Key values | Example |
---|---|---|
Headers |
managerurl: Base URL of the eG Manager i.e., http://<IP address of the eG console:Port> user: eG username or domain/eG username pwd: Base64 encoded password |
{ "test":"TCP Port Status", "host":"sql", "port":"1433", "lastmeasure":"true", "startDate":"2020-01-29 18:00:26", "endDate":"2020-01-29 18:15:03" } |
Body |
Default: { "test":"Test name", "host":"Host name", "port":"Port", "info":"info" } |
|
Optional: { "lastmeasure":"true/false", "startDate":"start date", "endDate":"End date", "measures":"comma-separated list of measures", "msmthost":"Measurement Host", "type":"dd", "segment":"Segment name", "service":"Service name", "searchhost":"Search Host", "searchinfo":"Search info", "groupby":"measure", "orderby":"Ascending/Descending", "dateformat":"Date formant", } |
Type | Code | Content |
---|---|---|
JSON |
200 |
[ "TRGT_HOST PORT_NO SITE_NAME INFO MSMT_HOST MSMT_TIME AVAILABILITY AVAILABILITY_ST RESPONSETIME RESPONSETIME_ST ", "", "cvadddc7v1912 80 NULL +80 eGDP169 2020-09-17 15:34:58 100.0000 GOOD 0.0030 GOOD", "cvadddc7v1912 80 NULL +80 eGDP169 2020-09-17 15:39:48 100.0000 GOOD 0.0030 GOOD", "cvadddc7v1912 80 NULL +80 eGDP169 2020-09-17 15:44:41 100.0000 GOOD 0.0040 GOOD", "cvadddc7v1912 80 NULL +80 eGDP169 2020-09-17 15:49:39 100.0000 GOOD 0.0070 GOOD", . . . ] |
Type | Code | Content |
---|---|---|
JSON |
401 UNAUTHORIZED |
{"code": 401,"error": "Unauthorized user"} |
JSON |
500 Server Error |
{"code": 500,"error": " Server Error "} |
Figure 1 : Retrieving measurement data of a test using Postman REST Client
Retrieving Test Data using cURL
To retrieve the measurement data collected upon execution of tests across all relevant component types using cURL, the command should be specified in the following format:
curl -location -request POST "http://<eG Manager IP:Port>/api/eg/analytics/getTestData" -H "user:<eG username or domain/eG username>" -H "pwd:Base64 encoded password" -H "managerurl:http://<eG Manager IP:Port>" -H"Content-Type:application/json" --data-raw "{\"test\":\"test name\"}
Figure 2 shows an example cURL command for retrieving the measurement data that is reported by eG Enterprise by monitoring all the components in the target environment.
Figure 2 : An example cURL command to retrieve the measurement data of the test
Figure 3 shows a sample output that retrieves the measurement data of a chosen test reported by eG Enterprise using cURL.
Figure 3 : Sample output with the measurement data of a test across all monitored component types