User will need an opDashOperatorRole access for this API
Run alert by reference:
GET /op/api/v1/alerts/00000000-0000-0000-0000-a10000000001
{
"message": "Execution finished with no alerts.",
"esSearchResponse": {
"hits": {
"total": 0,
"hits": [],
"max_score": 0
},
"_shards": {
"total": 15,
"failed": 0,
"successful": 15
},
"timed_out": false,
"took": 236,
"aggregations": {
"terms1": {
"sum_other_doc_count": 0,
"buckets": [],
"doc_count_error_upper_bound": 0
}
}
},
"jsonQuery": "{\"query\":{\"bool\":{\"must\":{\"match_all\":{}},\"filter\":{\"bool\":{\"must\":[{\"range\":{\"systemLoadTimeInMil\":{\"gte\":1486024160406,\"lte\":1486027760406}}}],\"must_not\":[]}}}},\"aggs\":{\"terms1\":{\"terms\":{\"field\":\"deviceName\",\"size\":1000,\"shardSize\":10000,\"order\":{\"max\":\"desc\"}},\"aggs\":{\"max\":{\"max\":{\"field\":\"usedCPUInPercentage\"}}}}},\"size\":0}",
"status": "OK",
"recipients": "someone@my-org.com",
"apiReference": "00000000-0000-0000-0000-a10000000001",
"queryName": "Devices_CPU",
"queryId": 1,
"filters": ":timeRangeType-recent:timeRangePeriod-3600000",
"threshold": 0
}
Example of an error:
{
"summary": "Exception:Reference test not found in QueryMetadata table (org.montier.alerts.rest.QueryResource.executeQuery(QueryResource.java:58))",
"message": "Reference test not found in QueryMetadata table",
"status": "error"
}
Get all available alerts:
GET /op/api/v1/alerts/
The lastUpdateTime field returns the last time the alert was updated in epoch time format
{
"alerts": [
{
"name": "Devices_CPU",
"description": "Alert on Devices CPU over 80%",
"URI": "/op/api/v1/alerts/bc4353e3-7ba0-48e1-bc08-8b5cedf7d0cd",
"lastUpdateTime": 1513011809080
},
{
"name": "Devices_Memory",
"description": "Alert on Devices Memory over 70%",
"URI": "/op/api/v1/alerts/879b09f5-3bf4-47c6-88c0-51698294eab0",
"lastUpdateTime": 1487870145403
},
{
"name": "Devices_Load",
"description": "Alert on Devices Load over 80%",
"URI": "/op/api/v1/alerts/a43a6098-95bb-48fe-9b40-a226b2e22d3b",
"lastUpdateTime": 1487870145413
},
{
"name": "Devices_Fan",
"description": "Alert on Fan Health if less than 100%",
"URI": "/op/api/v1/alerts/b056372c-0222-431f-84ba-91b667bc4d13",
"lastUpdateTime": 1487870145420
},
{
"name": "Device_Temperature",
"description": "Alert on Temperature Health if less than 100%",
"URI": "/op/api/v1/alerts/935133bb-4b2f-4831-ad6f-d198995def76",
"lastUpdateTime": 1513581493084
}
]
}