查询报警器 (QueryAlarm)

用户可以使用QueryAlarm查询报警器:

QueryAlarm namespace=ZStack/VM metricName~=%CPU%

原生域查询(Primitive Fields of Query)

名字 描述 可选的 可选的参数值 起始支持版本
uuid 请参见 资源属性 2.3
name 请参见 资源属性 2.3
description 请参见 资源属性 2.3
period 阈值持续时间 2.3
namespace 名字空间 2.3
metricName 监控项名称 2.3
threshold 阈值 2.3
repeatInterval 报警重复时间 2.3
createDate 创建时间 2.3
lastOpDate 最后一次修改时间 2.3
comparisonOperator 2.3
status 2.3
labels 2.3
actions 2.3
groupBy 以字段分组,相当于MySQL中的group by关键字。例如groupBy=type 2.3
createDate 请参见 资源属性 2.3
lastOpDate 请参见 资源属性 2.3
userTags 用户标签,请参见 创建用户标签(CreateUserTag) 2.3
systemTags 系统标签,请参见 创建系统标签(CreateSystemTag) 2.3
示例
{
    "inventories": [
        {
            "actions": [
                {
                    "actionType": "sns",
                    "actionUuid": "e7d6f5e23bb74e99a2777126078b551c",
                    "alarmUuid": "b632652cc16044cdb6b4f516ed93a118"
                }
            ],
            "comparisonOperator": "GreaterThanOrEqualTo",
            "createDate": "Jun 20, 2018 10:45:45 AM",
            "labels": [
                {
                    "key": "DirPath",
                    "operator": "Equal",
                    "uuid": "dfed592b822f46439195d7ce7728cdeb",
                    "value": "/var/lib/zstack/"
                }
            ],
            "lastOpDate": "Jun 20, 2018 10:45:45 AM",
            "metricName": "ManagementServerDirUsedCapacityInPercent",
            "name": "ZStack Data Directory Capacity Alarm",
            "namespace": "ZStack/System",
            "period": 60,
            "repeatInterval": 1800,
            "state": "Enabled",
            "status": "OK",
            "threshold": 70.0,
            "uuid": "b632652cc16044cdb6b4f516ed93a118"
        }
    ],
    "success": true
}

嵌套和扩展域查询(Nested And Expanded Fields of Query)

域(Field) 清单(Inventory) 描述 起始支持版本
actions actions Inventory 报警状态 2.3
labels labels Inventory 报警标签 2.3