All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.pulumi.alicloud.cms.MetricRuleTemplateArgs Maven / Gradle / Ivy

There is a newer version: 3.63.0-alpha.1727424957
Show newest version
// *** WARNING: this file was generated by pulumi-java-gen. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***

package com.pulumi.alicloud.cms;

import com.pulumi.alicloud.cms.inputs.MetricRuleTemplateAlertTemplateArgs;
import com.pulumi.core.Output;
import com.pulumi.core.annotations.Import;
import com.pulumi.exceptions.MissingRequiredPropertyException;
import java.lang.Integer;
import java.lang.String;
import java.util.List;
import java.util.Objects;
import java.util.Optional;
import javax.annotation.Nullable;


public final class MetricRuleTemplateArgs extends com.pulumi.resources.ResourceArgs {

    public static final MetricRuleTemplateArgs Empty = new MetricRuleTemplateArgs();

    /**
     * The details of alert rules that are generated based on the alert template. See `alert_templates` below.
     * 
     */
    @Import(name="alertTemplates")
    private @Nullable Output> alertTemplates;

    /**
     * @return The details of alert rules that are generated based on the alert template. See `alert_templates` below.
     * 
     */
    public Optional>> alertTemplates() {
        return Optional.ofNullable(this.alertTemplates);
    }

    /**
     * The mode in which the alert template is applied. Valid values:`GROUP_INSTANCE_FIRST`or `ALARM_TEMPLATE_FIRST`. GROUP_INSTANCE_FIRST: The metrics in the application group take precedence. If a metric specified in the alert template does not exist in the application group, the system does not generate an alert rule for the metric based on the alert template. ALARM_TEMPLATE_FIRST: The metrics specified in the alert template take precedence. If a metric specified in the alert template does not exist in the application group, the system still generates an alert rule for the metric based on the alert template.
     * 
     */
    @Import(name="applyMode")
    private @Nullable Output applyMode;

    /**
     * @return The mode in which the alert template is applied. Valid values:`GROUP_INSTANCE_FIRST`or `ALARM_TEMPLATE_FIRST`. GROUP_INSTANCE_FIRST: The metrics in the application group take precedence. If a metric specified in the alert template does not exist in the application group, the system does not generate an alert rule for the metric based on the alert template. ALARM_TEMPLATE_FIRST: The metrics specified in the alert template take precedence. If a metric specified in the alert template does not exist in the application group, the system still generates an alert rule for the metric based on the alert template.
     * 
     */
    public Optional> applyMode() {
        return Optional.ofNullable(this.applyMode);
    }

    /**
     * The description of the alert template.
     * 
     */
    @Import(name="description")
    private @Nullable Output description;

    /**
     * @return The description of the alert template.
     * 
     */
    public Optional> description() {
        return Optional.ofNullable(this.description);
    }

    /**
     * The end of the time period during which the alert rule is effective. Valid values: 00 to 23. The value 00 indicates 00:59 and the value 23 indicates 23:59.
     * 
     */
    @Import(name="enableEndTime")
    private @Nullable Output enableEndTime;

    /**
     * @return The end of the time period during which the alert rule is effective. Valid values: 00 to 23. The value 00 indicates 00:59 and the value 23 indicates 23:59.
     * 
     */
    public Optional> enableEndTime() {
        return Optional.ofNullable(this.enableEndTime);
    }

    /**
     * The beginning of the time period during which the alert rule is effective. Valid values: 00 to 23. The value 00 indicates 00:00 and the value 23 indicates 23:00.
     * 
     */
    @Import(name="enableStartTime")
    private @Nullable Output enableStartTime;

    /**
     * @return The beginning of the time period during which the alert rule is effective. Valid values: 00 to 23. The value 00 indicates 00:00 and the value 23 indicates 23:00.
     * 
     */
    public Optional> enableStartTime() {
        return Optional.ofNullable(this.enableStartTime);
    }

    /**
     * The ID of the application group.
     * 
     */
    @Import(name="groupId")
    private @Nullable Output groupId;

    /**
     * @return The ID of the application group.
     * 
     */
    public Optional> groupId() {
        return Optional.ofNullable(this.groupId);
    }

    /**
     * The name of the alert template.
     * 
     */
    @Import(name="metricRuleTemplateName", required=true)
    private Output metricRuleTemplateName;

    /**
     * @return The name of the alert template.
     * 
     */
    public Output metricRuleTemplateName() {
        return this.metricRuleTemplateName;
    }

    /**
     * The alert notification method. Valid values:Set the value to 4. The value 4 indicates that alert notifications are sent by using TradeManager and DingTalk chatbots.
     * 
     */
    @Import(name="notifyLevel")
    private @Nullable Output notifyLevel;

    /**
     * @return The alert notification method. Valid values:Set the value to 4. The value 4 indicates that alert notifications are sent by using TradeManager and DingTalk chatbots.
     * 
     */
    public Optional> notifyLevel() {
        return Optional.ofNullable(this.notifyLevel);
    }

    /**
     * The version of the alert template to be modified.
     * 
     * > **NOTE:** The version changes with the number of times that the alert template is modified.
     * 
     */
    @Import(name="restVersion")
    private @Nullable Output restVersion;

    /**
     * @return The version of the alert template to be modified.
     * 
     * > **NOTE:** The version changes with the number of times that the alert template is modified.
     * 
     */
    public Optional> restVersion() {
        return Optional.ofNullable(this.restVersion);
    }

    /**
     * The mute period during which notifications are not repeatedly sent for an alert.Valid values: 0 to 86400. Unit: seconds. Default value: `86400`.
     * 
     * > **NOTE:** Only one alert notification is sent during each mute period even if the metric value exceeds the alert threshold several times.
     * 
     */
    @Import(name="silenceTime")
    private @Nullable Output silenceTime;

    /**
     * @return The mute period during which notifications are not repeatedly sent for an alert.Valid values: 0 to 86400. Unit: seconds. Default value: `86400`.
     * 
     * > **NOTE:** Only one alert notification is sent during each mute period even if the metric value exceeds the alert threshold several times.
     * 
     */
    public Optional> silenceTime() {
        return Optional.ofNullable(this.silenceTime);
    }

    /**
     * The callback URL to which a POST request is sent when an alert is triggered based on the alert rule.
     * 
     */
    @Import(name="webhook")
    private @Nullable Output webhook;

    /**
     * @return The callback URL to which a POST request is sent when an alert is triggered based on the alert rule.
     * 
     */
    public Optional> webhook() {
        return Optional.ofNullable(this.webhook);
    }

    private MetricRuleTemplateArgs() {}

    private MetricRuleTemplateArgs(MetricRuleTemplateArgs $) {
        this.alertTemplates = $.alertTemplates;
        this.applyMode = $.applyMode;
        this.description = $.description;
        this.enableEndTime = $.enableEndTime;
        this.enableStartTime = $.enableStartTime;
        this.groupId = $.groupId;
        this.metricRuleTemplateName = $.metricRuleTemplateName;
        this.notifyLevel = $.notifyLevel;
        this.restVersion = $.restVersion;
        this.silenceTime = $.silenceTime;
        this.webhook = $.webhook;
    }

    public static Builder builder() {
        return new Builder();
    }
    public static Builder builder(MetricRuleTemplateArgs defaults) {
        return new Builder(defaults);
    }

    public static final class Builder {
        private MetricRuleTemplateArgs $;

        public Builder() {
            $ = new MetricRuleTemplateArgs();
        }

        public Builder(MetricRuleTemplateArgs defaults) {
            $ = new MetricRuleTemplateArgs(Objects.requireNonNull(defaults));
        }

        /**
         * @param alertTemplates The details of alert rules that are generated based on the alert template. See `alert_templates` below.
         * 
         * @return builder
         * 
         */
        public Builder alertTemplates(@Nullable Output> alertTemplates) {
            $.alertTemplates = alertTemplates;
            return this;
        }

        /**
         * @param alertTemplates The details of alert rules that are generated based on the alert template. See `alert_templates` below.
         * 
         * @return builder
         * 
         */
        public Builder alertTemplates(List alertTemplates) {
            return alertTemplates(Output.of(alertTemplates));
        }

        /**
         * @param alertTemplates The details of alert rules that are generated based on the alert template. See `alert_templates` below.
         * 
         * @return builder
         * 
         */
        public Builder alertTemplates(MetricRuleTemplateAlertTemplateArgs... alertTemplates) {
            return alertTemplates(List.of(alertTemplates));
        }

        /**
         * @param applyMode The mode in which the alert template is applied. Valid values:`GROUP_INSTANCE_FIRST`or `ALARM_TEMPLATE_FIRST`. GROUP_INSTANCE_FIRST: The metrics in the application group take precedence. If a metric specified in the alert template does not exist in the application group, the system does not generate an alert rule for the metric based on the alert template. ALARM_TEMPLATE_FIRST: The metrics specified in the alert template take precedence. If a metric specified in the alert template does not exist in the application group, the system still generates an alert rule for the metric based on the alert template.
         * 
         * @return builder
         * 
         */
        public Builder applyMode(@Nullable Output applyMode) {
            $.applyMode = applyMode;
            return this;
        }

        /**
         * @param applyMode The mode in which the alert template is applied. Valid values:`GROUP_INSTANCE_FIRST`or `ALARM_TEMPLATE_FIRST`. GROUP_INSTANCE_FIRST: The metrics in the application group take precedence. If a metric specified in the alert template does not exist in the application group, the system does not generate an alert rule for the metric based on the alert template. ALARM_TEMPLATE_FIRST: The metrics specified in the alert template take precedence. If a metric specified in the alert template does not exist in the application group, the system still generates an alert rule for the metric based on the alert template.
         * 
         * @return builder
         * 
         */
        public Builder applyMode(String applyMode) {
            return applyMode(Output.of(applyMode));
        }

        /**
         * @param description The description of the alert template.
         * 
         * @return builder
         * 
         */
        public Builder description(@Nullable Output description) {
            $.description = description;
            return this;
        }

        /**
         * @param description The description of the alert template.
         * 
         * @return builder
         * 
         */
        public Builder description(String description) {
            return description(Output.of(description));
        }

        /**
         * @param enableEndTime The end of the time period during which the alert rule is effective. Valid values: 00 to 23. The value 00 indicates 00:59 and the value 23 indicates 23:59.
         * 
         * @return builder
         * 
         */
        public Builder enableEndTime(@Nullable Output enableEndTime) {
            $.enableEndTime = enableEndTime;
            return this;
        }

        /**
         * @param enableEndTime The end of the time period during which the alert rule is effective. Valid values: 00 to 23. The value 00 indicates 00:59 and the value 23 indicates 23:59.
         * 
         * @return builder
         * 
         */
        public Builder enableEndTime(String enableEndTime) {
            return enableEndTime(Output.of(enableEndTime));
        }

        /**
         * @param enableStartTime The beginning of the time period during which the alert rule is effective. Valid values: 00 to 23. The value 00 indicates 00:00 and the value 23 indicates 23:00.
         * 
         * @return builder
         * 
         */
        public Builder enableStartTime(@Nullable Output enableStartTime) {
            $.enableStartTime = enableStartTime;
            return this;
        }

        /**
         * @param enableStartTime The beginning of the time period during which the alert rule is effective. Valid values: 00 to 23. The value 00 indicates 00:00 and the value 23 indicates 23:00.
         * 
         * @return builder
         * 
         */
        public Builder enableStartTime(String enableStartTime) {
            return enableStartTime(Output.of(enableStartTime));
        }

        /**
         * @param groupId The ID of the application group.
         * 
         * @return builder
         * 
         */
        public Builder groupId(@Nullable Output groupId) {
            $.groupId = groupId;
            return this;
        }

        /**
         * @param groupId The ID of the application group.
         * 
         * @return builder
         * 
         */
        public Builder groupId(String groupId) {
            return groupId(Output.of(groupId));
        }

        /**
         * @param metricRuleTemplateName The name of the alert template.
         * 
         * @return builder
         * 
         */
        public Builder metricRuleTemplateName(Output metricRuleTemplateName) {
            $.metricRuleTemplateName = metricRuleTemplateName;
            return this;
        }

        /**
         * @param metricRuleTemplateName The name of the alert template.
         * 
         * @return builder
         * 
         */
        public Builder metricRuleTemplateName(String metricRuleTemplateName) {
            return metricRuleTemplateName(Output.of(metricRuleTemplateName));
        }

        /**
         * @param notifyLevel The alert notification method. Valid values:Set the value to 4. The value 4 indicates that alert notifications are sent by using TradeManager and DingTalk chatbots.
         * 
         * @return builder
         * 
         */
        public Builder notifyLevel(@Nullable Output notifyLevel) {
            $.notifyLevel = notifyLevel;
            return this;
        }

        /**
         * @param notifyLevel The alert notification method. Valid values:Set the value to 4. The value 4 indicates that alert notifications are sent by using TradeManager and DingTalk chatbots.
         * 
         * @return builder
         * 
         */
        public Builder notifyLevel(String notifyLevel) {
            return notifyLevel(Output.of(notifyLevel));
        }

        /**
         * @param restVersion The version of the alert template to be modified.
         * 
         * > **NOTE:** The version changes with the number of times that the alert template is modified.
         * 
         * @return builder
         * 
         */
        public Builder restVersion(@Nullable Output restVersion) {
            $.restVersion = restVersion;
            return this;
        }

        /**
         * @param restVersion The version of the alert template to be modified.
         * 
         * > **NOTE:** The version changes with the number of times that the alert template is modified.
         * 
         * @return builder
         * 
         */
        public Builder restVersion(String restVersion) {
            return restVersion(Output.of(restVersion));
        }

        /**
         * @param silenceTime The mute period during which notifications are not repeatedly sent for an alert.Valid values: 0 to 86400. Unit: seconds. Default value: `86400`.
         * 
         * > **NOTE:** Only one alert notification is sent during each mute period even if the metric value exceeds the alert threshold several times.
         * 
         * @return builder
         * 
         */
        public Builder silenceTime(@Nullable Output silenceTime) {
            $.silenceTime = silenceTime;
            return this;
        }

        /**
         * @param silenceTime The mute period during which notifications are not repeatedly sent for an alert.Valid values: 0 to 86400. Unit: seconds. Default value: `86400`.
         * 
         * > **NOTE:** Only one alert notification is sent during each mute period even if the metric value exceeds the alert threshold several times.
         * 
         * @return builder
         * 
         */
        public Builder silenceTime(Integer silenceTime) {
            return silenceTime(Output.of(silenceTime));
        }

        /**
         * @param webhook The callback URL to which a POST request is sent when an alert is triggered based on the alert rule.
         * 
         * @return builder
         * 
         */
        public Builder webhook(@Nullable Output webhook) {
            $.webhook = webhook;
            return this;
        }

        /**
         * @param webhook The callback URL to which a POST request is sent when an alert is triggered based on the alert rule.
         * 
         * @return builder
         * 
         */
        public Builder webhook(String webhook) {
            return webhook(Output.of(webhook));
        }

        public MetricRuleTemplateArgs build() {
            if ($.metricRuleTemplateName == null) {
                throw new MissingRequiredPropertyException("MetricRuleTemplateArgs", "metricRuleTemplateName");
            }
            return $;
        }
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy