Retrieving Live Measures of a Component

Using the eG REST API, the measures reported by executing the tests of a component 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

{

"servername":"windows_136",

"servertype":"Microsoft Windows"

}

Example for retrieving current measures from an Oracle Database Server:

{

"servername":"Oractest:1521:egora",

"servertype":"Oracle Database Server"

}

Body

{

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

"servertype":"Component Type"

}

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

{

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

"servertype":"Component Type"

}

 

Success Response
Type Code Content

JSON

200

[{"Measure Details for windows_136:Microsoft Windows": [{

"Disk Space": {

"State": "GOOD",

"Last Measurement Time": "Aug 17, 2020 00:30:36",

"Total capacity": [{

"State": "GOOD",

"Value": "51098",

"Unit": "MB"

}]

}

}]

}]

 

Failure Response
Type Code Content

JSON

401 UNAUTHORIZED

{"code": 401,"error": "Unauthorized user"}

JSON

500 Server Error

{"code": 500,"error": " Server Error "}

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 -location -request 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>" -d"{\"servertype\":\Microsoft Windows\",\servername\":\"name of the component\"}" -H"Content-Type:application/json" -s

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