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

com.pulumi.kubernetes.apps.v1.kotlin.inputs.DeploymentSpecPatchArgs.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.apps.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.apps.v1.inputs.DeploymentSpecPatchArgs.builder
import com.pulumi.kubernetes.core.v1.kotlin.inputs.PodTemplateSpecPatchArgs
import com.pulumi.kubernetes.core.v1.kotlin.inputs.PodTemplateSpecPatchArgsBuilder
import com.pulumi.kubernetes.meta.v1.kotlin.inputs.LabelSelectorPatchArgs
import com.pulumi.kubernetes.meta.v1.kotlin.inputs.LabelSelectorPatchArgsBuilder
import kotlin.Boolean
import kotlin.Int
import kotlin.Suppress
import kotlin.Unit
import kotlin.jvm.JvmName

/**
 * DeploymentSpec is the specification of the desired behavior of the Deployment.
 * @property minReadySeconds Minimum number of seconds for which a newly created pod should be ready without any of its container crashing, for it to be considered available. Defaults to 0 (pod will be considered available as soon as it is ready)
 * @property paused Indicates that the deployment is paused.
 * @property progressDeadlineSeconds The maximum time in seconds for a deployment to make progress before it is considered to be failed. The deployment controller will continue to process failed deployments and a condition with a ProgressDeadlineExceeded reason will be surfaced in the deployment status. Note that progress will not be estimated during the time a deployment is paused. Defaults to 600s.
 * @property replicas Number of desired pods. This is a pointer to distinguish between explicit zero and not specified. Defaults to 1.
 * @property revisionHistoryLimit The number of old ReplicaSets to retain to allow rollback. This is a pointer to distinguish between explicit zero and not specified. Defaults to 10.
 * @property selector Label selector for pods. Existing ReplicaSets whose pods are selected by this will be the ones affected by this deployment. It must match the pod template's labels.
 * @property strategy The deployment strategy to use to replace existing pods with new ones.
 * @property template Template describes the pods that will be created. The only allowed template.spec.restartPolicy value is "Always".
 */
public data class DeploymentSpecPatchArgs(
    public val minReadySeconds: Output? = null,
    public val paused: Output? = null,
    public val progressDeadlineSeconds: Output? = null,
    public val replicas: Output? = null,
    public val revisionHistoryLimit: Output? = null,
    public val selector: Output? = null,
    public val strategy: Output? = null,
    public val template: Output? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.kubernetes.apps.v1.inputs.DeploymentSpecPatchArgs =
        com.pulumi.kubernetes.apps.v1.inputs.DeploymentSpecPatchArgs.builder()
            .minReadySeconds(minReadySeconds?.applyValue({ args0 -> args0 }))
            .paused(paused?.applyValue({ args0 -> args0 }))
            .progressDeadlineSeconds(progressDeadlineSeconds?.applyValue({ args0 -> args0 }))
            .replicas(replicas?.applyValue({ args0 -> args0 }))
            .revisionHistoryLimit(revisionHistoryLimit?.applyValue({ args0 -> args0 }))
            .selector(selector?.applyValue({ args0 -> args0.let({ args0 -> args0.toJava() }) }))
            .strategy(strategy?.applyValue({ args0 -> args0.let({ args0 -> args0.toJava() }) }))
            .template(template?.applyValue({ args0 -> args0.let({ args0 -> args0.toJava() }) })).build()
}

/**
 * Builder for [DeploymentSpecPatchArgs].
 */
@PulumiTagMarker
public class DeploymentSpecPatchArgsBuilder internal constructor() {
    private var minReadySeconds: Output? = null

    private var paused: Output? = null

    private var progressDeadlineSeconds: Output? = null

    private var replicas: Output? = null

    private var revisionHistoryLimit: Output? = null

    private var selector: Output? = null

    private var strategy: Output? = null

    private var template: Output? = null

    /**
     * @param value Minimum number of seconds for which a newly created pod should be ready without any of its container crashing, for it to be considered available. Defaults to 0 (pod will be considered available as soon as it is ready)
     */
    @JvmName("fojrdknsmifnqold")
    public suspend fun minReadySeconds(`value`: Output) {
        this.minReadySeconds = value
    }

    /**
     * @param value Indicates that the deployment is paused.
     */
    @JvmName("gtgsjpmvjllkiysh")
    public suspend fun paused(`value`: Output) {
        this.paused = value
    }

    /**
     * @param value The maximum time in seconds for a deployment to make progress before it is considered to be failed. The deployment controller will continue to process failed deployments and a condition with a ProgressDeadlineExceeded reason will be surfaced in the deployment status. Note that progress will not be estimated during the time a deployment is paused. Defaults to 600s.
     */
    @JvmName("djynyyoxvxaevkuj")
    public suspend fun progressDeadlineSeconds(`value`: Output) {
        this.progressDeadlineSeconds = value
    }

    /**
     * @param value Number of desired pods. This is a pointer to distinguish between explicit zero and not specified. Defaults to 1.
     */
    @JvmName("dxbxwbmgiflxbina")
    public suspend fun replicas(`value`: Output) {
        this.replicas = value
    }

