How do you get ‘Worst 5 by Health’ & ‘Worst 5 by Risk’? Can you provide the details to get this information?
DX Dashboards 2.x
Use the below API which gives the both health, risk, and other service KPI depend upon the projectionFilter.
|
Attribute Name |
Description |
|
time |
An optional attribute with current Epoch time |
|
filters |
It can use if the specific filter like on service like name, risk and health etc, empty filter means for all. Example: "filters": [ { "fieldDescription": "Name", "field": "name", "value": " ExampleTest", "condition": "equals", "isCustom": false } ] |
|
sortField |
Service attribute name for sort |
|
sortOrder |
asc/desc |
|
groupServices |
False/true, if true, it will return only parent services |
|
pageNum |
Page number to get the result |
|
pageSize |
Size of service on per page |
|
projectionFilter |
ProjectionFIlter to control the response of the service. Below are the attribute we can pass. · "rollupFilteredAlarmCount", · "situationCount", · "availability", · "filteredParent", · "availability_lastday", · "immediateFilteredChildren", · "immediateFilterChildrenCount", · "health", · "extId", · "location", · "maintenance", · "name", · "risk", · "status", · "tags", · "isAvailabilityConfigured" |
|
showAlarms |
It will show the alarm count on the service |
Request :curl --request POST \ --url <oi-adminui endpoint>/oi/v2/servicerepo/services \ --header 'Authorization: Bearer <authorization token>' \ --header 'Content-Type: application/json' \ --data '{ "time": 1639647628189, "filters": [], "sortField": "health", "sortOrder": "asc", // asc/desc "groupServices": false, "pageNum": 1, "pageSize": 25, "projectionFilter": [
"availability",
"health",
"name",
"risk"
], "showAlarms": false}
Response:
{
"services": [
{
"name": "UIM",
"risk": 0.0,
"health": 100.0,
"nameLowerCase": "uim"
},
{
"name": "Third Level Top 1",
"risk": 0.0,
"health": 100.0,
"nameLowerCase": "third level top 1"
},
{
"name": "Banking Servic",
"risk": 0.0,
"health": 100.0,
"nameLowerCase": "banking servic"
},
{
"name": "P1",
"risk": 0.0,
"health": 100.0,
"nameLowerCase": "p1"
},
{
"name": "EMEA_Retail",
"risk": 0.0,
"health": 100.0,
"nameLowerCase": "emea_retail"
}
],
"groupedCnt": 0,
"filteredCnt": 9,
"totalCnt": 9,
"isAvailabilityConfigured": false
}
The exact API parameters for top 5 risk and top 5 health, are seen in the admin UI as below. You can add filters as per requirements.
"time" is the epoch millis for the current time for query.
Endpoint: POST <adminUI>/oi/v2/servicerepo/group
Header: Authorization: Bearer <user token fromUI>
Input payload (for "risk"):
|
for Risk |
for Health |
|
{ |
{ |
Response having "health". Similarly you'll get "risk" for the "risk" payload.
|
{ |