Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

It is possible to obtain metric value changes in realtime, when metric value has exceeded or dropped below specified threshold. This is That can be done using alarms, which can be obtained via STOMP over Websocket by /alarm event subscription.

Alarm creation

A new alarm can be created with REST API query /api/alarm/create

...

  • type – alarm type:
    • 0 – value has dropped below the threshold
    • 1 – value has exceeded the threshold
  • name – alarm name
  • value – threshold value
  • metric – metric identifier (for example, video bitrate for example)
  • node – node identifier
  • time – time in milliseconds during which the metric value must be above or below the threshold.

In the example above, the alarm was created that triggers 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.

Alarm changing

Alarm An alarm parameters can be changed with REST API query /api/alarm/update

Code Block
languagejs
themeRDark
https://hostname:8090/api/alarm/update
{
  "id": "17",
  "type":"0",
  "name":"testalarm",
  "value":"500000",
  "metric":"4",
  "node":"15",
  "time":"5000"
}

Where:

  • id – alarm identifier
  • type – alarm type:
    • 0 – value has dropped below the threshold
    • 1 – value has exceeded the threshold
  • name – alarm name
  • value – threshold value
  • metric – metric identifier (for example, video bitrate for example)
  • node – node identifier
  • time – time in milliseconds during which the metric value must be above or below the threshold.

...

Code Block
languagejs
themeRDark
https://hostname:8090/api/alarm/delete
{
  "id": "17"
}

Where:

  • id – alarm identifier

STOMP messages about the alarm triggering stop when alarm it is deleted.

Obtaining alarm information

Alarm An alarm information can be obtained with REST API query /api/alarm/list

Code Block
languagejs
themeRDark
https://hostname:8090/api/alarm/list
{
  "id": "17"
}

Where:

  • id – alarm identifier

If alarm Id is set, the response will contain this only that alarm information only. If alarm Ids Id is not set, the response will contain list with all the alarms list on backend server.

The For every alarm, the response contains the same fields for every alarm as /api/alarm/update query.