Class: Kubevirt::V1VirtualMachineInstanceStatus

Inherits:
Object
  • 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

Constructor Details

#initialize(attributes = {}) ⇒ V1VirtualMachineInstanceStatus

Initializes the object

Parameters:

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

    Model attributes in the form of hash



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
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
# File 'lib/kubevirt/models/v1_virtual_machine_instance_status.rb', line 189

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
  attributes = attributes.each_with_object({}) { |(k, v), h|
    if (!self.class.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: " + self.class.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?(:'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?(:'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

#conditionsObject

Conditions are specific points in VirtualMachineInstance’s pod runtime.



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

def conditions
  @conditions
end

#current_cpu_topologyObject

Returns the value of attribute current_cpu_topology.



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

def current_cpu_topology
  @current_cpu_topology
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.



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

def evacuation_node_name
  @evacuation_node_name
end

#fs_freeze_statusObject

FSFreezeStatus is the state of the fs of the guest it can be either frozen or thawed



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

def fs_freeze_status
  @fs_freeze_status
end

#guest_os_infoObject

Returns the value of attribute guest_os_info.



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

def guest_os_info
  @guest_os_info
end

#interfacesObject

Interfaces represent the details of available network interfaces.



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

def interfaces
  @interfaces
end

#kernel_boot_statusObject

Returns the value of attribute kernel_boot_status.



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

def kernel_boot_status
  @kernel_boot_status
end

#launcher_container_image_versionObject

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



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

def launcher_container_image_version
  @launcher_container_image_version
end

#machineObject

Returns the value of attribute machine.



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

def machine
  @machine
end

#memoryObject

Returns the value of attribute memory.



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

def memory
  @memory
end

#migrated_volumesObject

MigratedVolumes lists the source and destination volumes during the volume migration



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

def migrated_volumes
  @migrated_volumes
end

#migration_methodObject

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



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

def migration_method
  @migration_method
end

#migration_stateObject

Returns the value of attribute migration_state.



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

def migration_state
  @migration_state
end

#migration_transportObject

This represents the migration transport



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

def migration_transport
  @migration_transport
end

#node_nameObject

NodeName is the name where the VirtualMachineInstance is currently running.



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

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.



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

def phase
  @phase
end

#phase_transition_timestampsObject

PhaseTransitionTimestamp is the timestamp of when the last phase change occurred



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

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.



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

def qos_class
  @qos_class
end

#reasonObject

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



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

def reason
  @reason
end

#runtime_userObject

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



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

def runtime_user
  @runtime_user
end

#selinux_contextObject

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



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

def selinux_context
  @selinux_context
end

#topology_hintsObject

Returns the value of attribute topology_hints.



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

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



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

def virtual_machine_revision_name
  @virtual_machine_revision_name
end

#volume_statusObject

VolumeStatus contains the statuses of all the volumes



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

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

._deserialize(type, value) ⇒ Object

Deserializes the data based on type

Parameters:

  • string

    type Data type

  • string

    value Value to be deserialized

Returns:

  • (Object)

    Deserialized data



420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
# File 'lib/kubevirt/models/v1_virtual_machine_instance_status.rb', line 420

def self._deserialize(type, value)
  case type.to_sym
  when :Time
    Time.parse(value)
  when :Date
    Date.parse(value)
  when :String
    value.to_s
  when :Integer
    value.to_i
  when :Float
    value.to_f
  when :Boolean
    if value.to_s =~ /\A(true|t|yes|y|1)\z/i
      true
    else
      false
    end
  when :Object
    # generic object (usually a Hash), return directly
    value
  when /\AArray<(?<inner_type>.+)>\z/
    inner_type = Regexp.last_match[:inner_type]
    value.map { |v| _deserialize(inner_type, v) }
  when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
    k_type = Regexp.last_match[:k_type]
    v_type = Regexp.last_match[:v_type]
    {}.tap do |hash|
      value.each do |k, v|
        hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
      end
    end
  else # model
    # models (e.g. Pet) or oneOf
    klass = Kubevirt.const_get(type)
    klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
  end
end

.acceptable_attributesObject

Returns all the JSON keys this model knows about



145
146
147
# File 'lib/kubevirt/models/v1_virtual_machine_instance_status.rb', line 145

def self.acceptable_attributes
  attribute_map.values
end

.attribute_mapObject

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



113
114
115
116
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
# File 'lib/kubevirt/models/v1_virtual_machine_instance_status.rb', line 113

def self.attribute_map
  {
    :'vsockcid' => :'VSOCKCID',
    :'active_pods' => :'activePods',
    :'conditions' => :'conditions',
    :'current_cpu_topology' => :'currentCPUTopology',
    :'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



396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
# File 'lib/kubevirt/models/v1_virtual_machine_instance_status.rb', line 396

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



182
183
184
185
# File 'lib/kubevirt/models/v1_virtual_machine_instance_status.rb', line 182

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

.openapi_typesObject

Attribute type mapping.



150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
# File 'lib/kubevirt/models/v1_virtual_machine_instance_status.rb', line 150

def self.openapi_types
  {
    :'vsockcid' => :'Integer',
    :'active_pods' => :'Hash<String, String>',
    :'conditions' => :'Array<V1VirtualMachineInstanceCondition>',
    :'current_cpu_topology' => :'V1CPUTopology',
    :'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



350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
# File 'lib/kubevirt/models/v1_virtual_machine_instance_status.rb', line 350

def ==(o)
  return true if self.equal?(o)
  self.class == o.class &&
      vsockcid == o.vsockcid &&
      active_pods == o.active_pods &&
      conditions == o.conditions &&
      current_cpu_topology == o.current_cpu_topology &&
      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

#_to_hash(value) ⇒ Hash

Outputs non-array value in the form of hash For object, use to_hash. Otherwise, just return the value

Parameters:

  • value (Object)

    Any valid value

Returns:

  • (Hash)

    Returns the value in the form of hash



491
492
493
494
495
496
497
498
499
500
501
502
503
# File 'lib/kubevirt/models/v1_virtual_machine_instance_status.rb', line 491

def _to_hash(value)
  if value.is_a?(Array)
    value.compact.map { |v| _to_hash(v) }
  elsif value.is_a?(Hash)
    {}.tap do |hash|
      value.each { |k, v| hash[k] = _to_hash(v) }
    end
  elsif value.respond_to? :to_hash
    value.to_hash
  else
    value
  end
end

#eql?(o) ⇒ Boolean

Parameters:

  • Object (Object)

    to be compared

Returns:

  • (Boolean)

See Also:

  • `==` method


383
384
385
# File 'lib/kubevirt/models/v1_virtual_machine_instance_status.rb', line 383

def eql?(o)
  self == o
end

#hashInteger

Calculates hash code according to all attributes.

Returns:

  • (Integer)

    Hash code



389
390
391
# File 'lib/kubevirt/models/v1_virtual_machine_instance_status.rb', line 389

def hash
  [vsockcid, active_pods, conditions, current_cpu_topology, 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



323
324
325
326
327
# File 'lib/kubevirt/models/v1_virtual_machine_instance_status.rb', line 323

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

#to_bodyHash

to_body is an alias to to_hash (backward compatibility)

Returns:

  • (Hash)

    Returns the object in the form of hash



467
468
469
# File 'lib/kubevirt/models/v1_virtual_machine_instance_status.rb', line 467

def to_body
  to_hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



473
474
475
476
477
478
479
480
481
482
483
484
485
# File 'lib/kubevirt/models/v1_virtual_machine_instance_status.rb', line 473

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

#to_sString

Returns the string representation of the object

Returns:

  • (String)

    String presentation of the object



461
462
463
# File 'lib/kubevirt/models/v1_virtual_machine_instance_status.rb', line 461

def to_s
  to_hash.to_s
end

#valid?Boolean

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

Returns:

  • (Boolean)

    true if the model is valid



331
332
333
334
335
336
# File 'lib/kubevirt/models/v1_virtual_machine_instance_status.rb', line 331

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