/* tslint:disable */ /* eslint-disable */ /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: unversioned * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ import { exists } from '../runtime'; import { IoK8sApiAutoscalingV2CrossVersionObjectReference, IoK8sApiAutoscalingV2CrossVersionObjectReferenceFromJSON, IoK8sApiAutoscalingV2CrossVersionObjectReferenceToJSON, IoK8sApiAutoscalingV2HorizontalPodAutoscalerBehavior, IoK8sApiAutoscalingV2HorizontalPodAutoscalerBehaviorFromJSON, IoK8sApiAutoscalingV2HorizontalPodAutoscalerBehaviorToJSON, IoK8sApiAutoscalingV2MetricSpec, IoK8sApiAutoscalingV2MetricSpecFromJSON, IoK8sApiAutoscalingV2MetricSpecToJSON, } from './'; /** * HorizontalPodAutoscalerSpec describes the desired functionality of the HorizontalPodAutoscaler. * @export * @interface IoK8sApiAutoscalingV2HorizontalPodAutoscalerSpec */ export interface IoK8sApiAutoscalingV2HorizontalPodAutoscalerSpec { /** * * @type {IoK8sApiAutoscalingV2HorizontalPodAutoscalerBehavior} * @memberof IoK8sApiAutoscalingV2HorizontalPodAutoscalerSpec */ behavior?: IoK8sApiAutoscalingV2HorizontalPodAutoscalerBehavior; /** * maxReplicas is the upper limit for the number of replicas to which the autoscaler can scale up. It cannot be less that minReplicas. * @type {number} * @memberof IoK8sApiAutoscalingV2HorizontalPodAutoscalerSpec */ maxReplicas: number; /** * metrics contains the specifications for which to use to calculate the desired replica count (the maximum replica count across all metrics will be used). The desired replica count is calculated multiplying the ratio between the target value and the current value by the current number of pods. Ergo, metrics used must decrease as the pod count is increased, and vice-versa. See the individual metric source types for more information about how each type of metric must respond. If not set, the default metric will be set to 80% average CPU utilization. * @type {Array} * @memberof IoK8sApiAutoscalingV2HorizontalPodAutoscalerSpec */ metrics?: Array; /** * minReplicas is the lower limit for the number of replicas to which the autoscaler can scale down. It defaults to 1 pod. minReplicas is allowed to be 0 if the alpha feature gate HPAScaleToZero is enabled and at least one Object or External metric is configured. Scaling is active as long as at least one metric value is available. * @type {number} * @memberof IoK8sApiAutoscalingV2HorizontalPodAutoscalerSpec */ minReplicas?: number; /** * * @type {IoK8sApiAutoscalingV2CrossVersionObjectReference} * @memberof IoK8sApiAutoscalingV2HorizontalPodAutoscalerSpec */ scaleTargetRef: IoK8sApiAutoscalingV2CrossVersionObjectReference; } export function IoK8sApiAutoscalingV2HorizontalPodAutoscalerSpecFromJSON( json: any, ): IoK8sApiAutoscalingV2HorizontalPodAutoscalerSpec { return IoK8sApiAutoscalingV2HorizontalPodAutoscalerSpecFromJSONTyped(json, false); } export function IoK8sApiAutoscalingV2HorizontalPodAutoscalerSpecFromJSONTyped( json: any, _ignoreDiscriminator: boolean, ): IoK8sApiAutoscalingV2HorizontalPodAutoscalerSpec { if (json === undefined || json === null) { return json; } return { behavior: !exists(json, 'behavior') ? undefined : IoK8sApiAutoscalingV2HorizontalPodAutoscalerBehaviorFromJSON(json['behavior']), maxReplicas: json['maxReplicas'], metrics: !exists(json, 'metrics') ? undefined : (json['metrics'] as Array).map(IoK8sApiAutoscalingV2MetricSpecFromJSON), minReplicas: !exists(json, 'minReplicas') ? undefined : json['minReplicas'], scaleTargetRef: IoK8sApiAutoscalingV2CrossVersionObjectReferenceFromJSON( json['scaleTargetRef'], ), }; } export function IoK8sApiAutoscalingV2HorizontalPodAutoscalerSpecToJSON( value?: IoK8sApiAutoscalingV2HorizontalPodAutoscalerSpec | null, ): any { if (value === undefined) { return undefined; } if (value === null) { return null; } return { behavior: IoK8sApiAutoscalingV2HorizontalPodAutoscalerBehaviorToJSON(value.behavior), maxReplicas: value.maxReplicas, metrics: value.metrics === undefined ? undefined : (value.metrics as Array).map(IoK8sApiAutoscalingV2MetricSpecToJSON), minReplicas: value.minReplicas, scaleTargetRef: IoK8sApiAutoscalingV2CrossVersionObjectReferenceToJSON(value.scaleTargetRef), }; }