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

com.pulumi.kubernetes.batch.v1.kotlin.inputs.PodFailurePolicyRulePatchArgs.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.batch.v1.kotlin.inputs

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.batch.v1.inputs.PodFailurePolicyRulePatchArgs.builder
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.List
import kotlin.jvm.JvmName

/**
 * PodFailurePolicyRule describes how a pod failure is handled when the requirements are met. One of onExitCodes and onPodConditions, but not both, can be used in each rule.
 * @property action Specifies the action taken on a pod failure when the requirements are satisfied. Possible values are:
 * - FailJob: indicates that the pod's job is marked as Failed and all
 *   running pods are terminated.
 * - FailIndex: indicates that the pod's index is marked as Failed and will
 *   not be restarted.
 *   This value is beta-level. It can be used when the
 *   `JobBackoffLimitPerIndex` feature gate is enabled (enabled by default).
 * - Ignore: indicates that the counter towards the .backoffLimit is not
 *   incremented and a replacement pod is created.
 * - Count: indicates that the pod is handled in the default way - the
 *   counter towards the .backoffLimit is incremented.
 * Additional values are considered to be added in the future. Clients should react to an unknown action by skipping the rule.
 * @property onExitCodes Represents the requirement on the container exit codes.
 * @property onPodConditions Represents the requirement on the pod conditions. The requirement is represented as a list of pod condition patterns. The requirement is satisfied if at least one pattern matches an actual pod condition. At most 20 elements are allowed.
 */
public data class PodFailurePolicyRulePatchArgs(
    public val action: Output? = null,
    public val onExitCodes: Output? = null,
    public val onPodConditions: Output>? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.kubernetes.batch.v1.inputs.PodFailurePolicyRulePatchArgs =
        com.pulumi.kubernetes.batch.v1.inputs.PodFailurePolicyRulePatchArgs.builder()
            .action(action?.applyValue({ args0 -> args0 }))
            .onExitCodes(onExitCodes?.applyValue({ args0 -> args0.let({ args0 -> args0.toJava() }) }))
            .onPodConditions(
                onPodConditions?.applyValue({ args0 ->
                    args0.map({ args0 ->
                        args0.let({ args0 ->
                            args0.toJava()
                        })
                    })
                }),
            ).build()
}

/**
 * Builder for [PodFailurePolicyRulePatchArgs].
 */
@PulumiTagMarker
public class PodFailurePolicyRulePatchArgsBuilder internal constructor() {
    private var action: Output? = null

    private var onExitCodes: Output? = null

    private var onPodConditions: Output>? = null

    /**
     * @param value Specifies the action taken on a pod failure when the requirements are satisfied. Possible values are:
     * - FailJob: indicates that the pod's job is marked as Failed and all
     *   running pods are terminated.
     * - FailIndex: indicates that the pod's index is marked as Failed and will
     *   not be restarted.
     *   This value is beta-level. It can be used when the
     *   `JobBackoffLimitPerIndex` feature gate is enabled (enabled by default).
     * - Ignore: indicates that the counter towards the .backoffLimit is not
     *   incremented and a replacement pod is created.
     * - Count: indicates that the pod is handled in the default way - the
     *   counter towards the .backoffLimit is incremented.
     * Additional values are considered to be added in the future. Clients should react to an unknown action by skipping the rule.
     */
    @JvmName("cdetywkoveghqhlo")
    public suspend fun action(`value`: Output) {
        this.action = value
    }

    /**
     * @param value Represents the requirement on the container exit codes.
     */
    @JvmName("hfoaiyprkfvgonko")
    public suspend fun onExitCodes(`value`: Output) {
        this.onExitCodes = value
    }

    /**
     * @param value Represents the requirement on the pod conditions. The requirement is represented as a list of pod condition patterns. The requirement is satisfied if at least one pattern matches an actual pod condition. At most 20 elements are allowed.
     */
    @JvmName("njfrhytdkwpcrcyd")
    public suspend fun onPodConditions(`value`: Output>) {
        this.onPodConditions = value
    }

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

    /**
     * @param values Represents the requirement on the pod conditions. The requirement is represented as a list of pod condition patterns. The requirement is satisfied if at least one pattern matches an actual pod condition. At most 20 elements are allowed.
     */
    @JvmName("rdcnbovyruhdiwls")
    public suspend fun onPodConditions(values: List>) {
        this.onPodConditions = Output.all(values)
    }

    /**
     * @param value Specifies the action taken on a pod failure when the requirements are satisfied. Possible values are:
     * - FailJob: indicates that the pod's job is marked as Failed and all
     *   running pods are terminated.
     * - FailIndex: indicates that the pod's index is marked as Failed and will
     *   not be restarted.
     *   This value is beta-level. It can be used when the
     *   `JobBackoffLimitPerIndex` feature gate is enabled (enabled by default).
     * - Ignore: indicates that the counter towards the .backoffLimit is not
     *   incremented and a replacement pod is created.
     * - Count: indicates that the pod is handled in the default way - the
     *   counter towards the .backoffLimit is incremented.
     * Additional values are considered to be added in the future. Clients should react to an unknown action by skipping the rule.
     */
    @JvmName("cafrmxtpnyvkofhy")
    public suspend fun action(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.action = mapped
    }

    /**
     * @param value Represents the requirement on the container exit codes.
     */
    @JvmName("mdnutbmnmhhgjrbq")
    public suspend fun onExitCodes(`value`: PodFailurePolicyOnExitCodesRequirementPatchArgs?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.onExitCodes = mapped
    }

    /**
     * @param argument Represents the requirement on the container exit codes.
     */
    @JvmName("xmnrnsraowgotuxm")
    public suspend fun onExitCodes(argument: suspend PodFailurePolicyOnExitCodesRequirementPatchArgsBuilder.() -> Unit) {
        val toBeMapped = PodFailurePolicyOnExitCodesRequirementPatchArgsBuilder().applySuspend {
            argument()
        }.build()
        val mapped = of(toBeMapped)
        this.onExitCodes = mapped
    }

    /**
     * @param value Represents the requirement on the pod conditions. The requirement is represented as a list of pod condition patterns. The requirement is satisfied if at least one pattern matches an actual pod condition. At most 20 elements are allowed.
     */
    @JvmName("aeklsxjwsaewaqpv")
    public suspend fun onPodConditions(`value`: List?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.onPodConditions = mapped
    }

    /**
     * @param argument Represents the requirement on the pod conditions. The requirement is represented as a list of pod condition patterns. The requirement is satisfied if at least one pattern matches an actual pod condition. At most 20 elements are allowed.
     */
    @JvmName("ahqgcvxuphbyniad")
    public suspend fun onPodConditions(argument: List Unit>) {
        val toBeMapped = argument.toList().map {
            PodFailurePolicyOnPodConditionsPatternPatchArgsBuilder().applySuspend { it() }.build()
        }
        val mapped = of(toBeMapped)
        this.onPodConditions = mapped
    }

    /**
     * @param argument Represents the requirement on the pod conditions. The requirement is represented as a list of pod condition patterns. The requirement is satisfied if at least one pattern matches an actual pod condition. At most 20 elements are allowed.
     */
    @JvmName("hfnlgfmvolqulypi")
    public suspend fun onPodConditions(vararg argument: suspend PodFailurePolicyOnPodConditionsPatternPatchArgsBuilder.() -> Unit) {
        val toBeMapped = argument.toList().map {
            PodFailurePolicyOnPodConditionsPatternPatchArgsBuilder().applySuspend { it() }.build()
        }
        val mapped = of(toBeMapped)
        this.onPodConditions = mapped
    }

    /**
     * @param argument Represents the requirement on the pod conditions. The requirement is represented as a list of pod condition patterns. The requirement is satisfied if at least one pattern matches an actual pod condition. At most 20 elements are allowed.
     */
    @JvmName("arfbhhnagbwowrcp")
    public suspend fun onPodConditions(argument: suspend PodFailurePolicyOnPodConditionsPatternPatchArgsBuilder.() -> Unit) {
        val toBeMapped = listOf(
            PodFailurePolicyOnPodConditionsPatternPatchArgsBuilder().applySuspend {
                argument()
            }.build(),
        )
        val mapped = of(toBeMapped)
        this.onPodConditions = mapped
    }

    /**
     * @param values Represents the requirement on the pod conditions. The requirement is represented as a list of pod condition patterns. The requirement is satisfied if at least one pattern matches an actual pod condition. At most 20 elements are allowed.
     */
    @JvmName("ywewjjqnhkduvyog")
    public suspend fun onPodConditions(vararg values: PodFailurePolicyOnPodConditionsPatternPatchArgs) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.onPodConditions = mapped
    }

    internal fun build(): PodFailurePolicyRulePatchArgs = PodFailurePolicyRulePatchArgs(
        action = action,
        onExitCodes = onExitCodes,
        onPodConditions = onPodConditions,
    )
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy