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

com.pulumi.azurenative.insights.MetricAlertArgs Maven / Gradle / Ivy

There is a newer version: 2.78.0
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.azurenative.insights;

import com.pulumi.azurenative.insights.inputs.MetricAlertActionArgs;
import com.pulumi.azurenative.insights.inputs.MetricAlertMultipleResourceMultipleMetricCriteriaArgs;
import com.pulumi.azurenative.insights.inputs.MetricAlertSingleResourceMultipleMetricCriteriaArgs;
import com.pulumi.azurenative.insights.inputs.WebtestLocationAvailabilityCriteriaArgs;
import com.pulumi.core.Output;
import com.pulumi.core.annotations.Import;
import com.pulumi.exceptions.MissingRequiredPropertyException;
import java.lang.Boolean;
import java.lang.Integer;
import java.lang.Object;
import java.lang.String;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.Optional;
import javax.annotation.Nullable;


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

    public static final MetricAlertArgs Empty = new MetricAlertArgs();

    /**
     * the array of actions that are performed when the alert rule becomes active, and when an alert condition is resolved.
     * 
     */
    @Import(name="actions")
    private @Nullable Output> actions;

    /**
     * @return the array of actions that are performed when the alert rule becomes active, and when an alert condition is resolved.
     * 
     */
    public Optional>> actions() {
        return Optional.ofNullable(this.actions);
    }

    /**
     * the flag that indicates whether the alert should be auto resolved or not. The default is true.
     * 
     */
    @Import(name="autoMitigate")
    private @Nullable Output autoMitigate;

    /**
     * @return the flag that indicates whether the alert should be auto resolved or not. The default is true.
     * 
     */
    public Optional> autoMitigate() {
        return Optional.ofNullable(this.autoMitigate);
    }

    /**
     * defines the specific alert criteria information.
     * 
     */
    @Import(name="criteria", required=true)
    private Output criteria;

    /**
     * @return defines the specific alert criteria information.
     * 
     */
    public Output criteria() {
        return this.criteria;
    }

    /**
     * the description of the metric alert that will be included in the alert email.
     * 
     */
    @Import(name="description")
    private @Nullable Output description;

    /**
     * @return the description of the metric alert that will be included in the alert email.
     * 
     */
    public Optional> description() {
        return Optional.ofNullable(this.description);
    }

    /**
     * the flag that indicates whether the metric alert is enabled.
     * 
     */
    @Import(name="enabled", required=true)
    private Output enabled;

    /**
     * @return the flag that indicates whether the metric alert is enabled.
     * 
     */
    public Output enabled() {
        return this.enabled;
    }

    /**
     * how often the metric alert is evaluated represented in ISO 8601 duration format.
     * 
     */
    @Import(name="evaluationFrequency", required=true)
    private Output evaluationFrequency;

    /**
     * @return how often the metric alert is evaluated represented in ISO 8601 duration format.
     * 
     */
    public Output evaluationFrequency() {
        return this.evaluationFrequency;
    }

    /**
     * Resource location
     * 
     */
    @Import(name="location")
    private @Nullable Output location;

    /**
     * @return Resource location
     * 
     */
    public Optional> location() {
        return Optional.ofNullable(this.location);
    }

    /**
     * The name of the resource group. The name is case insensitive.
     * 
     */
    @Import(name="resourceGroupName", required=true)
    private Output resourceGroupName;

    /**
     * @return The name of the resource group. The name is case insensitive.
     * 
     */
    public Output resourceGroupName() {
        return this.resourceGroupName;
    }

    /**
     * The name of the rule.
     * 
     */
    @Import(name="ruleName")
    private @Nullable Output ruleName;

    /**
     * @return The name of the rule.
     * 
     */
    public Optional> ruleName() {
        return Optional.ofNullable(this.ruleName);
    }

    /**
     * the list of resource id's that this metric alert is scoped to.
     * 
     */
    @Import(name="scopes", required=true)
    private Output> scopes;

    /**
     * @return the list of resource id's that this metric alert is scoped to.
     * 
     */
    public Output> scopes() {
        return this.scopes;
    }

    /**
     * Alert severity {0, 1, 2, 3, 4}
     * 
     */
    @Import(name="severity", required=true)
    private Output severity;

    /**
     * @return Alert severity {0, 1, 2, 3, 4}
     * 
     */
    public Output severity() {
        return this.severity;
    }

    /**
     * Resource tags
     * 
     */
    @Import(name="tags")
    private @Nullable Output> tags;

    /**
     * @return Resource tags
     * 
     */
    public Optional>> tags() {
        return Optional.ofNullable(this.tags);
    }

    /**
     * the region of the target resource(s) on which the alert is created/updated. Mandatory if the scope contains a subscription, resource group, or more than one resource.
     * 
     */
    @Import(name="targetResourceRegion")
    private @Nullable Output targetResourceRegion;

    /**
     * @return the region of the target resource(s) on which the alert is created/updated. Mandatory if the scope contains a subscription, resource group, or more than one resource.
     * 
     */
    public Optional> targetResourceRegion() {
        return Optional.ofNullable(this.targetResourceRegion);
    }

    /**
     * the resource type of the target resource(s) on which the alert is created/updated. Mandatory if the scope contains a subscription, resource group, or more than one resource.
     * 
     */
    @Import(name="targetResourceType")
    private @Nullable Output targetResourceType;

    /**
     * @return the resource type of the target resource(s) on which the alert is created/updated. Mandatory if the scope contains a subscription, resource group, or more than one resource.
     * 
     */
    public Optional> targetResourceType() {
        return Optional.ofNullable(this.targetResourceType);
    }

    /**
     * the period of time (in ISO 8601 duration format) that is used to monitor alert activity based on the threshold.
     * 
     */
    @Import(name="windowSize", required=true)
    private Output windowSize;

    /**
     * @return the period of time (in ISO 8601 duration format) that is used to monitor alert activity based on the threshold.
     * 
     */
    public Output windowSize() {
        return this.windowSize;
    }

    private MetricAlertArgs() {}

    private MetricAlertArgs(MetricAlertArgs $) {
        this.actions = $.actions;
        this.autoMitigate = $.autoMitigate;
        this.criteria = $.criteria;
        this.description = $.description;
        this.enabled = $.enabled;
        this.evaluationFrequency = $.evaluationFrequency;
        this.location = $.location;
        this.resourceGroupName = $.resourceGroupName;
        this.ruleName = $.ruleName;
        this.scopes = $.scopes;
        this.severity = $.severity;
        this.tags = $.tags;
        this.targetResourceRegion = $.targetResourceRegion;
        this.targetResourceType = $.targetResourceType;
        this.windowSize = $.windowSize;
    }

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

    public static final class Builder {
        private MetricAlertArgs $;

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

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

        /**
         * @param actions the array of actions that are performed when the alert rule becomes active, and when an alert condition is resolved.
         * 
         * @return builder
         * 
         */
        public Builder actions(@Nullable Output> actions) {
            $.actions = actions;
            return this;
        }

        /**
         * @param actions the array of actions that are performed when the alert rule becomes active, and when an alert condition is resolved.
         * 
         * @return builder
         * 
         */
        public Builder actions(List actions) {
            return actions(Output.of(actions));
        }

        /**
         * @param actions the array of actions that are performed when the alert rule becomes active, and when an alert condition is resolved.
         * 
         * @return builder
         * 
         */
        public Builder actions(MetricAlertActionArgs... actions) {
            return actions(List.of(actions));
        }

        /**
         * @param autoMitigate the flag that indicates whether the alert should be auto resolved or not. The default is true.
         * 
         * @return builder
         * 
         */
        public Builder autoMitigate(@Nullable Output autoMitigate) {
            $.autoMitigate = autoMitigate;
            return this;
        }

        /**
         * @param autoMitigate the flag that indicates whether the alert should be auto resolved or not. The default is true.
         * 
         * @return builder
         * 
         */
        public Builder autoMitigate(Boolean autoMitigate) {
            return autoMitigate(Output.of(autoMitigate));
        }

        /**
         * @param criteria defines the specific alert criteria information.
         * 
         * @return builder
         * 
         */
        public Builder criteria(Output criteria) {
            $.criteria = criteria;
            return this;
        }

        /**
         * @param criteria defines the specific alert criteria information.
         * 
         * @return builder
         * 
         */
        public Builder criteria(Object criteria) {
            return criteria(Output.of(criteria));
        }

        /**
         * @param description the description of the metric alert that will be included in the alert email.
         * 
         * @return builder
         * 
         */
        public Builder description(@Nullable Output description) {
            $.description = description;
            return this;
        }

        /**
         * @param description the description of the metric alert that will be included in the alert email.
         * 
         * @return builder
         * 
         */
        public Builder description(String description) {
            return description(Output.of(description));
        }

        /**
         * @param enabled the flag that indicates whether the metric alert is enabled.
         * 
         * @return builder
         * 
         */
        public Builder enabled(Output enabled) {
            $.enabled = enabled;
            return this;
        }

        /**
         * @param enabled the flag that indicates whether the metric alert is enabled.
         * 
         * @return builder
         * 
         */
        public Builder enabled(Boolean enabled) {
            return enabled(Output.of(enabled));
        }

        /**
         * @param evaluationFrequency how often the metric alert is evaluated represented in ISO 8601 duration format.
         * 
         * @return builder
         * 
         */
        public Builder evaluationFrequency(Output evaluationFrequency) {
            $.evaluationFrequency = evaluationFrequency;
            return this;
        }

        /**
         * @param evaluationFrequency how often the metric alert is evaluated represented in ISO 8601 duration format.
         * 
         * @return builder
         * 
         */
        public Builder evaluationFrequency(String evaluationFrequency) {
            return evaluationFrequency(Output.of(evaluationFrequency));
        }

        /**
         * @param location Resource location
         * 
         * @return builder
         * 
         */
        public Builder location(@Nullable Output location) {
            $.location = location;
            return this;
        }

        /**
         * @param location Resource location
         * 
         * @return builder
         * 
         */
        public Builder location(String location) {
            return location(Output.of(location));
        }

        /**
         * @param resourceGroupName The name of the resource group. The name is case insensitive.
         * 
         * @return builder
         * 
         */
        public Builder resourceGroupName(Output resourceGroupName) {
            $.resourceGroupName = resourceGroupName;
            return this;
        }

        /**
         * @param resourceGroupName The name of the resource group. The name is case insensitive.
         * 
         * @return builder
         * 
         */
        public Builder resourceGroupName(String resourceGroupName) {
            return resourceGroupName(Output.of(resourceGroupName));
        }

        /**
         * @param ruleName The name of the rule.
         * 
         * @return builder
         * 
         */
        public Builder ruleName(@Nullable Output ruleName) {
            $.ruleName = ruleName;
            return this;
        }

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

        /**
         * @param scopes the list of resource id's that this metric alert is scoped to.
         * 
         * @return builder
         * 
         */
        public Builder scopes(Output> scopes) {
            $.scopes = scopes;
            return this;
        }

        /**
         * @param scopes the list of resource id's that this metric alert is scoped to.
         * 
         * @return builder
         * 
         */
        public Builder scopes(List scopes) {
            return scopes(Output.of(scopes));
        }

        /**
         * @param scopes the list of resource id's that this metric alert is scoped to.
         * 
         * @return builder
         * 
         */
        public Builder scopes(String... scopes) {
            return scopes(List.of(scopes));
        }

        /**
         * @param severity Alert severity {0, 1, 2, 3, 4}
         * 
         * @return builder
         * 
         */
        public Builder severity(Output severity) {
            $.severity = severity;
            return this;
        }

        /**
         * @param severity Alert severity {0, 1, 2, 3, 4}
         * 
         * @return builder
         * 
         */
        public Builder severity(Integer severity) {
            return severity(Output.of(severity));
        }

        /**
         * @param tags Resource tags
         * 
         * @return builder
         * 
         */
        public Builder tags(@Nullable Output> tags) {
            $.tags = tags;
            return this;
        }

        /**
         * @param tags Resource tags
         * 
         * @return builder
         * 
         */
        public Builder tags(Map tags) {
            return tags(Output.of(tags));
        }

        /**
         * @param targetResourceRegion the region of the target resource(s) on which the alert is created/updated. Mandatory if the scope contains a subscription, resource group, or more than one resource.
         * 
         * @return builder
         * 
         */
        public Builder targetResourceRegion(@Nullable Output targetResourceRegion) {
            $.targetResourceRegion = targetResourceRegion;
            return this;
        }

        /**
         * @param targetResourceRegion the region of the target resource(s) on which the alert is created/updated. Mandatory if the scope contains a subscription, resource group, or more than one resource.
         * 
         * @return builder
         * 
         */
        public Builder targetResourceRegion(String targetResourceRegion) {
            return targetResourceRegion(Output.of(targetResourceRegion));
        }

        /**
         * @param targetResourceType the resource type of the target resource(s) on which the alert is created/updated. Mandatory if the scope contains a subscription, resource group, or more than one resource.
         * 
         * @return builder
         * 
         */
        public Builder targetResourceType(@Nullable Output targetResourceType) {
            $.targetResourceType = targetResourceType;
            return this;
        }

        /**
         * @param targetResourceType the resource type of the target resource(s) on which the alert is created/updated. Mandatory if the scope contains a subscription, resource group, or more than one resource.
         * 
         * @return builder
         * 
         */
        public Builder targetResourceType(String targetResourceType) {
            return targetResourceType(Output.of(targetResourceType));
        }

        /**
         * @param windowSize the period of time (in ISO 8601 duration format) that is used to monitor alert activity based on the threshold.
         * 
         * @return builder
         * 
         */
        public Builder windowSize(Output windowSize) {
            $.windowSize = windowSize;
            return this;
        }

        /**
         * @param windowSize the period of time (in ISO 8601 duration format) that is used to monitor alert activity based on the threshold.
         * 
         * @return builder
         * 
         */
        public Builder windowSize(String windowSize) {
            return windowSize(Output.of(windowSize));
        }

        public MetricAlertArgs build() {
            if ($.criteria == null) {
                throw new MissingRequiredPropertyException("MetricAlertArgs", "criteria");
            }
            if ($.enabled == null) {
                throw new MissingRequiredPropertyException("MetricAlertArgs", "enabled");
            }
            if ($.evaluationFrequency == null) {
                throw new MissingRequiredPropertyException("MetricAlertArgs", "evaluationFrequency");
            }
            if ($.resourceGroupName == null) {
                throw new MissingRequiredPropertyException("MetricAlertArgs", "resourceGroupName");
            }
            if ($.scopes == null) {
                throw new MissingRequiredPropertyException("MetricAlertArgs", "scopes");
            }
            if ($.severity == null) {
                throw new MissingRequiredPropertyException("MetricAlertArgs", "severity");
            }
            if ($.windowSize == null) {
                throw new MissingRequiredPropertyException("MetricAlertArgs", "windowSize");
            }
            return $;
        }
    }

}