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

com.pulumi.azurenative.alertsmanagement.inputs.PrometheusRuleArgs Maven / Gradle / Ivy

There is a newer version: 2.72.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.alertsmanagement.inputs;

import com.pulumi.azurenative.alertsmanagement.inputs.PrometheusRuleGroupActionArgs;
import com.pulumi.azurenative.alertsmanagement.inputs.PrometheusRuleResolveConfigurationArgs;
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.String;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.Optional;
import javax.annotation.Nullable;


/**
 * An Azure Prometheus alerting or recording rule.
 * 
 */
public final class PrometheusRuleArgs extends com.pulumi.resources.ResourceArgs {

    public static final PrometheusRuleArgs Empty = new PrometheusRuleArgs();

    /**
     * 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 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);
    }

    /**
     * Alert rule name.
     * 
     */
    @Import(name="alert")
    private @Nullable Output alert;

    /**
     * @return Alert rule name.
     * 
     */
    public Optional> alert() {
        return Optional.ofNullable(this.alert);
    }

    /**
     * The annotations clause specifies a set of informational labels that can be used to store longer additional information such as alert descriptions or runbook links. The annotation values can be templated.
     * 
     */
    @Import(name="annotations")
    private @Nullable Output> annotations;

    /**
     * @return The annotations clause specifies a set of informational labels that can be used to store longer additional information such as alert descriptions or runbook links. The annotation values can be templated.
     * 
     */
    public Optional>> annotations() {
        return Optional.ofNullable(this.annotations);
    }

    /**
     * Enable/disable rule.
     * 
     */
    @Import(name="enabled")
    private @Nullable Output enabled;

    /**
     * @return Enable/disable rule.
     * 
     */
    public Optional> enabled() {
        return Optional.ofNullable(this.enabled);
    }

    /**
     * The PromQL expression to evaluate. https://prometheus.io/docs/prometheus/latest/querying/basics/. Evaluated periodically as given by 'interval', and the result recorded as a new set of time series with the metric name as given by 'record'.
     * 
     */
    @Import(name="expression", required=true)
    private Output expression;

    /**
     * @return The PromQL expression to evaluate. https://prometheus.io/docs/prometheus/latest/querying/basics/. Evaluated periodically as given by 'interval', and the result recorded as a new set of time series with the metric name as given by 'record'.
     * 
     */
    public Output expression() {
        return this.expression;
    }

    /**
     * The amount of time alert must be active before firing.
     * 
     */
    @Import(name="for")
    private @Nullable Output for_;

    /**
     * @return The amount of time alert must be active before firing.
     * 
     */
    public Optional> for_() {
        return Optional.ofNullable(this.for_);
    }

    /**
     * Labels to add or overwrite before storing the result.
     * 
     */
    @Import(name="labels")
    private @Nullable Output> labels;

    /**
     * @return Labels to add or overwrite before storing the result.
     * 
     */
    public Optional>> labels() {
        return Optional.ofNullable(this.labels);
    }

    /**
     * Recorded metrics name.
     * 
     */
    @Import(name="record")
    private @Nullable Output record;

    /**
     * @return Recorded metrics name.
     * 
     */
    public Optional> record() {
        return Optional.ofNullable(this.record);
    }

    /**
     * Defines the configuration for resolving fired alerts. Only relevant for alerts.
     * 
     */
    @Import(name="resolveConfiguration")
    private @Nullable Output resolveConfiguration;

    /**
     * @return Defines the configuration for resolving fired alerts. Only relevant for alerts.
     * 
     */
    public Optional> resolveConfiguration() {
        return Optional.ofNullable(this.resolveConfiguration);
    }

    /**
     * The severity of the alerts fired by the rule. Must be between 0 and 4.
     * 
     */
    @Import(name="severity")
    private @Nullable Output severity;

    /**
     * @return The severity of the alerts fired by the rule. Must be between 0 and 4.
     * 
     */
    public Optional> severity() {
        return Optional.ofNullable(this.severity);
    }

    private PrometheusRuleArgs() {}

    private PrometheusRuleArgs(PrometheusRuleArgs $) {
        this.actions = $.actions;
        this.alert = $.alert;
        this.annotations = $.annotations;
        this.enabled = $.enabled;
        this.expression = $.expression;
        this.for_ = $.for_;
        this.labels = $.labels;
        this.record = $.record;
        this.resolveConfiguration = $.resolveConfiguration;
        this.severity = $.severity;
    }

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

    public static final class Builder {
        private PrometheusRuleArgs $;

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

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

        /**
         * @param actions 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 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 Actions that are performed when the alert rule becomes active, and when an alert condition is resolved.
         * 
         * @return builder
         * 
         */
        public Builder actions(PrometheusRuleGroupActionArgs... actions) {
            return actions(List.of(actions));
        }

        /**
         * @param alert Alert rule name.
         * 
         * @return builder
         * 
         */
        public Builder alert(@Nullable Output alert) {
            $.alert = alert;
            return this;
        }

        /**
         * @param alert Alert rule name.
         * 
         * @return builder
         * 
         */
        public Builder alert(String alert) {
            return alert(Output.of(alert));
        }

        /**
         * @param annotations The annotations clause specifies a set of informational labels that can be used to store longer additional information such as alert descriptions or runbook links. The annotation values can be templated.
         * 
         * @return builder
         * 
         */
        public Builder annotations(@Nullable Output> annotations) {
            $.annotations = annotations;
            return this;
        }

        /**
         * @param annotations The annotations clause specifies a set of informational labels that can be used to store longer additional information such as alert descriptions or runbook links. The annotation values can be templated.
         * 
         * @return builder
         * 
         */
        public Builder annotations(Map annotations) {
            return annotations(Output.of(annotations));
        }

        /**
         * @param enabled Enable/disable rule.
         * 
         * @return builder
         * 
         */
        public Builder enabled(@Nullable Output enabled) {
            $.enabled = enabled;
            return this;
        }

        /**
         * @param enabled Enable/disable rule.
         * 
         * @return builder
         * 
         */
        public Builder enabled(Boolean enabled) {
            return enabled(Output.of(enabled));
        }

        /**
         * @param expression The PromQL expression to evaluate. https://prometheus.io/docs/prometheus/latest/querying/basics/. Evaluated periodically as given by 'interval', and the result recorded as a new set of time series with the metric name as given by 'record'.
         * 
         * @return builder
         * 
         */
        public Builder expression(Output expression) {
            $.expression = expression;
            return this;
        }

        /**
         * @param expression The PromQL expression to evaluate. https://prometheus.io/docs/prometheus/latest/querying/basics/. Evaluated periodically as given by 'interval', and the result recorded as a new set of time series with the metric name as given by 'record'.
         * 
         * @return builder
         * 
         */
        public Builder expression(String expression) {
            return expression(Output.of(expression));
        }

        /**
         * @param for_ The amount of time alert must be active before firing.
         * 
         * @return builder
         * 
         */
        public Builder for_(@Nullable Output for_) {
            $.for_ = for_;
            return this;
        }

        /**
         * @param for_ The amount of time alert must be active before firing.
         * 
         * @return builder
         * 
         */
        public Builder for_(String for_) {
            return for_(Output.of(for_));
        }

        /**
         * @param labels Labels to add or overwrite before storing the result.
         * 
         * @return builder
         * 
         */
        public Builder labels(@Nullable Output> labels) {
            $.labels = labels;
            return this;
        }

        /**
         * @param labels Labels to add or overwrite before storing the result.
         * 
         * @return builder
         * 
         */
        public Builder labels(Map labels) {
            return labels(Output.of(labels));
        }

        /**
         * @param record Recorded metrics name.
         * 
         * @return builder
         * 
         */
        public Builder record(@Nullable Output record) {
            $.record = record;
            return this;
        }

        /**
         * @param record Recorded metrics name.
         * 
         * @return builder
         * 
         */
        public Builder record(String record) {
            return record(Output.of(record));
        }

        /**
         * @param resolveConfiguration Defines the configuration for resolving fired alerts. Only relevant for alerts.
         * 
         * @return builder
         * 
         */
        public Builder resolveConfiguration(@Nullable Output resolveConfiguration) {
            $.resolveConfiguration = resolveConfiguration;
            return this;
        }

        /**
         * @param resolveConfiguration Defines the configuration for resolving fired alerts. Only relevant for alerts.
         * 
         * @return builder
         * 
         */
        public Builder resolveConfiguration(PrometheusRuleResolveConfigurationArgs resolveConfiguration) {
            return resolveConfiguration(Output.of(resolveConfiguration));
        }

        /**
         * @param severity The severity of the alerts fired by the rule. Must be between 0 and 4.
         * 
         * @return builder
         * 
         */
        public Builder severity(@Nullable Output severity) {
            $.severity = severity;
            return this;
        }

        /**
         * @param severity The severity of the alerts fired by the rule. Must be between 0 and 4.
         * 
         * @return builder
         * 
         */
        public Builder severity(Integer severity) {
            return severity(Output.of(severity));
        }

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

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy