/* 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 { V1CPUFeature, V1CPUFeatureFromJSON, V1CPUFeatureToJSON, V1NUMA, V1NUMAFromJSON, V1NUMAToJSON, V1Realtime, V1RealtimeFromJSON, V1RealtimeToJSON, } from './'; /** * CPU allows specifying the CPU topology. * @export * @interface V1CPU */ export interface V1CPU { /** * Cores specifies the number of cores inside the vmi. Must be a value greater or equal 1. * @type {number} * @memberof V1CPU */ cores?: number; /** * DedicatedCPUPlacement requests the scheduler to place the VirtualMachineInstance on a node with enough dedicated pCPUs and pin the vCPUs to it. * @type {boolean} * @memberof V1CPU */ dedicatedCpuPlacement?: boolean; /** * Features specifies the CPU features list inside the VMI. * @type {Array} * @memberof V1CPU */ features?: Array; /** * IsolateEmulatorThread requests one more dedicated pCPU to be allocated for the VMI to place the emulator thread on it. * @type {boolean} * @memberof V1CPU */ isolateEmulatorThread?: boolean; /** * MaxSockets specifies the maximum amount of sockets that can be hotplugged * @type {number} * @memberof V1CPU */ maxSockets?: number; /** * Model specifies the CPU model inside the VMI. List of available models https://github.com/libvirt/libvirt/tree/master/src/cpu_map. It is possible to specify special cases like "host-passthrough" to get the same CPU as the node and "host-model" to get CPU closest to the node one. Defaults to host-model. * @type {string} * @memberof V1CPU */ model?: string; /** * * @type {V1NUMA} * @memberof V1CPU */ numa?: V1NUMA; /** * * @type {V1Realtime} * @memberof V1CPU */ realtime?: V1Realtime; /** * Sockets specifies the number of sockets inside the vmi. Must be a value greater or equal 1. * @type {number} * @memberof V1CPU */ sockets?: number; /** * Threads specifies the number of threads inside the vmi. Must be a value greater or equal 1. * @type {number} * @memberof V1CPU */ threads?: number; } export function V1CPUFromJSON(json: any): V1CPU { return V1CPUFromJSONTyped(json, false); } export function V1CPUFromJSONTyped(json: any, _ignoreDiscriminator: boolean): V1CPU { if (json === undefined || json === null) { return json; } return { cores: !exists(json, 'cores') ? undefined : json['cores'], dedicatedCpuPlacement: !exists(json, 'dedicatedCpuPlacement') ? undefined : json['dedicatedCpuPlacement'], features: !exists(json, 'features') ? undefined : (json['features'] as Array).map(V1CPUFeatureFromJSON), isolateEmulatorThread: !exists(json, 'isolateEmulatorThread') ? undefined : json['isolateEmulatorThread'], maxSockets: !exists(json, 'maxSockets') ? undefined : json['maxSockets'], model: !exists(json, 'model') ? undefined : json['model'], numa: !exists(json, 'numa') ? undefined : V1NUMAFromJSON(json['numa']), realtime: !exists(json, 'realtime') ? undefined : V1RealtimeFromJSON(json['realtime']), sockets: !exists(json, 'sockets') ? undefined : json['sockets'], threads: !exists(json, 'threads') ? undefined : json['threads'], }; } export function V1CPUToJSON(value?: V1CPU | null): any { if (value === undefined) { return undefined; } if (value === null) { return null; } return { cores: value.cores, dedicatedCpuPlacement: value.dedicatedCpuPlacement, features: value.features === undefined ? undefined : (value.features as Array).map(V1CPUFeatureToJSON), isolateEmulatorThread: value.isolateEmulatorThread, maxSockets: value.maxSockets, model: value.model, numa: V1NUMAToJSON(value.numa), realtime: V1RealtimeToJSON(value.realtime), sockets: value.sockets, threads: value.threads, }; }