Search Alert Rule¶
Query alert rule under a specific organization.
Request Format¶
POST https://{apigw-address}/event-service/v2.1/alert-rules?action=search
Request Parameters (URI)¶
Name |
Location (Path/Query) |
Required or Not |
Data Type |
Description |
---|---|---|---|---|
orgId |
Query |
true |
String |
Organization ID which the asset belongs to. How to get orgId>> |
Request Parameters (Body)¶
Name |
Required or Not |
Data Type |
Description |
---|---|---|---|
modelId |
false |
String |
Model applicable for the alert rule |
measurepointId |
false |
String |
Asset measurement point. How to get pointId>> |
expression |
false |
String |
Query expression, which supports for sql-like query. The fields that are supported for query include: |
pagination |
false |
Pagination request struct |
Random pagination. The default is to sort in descending order by |
Response Parameters¶
Name |
Data Type |
Description |
---|---|---|
data |
AlertRule struct |
Alert rule information. See AlertRule Struct. |
AlertRule Struct ¶
AssetNode Struct ¶
Name |
Required or Not |
Data Type |
Description |
---|---|---|---|
treeId |
true |
String |
Asset tree ID. If it is “all”, it indicates that this is a special node, standing for the globality of the organization. |
assetId |
true |
String |
Asset ID. |
Sample¶
Request Sample¶
POST https://{apigw-address}/event-service/v2.1/alert-rules?action=search&orgId=yourOrgId
{
"modelId": "EnOS_Solar_CombinerBox",
"measurepointId": "CBX.BranchStateAttr"
}
Return Sample¶
{
"pagination": {
"pageNo": 1,
"pageSize": 10,
"totalSize": 1,
"sortedBy": [{
"field": "updateTime",
"order": "DESC"
}]
},
"code": 0,
"msg": "OK",
"requestId": "a9689b9f-0cb6-4e47-a41c-bd459b687309",
"data": [{
"orgId": "yourOrgId",
"ruleId": "zh_model_struct",
"ruleDesc": {
"defaultValue": "Grid is connected from converter",
"i18nValue": {
"en_US": "Grid is connected from converter",
"zh_CN": "电网由变频器连接"
}
},
"modelId": "zh_model",
"measurepointId": "aa",
"condition": "${aa} = 18",
"isEnabled": true,
"severityId": "WARN",
"severityDesc": {
"defaultValue": "WARN"
},
"contentId": "planetTemperature",
"contentDesc": {
"defaultValue": "连接"
},
"typeId": "warning_Type",
"typeDesc": {
"defaultValue": "connected"
},
"tags": {
"key1": "v1"
},
"isRoot": false,
"scope": [{
"treeId": "ptde66nd",
"assetId": "FbFy8qyz"
}]
},{
"orgId": "yourOrgId",
"ruleId": "zh_model_struct2",
"ruleDesc": {
"defaultValue": "Grid is connected from converter",
"i18nValue": {
"en_US": "Grid is connected from converter",
"zh_CN": "电网由变频器连接"
}
},
"modelId": "zh_model",
"measurepointId": "aa",
"condition": "${aa} = 18",
"isEnabled": true,
"severityId": "WARN",
"severityDesc": {
"defaultValue": "WARN"
},
"contentId": "planetTemperature",
"contentDesc": {
"defaultValue": "连接"
},
"typeId": "warning_Type",
"typeDesc": {
"defaultValue": "connected"
},
"tags": {
"key1": "v1"
},
"isRoot": false,
"scope": [{
"treeId": "ptde66nd",
"assetId": "FbFy8qyz"
}]
}]
}