public static final class PutResourceMetricRulesRequest.Rules.Builder extends Object
| 限定符和类型 | 方法和说明 |
|---|---|
PutResourceMetricRulesRequest.Rules |
build() |
PutResourceMetricRulesRequest.Rules.Builder |
contactGroups(String contactGroups)
The alert contact groups.
|
PutResourceMetricRulesRequest.Rules.Builder |
effectiveInterval(String effectiveInterval)
The time period during which the alert rule is effective.
|
PutResourceMetricRulesRequest.Rules.Builder |
emailSubject(String emailSubject)
The subject of the alert notification email.
|
PutResourceMetricRulesRequest.Rules.Builder |
escalations(PutResourceMetricRulesRequest.Escalations escalations)
Escalations.
|
PutResourceMetricRulesRequest.Rules.Builder |
interval(String interval)
The interval at which alerts are triggered based on the alert rule.
|
PutResourceMetricRulesRequest.Rules.Builder |
labels(List<PutResourceMetricRulesRequest.Labels> labels)
If the metric meets the specified condition in the alert rule and CloudMonitor sends an alert notification, the tag is also written to the metric and displayed in the alert notification.
|
PutResourceMetricRulesRequest.Rules.Builder |
metricName(String metricName)
The metric name.
|
PutResourceMetricRulesRequest.Rules.Builder |
namespace(String namespace)
The namespace of the cloud service.
|
PutResourceMetricRulesRequest.Rules.Builder |
noDataPolicy(String noDataPolicy)
The method that is used to handle alerts when no monitoring data is found.
|
PutResourceMetricRulesRequest.Rules.Builder |
noEffectiveInterval(String noEffectiveInterval)
The time period during which the alert rule is ineffective.
|
PutResourceMetricRulesRequest.Rules.Builder |
period(String period)
The statistical period of the metric.
|
PutResourceMetricRulesRequest.Rules.Builder |
resources(String resources)
The information about the resource.
|
PutResourceMetricRulesRequest.Rules.Builder |
ruleId(String ruleId)
The ID of the alert rule.
|
PutResourceMetricRulesRequest.Rules.Builder |
ruleName(String ruleName)
The name of the alert rule.
|
PutResourceMetricRulesRequest.Rules.Builder |
sendOK(Boolean sendOK)
SendOK.
|
PutResourceMetricRulesRequest.Rules.Builder |
silenceTime(Integer silenceTime)
The mute period during which new alert notifications are not sent even if the trigger conditions are met.
|
PutResourceMetricRulesRequest.Rules.Builder |
webhook(String webhook)
The callback URL to which a POST request is sent when an alert is triggered based on the alert rule.
|
public PutResourceMetricRulesRequest.Rules.Builder escalations(PutResourceMetricRulesRequest.Escalations escalations)
public PutResourceMetricRulesRequest.Rules.Builder contactGroups(String contactGroups)
The alert contact groups. The alert notifications are sent to the alert contacts in the alert contact group.
Valid values of N: 1 to 500.
An alert contact group can contain one or more alert contacts. For information about how to create alert contacts and alert contact groups, see PutContact and PutContactGroup.
This parameter is required.
example:ECS_Group
public PutResourceMetricRulesRequest.Rules.Builder effectiveInterval(String effectiveInterval)
The time period during which the alert rule is effective.
Valid values of N: 1 to 500.
example:00:00-23:59
public PutResourceMetricRulesRequest.Rules.Builder emailSubject(String emailSubject)
The subject of the alert notification email.
Valid values of N: 1 to 500.
public PutResourceMetricRulesRequest.Rules.Builder interval(String interval)
The interval at which alerts are triggered based on the alert rule.
Unit: seconds.
Valid values of N: 1 to 500.
example:For information about how to query the statistical period of a metric, see Appendix 1: Metrics.
60
public PutResourceMetricRulesRequest.Rules.Builder labels(List<PutResourceMetricRulesRequest.Labels> labels)
If the metric meets the specified condition in the alert rule and CloudMonitor sends an alert notification, the tag is also written to the metric and displayed in the alert notification.
public PutResourceMetricRulesRequest.Rules.Builder metricName(String metricName)
The metric name.
Valid values of N: 1 to 500.
For information about how to query the name of a metric, see Appendix 1: Metrics.
example:cpu_total
public PutResourceMetricRulesRequest.Rules.Builder namespace(String namespace)
The namespace of the cloud service.
Valid values of N: 1 to 500.
For information about how to query the namespace of a cloud service, see Appendix 1: Metrics.
This parameter is required.
example:acs_ecs_dashboard
public PutResourceMetricRulesRequest.Rules.Builder noDataPolicy(String noDataPolicy)
The method that is used to handle alerts when no monitoring data is found. Valid values:
Valid values of N: 1 to 500.
example:KEEP_LAST_STATE
public PutResourceMetricRulesRequest.Rules.Builder noEffectiveInterval(String noEffectiveInterval)
The time period during which the alert rule is ineffective.
Valid values of N: 1 to 500.
example:00:00-06:00
public PutResourceMetricRulesRequest.Rules.Builder period(String period)
The statistical period of the metric.
Unit: seconds. The default value is the interval at which the monitoring data of the metric is collected.
Valid values of N: 1 to 500.
example:For information about how to query the statistical period of a metric, see Appendix 1: Metrics.
60
public PutResourceMetricRulesRequest.Rules.Builder resources(String resources)
The information about the resource. Example: [{"instanceId":"i-uf6j91r34rnwawoo****"}] or [{"userId":"100931896542****"}].
Valid values of N: 1 to 500.
For more information about the supported dimensions that are used to query resources, see Appendix 1: Metrics.
This parameter is required.
example:[{"instanceId":"i-uf6j91r34rnwawoo****"}]
public PutResourceMetricRulesRequest.Rules.Builder ruleId(String ruleId)
The ID of the alert rule.
Valid values of N: 1 to 500.
You can specify a new ID or the ID of an existing alert rule. For information about how to query the ID of an alert rule, see DescribeMetricRuleList.
If you specify a new ID, a threshold-triggered alert rule is created.
This parameter is required.
example:a151cd6023eacee2f0978e03863cc1697c89508****
public PutResourceMetricRulesRequest.Rules.Builder ruleName(String ruleName)
The name of the alert rule.
Valid values of N: 1 to 500.
You can specify a new name or the name of an existing alert rule. For information about how to query the name of an alert rule, see DescribeMetricRuleList.
If you specify a new name, a threshold-triggered alert rule is created.
This parameter is required.
example:test123
public PutResourceMetricRulesRequest.Rules.Builder sendOK(Boolean sendOK)
public PutResourceMetricRulesRequest.Rules.Builder silenceTime(Integer silenceTime)
The mute period during which new alert notifications are not sent even if the trigger conditions are met.
Unit: seconds. Default value: 86400.
Valid values of N: 1 to 500.
example:If an alert is not cleared after the mute period ends, CloudMonitor resends an alert notification.
86400
public PutResourceMetricRulesRequest.Rules.Builder webhook(String webhook)
The callback URL to which a POST request is sent when an alert is triggered based on the alert rule.
Valid values of N: 1 to 500.
example:public PutResourceMetricRulesRequest.Rules build()
Copyright © 2026. All rights reserved.