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

com.pulumi.azure.monitoring.kotlin.inputs.AutoscaleSettingProfileRuleMetricTriggerArgs.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.AutoscaleSettingProfileRuleMetricTriggerArgs.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.Double
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.List
import kotlin.jvm.JvmName

/**
 *
 * @property dimensions One or more `dimensions` block as defined below.
 * @property divideByInstanceCount Whether to enable metric divide by instance count.
 * @property metricName The name of the metric that defines what the rule monitors, such as `Percentage CPU` for `Virtual Machine Scale Sets` and `CpuPercentage` for `App Service Plan`.
 * > **NOTE:** The allowed value of `metric_name` highly depends on the targeting resource type, please visit [Supported metrics with Azure Monitor](https://docs.microsoft.com/azure/azure-monitor/platform/metrics-supported) for more details.
 * @property metricNamespace The namespace of the metric that defines what the rule monitors, such as `microsoft.compute/virtualmachinescalesets` for `Virtual Machine Scale Sets`.
 * @property metricResourceId The ID of the Resource which the Rule monitors.
 * @property operator Specifies the operator used to compare the metric data and threshold. Possible values are: `Equals`, `NotEquals`, `GreaterThan`, `GreaterThanOrEqual`, `LessThan`, `LessThanOrEqual`.
 * @property statistic Specifies how the metrics from multiple instances are combined. Possible values are `Average`, `Max`, `Min` and `Sum`.
 * @property threshold Specifies the threshold of the metric that triggers the scale action.
 * @property timeAggregation Specifies how the data that's collected should be combined over time. Possible values include `Average`, `Count`, `Maximum`, `Minimum`, `Last` and `Total`.
 * @property timeGrain Specifies the granularity of metrics that the rule monitors, which must be one of the pre-defined values returned from the metric definitions for the metric. This value must be between 1 minute and 12 hours an be formatted as an ISO 8601 string.
 * @property timeWindow Specifies the time range for which data is collected, which must be greater than the delay in metric collection (which varies from resource to resource). This value must be between 5 minutes and 12 hours and be formatted as an ISO 8601 string.
 */
