Class: Kubevirt::V1VirtualMachineInstanceStatus

Inherits:
ApiModelBase
  • Object
show all
Defined in:
lib/kubevirt/models/v1_virtual_machine_instance_status.rb

Overview

VirtualMachineInstanceStatus represents information about the status of a VirtualMachineInstance. Status may trail the actual state of a system.

Defined Under Namespace

Classes: EnumAttributeValidator

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 = {}) ⇒ V1VirtualMachineInstanceStatus

Initializes the object

Parameters:

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

    Model attributes in the form of hash



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
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
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/v1_virtual_machine_instance_status.rb', line 202

def initialize(attributes = {})
  if (!attributes.is_a?(Hash))
    fail ArgumentError, "The input argument (attributes) must be a hash in `Kubevirt::V1VirtualMachineInstanceStatus` 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::V1VirtualMachineInstanceStatus`. 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?(:'vsockcid')
    self.vsockcid = attributes[:'vsockcid']
  end

  if attributes.key?(:'active_pods')
    if (value = attributes[:'active_pods']).is_a?(Hash)
      self.active_pods = value
    end
  end

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

  if attributes.key?(:'conditions')
    if (value = attributes[:'conditions']).is_a?(Array)
      self.conditions = value
    end
  end

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

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

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

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

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

  if attributes.key?(:'interfaces')
    if (value = attributes[:'interfaces']).is_a?(Array)
      self.interfaces = value
    end
  end

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

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

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

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

  if attributes.key?(:'migrated_volumes')
    if (value = attributes[:'migrated_volumes']).is_a?(Array)
      self.migrated_volumes = value
    end
  end

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

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

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

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

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

  if attributes.key?(:'phase_transition_timestamps')
    if (value = attributes[:'phase_transition_timestamps']).is_a?(Array)
      self.phase_transition_timestamps = value
    end
  end

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

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

  if attributes.key?(:'runtime_user')
    self.runtime_user = attributes[:'runtime_user']
  else
    self.runtime_user = 0
  end

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

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

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

  if attributes.key?(:'volume_status')
    if (value = attributes[:'volume_status']).is_a?(Array)
      self.volume_status = value
    end
  end
end

Instance Attribute Details

#active_podsObject

ActivePods is a mapping of pod UID to node name. It is possible for multiple pods to be running for a single VMI during migration.



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

def active_pods
  @active_pods
end

#changed_block_trackingObject

Returns the value of attribute changed_block_tracking.



25
26
27
# File 'lib/kubevirt/models/v1_virtual_machine_instance_status.rb', line 25

def changed_block_tracking
  @changed_block_tracking
end

#conditionsObject

Conditions are specific points in VirtualMachineInstance’s pod runtime.



28
29
30
# File 'lib/kubevirt/models/v1_virtual_machine_instance_status.rb', line 28

def conditions
  @conditions
end

#current_cpu_topologyObject

Returns the value of attribute current_cpu_topology.



30
31
32
# File 'lib/kubevirt/models/v1_virtual_machine_instance_status.rb', line 30

def current_cpu_topology
  @current_cpu_topology
end

#device_statusObject

Returns the value of attribute device_status.



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

def device_status
  @device_status
end

#evacuation_node_nameObject

EvacuationNodeName is used to track the eviction process of a VMI. It stores the name of the node that we want to evacuate. It is meant to be used by KubeVirt core components only and can’t be set or modified by users.



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

def evacuation_node_name
  @evacuation_node_name
end

#fs_freeze_statusObject

FSFreezeStatus indicates whether a freeze operation was requested for the guest filesystem. It will be set to "frozen" if the request was made, or unset otherwise. This does not reflect the actual state of the guest filesystem.



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

def fs_freeze_status
  @fs_freeze_status
end

#guest_os_infoObject

Returns the value of attribute guest_os_info.



40
41
42
# File 'lib/kubevirt/models/v1_virtual_machine_instance_status.rb', line 40

def guest_os_info
  @guest_os_info
end

#interfacesObject

Interfaces represent the details of available network interfaces.



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

def interfaces
  @interfaces
end

#kernel_boot_statusObject

Returns the value of attribute kernel_boot_status.



45
46
47
# File 'lib/kubevirt/models/v1_virtual_machine_instance_status.rb', line 45

def kernel_boot_status
  @kernel_boot_status
end

#launcher_container_image_versionObject

LauncherContainerImageVersion indicates what container image is currently active for the vmi.



48
49
50
# File 'lib/kubevirt/models/v1_virtual_machine_instance_status.rb', line 48

def launcher_container_image_version
  @launcher_container_image_version
end

#machineObject

Returns the value of attribute machine.



50
51
52
# File 'lib/kubevirt/models/v1_virtual_machine_instance_status.rb', line 50

def machine
  @machine
end

#memoryObject

Returns the value of attribute memory.



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

def memory
  @memory
end

#migrated_volumesObject

MigratedVolumes lists the source and destination volumes during the volume migration



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

def migrated_volumes
  @migrated_volumes
end

#migration_methodObject

Represents the method using which the vmi can be migrated: live migration or block migration



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

def migration_method
  @migration_method
end

#migration_stateObject

Returns the value of attribute migration_state.



60
61
62
# File 'lib/kubevirt/models/v1_virtual_machine_instance_status.rb', line 60

def migration_state
  @migration_state
end

#migration_transportObject

This represents the migration transport



63
64
65
# File 'lib/kubevirt/models/v1_virtual_machine_instance_status.rb', line 63

def migration_transport
  @migration_transport
end

#node_nameObject

NodeName is the name where the VirtualMachineInstance is currently running.



66
67
68
# File 'lib/kubevirt/models/v1_virtual_machine_instance_status.rb', line 66

def node_name
  @node_name
end

#phaseObject

Phase is the status of the VirtualMachineInstance in kubernetes world. It is not the VirtualMachineInstance status, but partially correlates to it.



69
70
71
# File 'lib/kubevirt/models/v1_virtual_machine_instance_status.rb', line 69

def phase
  @phase
end

#phase_transition_timestampsObject

PhaseTransitionTimestamp is the timestamp of when the last phase change occurred



72
73
74
# File 'lib/kubevirt/models/v1_virtual_machine_instance_status.rb', line 72

def phase_transition_timestamps
  @phase_transition_timestamps
end

#qos_classObject

The Quality of Service (QOS) classification assigned to the virtual machine instance based on resource requirements See PodQOSClass type for available QOS classes More info: git.k8s.io/community/contributors/design-proposals/node/resource-qos.md Possible enum values: - ‘"BestEffort"` is the BestEffort qos class. - `"Burstable"` is the Burstable qos class. - `"Guaranteed"` is the Guaranteed qos class.



75
76
77
# File 'lib/kubevirt/models/v1_virtual_machine_instance_status.rb', line 75

def qos_class
  @qos_class
end

#reasonObject

A brief CamelCase message indicating details about why the VMI is in this state. e.g. ‘NodeUnresponsive’



78
79
80
# File 'lib/kubevirt/models/v1_virtual_machine_instance_status.rb', line 78

def reason
  @reason
end

#runtime_userObject

RuntimeUser is used to determine what user will be used in launcher



81
82
83
# File 'lib/kubevirt/models/v1_virtual_machine_instance_status.rb', line 81

def runtime_user
  @runtime_user
end

#selinux_contextObject

SELinuxContext is the actual SELinux context of the virt-launcher pod



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

def selinux_context
  @selinux_context
end

#topology_hintsObject

Returns the value of attribute topology_hints.



86
87
88
# File 'lib/kubevirt/models/v1_virtual_machine_instance_status.rb', line 86

def topology_hints
  @topology_hints
end

#virtual_machine_revision_nameObject

VirtualMachineRevisionName is used to get the vm revision of the vmi when doing an online vm snapshot



89
90
91
# File 'lib/kubevirt/models/v1_virtual_machine_instance_status.rb', line 89

def virtual_machine_revision_name
  @virtual_machine_revision_name
end

#volume_statusObject

VolumeStatus contains the statuses of all the volumes



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

def volume_status
  @volume_status
end

#vsockcidObject

VSOCKCID is used to track the allocated VSOCK CID in the VM.



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

def vsockcid
  @vsockcid
end

Class Method Details

.acceptable_attribute_mapObject

Returns attribute mapping this model knows about



151
152
153
# File 'lib/kubevirt/models/v1_virtual_machine_instance_status.rb', line 151

def self.acceptable_attribute_map
  attribute_map
end

.acceptable_attributesObject

Returns all the JSON keys this model knows about



156
157
158
# File 'lib/kubevirt/models/v1_virtual_machine_instance_status.rb', line 156

def self.acceptable_attributes
  acceptable_attribute_map.values
end

.attribute_mapObject

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



117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
# File 'lib/kubevirt/models/v1_virtual_machine_instance_status.rb', line 117

def self.attribute_map
  {
    :'vsockcid' => :'VSOCKCID',
    :'active_pods' => :'activePods',
    :'changed_block_tracking' => :'changedBlockTracking',
    :'conditions' => :'conditions',
    :'current_cpu_topology' => :'currentCPUTopology',
    :'device_status' => :'deviceStatus',
    :'evacuation_node_name' => :'evacuationNodeName',
    :'fs_freeze_status' => :'fsFreezeStatus',
    :'guest_os_info' => :'guestOSInfo',
    :'interfaces' => :'interfaces',
    :'kernel_boot_status' => :'kernelBootStatus',
    :'launcher_container_image_version' => :'launcherContainerImageVersion',
    :'machine' => :'machine',
    :'memory' => :'memory',
    :'migrated_volumes' => :'migratedVolumes',
    :'migration_method' => :'migrationMethod',
    :'migration_state' => :'migrationState',
    :'migration_transport' => :'migrationTransport',
    :'node_name' => :'nodeName',
    :'phase' => :'phase',
    :'phase_transition_timestamps' => :'phaseTransitionTimestamps',
    :'qos_class' => :'qosClass',
    :'reason' => :'reason',
    :'runtime_user' => :'runtimeUser',
    :'selinux_context' => :'selinuxContext',
    :'topology_hints' => :'topologyHints',
    :'virtual_machine_revision_name' => :'virtualMachineRevisionName',
    :'volume_status' => :'volumeStatus'
  }
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



420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
# File 'lib/kubevirt/models/v1_virtual_machine_instance_status.rb', line 420

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



195
196
197
198
# File 'lib/kubevirt/models/v1_virtual_machine_instance_status.rb', line 195

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

.openapi_typesObject

Attribute type mapping.



161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
# File 'lib/kubevirt/models/v1_virtual_machine_instance_status.rb', line 161

def self.openapi_types
  {
    :'vsockcid' => :'Integer',
    :'active_pods' => :'Hash<String, String>',
    :'changed_block_tracking' => :'V1ChangedBlockTrackingStatus',
    :'conditions' => :'Array<V1VirtualMachineInstanceCondition>',
    :'current_cpu_topology' => :'V1CPUTopology',
    :'device_status' => :'V1DeviceStatus',
    :'evacuation_node_name' => :'String',
    :'fs_freeze_status' => :'String',
    :'guest_os_info' => :'V1VirtualMachineInstanceGuestOSInfo',
    :'interfaces' => :'Array<V1VirtualMachineInstanceNetworkInterface>',
    :'kernel_boot_status' => :'V1KernelBootStatus',
    :'launcher_container_image_version' => :'String',
    :'machine' => :'V1Machine',
    :'memory' => :'V1MemoryStatus',
    :'migrated_volumes' => :'Array<V1StorageMigratedVolumeInfo>',
    :'migration_method' => :'String',
    :'migration_state' => :'V1VirtualMachineInstanceMigrationState',
    :'migration_transport' => :'String',
    :'node_name' => :'String',
    :'phase' => :'String',
    :'phase_transition_timestamps' => :'Array<V1VirtualMachineInstancePhaseTransitionTimestamp>',
    :'qos_class' => :'String',
    :'reason' => :'String',
    :'runtime_user' => :'Integer',
    :'selinux_context' => :'String',
    :'topology_hints' => :'V1TopologyHints',
    :'virtual_machine_revision_name' => :'String',
    :'volume_status' => :'Array<V1VolumeStatus>'
  }
end

Instance Method Details

#==(o) ⇒ Object

Checks equality by comparing each attribute.

Parameters:

  • Object (Object)

    to be compared



372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
# File 'lib/kubevirt/models/v1_virtual_machine_instance_status.rb', line 372

def ==(o)
  return true if self.equal?(o)
  self.class == o.class &&
      vsockcid == o.vsockcid &&
      active_pods == o.active_pods &&
      changed_block_tracking == o.changed_block_tracking &&
      conditions == o.conditions &&
      current_cpu_topology == o.current_cpu_topology &&
      device_status == o.device_status &&
      evacuation_node_name == o.evacuation_node_name &&
      fs_freeze_status == o.fs_freeze_status &&
      guest_os_info == o.guest_os_info &&
      interfaces == o.interfaces &&
      kernel_boot_status == o.kernel_boot_status &&
      launcher_container_image_version == o.launcher_container_image_version &&
      machine == o.machine &&
      memory == o.memory &&
      migrated_volumes == o.migrated_volumes &&
      migration_method == o.migration_method &&
      migration_state == o.migration_state &&
      migration_transport == o.migration_transport &&
      node_name == o.node_name &&
      phase == o.phase &&
      phase_transition_timestamps == o.phase_transition_timestamps &&
      qos_class == o.qos_class &&
      reason == o.reason &&
      runtime_user == o.runtime_user &&
      selinux_context == o.selinux_context &&
      topology_hints == o.topology_hints &&
      virtual_machine_revision_name == o.virtual_machine_revision_name &&
      volume_status == o.volume_status
end

#eql?(o) ⇒ Boolean

Parameters:

  • Object (Object)

    to be compared

Returns:

  • (Boolean)

See Also:

  • `==` method


407
408
409
# File 'lib/kubevirt/models/v1_virtual_machine_instance_status.rb', line 407

def eql?(o)
  self == o
end

#hashInteger

Calculates hash code according to all attributes.

Returns:

  • (Integer)

    Hash code



413
414
415
# File 'lib/kubevirt/models/v1_virtual_machine_instance_status.rb', line 413

def hash
  [vsockcid, active_pods, changed_block_tracking, conditions, current_cpu_topology, device_status, evacuation_node_name, fs_freeze_status, guest_os_info, interfaces, kernel_boot_status, launcher_container_image_version, machine, memory, migrated_volumes, migration_method, migration_state, migration_transport, node_name, phase, phase_transition_timestamps, qos_class, reason, runtime_user, selinux_context, topology_hints, virtual_machine_revision_name, volume_status].hash
end

#list_invalid_propertiesObject

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

Returns:

  • Array for valid properties with the reasons



345
346
347
348
349
# File 'lib/kubevirt/models/v1_virtual_machine_instance_status.rb', line 345

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



442
443
444
445
446
447
448
449
450
451
452
453
454
# File 'lib/kubevirt/models/v1_virtual_machine_instance_status.rb', line 442

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



353
354
355
356
357
358
# File 'lib/kubevirt/models/v1_virtual_machine_instance_status.rb', line 353

def valid?
  warn '[DEPRECATED] the `valid?` method is obsolete'
  qos_class_validator = EnumAttributeValidator.new('String', ["BestEffort", "Burstable", "Guaranteed"])
  return false unless qos_class_validator.valid?(@qos_class)
  true
end