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

com.pulumi.kubernetes.resource.v1alpha2.kotlin.outputs.AllocationResult.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.v1alpha2.kotlin.outputs

import com.pulumi.kubernetes.core.v1.kotlin.outputs.NodeSelector
import kotlin.Boolean
import kotlin.Suppress
import kotlin.collections.List

/**
 * AllocationResult contains attributes of an allocated resource.
 * @property availableOnNodes This field will get set by the resource driver after it has allocated the resource to inform the scheduler where it can schedule Pods using the ResourceClaim.
 * Setting this field is optional. If null, the resource is available everywhere.
 * @property resourceHandles ResourceHandles contain the state associated with an allocation that should be maintained throughout the lifetime of a claim. Each ResourceHandle contains data that should be passed to a specific kubelet plugin once it lands on a node. This data is returned by the driver after a successful allocation and is opaque to Kubernetes. Driver documentation may explain to users how to interpret this data if needed.
 * Setting this field is optional. It has a maximum size of 32 entries. If null (or empty), it is assumed this allocation will be processed by a single kubelet plugin with no ResourceHandle data attached. The name of the kubelet plugin invoked will match the DriverName set in the ResourceClaimStatus this AllocationResult is embedded in.
 * @property shareable Shareable determines whether the resource supports more than one consumer at a time.
 */
public data class AllocationResult(
    public val availableOnNodes: NodeSelector? = null,
    public val resourceHandles: List? = null,
    public val shareable: Boolean? = null,
) {
    public companion object {
        public fun toKotlin(javaType: com.pulumi.kubernetes.resource.v1alpha2.outputs.AllocationResult): AllocationResult = AllocationResult(
            availableOnNodes = javaType.availableOnNodes().map({ args0 ->
                args0.let({ args0 ->
                    com.pulumi.kubernetes.core.v1.kotlin.outputs.NodeSelector.Companion.toKotlin(args0)
                })
            }).orElse(null),
            resourceHandles = javaType.resourceHandles().map({ args0 ->
                args0.let({ args0 ->
                    com.pulumi.kubernetes.resource.v1alpha2.kotlin.outputs.ResourceHandle.Companion.toKotlin(args0)
                })
            }),
            shareable = javaType.shareable().map({ args0 -> args0 }).orElse(null),
        )
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy