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

com.pulumi.alicloud.arms.kotlin.PrometheusAlertRuleArgs.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: 3.62.0.0
Show newest version
@file:Suppress("NAME_SHADOWING", "DEPRECATION")

package com.pulumi.alicloud.arms.kotlin

import com.pulumi.alicloud.arms.PrometheusAlertRuleArgs.builder
import com.pulumi.alicloud.arms.kotlin.inputs.PrometheusAlertRuleAnnotationArgs
import com.pulumi.alicloud.arms.kotlin.inputs.PrometheusAlertRuleAnnotationArgsBuilder
import com.pulumi.alicloud.arms.kotlin.inputs.PrometheusAlertRuleLabelArgs
import com.pulumi.alicloud.arms.kotlin.inputs.PrometheusAlertRuleLabelArgsBuilder
import com.pulumi.core.Output
import com.pulumi.core.Output.of
import com.pulumi.kotlin.ConvertibleToJava
import com.pulumi.kotlin.PulumiTagMarker
import com.pulumi.kotlin.applySuspend
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.List
import kotlin.jvm.JvmName

/**
 * Provides a Application Real-Time Monitoring Service (ARMS) Prometheus Alert Rule resource.
 * For information about Application Real-Time Monitoring Service (ARMS) Prometheus Alert Rule and how to use it, see [What is Prometheus Alert Rule](https://www.alibabacloud.com/help/en/doc-detail/212056.htm).
 * > **NOTE:** Available since v1.136.0.
 * ## Import
 * Application Real-Time Monitoring Service (ARMS) Prometheus Alert Rule can be imported using the id, e.g.
 * ```sh
 * $ pulumi import alicloud:arms/prometheusAlertRule:PrometheusAlertRule example :
 * ```
 * @property annotations The annotations of the alert rule. See `annotations` below.
 * @property clusterId The ID of the cluster.
 * @property dispatchRuleId The ID of the notification policy. This parameter is required when the `notify_type` parameter is set to `DISPATCH_RULE`.
 * @property duration The duration of the alert.
 * @property expression The alert rule expression that follows the PromQL syntax.
 * @property labels The labels of the resource. See `labels` below.
 * @property message The message of the alert notification.
 * @property notifyType The method of sending the alert notification. Valid values: `ALERT_MANAGER`, `DISPATCH_RULE`.
 * @property prometheusAlertRuleName The name of the resource.
 * @property type The type of the alert rule.
 */
public data class PrometheusAlertRuleArgs(
    public val annotations: Output>? = null,
    public val clusterId: Output? = null,
    public val dispatchRuleId: Output? = null,
    public val duration: Output? = null,
    public val expression: Output? = null,
    public val labels: Output>? = null,
    public val message: Output? = null,
    public val notifyType: Output? = null,
    public val prometheusAlertRuleName: Output? = null,
    public val type: Output? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.alicloud.arms.PrometheusAlertRuleArgs =
        com.pulumi.alicloud.arms.PrometheusAlertRuleArgs.builder()
            .annotations(
                annotations?.applyValue({ args0 ->
                    args0.map({ args0 ->
                        args0.let({ args0 ->
                            args0.toJava()
                        })
                    })
                }),
            )
            .clusterId(clusterId?.applyValue({ args0 -> args0 }))
            .dispatchRuleId(dispatchRuleId?.applyValue({ args0 -> args0 }))
            .duration(duration?.applyValue({ args0 -> args0 }))
            .expression(expression?.applyValue({ args0 -> args0 }))
            .labels(labels?.applyValue({ args0 -> args0.map({ args0 -> args0.let({ args0 -> args0.toJava() }) }) }))
            .message(message?.applyValue({ args0 -> args0 }))
            .notifyType(notifyType?.applyValue({ args0 -> args0 }))
            .prometheusAlertRuleName(prometheusAlertRuleName?.applyValue({ args0 -> args0 }))
            .type(type?.applyValue({ args0 -> args0 })).build()
}

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

    private var clusterId: Output? = null

    private var dispatchRuleId: Output? = null

    private var duration: Output? = null

    private var expression: Output? = null

    private var labels: Output>? = null

    private var message: Output? = null

    private var notifyType: Output? = null

    private var prometheusAlertRuleName: Output? = null

    private var type: Output? = null

    /**
     * @param value The annotations of the alert rule. See `annotations` below.
     */
    @JvmName("cbeauyefkrsvnstj")
    public suspend fun annotations(`value`: Output>) {
        this.annotations = value
    }

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

    /**
     * @param values The annotations of the alert rule. See `annotations` below.
     */
    @JvmName("wqymvxmbpvbbcbuk")
    public suspend fun annotations(values: List>) {
        this.annotations = Output.all(values)
    }

    /**
     * @param value The ID of the cluster.
     */
    @JvmName("eipbynqqwnbkvvnt")
    public suspend fun clusterId(`value`: Output) {
        this.clusterId = value
    }

    /**
     * @param value The ID of the notification policy. This parameter is required when the `notify_type` parameter is set to `DISPATCH_RULE`.
     */
    @JvmName("hppivtlptonifoff")
    public suspend fun dispatchRuleId(`value`: Output) {
        this.dispatchRuleId = value
    }

    /**
     * @param value The duration of the alert.
     */
    @JvmName("psoggypftofconnu")
    public suspend fun duration(`value`: Output) {
        this.duration = value
    }

    /**
     * @param value The alert rule expression that follows the PromQL syntax.
     */
    @JvmName("eiwbcgwbetssxhdf")
    public suspend fun expression(`value`: Output) {
        this.expression = value
    }

    /**
     * @param value The labels of the resource. See `labels` below.
     */
    @JvmName("hnynftllyflslggu")
    public suspend fun labels(`value`: Output>) {
        this.labels = value
    }

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

    /**
     * @param values The labels of the resource. See `labels` below.
     */
    @JvmName("nhkaqntedqlfnvcm")
    public suspend fun labels(values: List>) {
        this.labels = Output.all(values)
    }

    /**
     * @param value The message of the alert notification.
     */
    @JvmName("bntfynwbwjhojkwp")
    public suspend fun message(`value`: Output) {
        this.message = value
    }

    /**
     * @param value The method of sending the alert notification. Valid values: `ALERT_MANAGER`, `DISPATCH_RULE`.
     */
    @JvmName("ymvucbxkqacbftko")
    public suspend fun notifyType(`value`: Output) {
        this.notifyType = value
    }

    /**
     * @param value The name of the resource.
     */
    @JvmName("dyneglwbfpfpbxob")
    public suspend fun prometheusAlertRuleName(`value`: Output) {
        this.prometheusAlertRuleName = value
    }

    /**
     * @param value The type of the alert rule.
     */
    @JvmName("umuibgeelxabycle")
    public suspend fun type(`value`: Output) {
        this.type = value
    }

    /**
     * @param value The annotations of the alert rule. See `annotations` below.
     */
    @JvmName("hbwmartroswdnhww")
    public suspend fun annotations(`value`: List?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.annotations = mapped
    }

    /**
     * @param argument The annotations of the alert rule. See `annotations` below.
     */
    @JvmName("kaqspmjlomwefsne")
    public suspend fun annotations(argument: List Unit>) {
        val toBeMapped = argument.toList().map {
            PrometheusAlertRuleAnnotationArgsBuilder().applySuspend { it() }.build()
        }
        val mapped = of(toBeMapped)
        this.annotations = mapped
    }

    /**
     * @param argument The annotations of the alert rule. See `annotations` below.
     */
    @JvmName("bntbomesdatntxdm")
    public suspend fun annotations(vararg argument: suspend PrometheusAlertRuleAnnotationArgsBuilder.() -> Unit) {
        val toBeMapped = argument.toList().map {
            PrometheusAlertRuleAnnotationArgsBuilder().applySuspend { it() }.build()
        }
        val mapped = of(toBeMapped)
        this.annotations = mapped
    }

    /**
     * @param argument The annotations of the alert rule. See `annotations` below.
     */
    @JvmName("ooknrtpkqxmvptoj")
    public suspend fun annotations(argument: suspend PrometheusAlertRuleAnnotationArgsBuilder.() -> Unit) {
        val toBeMapped = listOf(
            PrometheusAlertRuleAnnotationArgsBuilder().applySuspend {
                argument()
            }.build(),
        )
        val mapped = of(toBeMapped)
        this.annotations = mapped
    }

    /**
     * @param values The annotations of the alert rule. See `annotations` below.
     */
    @JvmName("ickxicwuvaupmmsn")
    public suspend fun annotations(vararg values: PrometheusAlertRuleAnnotationArgs) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.annotations = mapped
    }

    /**
     * @param value The ID of the cluster.
     */
    @JvmName("iugotlgpgeqaqisy")
    public suspend fun clusterId(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.clusterId = mapped
    }

    /**
     * @param value The ID of the notification policy. This parameter is required when the `notify_type` parameter is set to `DISPATCH_RULE`.
     */
    @JvmName("lcjydjkpeuctpyey")
    public suspend fun dispatchRuleId(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.dispatchRuleId = mapped
    }

    /**
     * @param value The duration of the alert.
     */
    @JvmName("hkiwjvlfsopxqnnb")
    public suspend fun duration(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.duration = mapped
    }

    /**
     * @param value The alert rule expression that follows the PromQL syntax.
     */
    @JvmName("piumkltmytdblaea")
    public suspend fun expression(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.expression = mapped
    }

    /**
     * @param value The labels of the resource. See `labels` below.
     */
    @JvmName("aoyqlvbcdpehrcvx")
    public suspend fun labels(`value`: List?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.labels = mapped
    }

    /**
     * @param argument The labels of the resource. See `labels` below.
     */
    @JvmName("yqxkerdgjugivccl")
    public suspend fun labels(argument: List Unit>) {
        val toBeMapped = argument.toList().map {
            PrometheusAlertRuleLabelArgsBuilder().applySuspend {
                it()
            }.build()
        }
        val mapped = of(toBeMapped)
        this.labels = mapped
    }

    /**
     * @param argument The labels of the resource. See `labels` below.
     */
    @JvmName("uhyugyfwqlisvhjt")
    public suspend fun labels(vararg argument: suspend PrometheusAlertRuleLabelArgsBuilder.() -> Unit) {
        val toBeMapped = argument.toList().map {
            PrometheusAlertRuleLabelArgsBuilder().applySuspend {
                it()
            }.build()
        }
        val mapped = of(toBeMapped)
        this.labels = mapped
    }

    /**
     * @param argument The labels of the resource. See `labels` below.
     */
    @JvmName("mdprifxbaevjvtlq")
    public suspend fun labels(argument: suspend PrometheusAlertRuleLabelArgsBuilder.() -> Unit) {
        val toBeMapped = listOf(
            PrometheusAlertRuleLabelArgsBuilder().applySuspend {
                argument()
            }.build(),
        )
        val mapped = of(toBeMapped)
        this.labels = mapped
    }

    /**
     * @param values The labels of the resource. See `labels` below.
     */
    @JvmName("rdrxpaonswmpiblw")
    public suspend fun labels(vararg values: PrometheusAlertRuleLabelArgs) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.labels = mapped
    }

    /**
     * @param value The message of the alert notification.
     */
    @JvmName("udkguvomgcybcfkh")
    public suspend fun message(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.message = mapped
    }

    /**
     * @param value The method of sending the alert notification. Valid values: `ALERT_MANAGER`, `DISPATCH_RULE`.
     */
    @JvmName("lxxolxeoxktgtrbc")
    public suspend fun notifyType(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.notifyType = mapped
    }

    /**
     * @param value The name of the resource.
     */
    @JvmName("giguxdtwsybjukun")
    public suspend fun prometheusAlertRuleName(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.prometheusAlertRuleName = mapped
    }

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

    internal fun build(): PrometheusAlertRuleArgs = PrometheusAlertRuleArgs(
        annotations = annotations,
        clusterId = clusterId,
        dispatchRuleId = dispatchRuleId,
        duration = duration,
        expression = expression,
        labels = labels,
        message = message,
        notifyType = notifyType,
        prometheusAlertRuleName = prometheusAlertRuleName,
        type = type,
    )
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy