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

com.pulumi.kubernetes.autoscaling.v2.kotlin.outputs.MetricSpecPatch.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.

The newest version!
@file:Suppress("NAME_SHADOWING", "DEPRECATION")

package com.pulumi.kubernetes.autoscaling.v2.kotlin.outputs

import kotlin.String
import kotlin.Suppress

/**
 * MetricSpec specifies how to scale based on a single metric (only `type` and one other matching field should be set at once).
 * @property containerResource containerResource refers to a resource metric (such as those specified in requests and limits) known to Kubernetes describing a single container in each pod of the current scale target (e.g. CPU or memory). Such metrics are built in to Kubernetes, and have special scaling options on top of those available to normal per-pod metrics using the "pods" source. This is an alpha feature and can be enabled by the HPAContainerMetrics feature flag.
 * @property external external refers to a global metric that is not associated with any Kubernetes object. It allows autoscaling based on information coming from components running outside of cluster (for example length of queue in cloud messaging service, or QPS from loadbalancer running outside of cluster).
 * @property object object refers to a metric describing a single kubernetes object (for example, hits-per-second on an Ingress object).
 * @property pods pods refers to a metric describing each pod in the current scale target (for example, transactions-processed-per-second).  The values will be averaged together before being compared to the target value.
 * @property resource resource refers to a resource metric (such as those specified in requests and limits) known to Kubernetes describing each pod in the current scale target (e.g. CPU or memory). Such metrics are built in to Kubernetes, and have special scaling options on top of those available to normal per-pod metrics using the "pods" source.
 * @property type type is the type of metric source.  It should be one of "ContainerResource", "External", "Object", "Pods" or "Resource", each mapping to a matching field in the object. Note: "ContainerResource" type is available on when the feature-gate HPAContainerMetrics is enabled
 */
public data class MetricSpecPatch(
    public val containerResource: ContainerResourceMetricSourcePatch? = null,
    public val `external`: ExternalMetricSourcePatch? = null,
    public val `object`: ObjectMetricSourcePatch? = null,
    public val pods: PodsMetricSourcePatch? = null,
    public val resource: ResourceMetricSourcePatch? = null,
    public val type: String? = null,
) {
    public companion object {
        public fun toKotlin(javaType: com.pulumi.kubernetes.autoscaling.v2.outputs.MetricSpecPatch): MetricSpecPatch = MetricSpecPatch(
            containerResource = javaType.containerResource().map({ args0 ->
                args0.let({ args0 ->
                    com.pulumi.kubernetes.autoscaling.v2.kotlin.outputs.ContainerResourceMetricSourcePatch.Companion.toKotlin(args0)
                })
            }).orElse(null),
            `external` = javaType.`external`().map({ args0 ->
                args0.let({ args0 ->
                    com.pulumi.kubernetes.autoscaling.v2.kotlin.outputs.ExternalMetricSourcePatch.Companion.toKotlin(args0)
                })
            }).orElse(null),
            `object` = javaType.`object`().map({ args0 ->
                args0.let({ args0 ->
                    com.pulumi.kubernetes.autoscaling.v2.kotlin.outputs.ObjectMetricSourcePatch.Companion.toKotlin(args0)
                })
            }).orElse(null),
            pods = javaType.pods().map({ args0 ->
                args0.let({ args0 ->
                    com.pulumi.kubernetes.autoscaling.v2.kotlin.outputs.PodsMetricSourcePatch.Companion.toKotlin(args0)
                })
            }).orElse(null),
            resource = javaType.resource().map({ args0 ->
                args0.let({ args0 ->
                    com.pulumi.kubernetes.autoscaling.v2.kotlin.outputs.ResourceMetricSourcePatch.Companion.toKotlin(args0)
                })
            }).orElse(null),
            type = javaType.type().map({ args0 -> args0 }).orElse(null),
        )
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy