Class: Kubevirt::V1beta1DevicePreferences

Inherits:
ApiModelBase show all
Defined in:
lib/kubevirt/models/v1beta1_device_preferences.rb

Overview

DevicePreferences contains various optional Device preferences.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from ApiModelBase

_deserialize, #_to_hash, #to_body, #to_s

Constructor Details

#initialize(attributes = {}) ⇒ V1beta1DevicePreferences

Initializes the object

Parameters:

  • attributes (Hash) (defaults to: {})

    Model attributes in the form of hash



176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
# File 'lib/kubevirt/models/v1beta1_device_preferences.rb', line 176

def initialize(attributes = {})
  if (!attributes.is_a?(Hash))
    fail ArgumentError, "The input argument (attributes) must be a hash in `Kubevirt::V1beta1DevicePreferences` initialize method"
  end

  # check to see if the attribute exists and convert string to symbol for hash key
  acceptable_attribute_map = self.class.acceptable_attribute_map
  attributes = attributes.each_with_object({}) { |(k, v), h|
    if (!acceptable_attribute_map.key?(k.to_sym))
      fail ArgumentError, "`#{k}` is not a valid attribute in `Kubevirt::V1beta1DevicePreferences`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
    end
    h[k.to_sym] = v
  }

  if attributes.key?(:'preferred_autoattach_graphics_device')
    self.preferred_autoattach_graphics_device = attributes[:'preferred_autoattach_graphics_device']
  end

  if attributes.key?(:'preferred_autoattach_input_device')
    self.preferred_autoattach_input_device = attributes[:'preferred_autoattach_input_device']
  end

  if attributes.key?(:'preferred_autoattach_mem_balloon')
    self.preferred_autoattach_mem_balloon = attributes[:'preferred_autoattach_mem_balloon']
  end

  if attributes.key?(:'preferred_autoattach_pod_interface')
    self.preferred_autoattach_pod_interface = attributes[:'preferred_autoattach_pod_interface']
  end

  if attributes.key?(:'preferred_autoattach_serial_console')
    self.preferred_autoattach_serial_console = attributes[:'preferred_autoattach_serial_console']
  end

  if attributes.key?(:'preferred_block_multi_queue')
    self.preferred_block_multi_queue = attributes[:'preferred_block_multi_queue']
  end

  if attributes.key?(:'preferred_cdrom_bus')
    self.preferred_cdrom_bus = attributes[:'preferred_cdrom_bus']
  end

  if attributes.key?(:'preferred_disable_hotplug')
    self.preferred_disable_hotplug = attributes[:'preferred_disable_hotplug']
  end

  if attributes.key?(:'preferred_disk_block_size')
    self.preferred_disk_block_size = attributes[:'preferred_disk_block_size']
  end

  if attributes.key?(:'preferred_disk_bus')
    self.preferred_disk_bus = attributes[:'preferred_disk_bus']
  end

  if attributes.key?(:'preferred_disk_cache')
    self.preferred_disk_cache = attributes[:'preferred_disk_cache']
  end

  if attributes.key?(:'preferred_disk_dedicated_io_thread')
    self.preferred_disk_dedicated_io_thread = attributes[:'preferred_disk_dedicated_io_thread']
  end

  if attributes.key?(:'preferred_disk_io')
    self.preferred_disk_io = attributes[:'preferred_disk_io']
  end

  if attributes.key?(:'preferred_input_bus')
    self.preferred_input_bus = attributes[:'preferred_input_bus']
  end

  if attributes.key?(:'preferred_input_type')
    self.preferred_input_type = attributes[:'preferred_input_type']
  end

  if attributes.key?(:'preferred_interface_masquerade')
    self.preferred_interface_masquerade = attributes[:'preferred_interface_masquerade']
  end

  if attributes.key?(:'preferred_interface_model')
    self.preferred_interface_model = attributes[:'preferred_interface_model']
  end

  if attributes.key?(:'preferred_lun_bus')
    self.preferred_lun_bus = attributes[:'preferred_lun_bus']
  end

  if attributes.key?(:'preferred_network_interface_multi_queue')
    self.preferred_network_interface_multi_queue = attributes[:'preferred_network_interface_multi_queue']
  end

  if attributes.key?(:'preferred_panic_device_model')
    self.preferred_panic_device_model = attributes[:'preferred_panic_device_model']
  end

  if attributes.key?(:'preferred_rng')
    self.preferred_rng = attributes[:'preferred_rng']
  end

  if attributes.key?(:'preferred_sound_model')
    self.preferred_sound_model = attributes[:'preferred_sound_model']
  end

  if attributes.key?(:'preferred_tpm')
    self.preferred_tpm = attributes[:'preferred_tpm']
  end

  if attributes.key?(:'preferred_use_virtio_transitional')
    self.preferred_use_virtio_transitional = attributes[:'preferred_use_virtio_transitional']
  end

  if attributes.key?(:'preferred_video_type')
    self.preferred_video_type = attributes[:'preferred_video_type']
  end

  if attributes.key?(:'preferred_virtual_gpu_options')
    self.preferred_virtual_gpu_options = attributes[:'preferred_virtual_gpu_options']
  end
end

Instance Attribute Details

#preferred_autoattach_graphics_deviceObject

PreferredAutoattachGraphicsDevice optionally defines the preferred value of AutoattachGraphicsDevice



20
21
22
# File 'lib/kubevirt/models/v1beta1_device_preferences.rb', line 20

def preferred_autoattach_graphics_device
  @preferred_autoattach_graphics_device
end

#preferred_autoattach_input_deviceObject

PreferredAutoattachInputDevice optionally defines the preferred value of AutoattachInputDevice



23
24
25
# File 'lib/kubevirt/models/v1beta1_device_preferences.rb', line 23

def preferred_autoattach_input_device
  @preferred_autoattach_input_device
end

#preferred_autoattach_mem_balloonObject

PreferredAutoattachMemBalloon optionally defines the preferred value of AutoattachMemBalloon



26
27
28
# File 'lib/kubevirt/models/v1beta1_device_preferences.rb', line 26

def preferred_autoattach_mem_balloon
  @preferred_autoattach_mem_balloon
end

#preferred_autoattach_pod_interfaceObject

PreferredAutoattachPodInterface optionally defines the preferred value of AutoattachPodInterface



29
30
31
# File 'lib/kubevirt/models/v1beta1_device_preferences.rb', line 29

def preferred_autoattach_pod_interface
  @preferred_autoattach_pod_interface
end

#preferred_autoattach_serial_consoleObject

PreferredAutoattachSerialConsole optionally defines the preferred value of AutoattachSerialConsole



32
33
34
# File 'lib/kubevirt/models/v1beta1_device_preferences.rb', line 32

def preferred_autoattach_serial_console
  @preferred_autoattach_serial_console
end

#preferred_block_multi_queueObject

PreferredBlockMultiQueue optionally enables the vhost multiqueue feature for virtio disks.



35
36
37
# File 'lib/kubevirt/models/v1beta1_device_preferences.rb', line 35

def preferred_block_multi_queue
  @preferred_block_multi_queue
end

#preferred_cdrom_busObject

PreferredCdromBus optionally defines the preferred bus for Cdrom Disk devices.



38
39
40
# File 'lib/kubevirt/models/v1beta1_device_preferences.rb', line 38

def preferred_cdrom_bus
  @preferred_cdrom_bus
end

#preferred_disable_hotplugObject

PreferredDisableHotplug optionally defines the preferred value of DisableHotplug



41
42
43
# File 'lib/kubevirt/models/v1beta1_device_preferences.rb', line 41

def preferred_disable_hotplug
  @preferred_disable_hotplug
end

#preferred_disk_block_sizeObject

Returns the value of attribute preferred_disk_block_size.



43
44
45
# File 'lib/kubevirt/models/v1beta1_device_preferences.rb', line 43

def preferred_disk_block_size
  @preferred_disk_block_size
end

#preferred_disk_busObject

PreferredDiskBus optionally defines the preferred bus for Disk Disk devices.



46
47
48
# File 'lib/kubevirt/models/v1beta1_device_preferences.rb', line 46

def preferred_disk_bus
  @preferred_disk_bus
end

#preferred_disk_cacheObject

PreferredCache optionally defines the DriverCache to be used by Disk devices.



49
50
51
# File 'lib/kubevirt/models/v1beta1_device_preferences.rb', line 49

def preferred_disk_cache
  @preferred_disk_cache
end

#preferred_disk_dedicated_io_threadObject

PreferredDedicatedIoThread optionally enables dedicated IO threads for Disk devices using the virtio bus.



52
53
54
# File 'lib/kubevirt/models/v1beta1_device_preferences.rb', line 52

def preferred_disk_dedicated_io_thread
  @preferred_disk_dedicated_io_thread
end

#preferred_disk_ioObject

PreferredIo optionally defines the QEMU disk IO mode to be used by Disk devices.



55
56
57
# File 'lib/kubevirt/models/v1beta1_device_preferences.rb', line 55

def preferred_disk_io
  @preferred_disk_io
end

#preferred_input_busObject

PreferredInputBus optionally defines the preferred bus for Input devices.



58
59
60
# File 'lib/kubevirt/models/v1beta1_device_preferences.rb', line 58

def preferred_input_bus
  @preferred_input_bus
end

#preferred_input_typeObject

PreferredInputType optionally defines the preferred type for Input devices.



61
62
63
# File 'lib/kubevirt/models/v1beta1_device_preferences.rb', line 61

def preferred_input_type
  @preferred_input_type
end

#preferred_interface_masqueradeObject

InterfaceMasquerade connects to a given network using netfilter rules to nat the traffic.



64
65
66
# File 'lib/kubevirt/models/v1beta1_device_preferences.rb', line 64

def preferred_interface_masquerade
  @preferred_interface_masquerade
end

#preferred_interface_modelObject

PreferredInterfaceModel optionally defines the preferred model to be used by Interface devices.



67
68
69
# File 'lib/kubevirt/models/v1beta1_device_preferences.rb', line 67

def preferred_interface_model
  @preferred_interface_model
end

#preferred_lun_busObject

PreferredLunBus optionally defines the preferred bus for Lun Disk devices.



70
71
72
# File 'lib/kubevirt/models/v1beta1_device_preferences.rb', line 70

def preferred_lun_bus
  @preferred_lun_bus
end

#preferred_network_interface_multi_queueObject

PreferredNetworkInterfaceMultiQueue optionally enables the vhost multiqueue feature for virtio interfaces.



73
74
75
# File 'lib/kubevirt/models/v1beta1_device_preferences.rb', line 73

def preferred_network_interface_multi_queue
  @preferred_network_interface_multi_queue
end

#preferred_panic_device_modelObject

PreferredPanicDeviceModel optionally defines the preferred panic device model to use with panic devices.



76
77
78
# File 'lib/kubevirt/models/v1beta1_device_preferences.rb', line 76

def preferred_panic_device_model
  @preferred_panic_device_model
end

#preferred_rngObject

Rng represents the random device passed from host



79
80
81
# File 'lib/kubevirt/models/v1beta1_device_preferences.rb', line 79

def preferred_rng
  @preferred_rng
end

#preferred_sound_modelObject

PreferredSoundModel optionally defines the preferred model for Sound devices.



82
83
84
# File 'lib/kubevirt/models/v1beta1_device_preferences.rb', line 82

def preferred_sound_model
  @preferred_sound_model
end

#preferred_tpmObject

Returns the value of attribute preferred_tpm.



84
85
86
# File 'lib/kubevirt/models/v1beta1_device_preferences.rb', line 84

def preferred_tpm
  @preferred_tpm
end

#preferred_use_virtio_transitionalObject

PreferredUseVirtioTransitional optionally defines the preferred value of UseVirtioTransitional



87
88
89
# File 'lib/kubevirt/models/v1beta1_device_preferences.rb', line 87

def preferred_use_virtio_transitional
  @preferred_use_virtio_transitional
end

#preferred_video_typeObject

PreferredVideoType optionally defines the preferred type for Video devices.



90
91
92
# File 'lib/kubevirt/models/v1beta1_device_preferences.rb', line 90

def preferred_video_type
  @preferred_video_type
end

#preferred_virtual_gpu_optionsObject

Returns the value of attribute preferred_virtual_gpu_options.



92
93
94
# File 'lib/kubevirt/models/v1beta1_device_preferences.rb', line 92

def preferred_virtual_gpu_options
  @preferred_virtual_gpu_options
end

Class Method Details

.acceptable_attribute_mapObject

Returns attribute mapping this model knows about



127
128
129
# File 'lib/kubevirt/models/v1beta1_device_preferences.rb', line 127

def self.acceptable_attribute_map
  attribute_map
end

.acceptable_attributesObject

Returns all the JSON keys this model knows about



132
133
134
# File 'lib/kubevirt/models/v1beta1_device_preferences.rb', line 132

def self.acceptable_attributes
  acceptable_attribute_map.values
end

.attribute_mapObject

Attribute mapping from ruby-style variable name to JSON key.



95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
# File 'lib/kubevirt/models/v1beta1_device_preferences.rb', line 95

def self.attribute_map
  {
    :'preferred_autoattach_graphics_device' => :'preferredAutoattachGraphicsDevice',
    :'preferred_autoattach_input_device' => :'preferredAutoattachInputDevice',
    :'preferred_autoattach_mem_balloon' => :'preferredAutoattachMemBalloon',
    :'preferred_autoattach_pod_interface' => :'preferredAutoattachPodInterface',
    :'preferred_autoattach_serial_console' => :'preferredAutoattachSerialConsole',
    :'preferred_block_multi_queue' => :'preferredBlockMultiQueue',
    :'preferred_cdrom_bus' => :'preferredCdromBus',
    :'preferred_disable_hotplug' => :'preferredDisableHotplug',
    :'preferred_disk_block_size' => :'preferredDiskBlockSize',
    :'preferred_disk_bus' => :'preferredDiskBus',
    :'preferred_disk_cache' => :'preferredDiskCache',
    :'preferred_disk_dedicated_io_thread' => :'preferredDiskDedicatedIoThread',
    :'preferred_disk_io' => :'preferredDiskIO',
    :'preferred_input_bus' => :'preferredInputBus',
    :'preferred_input_type' => :'preferredInputType',
    :'preferred_interface_masquerade' => :'preferredInterfaceMasquerade',
    :'preferred_interface_model' => :'preferredInterfaceModel',
    :'preferred_lun_bus' => :'preferredLunBus',
    :'preferred_network_interface_multi_queue' => :'preferredNetworkInterfaceMultiQueue',
    :'preferred_panic_device_model' => :'preferredPanicDeviceModel',
    :'preferred_rng' => :'preferredRng',
    :'preferred_sound_model' => :'preferredSoundModel',
    :'preferred_tpm' => :'preferredTPM',
    :'preferred_use_virtio_transitional' => :'preferredUseVirtioTransitional',
    :'preferred_video_type' => :'preferredVideoType',
    :'preferred_virtual_gpu_options' => :'preferredVirtualGPUOptions'
  }
end

.build_from_hash(attributes) ⇒ Object

Builds the object from hash

Parameters:

  • attributes (Hash)

    Model attributes in the form of hash

Returns:

  • (Object)

    Returns the model itself



358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
# File 'lib/kubevirt/models/v1beta1_device_preferences.rb', line 358

def self.build_from_hash(attributes)
  return nil unless attributes.is_a?(Hash)
  attributes = attributes.transform_keys(&:to_sym)
  transformed_hash = {}
  openapi_types.each_pair do |key, type|
    if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
      transformed_hash["#{key}"] = nil
    elsif type =~ /\AArray<(.*)>/i
      # check to ensure the input is an array given that the attribute
      # is documented as an array but the input is not
      if attributes[attribute_map[key]].is_a?(Array)
        transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
      end
    elsif !attributes[attribute_map[key]].nil?
      transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
    end
  end
  new(transformed_hash)
end

.openapi_nullableObject

List of attributes with nullable: true



169
170
171
172
# File 'lib/kubevirt/models/v1beta1_device_preferences.rb', line 169

def self.openapi_nullable
  Set.new([
  ])
end

.openapi_typesObject

Attribute type mapping.



137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
# File 'lib/kubevirt/models/v1beta1_device_preferences.rb', line 137

def self.openapi_types
  {
    :'preferred_autoattach_graphics_device' => :'Boolean',
    :'preferred_autoattach_input_device' => :'Boolean',
    :'preferred_autoattach_mem_balloon' => :'Boolean',
    :'preferred_autoattach_pod_interface' => :'Boolean',
    :'preferred_autoattach_serial_console' => :'Boolean',
    :'preferred_block_multi_queue' => :'Boolean',
    :'preferred_cdrom_bus' => :'String',
    :'preferred_disable_hotplug' => :'Boolean',
    :'preferred_disk_block_size' => :'V1BlockSize',
    :'preferred_disk_bus' => :'String',
    :'preferred_disk_cache' => :'String',
    :'preferred_disk_dedicated_io_thread' => :'Boolean',
    :'preferred_disk_io' => :'String',
    :'preferred_input_bus' => :'String',
    :'preferred_input_type' => :'String',
    :'preferred_interface_masquerade' => :'Object',
    :'preferred_interface_model' => :'String',
    :'preferred_lun_bus' => :'String',
    :'preferred_network_interface_multi_queue' => :'Boolean',
    :'preferred_panic_device_model' => :'String',
    :'preferred_rng' => :'Object',
    :'preferred_sound_model' => :'String',
    :'preferred_tpm' => :'V1TPMDevice',
    :'preferred_use_virtio_transitional' => :'Boolean',
    :'preferred_video_type' => :'String',
    :'preferred_virtual_gpu_options' => :'V1VGPUOptions'
  }
end

