...
A new alarm can be created with /api/alarm/create request
API | Request | Response | Response status | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
WS API |
|
| 200 OK 400 Object not found 500 Persist exception | ||||||||||
REST API |
|
| 200 OK 400 Object not found 500 Persist exception |
Where
- type – alarm type:
- 0 – value has dropped below the threshold
- 1 – value has exceeded the threshold
- 2 - value is equal to threshold
- 4 - monotonically increasing value has decreased
- 5 - monotonically decreasing value has increased
- name – alarm name
- value – threshold value
- metric – metric identifier (for example, video bitrate)
- node – node identifier
- time – time in milliseconds during which the metric value must be above or below the threshold
...
An alarm parameters can be changed with /api/alarm/update request
API | Request | Response | Response status | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
WS API |
|
| 200 OK 400 Object not found 500 Persist exception | ||||||||||
REST API |
|
| 200 OK 400 Object not found 500 Persist exception |
Where
- id – alarm identifier
- type – alarm type:
- 0 – value has dropped below the threshold
- 1 – value has exceeded the threshold
- 2 - value is equal to threshold
- 4 - monotonically increasing value has decreased
- 5 - monotonically decreasing value has increased
- name – alarm name
- value – threshold value
- metric – metric identifier (for example, video bitrate)
- node – node identifier
- time – time in milliseconds during which the metric value must be above or below the threshold
...
Alarm can be deleted with /api/alarm/delete request
API | Request | Response | Response status | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
WS API |
|
| 200 OK 400 Object not found 500 Persist exception | ||||||||||
REST API |
|
| 200 OK 400 Object not found 500 Persist exception |
Where
- id – alarm identifier
...
An alarm information can be obtained with /api/alarm/list request
API | Request | Response | Response status | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
WS API |
|
| 200 OK 400 Object not found 500 Persist exception | ||||||||||
REST API |
|
| 200 OK 400 Object not found 500 Persist exception |
Where
- id – alarm identifier
...
For every alarm, the response contains the same fields as /api/alarm/update request.
Alert message receiving
Alert messages are received if client is subscribed to /alarms queue. Alert message looks as follows:
Code Block | ||
---|---|---|
| ||
MESSAGE destination:/alarms content-type:application/json;charset=UTF-8 subscription:sub-0 message-id:4-187 content-length:242 { "timestamp":1561101716609, "status":"RAISED", "alarmType":"LESS", "alarmValue":700000, "alarmName":"alarm1", "mediaId":"617691c0-93f2-11e9-8808-938c74814152", "metricEnumName":"VIDEO_RATE", "metricValue":400232, "nodeHostName":"test.flashphoner.com" } |
Where:
- timestamp - time of alarm raised or cleared
- status - alarm state:
- RAISED - alarm is raised
- CLEARED - alarm is cleared
- alarmType - alarm type:
- LESS – value has dropped below the threshold
- MORE – value has exceeded the threshold
- EQUAL - value is equal to threshold
- MONOTONIC_UP - monotonically increasing value has decreased
- MONOTONIC_DOWN - monotonically decreasing value has increased
- alarmValue - alarm threshold value
- alarmName - alarm name
- mediaId - media session identifier for the stream which event is occured
- metricEnumName - metric name
- metricValue - metric value by which alarm was raised or cleared
- nodeHostName - server hostname on which the stream is published or played