Retrieving Live Measures of a Component

Using the eG REST API, the measures reported by executing the tests of one/more components during the current measurement period can be retrieved.

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

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

{

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

"componentType":"Microsoft SQL"

}

Example for retrieving current measures from an Oracle Database Server:

{

"componentName":"Oractest:1521:egora",

"componentType":"Oracle Database Server"

}

Body

Default:

{

"componentName":"comma-separated list of Hostname of the component:Port:SID/All",

"componentType":"Component Type"

}

If current measures of the Oracle Database server is to be retrieved, then the Key values should be specified as follows:

{

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

"componentType":"Component Type"

}

Optional:

{

"test":"Test name",

"measure":"Measure name".

"info":"Descriptor name",

"showDisplayName":"true/false"

}

 

Success Response
Type Code Content

JSON

200

[

{

"Measure Details for TEZ-MSSQL-DB:1433:Microsoft SQL": [

{

"Disk Activity": {

"priority": "minor",

"lastMeasurementTime": "Sep 01, 2022 17:38:19",

"Disk0 C:": [

{

"priority": "minor",

"Disk busy ": [

{

"priority": "minor",

"value": "96.6002",

"unit": "%"

}

],

"Disk busy due to reads ": [

{

"priority": "normal",

"value": "81.7349",

"unit": "%"

}

],

.

.

.

}]

}

}]

}]

 

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 Type or Component Name 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": "Please provide valid test name"} (or)

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

JSON

500 Server Error

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

Figure 1 : Example to retrieve current measures of a component using Postman REST Client

Retrieving Live Measures of a Component using cURL

To retrieve the measures of a component during the current measurement period through the REST API using cURL, the command should be specified in the following format:

curl -L -X POST "http://<eG Manager IP:Port>/api/eg/analytics/getLiveMeasure" -H "user:<eG username or domain/eG username>" -H "pwd:Base64 encoded password" -H "managerurl:http://<eG Manager IP:Port>" -–data-raw "{\"componentType\":\"name of component Type\",\”componentName\":\"name of the component:Port\",\"test\":\"name of test\", \"measure\":\"name of measure\",\"info\":\"Descriptor name\",\"showDisplayName\":\"true/false)\"}" -H "Content-Type:application/json"

Figure 2 shows an example of retrieving the current measures of a component using cURL.

Figure 2 : Retrieving current measures of a component using cURL