Instance Method Details

#==(o) ⇒ Object

Checks equality by comparing each attribute.

Parameters:

  • Object (Object)

    to be compared



312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
# File 'lib/kubevirt/models/v1beta1_device_preferences.rb', line 312

def ==(o)
  return true if self.equal?(o)
  self.class == o.class &&
      preferred_autoattach_graphics_device == o.preferred_autoattach_graphics_device &&
      preferred_autoattach_input_device == o.preferred_autoattach_input_device &&
      preferred_autoattach_mem_balloon == o.preferred_autoattach_mem_balloon &&
      preferred_autoattach_pod_interface == o.preferred_autoattach_pod_interface &&
      preferred_autoattach_serial_console == o.preferred_autoattach_serial_console &&
      preferred_block_multi_queue == o.preferred_block_multi_queue &&
      preferred_cdrom_bus == o.preferred_cdrom_bus &&
      preferred_disable_hotplug == o.preferred_disable_hotplug &&
      preferred_disk_block_size == o.preferred_disk_block_size &&
      preferred_disk_bus == o.preferred_disk_bus &&
      preferred_disk_cache == o.preferred_disk_cache &&
      preferred_disk_dedicated_io_thread == o.preferred_disk_dedicated_io_thread &&
      preferred_disk_io == o.preferred_disk_io &&
      preferred_input_bus == o.preferred_input_bus &&
      preferred_input_type == o.preferred_input_type &&
      preferred_interface_masquerade == o.preferred_interface_masquerade &&
      preferred_interface_model == o.preferred_interface_model &&
      preferred_lun_bus == o.preferred_lun_bus &&
      preferred_network_interface_multi_queue == o.preferred_network_interface_multi_queue &&
      preferred_panic_device_model == o.preferred_panic_device_model &&
      preferred_rng == o.preferred_rng &&
      preferred_sound_model == o.preferred_sound_model &&
      preferred_tpm == o.preferred_tpm &&
      preferred_use_virtio_transitional == o.preferred_use_virtio_transitional &&
      preferred_video_type == o.preferred_video_type &&
      preferred_virtual_gpu_options == o.preferred_virtual_gpu_options
end

#eql?(o) ⇒ Boolean

Parameters:

  • Object (Object)

    to be compared

Returns:

  • (Boolean)

See Also:

  • `==` method


345
346
347
# File 'lib/kubevirt/models/v1beta1_device_preferences.rb', line 345

def eql?(o)
  self == o
end

#hashInteger

Calculates hash code according to all attributes.

Returns:

  • (Integer)

    Hash code



351
352
353
# File 'lib/kubevirt/models/v1beta1_device_preferences.rb', line 351

def hash
  [preferred_autoattach_graphics_device, preferred_autoattach_input_device, preferred_autoattach_mem_balloon, preferred_autoattach_pod_interface, preferred_autoattach_serial_console, preferred_block_multi_queue, preferred_cdrom_bus, preferred_disable_hotplug, preferred_disk_block_size, preferred_disk_bus, preferred_disk_cache, preferred_disk_dedicated_io_thread, preferred_disk_io, preferred_input_bus, preferred_input_type, preferred_interface_masquerade, preferred_interface_model, preferred_lun_bus, preferred_network_interface_multi_queue, preferred_panic_device_model, preferred_rng, preferred_sound_model, preferred_tpm, preferred_use_virtio_transitional, preferred_video_type, preferred_virtual_gpu_options].hash
end

#list_invalid_propertiesObject

Show invalid properties with the reasons. Usually used together with valid?

Returns:

  • Array for valid properties with the reasons



297
298
299
300
301
# File 'lib/kubevirt/models/v1beta1_device_preferences.rb', line 297

def list_invalid_properties
  warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
  invalid_properties = Array.new
  invalid_properties
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



380
381
382
383
384
385
386
387
388
389
390
391
392
# File 'lib/kubevirt/models/v1beta1_device_preferences.rb', line 380

def to_hash
  hash = {}
  self.class.attribute_map.each_pair do |attr, param|
    value = self.send(attr)
    if value.nil?
      is_nullable = self.class.openapi_nullable.include?(attr)
      next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
    end

    hash[param] = _to_hash(value)
  end
  hash
end

#valid?Boolean

Check to see if the all the properties in the model are valid

Returns:

  • (Boolean)

    true if the model is valid



305
306
307
308
# File 'lib/kubevirt/models/v1beta1_device_preferences.rb', line 305

def valid?
  warn '[DEPRECATED] the `valid?` method is obsolete'
  true
end