ces__CreateAlarmRules
Creates Huawei Cloud CES alarm rules to monitor resources, events, and metrics, set thresholds and notification actions, and control when alerts are triggered.
Instructions
[CES] 创建告警规则
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"enabled": "<enabled>",
"name": "<name>",
"namespace": "<namespace>",
"notification_enabled": "<notification_enabled>",
"project_id": "<project_id>",
"resources": "<resources>",
"type": "<type>"
},
"name": "ces__CreateAlarmRules"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | 告警名称, 只能包含0-9/a-z/A-Z/_/-或汉字,长度1-128 | |
| tags | No | 租户标签列表 | |
| type | Yes | 告警规则类型,ALL_INSTANCE为全部资源指标告警,RESOURCE_GROUP为资源分组指标告警,MULTI_INSTANCE为指定资源指标告警,EVENT.SYS为系统事件告警,EVENT.CUSTOM自定义事件告警,DNSHealthCheck为健康检查告警; | |
| enabled | Yes | 是否开启告警规则。true:开启,false:关闭。 | |
| policies | No | 告警策略,当alarm_template_id字段为空时必填,不为空时不填 | |
| namespace | Yes | 查询服务的命名空间,各服务命名空间请参考[服务命名空间](https://support.huaweicloud.com/usermanual-ces/zh-cn_topic_0202622212.html) | |
| resources | Yes | 资源列表,告警规则类型为全部资源、资源分组时,资源维度值传空;告警规则类型为指定资源时,资源维度值必填,可以同时指定监控多个资源。 | |
| project_id | Yes | 租户ID | |
| description | No | 告警描述,长度0-256 | |
| product_name | No | 产品层级跨纬规则创建时需要指明的规则产品名称,一般由"服务命名空间,服务首层维度名称"组成,如"SYS.ECS,instance_id" | |
| resource_level | No | 产品层级跨纬规则创建时需要指明为产品层级规则,resource_level取值为product即为产品层级跨纬规则,不填或者取值为dimension则为旧的规则类型 | |
| ok_notifications | No | 告警恢复触发的动作 | |
| alarm_template_id | No | 告警规则关联告警模板ID,如果传了,告警规则关联的策略会和告警模板策略联动变化 | |
| resource_group_id | No | 资源分组ID,以rg开头,后跟22位由字母或数字组成的字符串 | |
| alarm_notifications | No | 告警触发的动作 | |
| notification_enabled | Yes | 是否开启告警通知。true:开启,false:关闭。 | |
| enterprise_project_id | No | 企业项目ID | |
| notification_end_time | No | 告警通知关闭时间 | |
| notification_begin_time | No | 告警通知开启时间 |