/* tslint:disable */ /* eslint-disable */ /** * KubeVirt API * This is KubeVirt API an add-on for Kubernetes. * * The version of the OpenAPI document: 1.0.0 * Contact: kubevirt-dev@googlegroups.com * * 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 { V1GPU, V1GPUFromJSON, V1GPUToJSON, V1HostDevice, V1HostDeviceFromJSON, V1HostDeviceToJSON, V1LaunchSecurity, V1LaunchSecurityFromJSON, V1LaunchSecurityToJSON, V1beta1CPUInstancetype, V1beta1CPUInstancetypeFromJSON, V1beta1CPUInstancetypeToJSON, V1beta1MemoryInstancetype, V1beta1MemoryInstancetypeFromJSON, V1beta1MemoryInstancetypeToJSON, } from './'; /** * VirtualMachineInstancetypeSpec is a description of the VirtualMachineInstancetype or VirtualMachineClusterInstancetype. * * CPU and Memory are required attributes with both requiring that their Guest attribute is defined, ensuring a number of vCPUs and amount of RAM is always provided by each instancetype. * @export * @interface V1beta1VirtualMachineInstancetypeSpec */ export interface V1beta1VirtualMachineInstancetypeSpec { /** * Optionally defines the required Annotations to be used by the instance type and applied to the VirtualMachineInstance * @type {{ [key: string]: string; }} * @memberof V1beta1VirtualMachineInstancetypeSpec */ annotations?: { [key: string]: string }; /** * * @type {V1beta1CPUInstancetype} * @memberof V1beta1VirtualMachineInstancetypeSpec */ cpu: V1beta1CPUInstancetype; /** * Optionally defines any GPU devices associated with the instancetype. * @type {Array} * @memberof V1beta1VirtualMachineInstancetypeSpec */ gpus?: Array; /** * Optionally defines any HostDevices associated with the instancetype. * @type {Array} * @memberof V1beta1VirtualMachineInstancetypeSpec */ hostDevices?: Array; /** * Optionally defines the IOThreadsPolicy to be used by the instancetype. * @type {string} * @memberof V1beta1VirtualMachineInstancetypeSpec */ ioThreadsPolicy?: string; /** * * @type {V1LaunchSecurity} * @memberof V1beta1VirtualMachineInstancetypeSpec */ launchSecurity?: V1LaunchSecurity; /** * * @type {V1beta1MemoryInstancetype} * @memberof V1beta1VirtualMachineInstancetypeSpec */ memory: V1beta1MemoryInstancetype; /** * NodeSelector is a selector which must be true for the vmi to fit on a node. Selector which must match a node's labels for the vmi to be scheduled on that node. More info: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/ * * NodeSelector is the name of the custom node selector for the instancetype. * @type {{ [key: string]: string; }} * @memberof V1beta1VirtualMachineInstancetypeSpec */ nodeSelector?: { [key: string]: string }; /** * If specified, the VMI will be dispatched by specified scheduler. If not specified, the VMI will be dispatched by default scheduler. * * SchedulerName is the name of the custom K8s scheduler for the instancetype. * @type {string} * @memberof V1beta1VirtualMachineInstancetypeSpec */ schedulerName?: string; } export function V1beta1VirtualMachineInstancetypeSpecFromJSON( json: any, ): V1beta1VirtualMachineInstancetypeSpec { return V1beta1VirtualMachineInstancetypeSpecFromJSONTyped(json, false); } export function V1beta1VirtualMachineInstancetypeSpecFromJSONTyped( json: any, _ignoreDiscriminator: boolean, ): V1beta1VirtualMachineInstancetypeSpec { if (json === undefined || json === null) { return json; } return { annotations: !exists(json, 'annotations') ? undefined : json['annotations'], cpu: V1beta1CPUInstancetypeFromJSON(json['cpu']), gpus: !exists(json, 'gpus') ? undefined : (json['gpus'] as Array).map(V1GPUFromJSON), hostDevices: !exists(json, 'hostDevices') ? undefined : (json['hostDevices'] as Array).map(V1HostDeviceFromJSON), ioThreadsPolicy: !exists(json, 'ioThreadsPolicy') ? undefined : json['ioThreadsPolicy'], launchSecurity: !exists(json, 'launchSecurity') ? undefined : V1LaunchSecurityFromJSON(json['launchSecurity']), memory: V1beta1MemoryInstancetypeFromJSON(json['memory']), nodeSelector: !exists(json, 'nodeSelector') ? undefined : json['nodeSelector'], schedulerName: !exists(json, 'schedulerName') ? undefined : json['schedulerName'], }; } export function V1beta1VirtualMachineInstancetypeSpecToJSON( value?: V1beta1VirtualMachineInstancetypeSpec | null, ): any { if (value === undefined) { return undefined; } if (value === null) { return null; } return { annotations: value.annotations, cpu: V1beta1CPUInstancetypeToJSON(value.cpu), gpus: value.gpus === undefined ? undefined : (value.gpus as Array).map(V1GPUToJSON), hostDevices: value.hostDevices === undefined ? undefined : (value.hostDevices as Array).map(V1HostDeviceToJSON), ioThreadsPolicy: value.ioThreadsPolicy, launchSecurity: V1LaunchSecurityToJSON(value.launchSecurity), memory: V1beta1MemoryInstancetypeToJSON(value.memory), nodeSelector: value.nodeSelector, schedulerName: value.schedulerName, }; }