It is possible to obtain metric value changes in realtime, when metric value has exceeded or dropped below specified threshold. That can be done using alarms, which can be obtained via STOMP over Websocket by /alarm event subscription.
A new alarm can be created with REST API query /api/alarm/create
https://hostname:8090/api/alarm/create { "type":"0", "name":"testalarm", "value":"500000", "metric":"4", "node":"15", "time":"5000" } |
Where
In the example above, an alarm, which is triggered if the video bitrate of the stream drops below 500 kbps for more than 5 seconds, was created.
If node Id is not set, the alarm applies to all the nodes on backend server.
An alarm parameters can be changed with REST API query /api/alarm/update
https://hostname:8090/api/alarm/update { "id": "17", "type":"0", "name":"testalarm", "value":"500000", "metric":"4", "node":"15", "time":"5000" } |
Where
Alarm can be deleted with REST API query /api/alarm/delete
https://hostname:8090/api/alarm/delete { "id": "17" } |
Where
STOMP messages about the alarm triggering stop when it is deleted.
An alarm information can be obtained with REST API query /api/alarm/list
https://hostname:8090/api/alarm/list { "id": "17" } |
Where
If alarm Id is set, the response will contain only that alarm information. If alarm Id is not set, the response will contain list with all the alarms on backend server.
For every alarm, the response contains the same fields as /api/alarm/update query.