    /**
     * @param value The number of old ReplicaSets to retain to allow rollback. This is a pointer to distinguish between explicit zero and not specified. Defaults to 10.
     */
    @JvmName("ctricmddpxldcomm")
    public suspend fun revisionHistoryLimit(`value`: Output) {
        this.revisionHistoryLimit = value
    }

    /**
     * @param value Label selector for pods. Existing ReplicaSets whose pods are selected by this will be the ones affected by this deployment. It must match the pod template's labels.
     */
    @JvmName("vrwvqeufqpqwshci")
    public suspend fun selector(`value`: Output) {
        this.selector = value
    }

    /**
     * @param value The deployment strategy to use to replace existing pods with new ones.
     */
    @JvmName("crjbnpifjthlwuxh")
    public suspend fun strategy(`value`: Output) {
        this.strategy = value
    }

    /**
     * @param value Template describes the pods that will be created. The only allowed template.spec.restartPolicy value is "Always".
     */
    @JvmName("opedfoxdeivegqfm")
    public suspend fun template(`value`: Output) {
        this.template = value
    }

    /**
     * @param value Minimum number of seconds for which a newly created pod should be ready without any of its container crashing, for it to be considered available. Defaults to 0 (pod will be considered available as soon as it is ready)
     */
    @JvmName("ybspfrwjrbtlefbe")
    public suspend fun minReadySeconds(`value`: Int?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.minReadySeconds = mapped
    }

    /**
     * @param value Indicates that the deployment is paused.
     */
    @JvmName("lesnvlsopwcioadk")
    public suspend fun paused(`value`: Boolean?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.paused = mapped
    }

    /**
     * @param value The maximum time in seconds for a deployment to make progress before it is considered to be failed. The deployment controller will continue to process failed deployments and a condition with a ProgressDeadlineExceeded reason will be surfaced in the deployment status. Note that progress will not be estimated during the time a deployment is paused. Defaults to 600s.
     */
    @JvmName("ymfjypxqutportdw")
    public suspend fun progressDeadlineSeconds(`value`: Int?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.progressDeadlineSeconds = mapped
    }

    /**
     * @param value Number of desired pods. This is a pointer to distinguish between explicit zero and not specified. Defaults to 1.
     */
    @JvmName("psivljxincfvepcj")
    public suspend fun replicas(`value`: Int?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.replicas = mapped
    }

    /**
     * @param value The number of old ReplicaSets to retain to allow rollback. This is a pointer to distinguish between explicit zero and not specified. Defaults to 10.
     */
    @JvmName("nfnbxtiupjluoecx")
    public suspend fun revisionHistoryLimit(`value`: Int?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.revisionHistoryLimit = mapped
    }

    /**
     * @param value Label selector for pods. Existing ReplicaSets whose pods are selected by this will be the ones affected by this deployment. It must match the pod template's labels.
     */
    @JvmName("ttgrtfqehabxerfx")
    public suspend fun selector(`value`: LabelSelectorPatchArgs?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.selector = mapped
    }

    /**
     * @param argument Label selector for pods. Existing ReplicaSets whose pods are selected by this will be the ones affected by this deployment. It must match the pod template's labels.
     */
    @JvmName("xcdcpyncgwljwxma")
    public suspend fun selector(argument: suspend LabelSelectorPatchArgsBuilder.() -> Unit) {
        val toBeMapped = LabelSelectorPatchArgsBuilder().applySuspend { argument() }.build()
        val mapped = of(toBeMapped)
        this.selector = mapped
    }

    /**
     * @param value The deployment strategy to use to replace existing pods with new ones.
     */
    @JvmName("yiisjdecrsiltvxt")
    public suspend fun strategy(`value`: DeploymentStrategyPatchArgs?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.strategy = mapped
    }

    /**
     * @param argument The deployment strategy to use to replace existing pods with new ones.
     */
    @JvmName("nvblklarnsgyerqg")
    public suspend fun strategy(argument: suspend DeploymentStrategyPatchArgsBuilder.() -> Unit) {
        val toBeMapped = DeploymentStrategyPatchArgsBuilder().applySuspend { argument() }.build()
        val mapped = of(toBeMapped)
        this.strategy = mapped
    }

    /**
     * @param value Template describes the pods that will be created. The only allowed template.spec.restartPolicy value is "Always".
     */
    @JvmName("cxwwouwtfamcpvha")
    public suspend fun template(`value`: PodTemplateSpecPatchArgs?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.template = mapped
    }

    /**
     * @param argument Template describes the pods that will be created. The only allowed template.spec.restartPolicy value is "Always".
     */
    @JvmName("qsbuafqsnecraioo")
    public suspend fun template(argument: suspend PodTemplateSpecPatchArgsBuilder.() -> Unit) {
        val toBeMapped = PodTemplateSpecPatchArgsBuilder().applySuspend { argument() }.build()
        val mapped = of(toBeMapped)
        this.template = mapped
    }

    internal fun build(): DeploymentSpecPatchArgs = DeploymentSpecPatchArgs(
        minReadySeconds = minReadySeconds,
        paused = paused,
        progressDeadlineSeconds = progressDeadlineSeconds,
        replicas = replicas,
        revisionHistoryLimit = revisionHistoryLimit,
        selector = selector,
        strategy = strategy,
        template = template,
    )
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy