Class: Kubevirt::V1VirtualMachineInstanceMigrationState
- Inherits:
-
Object
- Object
- Kubevirt::V1VirtualMachineInstanceMigrationState
- Defined in:
- lib/kubevirt/models/v1_virtual_machine_instance_migration_state.rb
Instance Attribute Summary collapse
-
#abort_requested ⇒ Object
Indicates that the migration has been requested to abort.
-
#abort_status ⇒ Object
Indicates the final status of the live migration abortion.
-
#completed ⇒ Object
Indicates the migration completed.
-
#end_timestamp ⇒ Object
Time is a wrapper around time.Time which supports correct marshaling to YAML and JSON.
-
#failed ⇒ Object
Indicates that the migration failed.
-
#failure_reason ⇒ Object
Contains the reason why the migration failed.
-
#migration_configuration ⇒ Object
Returns the value of attribute migration_configuration.
-
#migration_policy_name ⇒ Object
Name of the migration policy.
-
#migration_uid ⇒ Object
The VirtualMachineInstanceMigration object associated with this migration.
-
#mode ⇒ Object
Lets us know if the vmi is currently running pre or post copy migration.
-
#source_node ⇒ Object
The source node that the VMI originated on.
-
#source_persistent_state_pvc_name ⇒ Object
If the VMI being migrated uses persistent features (backend-storage), its source PVC name is saved here.
-
#source_pod ⇒ Object
Returns the value of attribute source_pod.
-
#start_timestamp ⇒ Object
Time is a wrapper around time.Time which supports correct marshaling to YAML and JSON.
-
#target_attachment_pod_uid ⇒ Object
The UID of the target attachment pod for hotplug volumes.
-
#target_cpu_set ⇒ Object
If the VMI requires dedicated CPUs, this field will hold the dedicated CPU set on the target node.
-
#target_direct_migration_node_ports ⇒ Object
The list of ports opened for live migration on the destination node.
-
#target_node ⇒ Object
The target node that the VMI is moving to.
-
#target_node_address ⇒ Object
The address of the target node to use for the migration.
-
#target_node_domain_detected ⇒ Object
The Target Node has seen the Domain Start Event.
-
#target_node_domain_ready_timestamp ⇒ Object
Time is a wrapper around time.Time which supports correct marshaling to YAML and JSON.
-
#target_node_topology ⇒ Object
If the VMI requires dedicated CPUs, this field will hold the numa topology on the target node.
-
#target_persistent_state_pvc_name ⇒ Object
If the VMI being migrated uses persistent features (backend-storage), its target PVC name is saved here.
-
#target_pod ⇒ Object
The target pod that the VMI is moving to.
Class Method Summary collapse
-
._deserialize(type, value) ⇒ Object
Deserializes the data based on type.
-
.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.
-
#_to_hash(value) ⇒ Hash
Outputs non-array value in the form of hash For object, use to_hash.
- #eql?(o) ⇒ Boolean
-
#hash ⇒ Integer
Calculates hash code according to all attributes.
-
#initialize(attributes = {}) ⇒ V1VirtualMachineInstanceMigrationState
constructor
Initializes the object.
-
#list_invalid_properties ⇒ Object
Show invalid properties with the reasons.
-
#to_body ⇒ Hash
to_body is an alias to to_hash (backward compatibility).
-
#to_hash ⇒ Hash
Returns the object in the form of hash.
-
#to_s ⇒ String
Returns the string representation of the object.
-
#valid? ⇒ Boolean
Check to see if the all the properties in the model are valid.
Constructor Details
#initialize(attributes = {}) ⇒ V1VirtualMachineInstanceMigrationState
Initializes the object
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 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 |
# File 'lib/kubevirt/models/v1_virtual_machine_instance_migration_state.rb', line 161 def initialize(attributes = {}) if (!attributes.is_a?(Hash)) fail ArgumentError, "The input argument (attributes) must be a hash in `Kubevirt::V1VirtualMachineInstanceMigrationState` 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::V1VirtualMachineInstanceMigrationState`. 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?(:'abort_requested') self.abort_requested = attributes[:'abort_requested'] end if attributes.key?(:'abort_status') self.abort_status = attributes[:'abort_status'] end if attributes.key?(:'completed') self.completed = attributes[:'completed'] end if attributes.key?(:'end_timestamp') self. = attributes[:'end_timestamp'] end if attributes.key?(:'failed') self.failed = attributes[:'failed'] end if attributes.key?(:'failure_reason') self.failure_reason = attributes[:'failure_reason'] end if attributes.key?(:'migration_configuration') self.migration_configuration = attributes[:'migration_configuration'] end if attributes.key?(:'migration_policy_name') self.migration_policy_name = attributes[:'migration_policy_name'] end if attributes.key?(:'migration_uid') self.migration_uid = attributes[:'migration_uid'] end if attributes.key?(:'mode') self.mode = attributes[:'mode'] end if attributes.key?(:'source_node') self.source_node = attributes[:'source_node'] end if attributes.key?(:'source_persistent_state_pvc_name') self.source_persistent_state_pvc_name = attributes[:'source_persistent_state_pvc_name'] end if attributes.key?(:'source_pod') self.source_pod = attributes[:'source_pod'] end if attributes.key?(:'start_timestamp') self. = attributes[:'start_timestamp'] end if attributes.key?(:'target_attachment_pod_uid') self. = attributes[:'target_attachment_pod_uid'] end if attributes.key?(:'target_cpu_set') if (value = attributes[:'target_cpu_set']).is_a?(Array) self.target_cpu_set = value end end if attributes.key?(:'target_direct_migration_node_ports') if (value = attributes[:'target_direct_migration_node_ports']).is_a?(Hash) self.target_direct_migration_node_ports = value end end if attributes.key?(:'target_node') self.target_node = attributes[:'target_node'] end if attributes.key?(:'target_node_address') self.target_node_address = attributes[:'target_node_address'] end if attributes.key?(:'target_node_domain_detected') self.target_node_domain_detected = attributes[:'target_node_domain_detected'] end if attributes.key?(:'target_node_domain_ready_timestamp') self. = attributes[:'target_node_domain_ready_timestamp'] end if attributes.key?(:'target_node_topology') self.target_node_topology = attributes[:'target_node_topology'] end if attributes.key?(:'target_persistent_state_pvc_name') self.target_persistent_state_pvc_name = attributes[:'target_persistent_state_pvc_name'] end if attributes.key?(:'target_pod') self.target_pod = attributes[:'target_pod'] end end |
Instance Attribute Details
#abort_requested ⇒ Object
Indicates that the migration has been requested to abort
19 20 21 |
# File 'lib/kubevirt/models/v1_virtual_machine_instance_migration_state.rb', line 19 def abort_requested @abort_requested end |
#abort_status ⇒ Object
Indicates the final status of the live migration abortion
22 23 24 |
# File 'lib/kubevirt/models/v1_virtual_machine_instance_migration_state.rb', line 22 def abort_status @abort_status end |
#completed ⇒ Object
Indicates the migration completed
25 26 27 |
# File 'lib/kubevirt/models/v1_virtual_machine_instance_migration_state.rb', line 25 def completed @completed end |
#end_timestamp ⇒ Object
Time is a wrapper around time.Time which supports correct marshaling to YAML and JSON. Wrappers are provided for many of the factory methods that the time package offers.
28 29 30 |
# File 'lib/kubevirt/models/v1_virtual_machine_instance_migration_state.rb', line 28 def end |
#failed ⇒ Object
Indicates that the migration failed
31 32 33 |
# File 'lib/kubevirt/models/v1_virtual_machine_instance_migration_state.rb', line 31 def failed @failed end |
#failure_reason ⇒ Object
Contains the reason why the migration failed
34 35 36 |
# File 'lib/kubevirt/models/v1_virtual_machine_instance_migration_state.rb', line 34 def failure_reason @failure_reason end |
#migration_configuration ⇒ Object
Returns the value of attribute migration_configuration.
36 37 38 |
# File 'lib/kubevirt/models/v1_virtual_machine_instance_migration_state.rb', line 36 def migration_configuration @migration_configuration end |
#migration_policy_name ⇒ Object
Name of the migration policy. If string is empty, no policy is matched
39 40 41 |
# File 'lib/kubevirt/models/v1_virtual_machine_instance_migration_state.rb', line 39 def migration_policy_name @migration_policy_name end |
#migration_uid ⇒ Object
The VirtualMachineInstanceMigration object associated with this migration
42 43 44 |
# File 'lib/kubevirt/models/v1_virtual_machine_instance_migration_state.rb', line 42 def migration_uid @migration_uid end |
#mode ⇒ Object
Lets us know if the vmi is currently running pre or post copy migration
45 46 47 |
# File 'lib/kubevirt/models/v1_virtual_machine_instance_migration_state.rb', line 45 def mode @mode end |
#source_node ⇒ Object
The source node that the VMI originated on
48 49 50 |
# File 'lib/kubevirt/models/v1_virtual_machine_instance_migration_state.rb', line 48 def source_node @source_node end |
#source_persistent_state_pvc_name ⇒ Object
If the VMI being migrated uses persistent features (backend-storage), its source PVC name is saved here
51 52 53 |
# File 'lib/kubevirt/models/v1_virtual_machine_instance_migration_state.rb', line 51 def source_persistent_state_pvc_name @source_persistent_state_pvc_name end |
#source_pod ⇒ Object
Returns the value of attribute source_pod.
53 54 55 |
# File 'lib/kubevirt/models/v1_virtual_machine_instance_migration_state.rb', line 53 def source_pod @source_pod end |
#start_timestamp ⇒ Object
Time is a wrapper around time.Time which supports correct marshaling to YAML and JSON. Wrappers are provided for many of the factory methods that the time package offers.
56 57 58 |
# File 'lib/kubevirt/models/v1_virtual_machine_instance_migration_state.rb', line 56 def end |
#target_attachment_pod_uid ⇒ Object
The UID of the target attachment pod for hotplug volumes
59 60 61 |
# File 'lib/kubevirt/models/v1_virtual_machine_instance_migration_state.rb', line 59 def end |
#target_cpu_set ⇒ Object
If the VMI requires dedicated CPUs, this field will hold the dedicated CPU set on the target node
62 63 64 |
# File 'lib/kubevirt/models/v1_virtual_machine_instance_migration_state.rb', line 62 def target_cpu_set @target_cpu_set end |
#target_direct_migration_node_ports ⇒ Object
The list of ports opened for live migration on the destination node
65 66 67 |
# File 'lib/kubevirt/models/v1_virtual_machine_instance_migration_state.rb', line 65 def target_direct_migration_node_ports @target_direct_migration_node_ports end |
#target_node ⇒ Object
The target node that the VMI is moving to
68 69 70 |
# File 'lib/kubevirt/models/v1_virtual_machine_instance_migration_state.rb', line 68 def target_node @target_node end |
#target_node_address ⇒ Object
The address of the target node to use for the migration
71 72 73 |
# File 'lib/kubevirt/models/v1_virtual_machine_instance_migration_state.rb', line 71 def target_node_address @target_node_address end |
#target_node_domain_detected ⇒ Object
The Target Node has seen the Domain Start Event
74 75 76 |
# File 'lib/kubevirt/models/v1_virtual_machine_instance_migration_state.rb', line 74 def target_node_domain_detected @target_node_domain_detected end |
#target_node_domain_ready_timestamp ⇒ Object
Time is a wrapper around time.Time which supports correct marshaling to YAML and JSON. Wrappers are provided for many of the factory methods that the time package offers.
77 78 79 |
# File 'lib/kubevirt/models/v1_virtual_machine_instance_migration_state.rb', line 77 def end |
#target_node_topology ⇒ Object
If the VMI requires dedicated CPUs, this field will hold the numa topology on the target node
80 81 82 |
# File 'lib/kubevirt/models/v1_virtual_machine_instance_migration_state.rb', line 80 def target_node_topology @target_node_topology end |
#target_persistent_state_pvc_name ⇒ Object
If the VMI being migrated uses persistent features (backend-storage), its target PVC name is saved here
83 84 85 |
# File 'lib/kubevirt/models/v1_virtual_machine_instance_migration_state.rb', line 83 def target_persistent_state_pvc_name @target_persistent_state_pvc_name end |
#target_pod ⇒ Object
The target pod that the VMI is moving to
86 87 88 |
# File 'lib/kubevirt/models/v1_virtual_machine_instance_migration_state.rb', line 86 def target_pod @target_pod end |
Class Method Details
._deserialize(type, value) ⇒ Object
Deserializes the data based on type
360 361 362 363 364 365 366 367 368 369 370 371 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 |
# File 'lib/kubevirt/models/v1_virtual_machine_instance_migration_state.rb', line 360 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_attributes ⇒ Object
Returns all the JSON keys this model knows about
119 120 121 |
# File 'lib/kubevirt/models/v1_virtual_machine_instance_migration_state.rb', line 119 def self.acceptable_attributes attribute_map.values end |
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 |
# File 'lib/kubevirt/models/v1_virtual_machine_instance_migration_state.rb', line 89 def self.attribute_map { :'abort_requested' => :'abortRequested', :'abort_status' => :'abortStatus', :'completed' => :'completed', :'end_timestamp' => :'endTimestamp', :'failed' => :'failed', :'failure_reason' => :'failureReason', :'migration_configuration' => :'migrationConfiguration', :'migration_policy_name' => :'migrationPolicyName', :'migration_uid' => :'migrationUid', :'mode' => :'mode', :'source_node' => :'sourceNode', :'source_persistent_state_pvc_name' => :'sourcePersistentStatePVCName', :'source_pod' => :'sourcePod', :'start_timestamp' => :'startTimestamp', :'target_attachment_pod_uid' => :'targetAttachmentPodUID', :'target_cpu_set' => :'targetCPUSet', :'target_direct_migration_node_ports' => :'targetDirectMigrationNodePorts', :'target_node' => :'targetNode', :'target_node_address' => :'targetNodeAddress', :'target_node_domain_detected' => :'targetNodeDomainDetected', :'target_node_domain_ready_timestamp' => :'targetNodeDomainReadyTimestamp', :'target_node_topology' => :'targetNodeTopology', :'target_persistent_state_pvc_name' => :'targetPersistentStatePVCName', :'target_pod' => :'targetPod' } end |
.build_from_hash(attributes) ⇒ Object
Builds the object from hash
336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 |
# File 'lib/kubevirt/models/v1_virtual_machine_instance_migration_state.rb', line 336 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
154 155 156 157 |
# File 'lib/kubevirt/models/v1_virtual_machine_instance_migration_state.rb', line 154 def self.openapi_nullable Set.new([ ]) end |
.openapi_types ⇒ Object
Attribute type mapping.
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 149 150 151 |
# File 'lib/kubevirt/models/v1_virtual_machine_instance_migration_state.rb', line 124 def self.openapi_types { :'abort_requested' => :'Boolean', :'abort_status' => :'String', :'completed' => :'Boolean', :'end_timestamp' => :'Time', :'failed' => :'Boolean', :'failure_reason' => :'String', :'migration_configuration' => :'V1MigrationConfiguration', :'migration_policy_name' => :'String', :'migration_uid' => :'String', :'mode' => :'String', :'source_node' => :'String', :'source_persistent_state_pvc_name' => :'String', :'source_pod' => :'String', :'start_timestamp' => :'Time', :'target_attachment_pod_uid' => :'String', :'target_cpu_set' => :'Array<Integer>', :'target_direct_migration_node_ports' => :'Hash<String, Integer>', :'target_node' => :'String', :'target_node_address' => :'String', :'target_node_domain_detected' => :'Boolean', :'target_node_domain_ready_timestamp' => :'Time', :'target_node_topology' => :'String', :'target_persistent_state_pvc_name' => :'String', :'target_pod' => :'String' } end |
Instance Method Details
#==(o) ⇒ Object
Checks equality by comparing each attribute.
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_migration_state.rb', line 292 def ==(o) return true if self.equal?(o) self.class == o.class && abort_requested == o.abort_requested && abort_status == o.abort_status && completed == o.completed && == o. && failed == o.failed && failure_reason == o.failure_reason && migration_configuration == o.migration_configuration && migration_policy_name == o.migration_policy_name && migration_uid == o.migration_uid && mode == o.mode && source_node == o.source_node && source_persistent_state_pvc_name == o.source_persistent_state_pvc_name && source_pod == o.source_pod && == o. && == o. && target_cpu_set == o.target_cpu_set && target_direct_migration_node_ports == o.target_direct_migration_node_ports && target_node == o.target_node && target_node_address == o.target_node_address && target_node_domain_detected == o.target_node_domain_detected && == o. && target_node_topology == o.target_node_topology && target_persistent_state_pvc_name == o.target_persistent_state_pvc_name && target_pod == o.target_pod end |
#_to_hash(value) ⇒ Hash
Outputs non-array value in the form of hash For object, use to_hash. Otherwise, just return the value
431 432 433 434 435 436 437 438 439 440 441 442 443 |
# File 'lib/kubevirt/models/v1_virtual_machine_instance_migration_state.rb', line 431 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
323 324 325 |
# File 'lib/kubevirt/models/v1_virtual_machine_instance_migration_state.rb', line 323 def eql?(o) self == o end |
#hash ⇒ Integer
Calculates hash code according to all attributes.
329 330 331 |
# File 'lib/kubevirt/models/v1_virtual_machine_instance_migration_state.rb', line 329 def hash [abort_requested, abort_status, completed, , failed, failure_reason, migration_configuration, migration_policy_name, migration_uid, mode, source_node, source_persistent_state_pvc_name, source_pod, , , target_cpu_set, target_direct_migration_node_ports, target_node, target_node_address, target_node_domain_detected, , target_node_topology, target_persistent_state_pvc_name, target_pod].hash end |
#list_invalid_properties ⇒ Object
Show invalid properties with the reasons. Usually used together with valid?
277 278 279 280 281 |
# File 'lib/kubevirt/models/v1_virtual_machine_instance_migration_state.rb', line 277 def list_invalid_properties warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new invalid_properties end |
#to_body ⇒ Hash
to_body is an alias to to_hash (backward compatibility)
407 408 409 |
# File 'lib/kubevirt/models/v1_virtual_machine_instance_migration_state.rb', line 407 def to_body to_hash end |
#to_hash ⇒ Hash
Returns the object in the form of hash
413 414 415 416 417 418 419 420 421 422 423 424 425 |
# File 'lib/kubevirt/models/v1_virtual_machine_instance_migration_state.rb', line 413 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_s ⇒ String
Returns the string representation of the object
401 402 403 |
# File 'lib/kubevirt/models/v1_virtual_machine_instance_migration_state.rb', line 401 def to_s to_hash.to_s end |
#valid? ⇒ Boolean
Check to see if the all the properties in the model are valid
285 286 287 288 |
# File 'lib/kubevirt/models/v1_virtual_machine_instance_migration_state.rb', line 285 def valid? warn '[DEPRECATED] the `valid?` method is obsolete' true end |