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

com.pulumi.kubernetes.policy.v1beta1.kotlin.inputs.PodDisruptionBudgetSpecPatchArgs.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: 4.18.2.0
Show newest version
@file:Suppress("NAME_SHADOWING", "DEPRECATION")

package com.pulumi.kubernetes.policy.v1beta1.kotlin.inputs

import com.pulumi.core.Either
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 com.pulumi.kubernetes.meta.v1.kotlin.inputs.LabelSelectorPatchArgs
import com.pulumi.kubernetes.meta.v1.kotlin.inputs.LabelSelectorPatchArgsBuilder
import com.pulumi.kubernetes.policy.v1beta1.inputs.PodDisruptionBudgetSpecPatchArgs.builder
import kotlin.Int
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.jvm.JvmName

/**
 * PodDisruptionBudgetSpec is a description of a PodDisruptionBudget.
 * @property maxUnavailable An eviction is allowed if at most "maxUnavailable" pods selected by "selector" are unavailable after the eviction, i.e. even in absence of the evicted pod. For example, one can prevent all voluntary evictions by specifying 0. This is a mutually exclusive setting with "minAvailable".
 * @property minAvailable An eviction is allowed if at least "minAvailable" pods selected by "selector" will still be available after the eviction, i.e. even in the absence of the evicted pod.  So for example you can prevent all voluntary evictions by specifying "100%".
 * @property selector Label query over pods whose evictions are managed by the disruption budget.
 */
public data class PodDisruptionBudgetSpecPatchArgs(
    public val maxUnavailable: Output>? = null,
    public val minAvailable: Output>? = null,
    public val selector: Output? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.kubernetes.policy.v1beta1.inputs.PodDisruptionBudgetSpecPatchArgs =
        com.pulumi.kubernetes.policy.v1beta1.inputs.PodDisruptionBudgetSpecPatchArgs.builder()
            .maxUnavailable(
                maxUnavailable?.applyValue({ args0 ->
                    args0.transform({ args0 -> args0 }, { args0 ->
                        args0
                    })
                }),
            )
            .minAvailable(
                minAvailable?.applyValue({ args0 ->
                    args0.transform({ args0 -> args0 }, { args0 ->
                        args0
                    })
                }),
            )
            .selector(selector?.applyValue({ args0 -> args0.let({ args0 -> args0.toJava() }) })).build()
}

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

    private var minAvailable: Output>? = null

    private var selector: Output? = null

    /**
     * @param value An eviction is allowed if at most "maxUnavailable" pods selected by "selector" are unavailable after the eviction, i.e. even in absence of the evicted pod. For example, one can prevent all voluntary evictions by specifying 0. This is a mutually exclusive setting with "minAvailable".
     */
    @JvmName("xdeehsobevuoujxd")
    public suspend fun maxUnavailable(`value`: Output>) {
        this.maxUnavailable = value
    }

    /**
     * @param value An eviction is allowed if at least "minAvailable" pods selected by "selector" will still be available after the eviction, i.e. even in the absence of the evicted pod.  So for example you can prevent all voluntary evictions by specifying "100%".
     */
    @JvmName("dtulgwssnxfvihou")
    public suspend fun minAvailable(`value`: Output>) {
        this.minAvailable = value
    }

    /**
     * @param value Label query over pods whose evictions are managed by the disruption budget.
     */
    @JvmName("rxlxsuuxgkvyiqmw")
    public suspend fun selector(`value`: Output) {
        this.selector = value
    }

    /**
     * @param value An eviction is allowed if at most "maxUnavailable" pods selected by "selector" are unavailable after the eviction, i.e. even in absence of the evicted pod. For example, one can prevent all voluntary evictions by specifying 0. This is a mutually exclusive setting with "minAvailable".
     */
    @JvmName("gesvbjfpgslcslwq")
    public suspend fun maxUnavailable(`value`: Either?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.maxUnavailable = mapped
    }

    /**
     * @param value An eviction is allowed if at most "maxUnavailable" pods selected by "selector" are unavailable after the eviction, i.e. even in absence of the evicted pod. For example, one can prevent all voluntary evictions by specifying 0. This is a mutually exclusive setting with "minAvailable".
     */
    @JvmName("edgavviejggceqvk")
    public fun maxUnavailable(`value`: Int) {
        val toBeMapped = Either.ofLeft(value)
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.maxUnavailable = mapped
    }

    /**
     * @param value An eviction is allowed if at most "maxUnavailable" pods selected by "selector" are unavailable after the eviction, i.e. even in absence of the evicted pod. For example, one can prevent all voluntary evictions by specifying 0. This is a mutually exclusive setting with "minAvailable".
     */
    @JvmName("yrbvpilofhctqhck")
    public fun maxUnavailable(`value`: String) {
        val toBeMapped = Either.ofRight(value)
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.maxUnavailable = mapped
    }

    /**
     * @param value An eviction is allowed if at least "minAvailable" pods selected by "selector" will still be available after the eviction, i.e. even in the absence of the evicted pod.  So for example you can prevent all voluntary evictions by specifying "100%".
     */
    @JvmName("vrlblpmcfpmpwpoo")
    public suspend fun minAvailable(`value`: Either?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.minAvailable = mapped
    }

    /**
     * @param value An eviction is allowed if at least "minAvailable" pods selected by "selector" will still be available after the eviction, i.e. even in the absence of the evicted pod.  So for example you can prevent all voluntary evictions by specifying "100%".
     */
    @JvmName("asxqprewupjybpvx")
    public fun minAvailable(`value`: Int) {
        val toBeMapped = Either.ofLeft(value)
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.minAvailable = mapped
    }

    /**
     * @param value An eviction is allowed if at least "minAvailable" pods selected by "selector" will still be available after the eviction, i.e. even in the absence of the evicted pod.  So for example you can prevent all voluntary evictions by specifying "100%".
     */
    @JvmName("kamrryqivgqikfxs")
    public fun minAvailable(`value`: String) {
        val toBeMapped = Either.ofRight(value)
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.minAvailable = mapped
    }

    /**
     * @param value Label query over pods whose evictions are managed by the disruption budget.
     */
    @JvmName("knwcoecdsfsrsqrk")
    public suspend fun selector(`value`: LabelSelectorPatchArgs?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.selector = mapped
    }

    /**
     * @param argument Label query over pods whose evictions are managed by the disruption budget.
     */
    @JvmName("mrcuqimofeegyjhm")
    public suspend fun selector(argument: suspend LabelSelectorPatchArgsBuilder.() -> Unit) {
        val toBeMapped = LabelSelectorPatchArgsBuilder().applySuspend { argument() }.build()
        val mapped = of(toBeMapped)
        this.selector = mapped
    }

    internal fun build(): PodDisruptionBudgetSpecPatchArgs = PodDisruptionBudgetSpecPatchArgs(
        maxUnavailable = maxUnavailable,
        minAvailable = minAvailable,
        selector = selector,
    )
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy