最近更新时间:2024.03.12 16:52:17
首次发布时间:2022.10.10 15:05:58
调用ListRules接口根据指定条件查询告警策略,请求参数中的条件是且的关系。
POST https://open.volcengineapi.com?Action=ListRules&Version=2018-01-01
ServiceName : Volc_Observe Region : cn-beijing AccessKey : xxx SecretKey : xxx
参数 | 类型 | 是否必填 | 示例值 | 描述 |
---|---|---|---|---|
RuleName | String | 否 |
| 查询指定的告警策略名称,会根据此告警名称做模糊匹配。 |
AlertState | Array | 否 |
| 查询指定告警状态的告警策略,可以多选。
|
Namespace | Array | 否 |
| 此策略的监控指标所属的产品空间。参见云产品监控指标下各产品的Namespace。 |
Level | Array | 否 |
| 查询指定级别的告警策略,可以多选。
|
EnableState | Array | 否 |
| 查询指定状态的告警策略,可以多选。
|
PageSize | Integer | 否 |
| 分页使用。分页返回的每页数量。 |
PageNumber | Integer | 否 |
| 分页使用。第几页,从第1页开始。 |
参数 | 类型 | 示例值 | 描述 |
---|---|---|---|
Data | Array | - | 内容为数组,数组元素为告警策略内容。元素内容,请参见Data数据结构。 |
PageNumber | Integer |
| 分页使用,表示第几页,从第1页开始。 |
PageSize | Integer |
| 分页使用,分页返回的每页数量。 |
TotalCount | Integer |
| 符合条件的告警策略数量。 |
参数 | 类型 | 示例值 | 描述 |
---|---|---|---|
Id | String |
| 告警策略ID。 |
RuleName | String |
| 告警策略名称。 |
Description | String |
| 策略描述。 |
Namespace | String |
| 此策略的监控指标所属的产品空间。参见云产品监控指标下各产品的Namespace。 |
SubNamespace | String |
| 此策略引用的指标所属的维度。参见云产品监控指标下各产品的SubNamespace。 |
CreatedAt | String |
| 告警策略创建时间。表达方式为时间戳。 |
UpdatedAt | String |
| 告警策略最后更新时间。表达方式为时间戳。 |
ContactGroupIds | Array |
| 告警策略绑定的告警通知组ID。 |
AlertMethods | Array |
| 告警策略的通知方式。
|
WebHook | String |
| 绑定的告警回调URL地址。 |
AlertState | String |
| 告警状态。
|
Level | String |
| 告警级别。
|
Conditions | Array | - | 告警条件。 |
OriginalDimensions | Map | - | 策略检测的资源ID。具体格式,请参见OriginalDimensions数据结构。 |
EffectStartAt | String |
| 策略生效窗口的开始时间。表达方式为HH:MM。 |
EffectEndAt | String |
| 策略生效窗口的截止时间。表达方式为HH:MM。 |
EnableState | String |
| 开启状态。
|
Regions | Array |
| 生效的RegionId列表。目前只能填一个RegionId。 |
EvaluationCount | Integer |
| 连续几次检测达到阈值才告警。 |
SilenceTime | Integer |
| 告警发送周期。单位为分钟。
|
MultipleConditions | Boolean |
| 告警策略是否用多指标。
|
ConditionOperator | String |
| 多指标判定条件。
|
参数 | 类型 | 示例值 | 描述 |
---|---|---|---|
MetricName | String |
| 监控指标的名称。参见云产品监控指标下各产品的MetricName。 |
MetricUnit | String |
| 监控指标的单位。参见云产品监控指标下各产品的MetricUnit。 |
Statistics | String |
| 统计方法。目前支持avg、max、min。 |
ComparisonOperator | String |
| 比较符号。支持 >、>=、<、<=、!=、=。 |
Threshold | String |
| 此指标的判断阈值。 |
Period | String |
| 统计周期。 |
参数 | 类型 | 是否必填 | 示例值 | 描述 |
---|---|---|---|---|
Key | String | 是 |
| 指标的Dimensions名称,例如:ResourceID、NodeName等。 |
Value | Array | 是 |
| 指标的Dimension的值,是一个数组。 |
POST https://open.volcengineapi.com?Action=ListRules&Version=2018-01-01 ServiceName=Volc_Observe Region=cn-beijing AccessKey=xxx SecretKey=xxx { "RuleName": "testabc", "AlertState": [ "normal" ], "Namespace": [ "VCM_ECS" ], "Level": [ "critical", "warning" ], "EnableState": [ "enable" ], "PageSize": 10, "PageNumber": 1 }
{ "ResponseMetadata": { "RequestId": "202209211700000102120522060*******", "Action": "ListRules", "Version": "2018-01-01", "Service": "", "Region": "" }, "Result": { "Data": [ { "Namespace": "VCM_ECS", "ResourceType": "云服务器", "SubNamespace": "Instance", "Dimension": "实例", "Id": "157241625255*******", "CreatedAt": "1663728223", "UpdatedAt": "1663748593", "Regions": [ "cn-beijing" ], "AccountId": "2100******", "RuleName": "test", "RuleType": "static", "Level": "warning", "EnableState": "disable", "ContactGroupIds": [ "1562776379697******" ], "AlertMethods": [ "Webhook", "Email" ], "WebHook": "", "Description": "", "CheckInterval": 1, "EvaluationCount": 1, "SilenceTime": 5, "EffectStartAt": "00:00", "EffectEndAt": "23:59", "Dimensions": [ { "ResourceID": "*" } ], "OriginalDimensions": { "ResourceID": [ "*" ] }, "Conditions": [ { "MetricName": "Instance_CpuBusy", "MetricUnit": "Percent", "Statistics": "avg", "ComparisonOperator": "<=", "Threshold": "100", "Period": "60" } ], "TriggerCondition": "多指标告警(任意):\n带外CPU利用率平均值<=100%, 持续1个周期(1周期=1分钟)\n带外磁盘读带宽平均值<=999MiB/s, 持续1个周期(1周期=1分钟)\n带外磁盘写带宽平均值<=999MiB/s, 持续1个周期(1周期=1分钟)", "AlertState": "normal", "ConditionOperator": "||", "MultipleConditions": true, "AlarmTemplateId": "", "AlarmTemplateType": "" } ], "PageNumber": 1, "PageSize": 10, "TotalCount": 1, "OrderBy": "", "Asc": false } }