REST API for alerts history¶
To access the Alerts REST API page:
- Click the Alerts bell icon in the top banner. The Alerts page opens to the History tab by default.
- Click the REST API tab.
The REST API page provides details of the alerts REST endpoint that can be used to programmatically obtain historical alert information.
After the alerts history starts populating, the Sample Response appears.
For more information, see REST API example.
REST API example¶
-
GET
/2.0/alerts/history
¶ Get the most recent alerts.
Query Parameters: - limit (int) – The maximum number of records to return
- ts (long) – The most recent alert to return (in milliseconds since epoch)
Response JSON Object: - guid (string) – The unique ID of this alert
Response JSON Array of Objects: - timestamp (string) – Milliseconds since the epoch when this alert was issued
- monitoringTrigger (map) – Trigger definition that caused this alert to be issued
- monitoringTrigger.guid (string) – The unique ID of this trigger
- monitoringTrigger.name (string) – The name of this trigger
- triggers (array) – The trigger cause associated with monitoringTrigger
- triggers[i].window (string) – Milliseconds since the epoch associated with the underlying data that caused this trigger was issued
- actions (array) – Actions taken due to the firing of monitoringTrigger
- actions[i].guid (string) – The unique ID of the action taken
- actions[i].name (string) – The name of the action taken
- actions[i].email (map) – The email address that the alert was sent to
Example request:
GET /2.0/alerts/history HTTP/1.1 Accept: application/json
Example response:
HTTP/1.1 200 OK Content-Type: application/json [ { "guid": "50c0e74a-6368-43bf-bff7-fa51beff9ad9", "timestamp": "1516207447488", "monitoringTrigger": { "guid": "c8d72271-9f57-44b5-a6a4-97c97f0d1668", "name": "rock-cg-0 consumption" }, "triggers": [ { "window": "1516207320000", "hasError": false, "component": { "componentId": "rock-cg-0" }, "longValue": "0" } ], "actions": [ { "guid": "f593d79d-1bb7-4179-8997-6a7c8045dd8e", "name": "1212", "email": { "address": "sdfsdf@lskdjf.com", "subject": "skldfjlsdkfj" } } ] } ]