public static final class CreateMetricRuleTemplateRequest.AlertTemplates.Builder extends Object
public CreateMetricRuleTemplateRequest.AlertTemplates.Builder escalations(CreateMetricRuleTemplateRequest.Escalations escalations)
public CreateMetricRuleTemplateRequest.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.
This parameter is required.
example:ecs
public CreateMetricRuleTemplateRequest.AlertTemplates.Builder metricName(String metricName)
The metric name.
Valid values of N: 1 to 200.
For information about how to obtain the name of a metric, see DescribeMetricMetaList or Metrics.
This parameter is required.
example:cpu_total
public CreateMetricRuleTemplateRequest.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.
This parameter is required.
example:acs_ecs_dashboard
public CreateMetricRuleTemplateRequest.AlertTemplates.Builder period(Integer period)
The aggregation period of monitoring data. Unit: seconds.
The default value is the minimum aggregation period. Generally, you do not need to specify the minimum aggregation period.
Valid values of N: 1 to 200.
example:60
public CreateMetricRuleTemplateRequest.AlertTemplates.Builder ruleName(String ruleName)
The name of the alert rule.
Valid values of N: 1 to 200.
This parameter is required.
example:ECS_Rule1
public CreateMetricRuleTemplateRequest.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 CreateMetricRuleTemplateRequest.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:public CreateMetricRuleTemplateRequest.AlertTemplates build()
Copyright © 2026. All rights reserved.