Alerts
The 'alerts' API allows viewing, creating, and updating alerts associated with the various devices in the system. Administrator or super administrator permissions are required.
GET /alert
The GET /alert endpoint provides a paginated list of alerts that can be filtered by the following fields:
- 'page' (optional): page number to display.
- 'size' (optional): number of elements per page.
- 'sort' (optional): sorting order of the elements. Can be ascending (ASC) or descending (DESC) and is based on any of the attributes by which to filter.
- 'id' (optional): alert identifier.
- 'name' (optional): alert name.
- 'state' (optional): state of the alert; there are three states: 'activated', 'disabled', or 'discharged'.
- 'type' (optional): type of alert; there are two types: 'EXPRESSION' and 'LAST_COMMUNICATION'.
- 'entityId' (optional): identifier of the device to which the alert is associated in the context broker.
- 'organization' (optional): organization to which the alert belongs.
- 'deviceId' (optional): identifier of the device to which the alert is associated.
- 'deviceName' (optional): name of the device to which the alert is associated.
- 'deviceType' (optional): type of the device to which the alert is associated.
- 'priority' (optional): alert priority; there are three levels: 'CRITICAL', 'MAJOR', and 'MINOR'.
- 'severity' (optional): alert severity; there are three levels: 'CRITICAL', 'MAJOR', and 'MINOR'.
- 'verticals.verticalId' (optional): identifier of a vertical of the device to which the alert is associated.
- 'verticals.name' (optional): name of a vertical of the device to which the alert is associated.
- 'attributes.id' (optional): identifier of the expression triggering an alarm.
- 'attributes.name' (optional): name of the expression triggering an alarm.
- 'attributes.operator' (optional): operator of the expression triggering an alarm; the following types exist: 'EQUAL_TO', 'GREATER_THAN', 'LESS_THAN', 'GREATER_THAN_OR_EQUAL', 'LESS_THAN_OR_EQUAL', 'NOT_EQUAL', 'BETWEEN'.
- 'attributes.value' (optional): expected value triggering an alarm.
- 'attributes.value2' (optional): second expected value triggering an alarm.
- 'timegap' (optional): time that must pass for an alarm to be triggered.
- 'timegapunit' (optional): time metric for an alert.
GET /alert/{id}
The GET /alert/{id} endpoint provides the alert by its id.
POST /alert
The POST /alert endpoint creates a new alert and must have the following format:
{
"name": "alert1",
"type": "EXPRESION",
"deviceId": 1,
"priority": "CRITICAL",
"severity": "CRITICAL",
"timegap": 10,
"timegapunit": "MINUTES",
"atributeConstraints": [
{
"name": "temperature",
"operator": "EQUAL_TO",
"value": "10",
"value2": "20"
}
]
}
- 'name' (required): name of the alert.
- 'type' (required): type of alert; there are two types: 'EXPRESSION' and 'LAST_COMMUNICATION'.
- 'deviceId' (required): identifier of the device to which the alert is associated.
- 'priority' (required): priority of the alert; there are three levels: 'CRITICAL', 'MAJOR', and 'MINOR'.
- 'severity' (required): severity of the alert; there are three levels: 'CRITICAL', 'MAJOR', and 'MINOR'.
- 'timegap' (required if the alert is of type LAST_COMMUNICATION): time that must pass for an alarm to be triggered.
- 'timegapunit' (required if the alert is of type LAST_COMMUNICATION): time metric for an alert.
- 'attributeConstraint.name' (required if it is an alert of type EXPRESSION): name of the expression triggering an alarm.
- 'attributeConstraint.operator' (required if it is an alert of type EXPRESSION): operator of the expression triggering an alarm; the following types exist: 'EQUAL_TO', 'GREATER_THAN', 'LESS_THAN', 'GREATER_THAN_OR_EQUAL', 'LESS_THAN_OR_EQUAL', 'NOT_EQUAL', 'BETWEEN'.
- 'attributeConstraint.value' (required if it is an alert of type EXPRESSION): expected value triggering an alarm.
- 'attributeConstraint.value2' (optional): second expected value triggering an alarm.
PUT /alert/{id}
The PUT /alert/{id} endpoint serves to modify an alert by its id. The data that can be modified are as follows:
- 'priority' (required): priority of the alert; there are three levels: 'CRITICAL', 'MAJOR', and 'MINOR'.
- 'severity' (required): severity of the alert; there are three levels: 'CRITICAL', 'MAJOR', and 'MINOR'.
- 'attributes.name' (required if it is an alert of type EXPRESSION): name of the expression triggering an alarm.
- 'attributes.operator' (required if it is an alert of type EXPRESSION): operator of the expression triggering an alarm; the following types exist: 'EQUAL_TO', 'GREATER_THAN', 'LESS_THAN', 'GREATER_THAN_OR_EQUAL', 'LESS_THAN_OR_EQUAL', 'NOT_EQUAL', 'BETWEEN'.
- 'attributes.value' (required if it is an alert of type EXPRESSION): expected value triggering an alarm.
- 'attributes.value2' (optional): second expected value triggering an alarm.
- 'timegap' (required if the alert is of type LAST_COMMUNICATION): time that must pass for an alarm to be triggered.
- 'timegapunit' (required if the alert is of type LAST_COMMUNICATION): time metric for an alert.
PUT /alert/{id}/changeStateActive
The PUT /alert/{id}/changeStateActive endpoint serves to change the state of the alert. There are three states for alerts: 'activated', 'disabled', or 'discharged'.
PUT /alert/updateDevice
The PUT /alert/updateDevice endpoint serves to modify the attributes referring to the device the alert is associated with, which are as follows:
- 'id' (optional): identifier of the device.
- 'name' (optional): name of the device.
- 'mnemonic' (optional): mnemonic name of the device.
- 'contextBrokerId' (optional): identifier of the device in the context broker.
- 'state' (optional): state of the device; there are three states: 'activated', 'disabled', or 'discharged'.
- 'type.id' (optional): id of the device type.
- 'type.name' (optional): name of the device type.
- 'verticals.id' (optional): id of a vertical associated with a device.
- 'verticals.name' (optional): name of a vertical associated with a device.
- 'description' (optional): description of the device.