public data class AutoscaleSettingProfileRuleMetricTriggerArgs(
    public val dimensions: Output>? =
        null,
    public val divideByInstanceCount: Output? = null,
    public val metricName: Output,
    public val metricNamespace: Output? = null,
    public val metricResourceId: Output,
    public val `operator`: Output,
    public val statistic: Output,
    public val threshold: Output,
    public val timeAggregation: Output,
    public val timeGrain: Output,
    public val timeWindow: Output,
) :
    ConvertibleToJava {
    override fun toJava():
        com.pulumi.azure.monitoring.inputs.AutoscaleSettingProfileRuleMetricTriggerArgs =
        com.pulumi.azure.monitoring.inputs.AutoscaleSettingProfileRuleMetricTriggerArgs.builder()
            .dimensions(
                dimensions?.applyValue({ args0 ->
                    args0.map({ args0 ->
                        args0.let({ args0 ->
                            args0.toJava()
                        })
                    })
                }),
            )
            .divideByInstanceCount(divideByInstanceCount?.applyValue({ args0 -> args0 }))
            .metricName(metricName.applyValue({ args0 -> args0 }))
            .metricNamespace(metricNamespace?.applyValue({ args0 -> args0 }))
            .metricResourceId(metricResourceId.applyValue({ args0 -> args0 }))
            .`operator`(`operator`.applyValue({ args0 -> args0 }))
            .statistic(statistic.applyValue({ args0 -> args0 }))
            .threshold(threshold.applyValue({ args0 -> args0 }))
            .timeAggregation(timeAggregation.applyValue({ args0 -> args0 }))
            .timeGrain(timeGrain.applyValue({ args0 -> args0 }))
            .timeWindow(timeWindow.applyValue({ args0 -> args0 })).build()
}

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

    private var divideByInstanceCount: Output? = null

    private var metricName: Output? = null

    private var metricNamespace: Output? = null

    private var metricResourceId: Output? = null

    private var `operator`: Output? = null

    private var statistic: Output? = null

    private var threshold: Output? = null

    private var timeAggregation: Output? = null

    private var timeGrain: Output? = null

    private var timeWindow: Output? = null

    /**
     * @param value One or more `dimensions` block as defined below.
     */
    @JvmName("myqmummkwimrbsth")
    public suspend
    fun dimensions(`value`: Output>) {
        this.dimensions = value
    }

    @JvmName("xcuesdtaprsmqpcf")
    public suspend fun dimensions(
        vararg
        values: Output,
    ) {
        this.dimensions = Output.all(values.asList())
    }

    /**
     * @param values One or more `dimensions` block as defined below.
     */
    @JvmName("lkclajgidowtpmlr")
    public suspend
    fun dimensions(values: List>) {
        this.dimensions = Output.all(values)
    }

    /**
     * @param value Whether to enable metric divide by instance count.
     */
    @JvmName("hryuoqjayrmswjgk")
    public suspend fun divideByInstanceCount(`value`: Output) {
        this.divideByInstanceCount = value
    }

    /**
     * @param value The name of the metric that defines what the rule monitors, such as `Percentage CPU` for `Virtual Machine Scale Sets` and `CpuPercentage` for `App Service Plan`.
     * > **NOTE:** The allowed value of `metric_name` highly depends on the targeting resource type, please visit [Supported metrics with Azure Monitor](https://docs.microsoft.com/azure/azure-monitor/platform/metrics-supported) for more details.
     */
    @JvmName("cloolqeocjwuwiod")
    public suspend fun metricName(`value`: Output) {
        this.metricName = value
    }

    /**
     * @param value The namespace of the metric that defines what the rule monitors, such as `microsoft.compute/virtualmachinescalesets` for `Virtual Machine Scale Sets`.
     */
    @JvmName("wjjdaakbwqclnaqy")
    public suspend fun metricNamespace(`value`: Output) {
        this.metricNamespace = value
    }

    /**
     * @param value The ID of the Resource which the Rule monitors.
     */
    @JvmName("xjbgkhkwsnssadhi")
    public suspend fun metricResourceId(`value`: Output) {
        this.metricResourceId = value
    }

    /**
     * @param value Specifies the operator used to compare the metric data and threshold. Possible values are: `Equals`, `NotEquals`, `GreaterThan`, `GreaterThanOrEqual`, `LessThan`, `LessThanOrEqual`.
     */
    @JvmName("fyfryikiyuhngdca")
    public suspend fun `operator`(`value`: Output) {
        this.`operator` = value
    }

    /**
     * @param value Specifies how the metrics from multiple instances are combined. Possible values are `Average`, `Max`, `Min` and `Sum`.
     */
    @JvmName("ahllhmvaniskkufv")
    public suspend fun statistic(`value`: Output) {
        this.statistic = value
    }

    /**
     * @param value Specifies the threshold of the metric that triggers the scale action.
     */
    @JvmName("reffhpqoxaiornxe")
    public suspend fun threshold(`value`: Output) {
        this.threshold = value
    }

    /**
     * @param value Specifies how the data that's collected should be combined over time. Possible values include `Average`, `Count`, `Maximum`, `Minimum`, `Last` and `Total`.
     */
    @JvmName("tmqmbehwqsfpfgua")
    public suspend fun timeAggregation(`value`: Output) {
        this.timeAggregation = value
    }

    /**
     * @param value Specifies the granularity of metrics that the rule monitors, which must be one of the pre-defined values returned from the metric definitions for the metric. This value must be between 1 minute and 12 hours an be formatted as an ISO 8601 string.
     */
    @JvmName("smskoykjlpvxuqwf")
    public suspend fun timeGrain(`value`: Output) {
        this.timeGrain = value
    }

    /**
     * @param value Specifies the time range for which data is collected, which must be greater than the delay in metric collection (which varies from resource to resource). This value must be between 5 minutes and 12 hours and be formatted as an ISO 8601 string.
     */
    @JvmName("uktnkjvtlwoffubw")
    public suspend fun timeWindow(`value`: Output) {
        this.timeWindow = value
    }

    /**
     * @param value One or more `dimensions` block as defined below.
     */
    @JvmName("ruxhrtbrhhgeorgk")
    public suspend
    fun dimensions(`value`: List?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.dimensions = mapped
    }

    /**
     * @param argument One or more `dimensions` block as defined below.
     */
    @JvmName("kostsncuqoswlpnp")
    public suspend
    fun dimensions(argument: List Unit>) {
        val toBeMapped = argument.toList().map {
            AutoscaleSettingProfileRuleMetricTriggerDimensionArgsBuilder().applySuspend { it() }.build()
        }
        val mapped = of(toBeMapped)
        this.dimensions = mapped
    }

    /**
     * @param argument One or more `dimensions` block as defined below.
     */
    @JvmName("rtwwpcimuyndftlo")
    public suspend fun dimensions(
        vararg
        argument: suspend AutoscaleSettingProfileRuleMetricTriggerDimensionArgsBuilder.() -> Unit,
    ) {
        val toBeMapped = argument.toList().map {
            AutoscaleSettingProfileRuleMetricTriggerDimensionArgsBuilder().applySuspend { it() }.build()
        }
        val mapped = of(toBeMapped)
        this.dimensions = mapped
    }

    /**
     * @param argument One or more `dimensions` block as defined below.
     */
    @JvmName("mckstikgqbjsilyb")
    public suspend
    fun dimensions(argument: suspend AutoscaleSettingProfileRuleMetricTriggerDimensionArgsBuilder.() -> Unit) {
        val toBeMapped =
            listOf(
                AutoscaleSettingProfileRuleMetricTriggerDimensionArgsBuilder().applySuspend {
                    argument()
                }.build(),
            )
        val mapped = of(toBeMapped)
        this.dimensions = mapped
    }

    /**
     * @param values One or more `dimensions` block as defined below.
     */
    @JvmName("advvqcusgjnuyvch")
    public suspend fun dimensions(
        vararg
        values: AutoscaleSettingProfileRuleMetricTriggerDimensionArgs,
    ) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.dimensions = mapped
    }

    /**
     * @param value Whether to enable metric divide by instance count.
     */
    @JvmName("nfkqvdslrfdvcrmh")
    public suspend fun divideByInstanceCount(`value`: Boolean?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.divideByInstanceCount = mapped
    }

    /**
     * @param value The name of the metric that defines what the rule monitors, such as `Percentage CPU` for `Virtual Machine Scale Sets` and `CpuPercentage` for `App Service Plan`.
     * > **NOTE:** The allowed value of `metric_name` highly depends on the targeting resource type, please visit [Supported metrics with Azure Monitor](https://docs.microsoft.com/azure/azure-monitor/platform/metrics-supported) for more details.
     */
    @JvmName("ksqppqhhtajawvfv")
    public suspend fun metricName(`value`: String) {
        val toBeMapped = value
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.metricName = mapped
    }

    /**
     * @param value The namespace of the metric that defines what the rule monitors, such as `microsoft.compute/virtualmachinescalesets` for `Virtual Machine Scale Sets`.
     */
    @JvmName("odvyareflbeungam")
    public suspend fun metricNamespace(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.metricNamespace = mapped
    }

    /**
     * @param value The ID of the Resource which the Rule monitors.
     */
    @JvmName("qxlfuvsmxwhgtrbm")
    public suspend fun metricResourceId(`value`: String) {
        val toBeMapped = value
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.metricResourceId = mapped
    }

    /**
     * @param value Specifies the operator used to compare the metric data and threshold. Possible values are: `Equals`, `NotEquals`, `GreaterThan`, `GreaterThanOrEqual`, `LessThan`, `LessThanOrEqual`.
     */
    @JvmName("blpkdcjcqwjtvhac")
    public suspend fun `operator`(`value`: String) {
        val toBeMapped = value
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.`operator` = mapped
    }

    /**
     * @param value Specifies how the metrics from multiple instances are combined. Possible values are `Average`, `Max`, `Min` and `Sum`.
     */
    @JvmName("lwlaxduqhtonuxkt")
    public suspend fun statistic(`value`: String) {
        val toBeMapped = value
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.statistic = mapped
    }

    /**
     * @param value Specifies the threshold of the metric that triggers the scale action.
     */
    @JvmName("ldadkwkberpuxvcx")
    public suspend fun threshold(`value`: Double) {
        val toBeMapped = value
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.threshold = mapped
    }

    /**
     * @param value Specifies how the data that's collected should be combined over time. Possible values include `Average`, `Count`, `Maximum`, `Minimum`, `Last` and `Total`.
     */
    @JvmName("qgdwojssxyyfuckl")
    public suspend fun timeAggregation(`value`: String) {
        val toBeMapped = value
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.timeAggregation = mapped
    }

    /**
     * @param value Specifies the granularity of metrics that the rule monitors, which must be one of the pre-defined values returned from the metric definitions for the metric. This value must be between 1 minute and 12 hours an be formatted as an ISO 8601 string.
     */
    @JvmName("wqnvtmvwwtdmfogr")
    public suspend fun timeGrain(`value`: String) {
        val toBeMapped = value
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.timeGrain = mapped
    }

    /**
     * @param value Specifies the time range for which data is collected, which must be greater than the delay in metric collection (which varies from resource to resource). This value must be between 5 minutes and 12 hours and be formatted as an ISO 8601 string.
     */
    @JvmName("kgmopxgrqsheplwn")
    public suspend fun timeWindow(`value`: String) {
        val toBeMapped = value
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.timeWindow = mapped
    }

    internal fun build(): AutoscaleSettingProfileRuleMetricTriggerArgs =
        AutoscaleSettingProfileRuleMetricTriggerArgs(
            dimensions = dimensions,
            divideByInstanceCount = divideByInstanceCount,
            metricName = metricName ?: throw PulumiNullFieldException("metricName"),
            metricNamespace = metricNamespace,
            metricResourceId = metricResourceId ?: throw PulumiNullFieldException("metricResourceId"),
            `operator` = `operator` ?: throw PulumiNullFieldException("operator"),
            statistic = statistic ?: throw PulumiNullFieldException("statistic"),
            threshold = threshold ?: throw PulumiNullFieldException("threshold"),
            timeAggregation = timeAggregation ?: throw PulumiNullFieldException("timeAggregation"),
            timeGrain = timeGrain ?: throw PulumiNullFieldException("timeGrain"),
            timeWindow = timeWindow ?: throw PulumiNullFieldException("timeWindow"),
        )
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy