Retrieving Top-N Analysis Data

To identify the best/worst players in a particular performance area, administrators need to rank components/descriptors for every metric collected by the eG Enterprise. For such ranking, administrators need to figure out the Top-N Analysis data offered by eG Enterprise. Using the eG REST API, administrators can figure out the Top-N data of the components/descriptors of a measure reported by eG Enterprise without logging into the eG console. The table below specifies the parameters that should be used to retrieve the health of the infrastructure.

URL: http://<eG manager IP:port>/api/eg/analytics/getTopNData

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

{

"timeline": "1 hour",

"componentName": "TEZ-MSSQL-DB:1433",

"componentType": "Microsoft SQL",

"test": "SQL Errors",

"measure": "Error rate",

"info": "Info Errors"

}

Body

Default:

{

"timeline":"Timeline for retrieving the measure data (in hours/days/weeks)",

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

"componentType":"Component Type",

"test":"Test name",

"measure":"Measure name",

"info":"Descriptor name",

"showDisplayName":"true/false"

}

 

Success Response
Type Code Content

JSON

200

[

{

"name": "TEZ-MSSQL-DB:1433 {Info Errors}",

"value": "11.51"

}

]

 

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. Manager Url,Username,password is not provided"} (or)

{"code": 400,"error": " Bad Request. Please refer EG REST API documentation and add required parameters for this API."} (or)

{"code": 400,"error": "Component Name or Component Type or Measure or Test or Timeline is not provided"} (or)

{"code": 400,"error": "Component not associated with this user"} (or)

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

{"code": 400,"error": "Provide a space between value and unit in Timeline"} (or)

{"code": 400,"error": "The test is not available with this component type"} (or)

{"code": 400,"error": "Invalid Timeline. Please refer EG REST API documentation for this API"}

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 Top-N Analysis Data using Postman REST Client

Retrieving Top-N Analysis Data using cURL

To retrieve the Top-N Data of components/descriptors using cURL, the command should be specified in the following format:

curl -L -X POST "http://<eG Manager IP:Port>/api/eg/analytics/getTopNData" -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 "{\"timeline\":\"Timeline for retrieving the Top-N data (in hours/days/weeks)\",\"componentType\":\"Component Type\",\"componentName\":\"Component name:Port\",\"test\":\"Test name\",\"measure\":\"Measure name\",\"info\":\"Descriptor name\"}"

Figure 2 shows an example of retrieving the Top-N Analysis Data using cURL.

Figure 2 : Retrieving Top-N Analysis Data using cURL