Class: Kubevirt::V1VirtualMachineStatus

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

Overview

VirtualMachineStatus represents the status returned by the controller to describe how the VirtualMachine is doing

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

Initializes the object

Parameters:

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

    Model attributes in the form of hash



133
134
135
136
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
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
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
# File 'lib/kubevirt/models/v1_virtual_machine_status.rb', line 133

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Instance Attribute Details

#changed_block_trackingObject

Returns the value of attribute changed_block_tracking.



19
20
21
# File 'lib/kubevirt/models/v1_virtual_machine_status.rb', line 19

def changed_block_tracking
  @changed_block_tracking
end

#conditionsObject

Hold the state information of the VirtualMachine and its VirtualMachineInstance



22
23
24
# File 'lib/kubevirt/models/v1_virtual_machine_status.rb', line 22

def conditions
  @conditions
end

#createdObject

Created indicates if the virtual machine is created in the cluster



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

def created
  @created
end

#desired_generationObject

DesiredGeneration is the generation which is desired for the VMI. This will be used in comparisons with ObservedGeneration to understand when the VMI is out of sync. This will be changed at the same time as ObservedGeneration to remove errors which could occur if Generation is updated through an Update() before ObservedGeneration in Status.



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

def desired_generation
  @desired_generation
end

#instancetype_refObject

Returns the value of attribute instancetype_ref.



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

def instancetype_ref
  @instancetype_ref
end

#memory_dump_requestObject

Returns the value of attribute memory_dump_request.



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

def memory_dump_request
  @memory_dump_request
end

#observed_generationObject

ObservedGeneration is the generation observed by the vmi when started.



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

def observed_generation
  @observed_generation
end

#preference_refObject

Returns the value of attribute preference_ref.



37
38
39
# File 'lib/kubevirt/models/v1_virtual_machine_status.rb', line 37

def preference_ref
  @preference_ref
end

#printable_statusObject

PrintableStatus is a human readable, high-level representation of the status of the virtual machine



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

def printable_status
  @printable_status
end

#readyObject

Ready indicates if the virtual machine is running and ready



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

def ready
  @ready
end

#restore_in_progressObject

RestoreInProgress is the name of the VirtualMachineRestore currently executing



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

def restore_in_progress
  @restore_in_progress
end

#run_strategyObject

RunStrategy tracks the last recorded RunStrategy used by the VM. This is needed to correctly process the next strategy (for now only the RerunOnFailure)



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

def run_strategy
  @run_strategy
end

#snapshot_in_progressObject

SnapshotInProgress is the name of the VirtualMachineSnapshot currently executing



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

def snapshot_in_progress
  @snapshot_in_progress
end

#start_failureObject

Returns the value of attribute start_failure.



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

def start_failure
  @start_failure
end

#state_change_requestsObject

StateChangeRequests indicates a list of actions that should be taken on a VMI e.g. stop a specific VMI then start a new one.



57
58
59
# File 'lib/kubevirt/models/v1_virtual_machine_status.rb', line 57

def state_change_requests
  @state_change_requests
end

#volume_requestsObject

VolumeRequests indicates a list of volumes add or remove from the VMI template and hotplug on an active running VMI.



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

def volume_requests
  @volume_requests
end

#volume_snapshot_statusesObject

VolumeSnapshotStatuses indicates a list of statuses whether snapshotting is supported by each volume.



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

def volume_snapshot_statuses
  @volume_snapshot_statuses
end

#volume_update_stateObject

Returns the value of attribute volume_update_state.



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

def volume_update_state
  @volume_update_state
end

Class Method Details

.acceptable_attribute_mapObject

Returns attribute mapping this model knows about



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

def self.acceptable_attribute_map
  attribute_map
end

.acceptable_attributesObject

Returns all the JSON keys this model knows about



97
98
99
# File 'lib/kubevirt/models/v1_virtual_machine_status.rb', line 97

def self.acceptable_attributes
  acceptable_attribute_map.values
end

.attribute_mapObject

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



68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
# File 'lib/kubevirt/models/v1_virtual_machine_status.rb', line 68

def self.attribute_map
  {
    :'changed_block_tracking' => :'changedBlockTracking',
    :'conditions' => :'conditions',
    :'created' => :'created',
    :'desired_generation' => :'desiredGeneration',
    :'instancetype_ref' => :'instancetypeRef',
    :'memory_dump_request' => :'memoryDumpRequest',
    :'observed_generation' => :'observedGeneration',
    :'preference_ref' => :'preferenceRef',
    :'printable_status' => :'printableStatus',
    :'ready' => :'ready',
    :'restore_in_progress' => :'restoreInProgress',
    :'run_strategy' => :'runStrategy',
    :'snapshot_in_progress' => :'snapshotInProgress',
    :'start_failure' => :'startFailure',
    :'state_change_requests' => :'stateChangeRequests',
    :'volume_requests' => :'volumeRequests',
    :'volume_snapshot_statuses' => :'volumeSnapshotStatuses',
    :'volume_update_state' => :'volumeUpdateState'
  }
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



283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
# File 'lib/kubevirt/models/v1_virtual_machine_status.rb', line 283

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



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

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

.openapi_typesObject

Attribute type mapping.



102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
# File 'lib/kubevirt/models/v1_virtual_machine_status.rb', line 102

def self.openapi_types
  {
    :'changed_block_tracking' => :'V1ChangedBlockTrackingStatus',
    :'conditions' => :'Array<V1VirtualMachineCondition>',
    :'created' => :'Boolean',
    :'desired_generation' => :'Integer',
    :'instancetype_ref' => :'V1InstancetypeStatusRef',
    :'memory_dump_request' => :'V1VirtualMachineMemoryDumpRequest',
    :'observed_generation' => :'Integer',
    :'preference_ref' => :'V1InstancetypeStatusRef',
    :'printable_status' => :'String',
    :'ready' => :'Boolean',
    :'restore_in_progress' => :'String',
    :'run_strategy' => :'String',
    :'snapshot_in_progress' => :'String',
    :'start_failure' => :'V1VirtualMachineStartFailure',
    :'state_change_requests' => :'Array<V1VirtualMachineStateChangeRequest>',
    :'volume_requests' => :'Array<V1VirtualMachineVolumeRequest>',
    :'volume_snapshot_statuses' => :'Array<V1VolumeSnapshotStatus>',
    :'volume_update_state' => :'V1VolumeUpdateState'
  }
end

Instance Method Details

#==(o) ⇒ Object

Checks equality by comparing each attribute.

Parameters:

  • Object (Object)

    to be compared



245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
# File 'lib/kubevirt/models/v1_virtual_machine_status.rb', line 245

def ==(o)
  return true if self.equal?(o)
  self.class == o.class &&
      changed_block_tracking == o.changed_block_tracking &&
      conditions == o.conditions &&
      created == o.created &&
      desired_generation == o.desired_generation &&
      instancetype_ref == o.instancetype_ref &&
      memory_dump_request == o.memory_dump_request &&
      observed_generation == o.observed_generation &&
      preference_ref == o.preference_ref &&
      printable_status == o.printable_status &&
      ready == o.ready &&
      restore_in_progress == o.restore_in_progress &&
      run_strategy == o.run_strategy &&
      snapshot_in_progress == o.snapshot_in_progress &&
      start_failure == o.start_failure &&
      state_change_requests == o.state_change_requests &&
      volume_requests == o.volume_requests &&
      volume_snapshot_statuses == o.volume_snapshot_statuses &&
      volume_update_state == o.volume_update_state
end

#eql?(o) ⇒ Boolean

Parameters:

  • Object (Object)

    to be compared

Returns:

  • (Boolean)

See Also:

  • `==` method


270
271
272
# File 'lib/kubevirt/models/v1_virtual_machine_status.rb', line 270

def eql?(o)
  self == o
end

#hashInteger

Calculates hash code according to all attributes.

Returns:

  • (Integer)

    Hash code



276
277
278
# File 'lib/kubevirt/models/v1_virtual_machine_status.rb', line 276

def hash
  [changed_block_tracking, conditions, created, desired_generation, instancetype_ref, memory_dump_request, observed_generation, preference_ref, printable_status, ready, restore_in_progress, run_strategy, snapshot_in_progress, start_failure, state_change_requests, volume_requests, volume_snapshot_statuses, volume_update_state].hash
end

#list_invalid_propertiesObject

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

Returns:

  • Array for valid properties with the reasons



230
231
232
233
234
# File 'lib/kubevirt/models/v1_virtual_machine_status.rb', line 230

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



305
306
307
308
309
310
311
312
313
314
315
316
317
# File 'lib/kubevirt/models/v1_virtual_machine_status.rb', line 305

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



238
239
240
241
# File 'lib/kubevirt/models/v1_virtual_machine_status.rb', line 238

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