Retrieving Trend Data
Using the eG REST API, administrators can retrieve the trend data of the tests across all relevant component types. The table below specifies the URL and the parameters that should be used to retrieve the measures of the tests.
URL: http://<eG manager IP:port>/api/eg/analytics/getTrendData
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":"Oracle Latches", "host":"Oracle", "port":"1521", "info":"egurkha+redo allocation", "type":"Trend" } |
Body |
Default: { "test":"Test name", "host":"Host name", "port":"Port", "info":"info" } |
|
Optional: { "startDate":"start_date", "endDate":"end_date", "measure":"comma-separated list of measures", "msmthost":"Measurement Host", "type":"trend", "segment":"Segment Name", "service":"Service Name", "searchhost":"Search Host", "searchinfo":"Info", "groupby":"measure", "orderby":"Ascending/Descending", } |
Type | Code | Content |
---|---|---|
JSON |
200 |
[ "TRGT_HOST PORT_NO SITE_NAME INFO MSMT_HOST MSMT_TIME ", "172.16.14.93 NULL NULL +Disk0 C: D: E: 172.16.14.93 2022-04-25 00:00:00 ", "TEZWIN19O365 NULL NULL +Disk0 C: TEZWIN19O365 2022-04-25 00:00:00 ", "172.16.14.93 NULL NULL +Disk0 C: D: E: 172.16.14.93 2022-04-25 00:00:00 ", "TEZWIN19O365 NULL NULL +Disk0 C: TEZWIN19O365 2022-04-25 00:00:00 ", "TEZWIN19O365 NULL NULL +Disk0 C: TEZWIN19O365 2022-04-25 13:00:00 ", "TEZWIN19O365 NULL NULL +Disk0 C: TEZWIN19O365 2022-04-25 13:00:00 ", "172.16.14.93 NULL NULL +Disk0 C: D: E: 172.16.14.93 2022-04-25 14:00:00 ", . . . ] |
Type | Code | Content |
---|---|---|
JSON |
401 UNAUTHORIZED |
{"code": 401,"error": "Unauthorized user"} |
JSON |
500 Server Error |
{"code": 500,"error": " Server Error "} |
Figure 1 : Retrieving trend data of a chosen measure using Postman REST Client
Retrieving Trend Data using cURL
To retrieve trend data of the tests using cURL, the command should be specified in the following format:
curl -location -request POST "http://<eG Manager IP:Port>/api/eg/analytics/getTrendData" -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\",\"measure\":\"comma-separated list of measures\",\"type\":\"Trend\"}"
Figure 2 shows an example to retrieve the trend data for the measures of a chosen test using cURL.
Figure 2 : An example cURL command to retrieve the trend data for the measures
Figure 3 shows a sample output that retrieves the trend data for the chosen measures of a chosen test reported by eG Enterprise using cURL.
Figure 3 : Sample output with the trend data for the chosen measures of a chosen test