Retrieving Problem Duration
Using the eG REST API, administrators can retrieve the duration for which an alarm was open for all component types or components or layers specific to the component type or tests specific to a component type.
Retrieving Problem Duration for Component Types
URL: http://<eG manager IP:port>/api/eg/analytics/getProblemDuration/servertype
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 |
{ "timeline":"1 hour" } |
Body |
Default: { "timeline":"Timeline for retrieving the alarm duration (in hours/days/weeks)" } |
Type | Code | Content |
---|---|---|
JSON |
200 |
{ "problemDuration": [ { "componentType": "Citrix License", "minDuration": "0s", "maxDuration": "1D", "avgDuration": "3h 33m" }, . . . } |
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": " Component type 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": "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 the duration for which an alarm was open for all Component Types using Postman REST Client
Retrieving Problem Duration for all Component Types using cURL
To retrieve the duration for which an alarm was open for the component types managed in the target environment using cURL, the command should be specified in the following format:
curl -L -X POST "http://<eG Manager IP:Port>/api/eg/analytics/getProblemDuration/servertype" -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 alarm duration(in hours/days/weeks)\"}"
Figure 2 shows an example of retrieving the duration for which an alarm was open for the component types managed in the target environment using cURL.
Figure 2 : Retrieving the duration for which an alarm was open for all Component Types using cURL
Retrieving Problem Duration for all Components
URL: http://<eG manager IP:port>/api/eg/analytics/getProblemDuration/servername
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 |
{ "timeline":"1 hour" } |
Body |
Default: { "timeline":"Timeline for retrieving the alarms (in hours/days/weeks)" } |
Type | Code | Content |
---|---|---|
JSON |
200 |
{ "problemDuration": [ { "componentName": "CTXCONNECTSRV", "minDuration": "0s", "maxDuration": "2D 22h", "avgDuration": "14h 55m" }, . . . } |
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": " Component type 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": "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 3 : Retrieving the duration for which an alarm was open for all Components using Postman REST Client
Retrieving Problem Duration for all Components using cURL
To retrieve the duration for which an alarm was open for all components managed in the target environment using cURL, the command should be specified in the following format:
curl -L -X POST "http://<eG Manager IP:Port>/api/eg/analytics/getProblemDuration/servername" -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 alarm duration(in hours/days/weeks)\"}"
Figure 2 shows an example of retrieving the duration for which an alarm was open for all components managed in the target environment using cURL.
Figure 4 : Retrieving the duration for which an alarm was open for all Components using cURL
Retrieving Problem Duration for all Layers of a Component Type
URL: http://<eG manager IP:port>/api/eg/analytics/getProblemDuration/layer
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 |
{ "timeline":"2 weeks", "componentType":Microsoft SQL" } |
Body |
Default: { "timeline":"Timeline for retrieving the alarms (in hours/days/weeks)", "componentType":"Component Type" } |
Type | Code | Content |
---|---|---|
JSON |
200 |
{ "problemDuration": [ { "layer": "Windows Service", "minDuration": "1s", "maxDuration": "2h 5m", "avgDuration": "6m 8s" }, . . . } |
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": " Component type 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": "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 5 : Retrieving the duration for which an alarm was open for all layers of a Component type using Postman REST Client
Retrieving Problem Duration for all Layers of a Component Type using cURL
To retrieve the duration for which an alarm was open for all layers of a component type managed in the target environment using cURL, the command should be specified in the following format:
curl -L -X POST "http://<eG Manager IP:Port>/api/eg/analytics/getProblemDuration/layer" -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 alarm duration(in hours/days/weeks)\",\"ComponentType\":\"Component Type\"}"
Figure 2 shows an example of retrieving the duration for which an alarm was open for all layers corresponding to a component type managed in the target environment using cURL.
Figure 6 : Retrieving the duration for which an alarm was open for all layers of a Component types using cURL
Retrieving Problem Duration for all Tests of a Component Type
URL: http://<eG manager IP:port>/api/eg/analytics/getProblemDuration/test
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 |
{ "timeline":"2 weeks", "componentType":Microsoft SQL" } |
Body |
Default: { "timeline":"Timeline for retrieving the alarms (in hours/days/weeks)", "componentType":"Component Type" } |
Type | Code | Content |
---|---|---|
JSON |
200 |
{ "problemDuration": [ { "test": "Uptime", "minDuration": "4m 2s", "maxDuration": "5m 9s", "avgDuration": "4m 35s" }, . . . } |
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": " Component type 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": "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 7 : Retrieving the duration for which an alarm was open for all Tests of a Component Type using Postman REST Client
Retrieving Problem Duration for all Tests of a Component Type using cURL
To retrieve the duration for which an alarm was open for all tests of a component type managed in the target environment using cURL, the command should be specified in the following format:
curl -L -X POST "http://<eG Manager IP:Port>/api/eg/analytics/getProblemDuration/test" -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 alarm duration(in hours/days/weeks)\",\"componentType\":\"Component Type\"}"
Figure 2 shows an example of retrieving the duration for which an alarm was open for all tests of a component type managed in the target environment using cURL.
Figure 8 : Retrieving the duration for which an alarm was open for all Tests of a Component Type using cURL