Api\AlertRuleController

api/alert-rules/{id} POST Create the specified user alert rule.

post/api/alert-rules

Headers

Authorizationstring
Content-Typestring
Acceptstring

Request body

namestring

The name of the alert rule.

descriptionstring

The description of the alert rule.

measurement_idinteger required

The physical quantity / unit to alert for.

calculationstring required

Calculation to be done with measurement value(s): (min, max, ave, der, cnt) -> Minimum, Maximum, Average (mean), Derivative, Count.

comparatorstring required

Logical comparator to perform with comparison calculation result and threshold_value (=, <, >, <=, >=).

comparisonstring required

Comparison function to perform with measurement value(s): (val, dif, abs, abs_dif) -> Value, Difference, Absolute value, Absolute value of the difference.

threshold_valuenumber required

The threshold value beyond which the alert will be sent.

calculation_minutesinteger

The amount of minutes used for calculating the (min, max, ave, der, cnt) of the measurement value(s). If not provided, the last recorded value is used as a reference.

alert_on_occurrencesinteger

Amount of occurences that a calculated value goed beyond the threshold_value. If not filled the standard is 1 (immediate alert).

alert_via_emailboolean

Set to false (0) if an e-mail should NOT be sent on alert. Default: true (1).

webhook_urlstring

URL of optional endpoint to call on alert for web hook integration.

activeboolean

Set to false (0) if the alert should NOT be active. Default: true (1).

exclude_monthsstring[]

Array of month indexes (1-12). If not filled the standard alert is 'always on'.

exclude_hoursstring[]

Array of hour indexes (0-23). If not filled the standard alert is 'always on'.

exclude_hive_idsstring[]

Array of Hive ids. If not filled the standard alert is evaluated on 'all hives'.

Example request

{
  "name": "unde",
  "description": "ea",
  "measurement_id": 14,
  "calculation": "suscipit",
  "comparator": "ex",
  "comparison": "pariatur",
  "threshold_value": 6574.72941,
  "calculation_minutes": 12,
  "alert_on_occurrences": 12,
  "alert_via_email": true,
  "webhook_url": "veritatis",
  "exclude_months": [
    1,
    2,
    3,
    11,
    12
  ],
  "exclude_hours": [
    0,
    1,
    2,
    3,
    22,
    23
  ],
  "exclude_hive_ids": [
    "qui"
  ]
}

Changes