调用ListRulesByIds接口根据告警策略ID查询告警策略。
ServiceName : Volc_Observe Region : cn-beijing AccessKey : xxx SecretKey : xxx
参数 | 类型 | 是否必选 | 示例值 | 描述 |
---|---|---|---|---|
Action | String | 是 | ListRulesByIds | 接口名称。当前 API 的名称为 ListRulesByIds 。 |
Version | String | 是 | 2018-01-01 | 接口版本。当前 API 的版本为 2018-01-01 。 |
参数 | 类型 | 是否必选 | 示例值 | 描述 |
---|---|---|---|---|
Ids | Array of String | 是 | ["1502121719593******"] | 要查询的告警策略ID。 |
参数 | 类型 | 示例值 | 描述 |
---|---|---|---|
Data | Array of RuleVO | - | 数组元素为告警策略内容。 |
参数 | 类型 | 示例值 | 描述 |
---|---|---|---|
Id | String | 1502121719593****** | 告警策略ID。 |
RuleName | String | vketest | 告警策略名称。 |
Description | String | 测试告警 | 策略描述。 |
Namespace | String | VCM_VKE | 此策略的监控指标所属的产品空间。参见云产品监控指标下各产品的Namespace。 |
SubNamespace | String | Cluster | 此策略引用的指标所属的维度。参见云产品监控指标下各产品的SubNamespace。 |
CreatedAt | String | 1659421463 | 告警策略创建时间。表达方式为时间戳。 |
UpdatedAt | String | 1659529768 | 告警策略最后更新时间。表达方式为时间戳。 |
ContactGroupIds | Array of String | ["148357472501******"] | 告警策略绑定的告警通知组ID。 |
AlertMethods | Array of String |
| 告警策略的通知方式。
|
WebHook | String | http://alert.volc.com/callback | 告警发生时回调的地址。 |
AlertState | String |
| 告警状态。
|
Level | String |
| 告警级别。
|
Conditions | Array of RuleCondition | - | 告警条件。是一个数组,里面可填多个指标判断式,最多10个。 |
OriginalDimensions | JSON Map | - | 策略检测的资源ID。 |
EffectStartAt | String | 00:00 | 策略生效窗口的开始时间。表达方式为HH:MM。 |
EffectEndAt | String | 23:59 | 策略生效窗口的截止时间。表达方式为HH:MM。 |
EnableState | String |
| 开启状态。
|
Regions | Array of String | ["cn-beijing"] | 生效的RegionId列表。目前只能填一个RegionId。 |
EvaluationCount | Integer | 5 | 连续几次检测达到阈值才告警。 |
SilenceTime | Integer | 5 | 告警发送周期。单位为分钟。支持配置为5、30、60、180、360、720、1440。 |
MultipleConditions | Boolean |
| 告警策略是否用多指标。
|
ConditionOperator | String |
| 多指标判定条件。
|
RecoveryNotify | Object of RecoveryNotify | - | 告警恢复通知。 |
NoData | Object of NoData | - | 无数据告警。 |
WebhookIds | Array of String | - | 告警发生时告警回调ID列表。 |
参数 | 类型 | 示例值 | 描述 |
---|---|---|---|
MetricName | String | Instance_CpuBusy | 监控指标的名称。参见云产品监控指标下各产品的MetricName。 |
Statistics | String |
| 统计方法。目前支持avg、max、min。 |
ComparisonOperator | String |
| 比较符号。支持普通阈值告警: >、>=、<、<=、!=、= ,以及以下同环比告警:
|
Threshold | String | 100 | 此指标的判断阈值。 |
MetricUnit | String |
| 监控指标的单位。参见云产品监控指标下各产品的MetricUnit。 说明 同环比告警,MetricUnit需要填写为"Percent"。 |
参数 | 类型 | 示例值 | 描述 |
---|---|---|---|
key | String | ResourceID | 指标的Dimensions名称,例如:ResourceID、NodeName等。 |
value | Array of String | ["i-ybw74rtkvd9z6f******", "i-ybvwojvnep9z6g******"] | 指标的Dimension的值,是一个数组。 如果希望选择"全部"实例的值,可以填星号 "*"。例如:["*"]。 |
参数 | 类型 | 示例值 | 描述 |
---|---|---|---|
Enable | Boolean | true | 是否开启告警恢复通知。默认自动开启。 |
参数 | 类型 | 示例值 | 描述 |
---|---|---|---|
Enable | Boolean | true | 是否开启无数据告警。默认关闭。 |
EvaluationCount | Integer | 10 | 连续几次检测无数据才告警。 |
POST https://open.volcengineapi.com?Action=ListRulesByIds&Version=2018-01-01 ServiceName: Volc_Observe Region: cn-beijing AccessKey: xxx SecretKey: xxx { "Ids":[ "1502121719593******" ] }
{ "ResponseMetadata": { "RequestId": "2023****54A0", "Action": "ListRulesByIds", "Version": "2018-01-01", "Service": "", "Region": "" }, "Result": { "Data": [ { "Namespace": "VCM_VKE", "ResourceType": "容器服务", "SubNamespace": "Cluster", "Dimension": "集群", "Id": "150****752", "CreatedAt": "1659421463", "UpdatedAt": "1659529768", "Regions": [ "cn-beijing" ], "AccountId": "2000******", "RuleName": "vketest", "RuleType": "static", "Level": "critical", "EnableState": "enable", "ContactGroupIds": [ "148357472501******" ], "AlertMethods": [ "Email" ], "CheckInterval": 1, "EvaluationCount": 5, "SilenceTime": 5, "EffectStartAt": "00:00", "EffectEndAt": "23:59", "Dimensions": [ { "Cluster": "*" } ], "OriginalDimensions": null, "Conditions": [ { "MetricName": "Cluster_CPUUsed", "MetricUnit": "Core", "Period": "", "Statistics": "avg", "ComparisonOperator": ">", "Threshold": "4" }, { "MetricName": "Cluster_MemoryUsed", "MetricUnit": "Megabytes", "Period": "", "Statistics": "avg", "ComparisonOperator": ">", "Threshold": "3" } ], "TriggerCondition": "多指标告警(任意):\n集群 CPU 用量平均值>4Core, 持续1个周期(1周期=1分钟)\n集群内存用量平均值>3MB, 持续1个周期(1周期=1分钟)", "AlertState": "normal", "Resources": { "集群": [ "全部集群" ] }, "ConditionOperator": "||", "MultipleConditions": true, "RecoveryNotify": { "Enable": true } } ] } }
本接口无特有的错误码。更多信息请参见错误码。