v1

latestOpenAPI 3.0.32026-07-171140286.6 KB
Api\AlertRuleController

api/alert-rules/{id} PATCH Update the specified user alert rule.

put/api/alert-rules/{id}

Headers

Authorizationstring
Content-Typestring
Acceptstring
Accept-languagestring

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": "dignissimos",
  "description": "id",
  "measurement_id": 18,
  "calculation": "dolorem",
  "comparator": "voluptas",
  "comparison": "qui",
  "threshold_value": 0.39,
  "formulas": [
    []
  ],
  "calculation_minutes": 7,
  "alert_on_occurrences": 16,
  "alert_via_email": true,
  "webhook_url": "et",
  "exclude_months": [
    1,
    2,
    3,
    11,
    12
  ],
  "exclude_hours": [
    0,
    1,
    2,
    3,
    22,
    23
  ],
  "exclude_hive_ids": [
    "et"
  ]
}