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

com.pulumi.azure.monitoring.kotlin.inputs.AlertPrometheusRuleGroupRuleArgs.kt Maven / Gradle / Ivy

Go to download

Build cloud applications and infrastructure by combining the safety and reliability of infrastructure as code with the power of the Kotlin programming language.

There is a newer version: 6.15.0.0
Show newest version
@file:Suppress("NAME_SHADOWING", "DEPRECATION")

package com.pulumi.azure.monitoring.kotlin.inputs

import com.pulumi.azure.monitoring.inputs.AlertPrometheusRuleGroupRuleArgs.builder
import com.pulumi.core.Output
import com.pulumi.core.Output.of
import com.pulumi.kotlin.ConvertibleToJava
import com.pulumi.kotlin.PulumiNullFieldException
import com.pulumi.kotlin.PulumiTagMarker
import com.pulumi.kotlin.applySuspend
import kotlin.Boolean
import kotlin.Int
import kotlin.Pair
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.List
import kotlin.collections.Map
import kotlin.jvm.JvmName

/**
 *
 * @property actions An `action` block as defined below.
 * @property alert Specifies the Alert rule name.
 * @property alertResolution An `alert_resolution` block as defined below.
 * @property annotations Specifies a set of informational labels that can be used to store longer additional information such as alert descriptions or runbook links.
 * @property enabled Is this rule enabled? Possible values are `true` and `false`.
 * @property expression Specifies the Prometheus Query Language expression to evaluate. For more details see [this doc](https://prometheus.io/docs/prometheus/latest/querying/basics). Evaluate at the period given by `interval` and record the result as a new set of time series with the metric name given by `record`.
 * @property for Specifies the amount of time alert must be active before firing, represented in ISO 8601 duration format.
 * @property labels Specifies the labels to add or overwrite before storing the result.
 * @property record Specifies the recorded metrics name.
 * @property severity Specifies the severity of the alerts fired by the rule. Possible values are between 0 and 4.
 */
public data class AlertPrometheusRuleGroupRuleArgs(
    public val actions: Output>? = null,
    public val alert: Output? = null,
    public val alertResolution: Output? = null,
    public val annotations: Output>? = null,
    public val enabled: Output? = null,
    public val expression: Output,
    public val `for`: Output? = null,
    public val labels: Output>? = null,
    public val record: Output? = null,
    public val severity: Output? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.azure.monitoring.inputs.AlertPrometheusRuleGroupRuleArgs =
        com.pulumi.azure.monitoring.inputs.AlertPrometheusRuleGroupRuleArgs.builder()
            .actions(
                actions?.applyValue({ args0 ->
                    args0.map({ args0 ->
                        args0.let({ args0 ->
                            args0.toJava()
                        })
                    })
                }),
            )
            .alert(alert?.applyValue({ args0 -> args0 }))
            .alertResolution(alertResolution?.applyValue({ args0 -> args0.let({ args0 -> args0.toJava() }) }))
            .annotations(
                annotations?.applyValue({ args0 ->
                    args0.map({ args0 ->
                        args0.key.to(args0.value)
                    }).toMap()
                }),
            )
            .enabled(enabled?.applyValue({ args0 -> args0 }))
            .expression(expression.applyValue({ args0 -> args0 }))
            .for_(`for`?.applyValue({ args0 -> args0 }))
            .labels(labels?.applyValue({ args0 -> args0.map({ args0 -> args0.key.to(args0.value) }).toMap() }))
            .record(record?.applyValue({ args0 -> args0 }))
            .severity(severity?.applyValue({ args0 -> args0 })).build()
}

/**
 * Builder for [AlertPrometheusRuleGroupRuleArgs].
 */
@PulumiTagMarker
public class AlertPrometheusRuleGroupRuleArgsBuilder internal constructor() {
    private var actions: Output>? = null

    private var alert: Output? = null

    private var alertResolution: Output? = null

    private var annotations: Output>? = null

    private var enabled: Output? = null

    private var expression: Output? = null

    private var `for`: Output? = null

    private var labels: Output>? = null

    private var record: Output? = null

    private var severity: Output? = null

    /**
     * @param value An `action` block as defined below.
     */
    @JvmName("fgsgdsmscgxdjnpd")
    public suspend fun actions(`value`: Output>) {
        this.actions = value
    }

    @JvmName("xgvsqnyocyimxoev")
    public suspend fun actions(vararg values: Output) {
        this.actions = Output.all(values.asList())
    }

    /**
     * @param values An `action` block as defined below.
     */
    @JvmName("kvfqvhdpxaxsdech")
    public suspend fun actions(values: List>) {
        this.actions = Output.all(values)
    }

    /**
     * @param value Specifies the Alert rule name.
     */
    @JvmName("pslacigmwaelmcny")
    public suspend fun alert(`value`: Output) {
        this.alert = value
    }

    /**
     * @param value An `alert_resolution` block as defined below.
     */
    @JvmName("tnravinuklrjjuit")
    public suspend fun alertResolution(`value`: Output) {
        this.alertResolution = value
    }

    /**
     * @param value Specifies a set of informational labels that can be used to store longer additional information such as alert descriptions or runbook links.
     */
    @JvmName("uvmqylfsdselplyc")
    public suspend fun annotations(`value`: Output>) {
        this.annotations = value
    }

    /**
     * @param value Is this rule enabled? Possible values are `true` and `false`.
     */
    @JvmName("xcmqmrpxxsdxnklw")
    public suspend fun enabled(`value`: Output) {
        this.enabled = value
    }

    /**
     * @param value Specifies the Prometheus Query Language expression to evaluate. For more details see [this doc](https://prometheus.io/docs/prometheus/latest/querying/basics). Evaluate at the period given by `interval` and record the result as a new set of time series with the metric name given by `record`.
     */
    @JvmName("rfmpjbobgfdrvbwk")
    public suspend fun expression(`value`: Output) {
        this.expression = value
    }

    /**
     * @param value Specifies the amount of time alert must be active before firing, represented in ISO 8601 duration format.
     */
    @JvmName("bytmukotufsywxal")
    public suspend fun `for`(`value`: Output) {
        this.`for` = value
    }

    /**
     * @param value Specifies the labels to add or overwrite before storing the result.
     */
    @JvmName("eqhmuwnwgppwdveg")
    public suspend fun labels(`value`: Output>) {
        this.labels = value
    }

    /**
     * @param value Specifies the recorded metrics name.
     */
    @JvmName("xsompnlciyxapide")
    public suspend fun record(`value`: Output) {
        this.record = value
    }

    /**
     * @param value Specifies the severity of the alerts fired by the rule. Possible values are between 0 and 4.
     */
    @JvmName("thpapachcuorxwse")
    public suspend fun severity(`value`: Output) {
        this.severity = value
    }

    /**
     * @param value An `action` block as defined below.
     */
    @JvmName("quxdhndsmhxahmpx")
    public suspend fun actions(`value`: List?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.actions = mapped
    }

    /**
     * @param argument An `action` block as defined below.
     */
    @JvmName("ikpgwonbtmqybjko")
    public suspend fun actions(argument: List Unit>) {
        val toBeMapped = argument.toList().map {
            AlertPrometheusRuleGroupRuleActionArgsBuilder().applySuspend { it() }.build()
        }
        val mapped = of(toBeMapped)
        this.actions = mapped
    }

    /**
     * @param argument An `action` block as defined below.
     */
    @JvmName("wkojkcvutwsowoqv")
    public suspend fun actions(vararg argument: suspend AlertPrometheusRuleGroupRuleActionArgsBuilder.() -> Unit) {
        val toBeMapped = argument.toList().map {
            AlertPrometheusRuleGroupRuleActionArgsBuilder().applySuspend { it() }.build()
        }
        val mapped = of(toBeMapped)
        this.actions = mapped
    }

    /**
     * @param argument An `action` block as defined below.
     */
    @JvmName("cwhcudgcdghgasxl")
    public suspend fun actions(argument: suspend AlertPrometheusRuleGroupRuleActionArgsBuilder.() -> Unit) {
        val toBeMapped = listOf(
            AlertPrometheusRuleGroupRuleActionArgsBuilder().applySuspend {
                argument()
            }.build(),
        )
        val mapped = of(toBeMapped)
        this.actions = mapped
    }

    /**
     * @param values An `action` block as defined below.
     */
    @JvmName("vfispmgkwsnlcgts")
    public suspend fun actions(vararg values: AlertPrometheusRuleGroupRuleActionArgs) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.actions = mapped
    }

    /**
     * @param value Specifies the Alert rule name.
     */
    @JvmName("wuunajqpvfgqyxlc")
    public suspend fun alert(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.alert = mapped
    }

    /**
     * @param value An `alert_resolution` block as defined below.
     */
    @JvmName("kmfwfvtphiadgmea")
    public suspend fun alertResolution(`value`: AlertPrometheusRuleGroupRuleAlertResolutionArgs?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.alertResolution = mapped
    }

    /**
     * @param argument An `alert_resolution` block as defined below.
     */
    @JvmName("bqqalqnndtjukcam")
    public suspend fun alertResolution(argument: suspend AlertPrometheusRuleGroupRuleAlertResolutionArgsBuilder.() -> Unit) {
        val toBeMapped = AlertPrometheusRuleGroupRuleAlertResolutionArgsBuilder().applySuspend {
            argument()
        }.build()
        val mapped = of(toBeMapped)
        this.alertResolution = mapped
    }

    /**
     * @param value Specifies a set of informational labels that can be used to store longer additional information such as alert descriptions or runbook links.
     */
    @JvmName("egoyulsgfoyooqpu")
    public suspend fun annotations(`value`: Map?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.annotations = mapped
    }

    /**
     * @param values Specifies a set of informational labels that can be used to store longer additional information such as alert descriptions or runbook links.
     */
    @JvmName("dwedoxhbqrdfolqc")
    public fun annotations(vararg values: Pair) {
        val toBeMapped = values.toMap()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.annotations = mapped
    }

    /**
     * @param value Is this rule enabled? Possible values are `true` and `false`.
     */
    @JvmName("hcucekclxspfmnvx")
    public suspend fun enabled(`value`: Boolean?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.enabled = mapped
    }

    /**
     * @param value Specifies the Prometheus Query Language expression to evaluate. For more details see [this doc](https://prometheus.io/docs/prometheus/latest/querying/basics). Evaluate at the period given by `interval` and record the result as a new set of time series with the metric name given by `record`.
     */
    @JvmName("knbnxqxqxuaynhvp")
    public suspend fun expression(`value`: String) {
        val toBeMapped = value
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.expression = mapped
    }

    /**
     * @param value Specifies the amount of time alert must be active before firing, represented in ISO 8601 duration format.
     */
    @JvmName("jcchialwydvphpiv")
    public suspend fun `for`(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.`for` = mapped
    }

    /**
     * @param value Specifies the labels to add or overwrite before storing the result.
     */
    @JvmName("tikdfprnusvayqks")
    public suspend fun labels(`value`: Map?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.labels = mapped
    }

    /**
     * @param values Specifies the labels to add or overwrite before storing the result.
     */
    @JvmName("epbtkpxeowllslcx")
    public fun labels(vararg values: Pair) {
        val toBeMapped = values.toMap()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.labels = mapped
    }

    /**
     * @param value Specifies the recorded metrics name.
     */
    @JvmName("rkvwqsmlkqsxlhog")
    public suspend fun record(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.record = mapped
    }

    /**
     * @param value Specifies the severity of the alerts fired by the rule. Possible values are between 0 and 4.
     */
    @JvmName("evoayyppdvldnkff")
    public suspend fun severity(`value`: Int?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.severity = mapped
    }

    internal fun build(): AlertPrometheusRuleGroupRuleArgs = AlertPrometheusRuleGroupRuleArgs(
        actions = actions,
        alert = alert,
        alertResolution = alertResolution,
        annotations = annotations,
        enabled = enabled,
        expression = expression ?: throw PulumiNullFieldException("expression"),
        `for` = `for`,
        labels = labels,
        record = record,
        severity = severity,
    )
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy