Creates an alert rule. The system will verify the validity of the input parameters:
Request Parameters (Body)
Note
In the following non-required fields, you must provide measurepointId
or deviceStatus
to trigger the alert.
Name |
Required or Not |
Data Type |
Description |
ruleId |
true |
String |
Alert rule ID, which is to be defined by the user. |
ruleDesc |
true |
StringI18n |
Alert description |
modelId |
true |
String |
Model applicable for the alert rule |
measurepointId |
false |
String |
Asset measurement point. How to get pointId>> |
deviceStatus |
false |
Object |
Device status, such as “offline”. See Setting State-based Alerts. |
condition |
true |
String |
Query expression-like statement. For example, “${temperature} = 19” indicates that the value of the measurement point “temperature” is 19. A slash “/” is used to express the hierarchical relationship, for which only one downward layer is supported now. For example, “${pointA/att1} = 18” indicates the “att1” attribute value of the measurement point “A” is 18. How to use expression>> |
severityId |
true |
String |
Alert severity ID |
contentId |
true |
String |
Alert content ID |
tags |
false |
tags struct |
Alert rule tag |
isEnabled |
false |
Boolean |
Whether it is allowed to take effect. It takes effect (“true”) by default. |
isRoot |
false |
Boolean |
Whether it is a root alert, which is “false” by default. |
scope |
true |
AssetNode struct |
Specify a node on the asset tree to indicate the scope of the alert rule. See AssetNode Struct. |
triggeringDelayTimer |
false |
Integer |
Time to delay the alert triggering. The unit is seconds and the range is [60 - 10800]. The alert will be triggered when an anomaly that matches the alert rule occurs, and this anomaly does not return to normal within the set time. When it is 0, trigger the alert immediately. See Tutorial: Setting Alert Triggering Delay Timer. |
AssetNode Struct
Name |
Required or Not |
Data Type |
Description |
treeId |
true |
String |
Asset tree ID. If it is set as “all”, it indicates that this is a special node, standing for the globality of the organization. |
assetId |
true |
String |
Asset ID. How to get assetId>> |