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

com.pulumi.gcp.monitoring.kotlin.inputs.AlertPolicyConditionConditionPrometheusQueryLanguageArgs.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: 8.10.0.0
Show newest version
@file:Suppress("NAME_SHADOWING", "DEPRECATION")

package com.pulumi.gcp.monitoring.kotlin.inputs

import com.pulumi.core.Output
import com.pulumi.core.Output.of
import com.pulumi.gcp.monitoring.inputs.AlertPolicyConditionConditionPrometheusQueryLanguageArgs.builder
import com.pulumi.kotlin.ConvertibleToJava
import com.pulumi.kotlin.PulumiNullFieldException
import com.pulumi.kotlin.PulumiTagMarker
import kotlin.Pair
import kotlin.String
import kotlin.Suppress
import kotlin.collections.Map
import kotlin.jvm.JvmName

/**
 *
 * @property alertRule The alerting rule name of this alert in the corresponding Prometheus
 * configuration file.
 * Some external tools may require this field to be populated correctly
 * in order to refer to the original Prometheus configuration file.
 * The rule group name and the alert name are necessary to update the
 * relevant AlertPolicies in case the definition of the rule group changes
 * in the future.
 * This field is optional. If this field is not empty, then it must be a
 * valid Prometheus label name.
 * - - -
 * @property duration Alerts are considered firing once their PromQL expression evaluated
 * to be "true" for this long. Alerts whose PromQL expression was not
 * evaluated to be "true" for long enough are considered pending. The
 * default value is zero. Must be zero or positive.
 * @property evaluationInterval How often this rule should be evaluated. Must be a positive multiple
 * of 30 seconds or missing. The default value is 30 seconds. If this
 * PrometheusQueryLanguageCondition was generated from a Prometheus
 * alerting rule, then this value should be taken from the enclosing
 * rule group.
 * @property labels Labels to add to or overwrite in the PromQL query result. Label names
 * must be valid.
 * Label values can be templatized by using variables. The only available
 * variable names are the names of the labels in the PromQL result, including
 * "__name__" and "value". "labels" may be empty. This field is intended to be
 * used for organizing and identifying the AlertPolicy
 * @property query The PromQL expression to evaluate. Every evaluation cycle this
 * expression is evaluated at the current time, and all resultant time
 * series become pending/firing alerts. This field must not be empty.
 * @property ruleGroup The rule group name of this alert in the corresponding Prometheus
 * configuration file.
 * Some external tools may require this field to be populated correctly
 * in order to refer to the original Prometheus configuration file.
 * The rule group name and the alert name are necessary to update the
 * relevant AlertPolicies in case the definition of the rule group changes
 * in the future. This field is optional.
 */
public data class AlertPolicyConditionConditionPrometheusQueryLanguageArgs(
    public val alertRule: Output? = null,
    public val duration: Output? = null,
    public val evaluationInterval: Output? = null,
    public val labels: Output>? = null,
    public val query: Output,
    public val ruleGroup: Output? = null,
) :
    ConvertibleToJava {
    override fun toJava(): com.pulumi.gcp.monitoring.inputs.AlertPolicyConditionConditionPrometheusQueryLanguageArgs =
        com.pulumi.gcp.monitoring.inputs.AlertPolicyConditionConditionPrometheusQueryLanguageArgs.builder()
            .alertRule(alertRule?.applyValue({ args0 -> args0 }))
            .duration(duration?.applyValue({ args0 -> args0 }))
            .evaluationInterval(evaluationInterval?.applyValue({ args0 -> args0 }))
            .labels(labels?.applyValue({ args0 -> args0.map({ args0 -> args0.key.to(args0.value) }).toMap() }))
            .query(query.applyValue({ args0 -> args0 }))
            .ruleGroup(ruleGroup?.applyValue({ args0 -> args0 })).build()
}

/**
 * Builder for [AlertPolicyConditionConditionPrometheusQueryLanguageArgs].
 */
@PulumiTagMarker
public class AlertPolicyConditionConditionPrometheusQueryLanguageArgsBuilder internal constructor() {
    private var alertRule: Output? = null

    private var duration: Output? = null

    private var evaluationInterval: Output? = null

    private var labels: Output>? = null

    private var query: Output? = null

    private var ruleGroup: Output? = null

    /**
     * @param value The alerting rule name of this alert in the corresponding Prometheus
     * configuration file.
     * Some external tools may require this field to be populated correctly
     * in order to refer to the original Prometheus configuration file.
     * The rule group name and the alert name are necessary to update the
     * relevant AlertPolicies in case the definition of the rule group changes
     * in the future.
     * This field is optional. If this field is not empty, then it must be a
     * valid Prometheus label name.
     * - - -
     */
    @JvmName("euybanpffauuvxdy")
    public suspend fun alertRule(`value`: Output) {
        this.alertRule = value
    }

    /**
     * @param value Alerts are considered firing once their PromQL expression evaluated
     * to be "true" for this long. Alerts whose PromQL expression was not
     * evaluated to be "true" for long enough are considered pending. The
     * default value is zero. Must be zero or positive.
     */
    @JvmName("sxvfewsknqrbofaf")
    public suspend fun duration(`value`: Output) {
        this.duration = value
    }

    /**
     * @param value How often this rule should be evaluated. Must be a positive multiple
     * of 30 seconds or missing. The default value is 30 seconds. If this
     * PrometheusQueryLanguageCondition was generated from a Prometheus
     * alerting rule, then this value should be taken from the enclosing
     * rule group.
     */
    @JvmName("epqnhorxqmqgftbu")
    public suspend fun evaluationInterval(`value`: Output) {
        this.evaluationInterval = value
    }

    /**
     * @param value Labels to add to or overwrite in the PromQL query result. Label names
     * must be valid.
     * Label values can be templatized by using variables. The only available
     * variable names are the names of the labels in the PromQL result, including
     * "__name__" and "value". "labels" may be empty. This field is intended to be
     * used for organizing and identifying the AlertPolicy
     */
    @JvmName("yrnqowmhnyicwyfu")
    public suspend fun labels(`value`: Output>) {
        this.labels = value
    }

    /**
     * @param value The PromQL expression to evaluate. Every evaluation cycle this
     * expression is evaluated at the current time, and all resultant time
     * series become pending/firing alerts. This field must not be empty.
     */
    @JvmName("odlhraudcsseexqx")
    public suspend fun query(`value`: Output) {
        this.query = value
    }

    /**
     * @param value The rule group name of this alert in the corresponding Prometheus
     * configuration file.
     * Some external tools may require this field to be populated correctly
     * in order to refer to the original Prometheus configuration file.
     * The rule group name and the alert name are necessary to update the
     * relevant AlertPolicies in case the definition of the rule group changes
     * in the future. This field is optional.
     */
    @JvmName("dfscsmdxwodujxpe")
    public suspend fun ruleGroup(`value`: Output) {
        this.ruleGroup = value
    }

    /**
     * @param value The alerting rule name of this alert in the corresponding Prometheus
     * configuration file.
     * Some external tools may require this field to be populated correctly
     * in order to refer to the original Prometheus configuration file.
     * The rule group name and the alert name are necessary to update the
     * relevant AlertPolicies in case the definition of the rule group changes
     * in the future.
     * This field is optional. If this field is not empty, then it must be a
     * valid Prometheus label name.
     * - - -
     */
    @JvmName("xhwyqvcobfbojsjk")
    public suspend fun alertRule(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.alertRule = mapped
    }

    /**
     * @param value Alerts are considered firing once their PromQL expression evaluated
     * to be "true" for this long. Alerts whose PromQL expression was not
     * evaluated to be "true" for long enough are considered pending. The
     * default value is zero. Must be zero or positive.
     */
    @JvmName("qhevsjfqrsjlrwiv")
    public suspend fun duration(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.duration = mapped
    }

    /**
     * @param value How often this rule should be evaluated. Must be a positive multiple
     * of 30 seconds or missing. The default value is 30 seconds. If this
     * PrometheusQueryLanguageCondition was generated from a Prometheus
     * alerting rule, then this value should be taken from the enclosing
     * rule group.
     */
    @JvmName("gkykbfikfsnnfeoc")
    public suspend fun evaluationInterval(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.evaluationInterval = mapped
    }

    /**
     * @param value Labels to add to or overwrite in the PromQL query result. Label names
     * must be valid.
     * Label values can be templatized by using variables. The only available
     * variable names are the names of the labels in the PromQL result, including
     * "__name__" and "value". "labels" may be empty. This field is intended to be
     * used for organizing and identifying the AlertPolicy
     */
    @JvmName("aflgxwdcicjljsvm")
    public suspend fun labels(`value`: Map?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.labels = mapped
    }

    /**
     * @param values Labels to add to or overwrite in the PromQL query result. Label names
     * must be valid.
     * Label values can be templatized by using variables. The only available
     * variable names are the names of the labels in the PromQL result, including
     * "__name__" and "value". "labels" may be empty. This field is intended to be
     * used for organizing and identifying the AlertPolicy
     */
    @JvmName("ivpqsgrmyxiqcltf")
    public fun labels(vararg values: Pair) {
        val toBeMapped = values.toMap()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.labels = mapped
    }

    /**
     * @param value The PromQL expression to evaluate. Every evaluation cycle this
     * expression is evaluated at the current time, and all resultant time
     * series become pending/firing alerts. This field must not be empty.
     */
    @JvmName("wvcxrwdijekwpuso")
    public suspend fun query(`value`: String) {
        val toBeMapped = value
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.query = mapped
    }

    /**
     * @param value The rule group name of this alert in the corresponding Prometheus
     * configuration file.
     * Some external tools may require this field to be populated correctly
     * in order to refer to the original Prometheus configuration file.
     * The rule group name and the alert name are necessary to update the
     * relevant AlertPolicies in case the definition of the rule group changes
     * in the future. This field is optional.
     */
    @JvmName("odhomentonlmcusf")
    public suspend fun ruleGroup(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.ruleGroup = mapped
    }

    internal fun build(): AlertPolicyConditionConditionPrometheusQueryLanguageArgs =
        AlertPolicyConditionConditionPrometheusQueryLanguageArgs(
            alertRule = alertRule,
            duration = duration,
            evaluationInterval = evaluationInterval,
            labels = labels,
            query = query ?: throw PulumiNullFieldException("query"),
            ruleGroup = ruleGroup,
        )
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy