Retrieving the Elements Associated with a Zone

To retrieve the details of elements such as sub-zones, services, segments and components associated with a zone added on eG Enterprise, administrators can use the eG REST API. The URL can be specified in the following format:

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

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

{

"zone" : "egAgentZone"

}

Body

{

"zone” : "name of zone"

}

 

 

Success Response
Type Code Content

JSON

200

{

"Components": {

"Total": 5,

"Summary": [

{

"critical": 1,

"color": "#cd0f0f"

},

{

"major": 0,

"color": "#fa9d1c"

},

{

"minor": 0,

"color": "#ccc100"

},

{

"unknown": 0,

"color": "#30a1d9"

},

{

"normal": 4,

"color": "#0c9a12"

}

],

"Details": [

{

"name": "eGDP180",

"priority": "critical",

"type": "eG Agent"

},

{

"name": "CTXCLD-SF",

"priority": "normal",

"type": "eG Agent"

},

{

"name": "cvad2003pvs2",

"priority": "normal",

"type": "eG Agent"

},

{

"name": "VAD1909-DDC1",

"priority": "normal",

"type": "eG Agent"

},

{

"name": "VAD1909-SF",

"priority": "normal",

"type": "eG Agent"

}

]

}

}

 

Failure Response
Type Code Content

JSON

401 UNAUTHORIZED

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

JSON

400 BAD REQUEST

{"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": "Please give Zone name. 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 the details of the elements associated with a zone using Postman REST Client

Retrieving Details of Elements Associated with Zones using cURL

To retrieve the details of the elements associated with a zone added on eG Enterprise using cURL, the command should be specified in the following format:

curl -location -request POST "http://<eG Manager IP:Port>/api/eg/analytics/getZoneDetails" -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 "{\"zone\" : \"name of zone\"}""

Figure 2 shows an example for retrieving the details of all the elements associated with a zone using cURL.

Figure 2 : Retrieving the details of all the elements associated with a zone using cURL