Class: Kubevirt::V1VirtualMachineStatus
- Inherits:
-
ApiModelBase
- Object
- ApiModelBase
- Kubevirt::V1VirtualMachineStatus
- 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
-
#changed_block_tracking ⇒ Object
Returns the value of attribute changed_block_tracking.
-
#conditions ⇒ Object
Hold the state information of the VirtualMachine and its VirtualMachineInstance.
-
#created ⇒ Object
Created indicates if the virtual machine is created in the cluster.
-
#desired_generation ⇒ Object
DesiredGeneration is the generation which is desired for the VMI.
-
#instancetype_ref ⇒ Object
Returns the value of attribute instancetype_ref.
-
#memory_dump_request ⇒ Object
Returns the value of attribute memory_dump_request.
-
#observed_generation ⇒ Object
ObservedGeneration is the generation observed by the vmi when started.
-
#preference_ref ⇒ Object
Returns the value of attribute preference_ref.
-
#printable_status ⇒ Object
PrintableStatus is a human readable, high-level representation of the status of the virtual machine.
-
#ready ⇒ Object
Ready indicates if the virtual machine is running and ready.
-
#restore_in_progress ⇒ Object
RestoreInProgress is the name of the VirtualMachineRestore currently executing.
-
#run_strategy ⇒ Object
RunStrategy tracks the last recorded RunStrategy used by the VM.
-
#snapshot_in_progress ⇒ Object
SnapshotInProgress is the name of the VirtualMachineSnapshot currently executing.
-
#start_failure ⇒ Object
Returns the value of attribute start_failure.
-
#state_change_requests ⇒ Object
StateChangeRequests indicates a list of actions that should be taken on a VMI e.g.
-
#volume_requests ⇒ Object
VolumeRequests indicates a list of volumes add or remove from the VMI template and hotplug on an active running VMI.
-
#volume_snapshot_statuses ⇒ Object
VolumeSnapshotStatuses indicates a list of statuses whether snapshotting is supported by each volume.
-
#volume_update_state ⇒ Object
Returns the value of attribute volume_update_state.
Class Method Summary collapse
-
.acceptable_attribute_map ⇒ Object
Returns attribute mapping this model knows about.
-
.acceptable_attributes ⇒ Object
Returns all the JSON keys this model knows about.
-
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
-
.build_from_hash(attributes) ⇒ Object
Builds the object from hash.
-
.openapi_nullable ⇒ Object
List of attributes with nullable: true.
-
.openapi_types ⇒ Object
Attribute type mapping.
Instance Method Summary collapse
-
#==(o) ⇒ Object
Checks equality by comparing each attribute.
- #eql?(o) ⇒ Boolean
-
#hash ⇒ Integer
Calculates hash code according to all attributes.
-
#initialize(attributes = {}) ⇒ V1VirtualMachineStatus
constructor
Initializes the object.
-
#list_invalid_properties ⇒ Object
Show invalid properties with the reasons.
-
#to_hash ⇒ Hash
Returns the object in the form of hash.
-
#valid? ⇒ Boolean
Check to see if the all the properties in the model are valid.
Methods inherited from ApiModelBase
_deserialize, #_to_hash, #to_body, #to_s
Constructor Details
#initialize(attributes = {}) ⇒ V1VirtualMachineStatus
Initializes the object
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_tracking ⇒ Object
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 |
#conditions ⇒ Object
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 |
#created ⇒ Object
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_generation ⇒ Object
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_ref ⇒ Object
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_request ⇒ Object
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_generation ⇒ Object
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_ref ⇒ Object
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_status ⇒ Object
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 |
#ready ⇒ Object
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_progress ⇒ Object
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_strategy ⇒ Object
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_progress ⇒ Object
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_failure ⇒ Object
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_requests ⇒ Object
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_requests ⇒ Object
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_statuses ⇒ Object
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_state ⇒ Object
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_map ⇒ Object
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_attributes ⇒ Object
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_map ⇒ Object
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
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_nullable ⇒ Object
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_types ⇒ Object
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.
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
270 271 272 |
# File 'lib/kubevirt/models/v1_virtual_machine_status.rb', line 270 def eql?(o) self == o end |
#hash ⇒ Integer
Calculates hash code according to all attributes.
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_properties ⇒ Object
Show invalid properties with the reasons. Usually used together with valid?
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_hash ⇒ 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
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 |