Explanation of Fields When Consuming Subscribed Alert Data¶
You can write the code to consume the alert data after you subscribe to the alert data by referring to the following field descriptions.
If you want to consume the data generated by Alert Engine in version 2.2.0, 2.3.0, and 2.4.0, refer to New Version.
The HistoryEvent structure is required to consume the basic alert data.
The AlertVo structure is required to consume the advanced alert data.
If you want to consume the data generated by Alert Engine in version 2.1.0, refer to Old Version and use the HistoryEvent structure.
New Version¶
HistoryEvent Structure¶
AlertVo Structure¶
Field Name |
Data Type |
Description |
---|---|---|
alertId |
String |
The alert ID |
eventType |
Integer |
0: represents the alert recovery,which is triggered by alert rule (History alerts) 1: represents the alert starts,which is triggered by alert rule (Active alerts) 2: represents the alert recovery,which is created by interface (History alerts) 3: represents the alert starts,which is created by interface (Active alerts) 4: represents the discrete alerts(History alerts) 5: represents the disordered alerts (dataSource alerts) Only 2, 3, and 4 are allowed to be entered in the Create Alert interface |
dataSource |
String |
The data source of the alert. For example, model_measurepoint represents the measurement point,device_status represents the device status,model_event represents event |
orgId |
String |
The organization ID which the asset belongs to |
instanceId |
String |
The entity of the alert. Currently only support asset and its value is assetId |
metricId |
String |
The ID of the original metric data |
occurTime |
Long |
The time when the alert occurred, expressed in UTC time. For example, 1555468200000 |
localOccurTime |
String |
The time when the alert occurred, expressed in local time. For example, 2020-12-12 00:00:00 |
recoverTime |
Long |
The time for the abnormal condition that triggered the alert to return to normal, expressed in UTC time. For example, 1555468200000 |
localRecoverTime |
String |
The time for the abnormal condition that triggered the alert to return to normal, expressed in local time. For example, 2020-12-12 00:00:00 |
recoverReason |
String |
The reason for the recovery of abnormal conditions |
value |
String |
The metric value when the alert was generated. For advanced alert functions such as multi-measurement point alerts or timing alerts, use the value of the metric corresponding to the alert generated |
metricTags |
Map<String, String> |
The tags for raw metric data. The tag for Key and Value is String Different businesses/systems have different raw metrics and define different tags. EnOS has the following standard tags that may appear in metricTags, among them, tags with __ prefix and suffix are generic keys, and those without __ are business-related keys. { __timezone__: Timezone __instance__: instanceId __metric__: metricId __alias__: The alias of the metricId modelIdPath: Model Path modelId: modelId assetTreePath: Asset Tree Pass assetTreePath_${treeId}: Specify the asset tree for treeId } |
severityId |
String |
The ID of the alert severity |
severityDesc |
StringI18n |
Description of the alert severity. See the sub-object internationalized name structure below for structure reference. |
typeId |
String |
The ID of the alert type |
typeDesc |
StringI18n |
Description of the alert type. See the sub-object internationalized name structure below for structure reference. |
parentTypeId |
String |
The ID of the alert parent type |
parentTypeDesc |
StringI18n |
Description of the alert parent type. See the sub-object internationalized name structure below for structure reference. |
contentId |
String |
The ID of the alert content (Only basic alerts are included) |
content |
StringI18n |
The content of the alert. See the sub-object internationalized name structure below for structure reference. |
ruleId |
String |
The ID of the alert rule |
ruleDesc |
StringI18n |
Description of the alert rule. See the sub-object internationalized name structure below for structure reference. |
ruleTags |
Map(Key 为 String,Value 为 String) |
Tags on alert rules |
tags |
Map(Key 为 String,Value 为 String) |
Tags, only full updates are supported |
isInhibited |
Boolean |
true:represents blocked false:represents unblocked |
maskedBy |
List<String> |
The ID of the root alert (Which alerts blocked the alerts) |
createTime |
Long |
The creation time of the alert |
updateTime |
Long |
The update time of the alert |
ability |
int |
0 represents basic 1 represents advance |
Old Version¶
HistoryEvent Structure¶
Field Name |
Data Type |
Description |
---|---|---|
eventId |
String |
The ID of the alert |
orgId |
String |
The organization ID which the asset belongs to |
deviceId |
String |
The ID of the asset |
modelId |
String |
The model ID which the asset belongs to |
modelIdPath |
String |
The path which the model belongs to |
pointId |
String |
The measurement points of assets |
deviceStatus |
String |
The device status |
hitRuleId |
Integer |
The rule ID of the triggered alert |
value |
Object |
The value of the measurement point. If triggeringDelayTimer is specified in the alert rule, the value of the measurement point is the value when triggeringDelayTimer starts timing |
time |
Long |
The time when the alert occurred. For example, 1555468200000 |
localTime |
Long |
The time when the alert occurred, expressed in local time. For example, 1555468200000 |
severityId |
Integer |
The ID of the alert severity |
severityDesc |
StringI18n |
Description of the alert severity |
typeId |
Integer |
The ID of the alert type |
typeDesc |
StringI18n |
Description of the alert type |
subTypeId |
Integer |
The subtype of the alert |
subTypeDesc |
StringI18n |
Description of the alert subtype |
contentId |
Integer |
The ID of the alert content |
contentDesc |
StringI18n |
Description of the alert content |
eventType |
Integer |
0: represents the alert recovery event, other value: represents the ordinary events 1: represents the alert event 2: represents the recovery event generated by interface 3: represents the alert event generated by interface |
ruleTag |
Map(Key is String,Value is String) |
The tag on the alert rule |
ruleDesc |
StringI18n |
Description of the alert rule |
assetPath |
List<String> |
The tree pass list of the asset that generated the alert. Return format: [“treeId1:/assetId1/assetId2/assetIdx”, “treeId2:/assetId3/assetIdx”] |
maskedBy |
List<String> |
The alert that block this alert. If this alert is the derived alert, returns the root alert information that caused the alert to be blocked. Return format: [“treeId1:eventId1”, “treeId1:eventId2”] |
createTime |
Long |
The generate time of the alert record,expressed in UTC time. For example: 1555468200000 |
updateTime |
Long |
The update time of the alert record,expressed in UTC time. For example: 1555468200000 |
recoverTime |
Long |
The time for the abnormal condition that triggered the alert to return to normal, expressed in UTC time. For example: 1555468200000 |
recoverLocalTime |
Long |
The time for the abnormal condition that triggered the alert to return to normal, expressed in local time. For example: 1555468200000 |
recoverReason |
String |
The reason for the recovery of abnormal conditions |
Sub-Object Field Description¶
Sub-Object Internationalized Name Structure¶
Field Name |
Data Type |
Description |
---|---|---|
defaultValue |
String |
The default name |
i18nValue |
Map<String, String> |
The name under each Locale,key is locale,value is the name under each locale |
The defaultValue
refers to the name that should be used when the locale
is not specified in i18nValue
. The locale
format follows the Unicode locale identifier, such as “en_US”. For more information, see https://www.unicode.org/reports/tr35/tr35-55/tr35.html#BCP_47_Language_Tag_Conversion.