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

com.pulumi.kubernetes.resource.v1beta1.kotlin.inputs.ResourceClaimStatusArgs.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.resource.v1beta1.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.resource.v1beta1.inputs.ResourceClaimStatusArgs.builder
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.List
import kotlin.jvm.JvmName

/**
 * ResourceClaimStatus tracks whether the resource has been allocated and what the result of that was.
 * @property allocation Allocation is set once the claim has been allocated successfully.
 * @property devices Devices contains the status of each device allocated for this claim, as reported by the driver. This can include driver-specific information. Entries are owned by their respective drivers.
 * @property reservedFor ReservedFor indicates which entities are currently allowed to use the claim. A Pod which references a ResourceClaim which is not reserved for that Pod will not be started. A claim that is in use or might be in use because it has been reserved must not get deallocated.
 * In a cluster with multiple scheduler instances, two pods might get scheduled concurrently by different schedulers. When they reference the same ResourceClaim which already has reached its maximum number of consumers, only one pod can be scheduled.
 * Both schedulers try to add their pod to the claim.status.reservedFor field, but only the update that reaches the API server first gets stored. The other one fails with an error and the scheduler which issued it knows that it must put the pod back into the queue, waiting for the ResourceClaim to become usable again.
 * There can be at most 32 such reservations. This may get increased in the future, but not reduced.
 */
public data class ResourceClaimStatusArgs(
    public val allocation: Output? = null,
    public val devices: Output>? = null,
    public val reservedFor: Output>? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.kubernetes.resource.v1beta1.inputs.ResourceClaimStatusArgs =
        com.pulumi.kubernetes.resource.v1beta1.inputs.ResourceClaimStatusArgs.builder()
            .allocation(allocation?.applyValue({ args0 -> args0.let({ args0 -> args0.toJava() }) }))
            .devices(
                devices?.applyValue({ args0 ->
                    args0.map({ args0 ->
                        args0.let({ args0 ->
                            args0.toJava()
                        })
                    })
                }),
            )
            .reservedFor(
                reservedFor?.applyValue({ args0 ->
                    args0.map({ args0 ->
                        args0.let({ args0 ->
                            args0.toJava()
                        })
                    })
                }),
            ).build()
}

/**
 * Builder for [ResourceClaimStatusArgs].
 */
@PulumiTagMarker
public class ResourceClaimStatusArgsBuilder internal constructor() {
    private var allocation: Output? = null

    private var devices: Output>? = null

    private var reservedFor: Output>? = null

    /**
     * @param value Allocation is set once the claim has been allocated successfully.
     */
    @JvmName("yrjkpctmbnovxwmh")
    public suspend fun allocation(`value`: Output) {
        this.allocation = value
    }

    /**
     * @param value Devices contains the status of each device allocated for this claim, as reported by the driver. This can include driver-specific information. Entries are owned by their respective drivers.
     */
    @JvmName("hxofbehbxmmnmnad")
    public suspend fun devices(`value`: Output>) {
        this.devices = value
    }

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

    /**
     * @param values Devices contains the status of each device allocated for this claim, as reported by the driver. This can include driver-specific information. Entries are owned by their respective drivers.
     */
    @JvmName("dpsqbothgefoooeb")
    public suspend fun devices(values: List>) {
        this.devices = Output.all(values)
    }

    /**
     * @param value ReservedFor indicates which entities are currently allowed to use the claim. A Pod which references a ResourceClaim which is not reserved for that Pod will not be started. A claim that is in use or might be in use because it has been reserved must not get deallocated.
     * In a cluster with multiple scheduler instances, two pods might get scheduled concurrently by different schedulers. When they reference the same ResourceClaim which already has reached its maximum number of consumers, only one pod can be scheduled.
     * Both schedulers try to add their pod to the claim.status.reservedFor field, but only the update that reaches the API server first gets stored. The other one fails with an error and the scheduler which issued it knows that it must put the pod back into the queue, waiting for the ResourceClaim to become usable again.
     * There can be at most 32 such reservations. This may get increased in the future, but not reduced.
     */
    @JvmName("jxakgroqjbxylxru")
    public suspend fun reservedFor(`value`: Output>) {
        this.reservedFor = value
    }

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

