public static final class PutCustomMetricRuleRequest.Builder extends Object
| 限定符和类型 | 方法和说明 |
|---|---|
PutCustomMetricRuleRequest |
build() |
PutCustomMetricRuleRequest.Builder |
comparisonOperator(String comparisonOperator)
The operator that is used to compare the metric value with the threshold.
|
PutCustomMetricRuleRequest.Builder |
contactGroups(String contactGroups)
The alert contact groups.
|
PutCustomMetricRuleRequest.Builder |
effectiveInterval(String effectiveInterval)
The period of time during which the alert rule is effective.
|
PutCustomMetricRuleRequest.Builder |
emailSubject(String emailSubject)
The subject of the alert notification email.
|
PutCustomMetricRuleRequest.Builder |
evaluationCount(Integer evaluationCount)
The consecutive number of times for which the metric value meets the alert condition before an alert is triggered.
|
PutCustomMetricRuleRequest.Builder |
groupId(String groupId)
The ID of the application group to which the custom monitoring data belongs.
|
PutCustomMetricRuleRequest.Builder |
level(String level)
The alert level.
|
PutCustomMetricRuleRequest.Builder |
metricName(String metricName)
The metric name.
|
PutCustomMetricRuleRequest.Builder |
period(String period)
The cycle that is used to aggregate custom monitoring data.
|
PutCustomMetricRuleRequest.Builder |
resources(String resources)
The custom monitoring data to which the alert rule applies.
|
PutCustomMetricRuleRequest.Builder |
ruleId(String ruleId)
The ID of the alert rule.
|
PutCustomMetricRuleRequest.Builder |
ruleName(String ruleName)
The name of the alert rule.
|
PutCustomMetricRuleRequest.Builder |
silenceTime(Integer silenceTime)
The mute period during which new alert notifications are not sent even if the trigger conditions are met.
|
PutCustomMetricRuleRequest.Builder |
statistics(String statistics)
The method used to calculate the metric value based on which alerts are triggered.
|
PutCustomMetricRuleRequest.Builder |
threshold(String threshold)
The alert threshold.
|
PutCustomMetricRuleRequest.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 PutCustomMetricRuleRequest.Builder comparisonOperator(String comparisonOperator)
The operator that is used to compare the metric value with the threshold. Valid values:
>==<=><!=This parameter is required.
example:=
public PutCustomMetricRuleRequest.Builder contactGroups(String contactGroups)
The alert contact groups. Separate multiple alert contact groups with commas (,).
This parameter is required.
example:ECS_Group
public PutCustomMetricRuleRequest.Builder effectiveInterval(String effectiveInterval)
The period of time during which the alert rule is effective. Valid values: 00:00 to 23:59.
example:00:00-23:59
public PutCustomMetricRuleRequest.Builder emailSubject(String emailSubject)
The subject of the alert notification email.
public PutCustomMetricRuleRequest.Builder evaluationCount(Integer evaluationCount)
The consecutive number of times for which the metric value meets the alert condition before an alert is triggered.
This parameter is required.
example:3
public PutCustomMetricRuleRequest.Builder groupId(String groupId)
The ID of the application group to which the custom monitoring data belongs.
example:The value 0 indicates that the reported custom monitoring data does not belong to an application group.
7378****
public PutCustomMetricRuleRequest.Builder level(String level)
The alert level. Valid values:
This parameter is required.
example:CRITICAL
public PutCustomMetricRuleRequest.Builder metricName(String metricName)
The metric name.
For more information about how to obtain the metric name, see DescribeCustomMetricList.
This parameter is required.
example:cpu_total
public PutCustomMetricRuleRequest.Builder period(String period)
The cycle that is used to aggregate custom monitoring data. Unit: seconds Set the value to an integral multiple of 60. The original reporting cycle of custom monitoring data is used by default.
example:300
public PutCustomMetricRuleRequest.Builder resources(String resources)
The custom monitoring data to which the alert rule applies. The value includes the application group ID to which the custom monitoring data belongs and the dimension to which the metric belongs.
This parameter is required.
example:[{"groupId":7378****,"dimension":"instanceId=i-hp3543t5e4sudb3s****"}]
public PutCustomMetricRuleRequest.Builder ruleId(String ruleId)
The ID of the alert rule.
You can specify an existing ID to modify the corresponding alert rule or specify a new ID to create an alert rule.
This parameter is required.
example:MyRuleId1
public PutCustomMetricRuleRequest.Builder ruleName(String ruleName)
The name of the alert rule.
example:CpuUsage
public PutCustomMetricRuleRequest.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, which is equivalent to one day.
example:Only one alert notification is sent during each mute period even if the metric value exceeds the alert threshold several times.
86400
public PutCustomMetricRuleRequest.Builder statistics(String statistics)
The method used to calculate the metric value based on which alerts are triggered.
This parameter is required.
example:Average
public PutCustomMetricRuleRequest.Builder threshold(String threshold)
The alert threshold.
This parameter is required.
example:90
public PutCustomMetricRuleRequest.Builder webhook(String webhook)
The callback URL to which a POST request is sent when an alert is triggered based on the alert rule.
example:public PutCustomMetricRuleRequest build()
Copyright © 2026. All rights reserved.