public static final class ModifyMetricRuleTemplateRequest.AlertTemplates.Builder extends Object
public ModifyMetricRuleTemplateRequest.AlertTemplates.Builder escalations(ModifyMetricRuleTemplateRequest.Escalations escalations)
public ModifyMetricRuleTemplateRequest.AlertTemplates.Builder category(String category)
The abbreviation of the cloud service name.
Valid values of N: 1 to 200.
For more information about how to obtain the abbreviation of a cloud service name, see metricCategory in the response parameter Labels of the DescribeProjectMeta operation.
ecs
public ModifyMetricRuleTemplateRequest.AlertTemplates.Builder metricName(String metricName)
The metric name.
Valid values of N: 1 to 200.
For information about how to obtain metrics, see DescribeMetricMetaList or Appendix 1: Metrics.
example:cpu_total
public ModifyMetricRuleTemplateRequest.AlertTemplates.Builder namespace(String namespace)
The namespace of the cloud service.
Valid values of N: 1 to 200.
For information about how to obtain the namespace of a cloud service, see DescribeMetricMetaList or Appendix 1: Metrics.
example:acs_ecs_dashboard
public ModifyMetricRuleTemplateRequest.AlertTemplates.Builder period(Integer period)
The statistical period of the monitoring data.
Valid values of N: 1 to 200.
example:If the value is set to 300 seconds, the monitoring data is collected every 300 seconds. If the monitoring data is reported every 1 minute, the alert system calculates the average, maximum, and minimum values of the monitoring data of 5 minutes and checks whether the aggregated values exceed the threshold. To prevent unexpected alerts, we recommend that you set this parameter together with other parameters.
60
public ModifyMetricRuleTemplateRequest.AlertTemplates.Builder ruleName(String ruleName)
The name of the alert rule.
Valid values of N: 1 to 200.
example:rule1
public ModifyMetricRuleTemplateRequest.AlertTemplates.Builder selector(String selector)
The dimension of the alert. It is an extended field.
Valid values of N: 1 to 200.
For example, an alert template is applied to an application group, this parameter is set to {"disk":"/"}, and the MetricName parameter is set to DiskUtilization. In this case, the generated alert rule is applied to the root disk partition ("/") of all instances in the application group to which the alert template is applied.
example:For more information about the values of extended fields, see DescribeMetricRuleTemplateAttribute.
{"disk":"/"}
public ModifyMetricRuleTemplateRequest.AlertTemplates.Builder webhook(String webhook)
The callback URL.
Valid values of N: 1 to 200.
The callback URL must be accessible over the Internet. CloudMonitor pushes an alert notification to the specified callback URL by sending an HTTP POST request. Only the HTTP protocol is supported.
example:https://apiwebhook.hipac.cn/api/v1/alarm/aly/eregfeeferrtbnmkdszp
public ModifyMetricRuleTemplateRequest.AlertTemplates build()
Copyright © 2026. All rights reserved.