    /**
     * @param values ReservedFor indicates which entities are currently allowed to use the claim. A Pod which references a ResourceClaim which is not reserved for that Pod will not be started. A claim that is in use or might be in use because it has been reserved must not get deallocated.
     * In a cluster with multiple scheduler instances, two pods might get scheduled concurrently by different schedulers. When they reference the same ResourceClaim which already has reached its maximum number of consumers, only one pod can be scheduled.
     * Both schedulers try to add their pod to the claim.status.reservedFor field, but only the update that reaches the API server first gets stored. The other one fails with an error and the scheduler which issued it knows that it must put the pod back into the queue, waiting for the ResourceClaim to become usable again.
     * There can be at most 32 such reservations. This may get increased in the future, but not reduced.
     */
    @JvmName("virtwwwdmudirrdr")
    public suspend fun reservedFor(values: List>) {
        this.reservedFor = Output.all(values)
    }

    /**
     * @param value Allocation is set once the claim has been allocated successfully.
     */
    @JvmName("fyfbberhefatmsjp")
    public suspend fun allocation(`value`: AllocationResultArgs?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.allocation = mapped
    }

    /**
     * @param argument Allocation is set once the claim has been allocated successfully.
     */
    @JvmName("sfilkrnarueapfme")
    public suspend fun allocation(argument: suspend AllocationResultArgsBuilder.() -> Unit) {
        val toBeMapped = AllocationResultArgsBuilder().applySuspend { argument() }.build()
        val mapped = of(toBeMapped)
        this.allocation = mapped
    }

    /**
     * @param value Devices contains the status of each device allocated for this claim, as reported by the driver. This can include driver-specific information. Entries are owned by their respective drivers.
     */
    @JvmName("colxhagrjrexoibr")
    public suspend fun devices(`value`: List?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.devices = mapped
    }

    /**
     * @param argument Devices contains the status of each device allocated for this claim, as reported by the driver. This can include driver-specific information. Entries are owned by their respective drivers.
     */
    @JvmName("mguxumdnrdmaduii")
    public suspend fun devices(argument: List Unit>) {
        val toBeMapped = argument.toList().map {
            AllocatedDeviceStatusArgsBuilder().applySuspend {
                it()
            }.build()
        }
        val mapped = of(toBeMapped)
        this.devices = mapped
    }

    /**
     * @param argument Devices contains the status of each device allocated for this claim, as reported by the driver. This can include driver-specific information. Entries are owned by their respective drivers.
     */
    @JvmName("lbjgdgkfcjsiabea")
    public suspend fun devices(vararg argument: suspend AllocatedDeviceStatusArgsBuilder.() -> Unit) {
        val toBeMapped = argument.toList().map {
            AllocatedDeviceStatusArgsBuilder().applySuspend {
                it()
            }.build()
        }
        val mapped = of(toBeMapped)
        this.devices = mapped
    }

    /**
     * @param argument Devices contains the status of each device allocated for this claim, as reported by the driver. This can include driver-specific information. Entries are owned by their respective drivers.
     */
    @JvmName("eautaeuebseaphbj")
    public suspend fun devices(argument: suspend AllocatedDeviceStatusArgsBuilder.() -> Unit) {
        val toBeMapped = listOf(AllocatedDeviceStatusArgsBuilder().applySuspend { argument() }.build())
        val mapped = of(toBeMapped)
        this.devices = mapped
    }

    /**
     * @param values Devices contains the status of each device allocated for this claim, as reported by the driver. This can include driver-specific information. Entries are owned by their respective drivers.
     */
    @JvmName("gkrgvgpdgetilegu")
    public suspend fun devices(vararg values: AllocatedDeviceStatusArgs) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.devices = mapped
    }

    /**
     * @param value ReservedFor indicates which entities are currently allowed to use the claim. A Pod which references a ResourceClaim which is not reserved for that Pod will not be started. A claim that is in use or might be in use because it has been reserved must not get deallocated.
     * In a cluster with multiple scheduler instances, two pods might get scheduled concurrently by different schedulers. When they reference the same ResourceClaim which already has reached its maximum number of consumers, only one pod can be scheduled.
     * Both schedulers try to add their pod to the claim.status.reservedFor field, but only the update that reaches the API server first gets stored. The other one fails with an error and the scheduler which issued it knows that it must put the pod back into the queue, waiting for the ResourceClaim to become usable again.
     * There can be at most 32 such reservations. This may get increased in the future, but not reduced.
     */
    @JvmName("jreervqnvaxrrkev")
    public suspend fun reservedFor(`value`: List?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.reservedFor = mapped
    }

    /**
     * @param argument ReservedFor indicates which entities are currently allowed to use the claim. A Pod which references a ResourceClaim which is not reserved for that Pod will not be started. A claim that is in use or might be in use because it has been reserved must not get deallocated.
     * In a cluster with multiple scheduler instances, two pods might get scheduled concurrently by different schedulers. When they reference the same ResourceClaim which already has reached its maximum number of consumers, only one pod can be scheduled.
     * Both schedulers try to add their pod to the claim.status.reservedFor field, but only the update that reaches the API server first gets stored. The other one fails with an error and the scheduler which issued it knows that it must put the pod back into the queue, waiting for the ResourceClaim to become usable again.
     * There can be at most 32 such reservations. This may get increased in the future, but not reduced.
     */
    @JvmName("lgxeipnaktdcxctx")
    public suspend fun reservedFor(argument: List Unit>) {
        val toBeMapped = argument.toList().map {
            ResourceClaimConsumerReferenceArgsBuilder().applySuspend { it() }.build()
        }
        val mapped = of(toBeMapped)
        this.reservedFor = mapped
    }

    /**
     * @param argument ReservedFor indicates which entities are currently allowed to use the claim. A Pod which references a ResourceClaim which is not reserved for that Pod will not be started. A claim that is in use or might be in use because it has been reserved must not get deallocated.
     * In a cluster with multiple scheduler instances, two pods might get scheduled concurrently by different schedulers. When they reference the same ResourceClaim which already has reached its maximum number of consumers, only one pod can be scheduled.
     * Both schedulers try to add their pod to the claim.status.reservedFor field, but only the update that reaches the API server first gets stored. The other one fails with an error and the scheduler which issued it knows that it must put the pod back into the queue, waiting for the ResourceClaim to become usable again.
     * There can be at most 32 such reservations. This may get increased in the future, but not reduced.
     */
    @JvmName("huneaphiohyfccmu")
    public suspend fun reservedFor(vararg argument: suspend ResourceClaimConsumerReferenceArgsBuilder.() -> Unit) {
        val toBeMapped = argument.toList().map {
            ResourceClaimConsumerReferenceArgsBuilder().applySuspend { it() }.build()
        }
        val mapped = of(toBeMapped)
        this.reservedFor = mapped
    }

    /**
     * @param argument ReservedFor indicates which entities are currently allowed to use the claim. A Pod which references a ResourceClaim which is not reserved for that Pod will not be started. A claim that is in use or might be in use because it has been reserved must not get deallocated.
     * In a cluster with multiple scheduler instances, two pods might get scheduled concurrently by different schedulers. When they reference the same ResourceClaim which already has reached its maximum number of consumers, only one pod can be scheduled.
     * Both schedulers try to add their pod to the claim.status.reservedFor field, but only the update that reaches the API server first gets stored. The other one fails with an error and the scheduler which issued it knows that it must put the pod back into the queue, waiting for the ResourceClaim to become usable again.
     * There can be at most 32 such reservations. This may get increased in the future, but not reduced.
     */
    @JvmName("jrqsijdqkqigjtll")
    public suspend fun reservedFor(argument: suspend ResourceClaimConsumerReferenceArgsBuilder.() -> Unit) {
        val toBeMapped = listOf(
            ResourceClaimConsumerReferenceArgsBuilder().applySuspend {
                argument()
            }.build(),
        )
        val mapped = of(toBeMapped)
        this.reservedFor = mapped
    }

    /**
     * @param values ReservedFor indicates which entities are currently allowed to use the claim. A Pod which references a ResourceClaim which is not reserved for that Pod will not be started. A claim that is in use or might be in use because it has been reserved must not get deallocated.
     * In a cluster with multiple scheduler instances, two pods might get scheduled concurrently by different schedulers. When they reference the same ResourceClaim which already has reached its maximum number of consumers, only one pod can be scheduled.
     * Both schedulers try to add their pod to the claim.status.reservedFor field, but only the update that reaches the API server first gets stored. The other one fails with an error and the scheduler which issued it knows that it must put the pod back into the queue, waiting for the ResourceClaim to become usable again.
     * There can be at most 32 such reservations. This may get increased in the future, but not reduced.
     */
    @JvmName("wggonixwjsqroahn")
    public suspend fun reservedFor(vararg values: ResourceClaimConsumerReferenceArgs) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.reservedFor = mapped
    }

    internal fun build(): ResourceClaimStatusArgs = ResourceClaimStatusArgs(
        allocation = allocation,
        devices = devices,
        reservedFor = reservedFor,
    )
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy