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

Inputs to be Specified
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":"Disk Space - Xen",

"orderby":"desc",

"componentName":"VDI_207",

"showData":"test"

}

Body

Default:

{

"test":"Test name",

"componentName":"Hostname of the component:Port",

"info":"info"

}

Optional:

{

"lastmeasure":"true/false",

"startDate":"start date",

"endDate":"End date",

"measuresList":"comma-separated list of measures",

"msmthost":"Measurement Host",

"showData":"Test",

"segment":"Segment name",

"service":"Service name",

"filterHost":"Search Host",

"filterInfo":"Search info",

"groupby":"measure",

"orderby":"Ascending/Descending",

"dateformat":"Date format",

}

 

Success Response
Type Code Content

JSON

200

[

[

"TRGT_HOST PORT_NO SITE_NAME INFO MSMT_HOST MSMT_TIME TOTAL_CAPACITY TOTAL_CAPACITY_ST PE_SIZE PE_SIZE_ST TOTAL_PE TOTAL_PE_ST ALLOC_PE ALLOC_PE_ST USED_SPACE USED_SPACE_ST DISK_USAGE DISK_USAGE_ST FREE_PE FREE_PE_ST FREE_SPACE FREE_SPACE_ST ALLOCATED_SIZE ALLOCATED_SIZE_ST UNALLOCATED_SIZE UNALLOCATED_SIZE_ST ALLOCATED_PCT ALLOCATED_PCT_ST ALLOCATED_VSPCT ALLOCATED_VSPCT_ST ",

"VDI_207 NULL NULL +Local storage 172.16.10.80 2022-08-26 11:50:19 835.0576 GOOD -5.0000 GOOD 213774.0000 GOOD 23211.0000 GOOD 90.6715 GOOD 10.8600 GOOD 190562.0000 GOOD 744.3861 GOOD 336.0000 GOOD 499.0576 GOOD 40.2400 GOOD 26.9900 GOOD",

"VDI_207 NULL NULL +Local storage 172.16.10.80 2022-08-26 11:54:57 835.0576 GOOD -5.0000 GOOD 213774.0000 GOOD 23211.0000 GOOD 90.6715 GOOD 10.8600 GOOD 190562.0000 GOOD 744.3861 GOOD 336.0000 GOOD 499.0576 GOOD 40.2400 GOOD 26.9900 GOOD",

.

.

.

]

 

Failure Response
Type Code Content

JSON

401 UNAUTHORIZED

{"code": 401,"error": "Invalid username or password"}

JSON

400 BAD REQUEST

You may receive one of the following responses:

{"code": 400,"error": "Bad Request. Header parameters : Username or Password or Manager URL is missing"} (or)

{"code": 400,"error": "Bad Request. Header parameters : Manager URL, Username or Password is not provided"} (or)

{"code": 400,"error": "No components associated for this user "}

JSON

500 Server Error

{"code": 500,"error": " Server Error. Please check /manager/logs/error_log in the installation directory for more information."}

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 -L -X 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\",\"componentName\":\"Name of Component\",\"showData\":\"test\"}

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