Class: Kubevirt::V1VirtualMachineInstanceMigrationState

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

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

Initializes the object

Parameters:

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

    Model attributes in the form of hash



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

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
  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::V1VirtualMachineInstanceMigrationState`. 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?(:'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.end_timestamp = 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_network_type')
    self.migration_network_type = attributes[:'migration_network_type']
  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?(:'source_state')
    self.source_state = attributes[:'source_state']
  end

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

  if attributes.key?(:'target_attachment_pod_uid')
    self.target_attachment_pod_uid = 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.target_node_domain_ready_timestamp = 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

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

Instance Attribute Details

#abort_requestedObject

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_statusObject

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

#completedObject

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_timestampObject

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_timestamp
  @end_timestamp
end

#failedObject

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_reasonObject

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_configurationObject

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_network_typeObject

The type of migration network, either ‘pod’ or ‘migration’



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

def migration_network_type
  @migration_network_type
end

#migration_policy_nameObject

Name of the migration policy. If string is empty, no policy is matched



42
43
44
# File 'lib/kubevirt/models/v1_virtual_machine_instance_migration_state.rb', line 42

def migration_policy_name
  @migration_policy_name
end

#migration_uidObject

The VirtualMachineInstanceMigration object associated with this migration



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

def migration_uid
  @migration_uid
end

#modeObject

Lets us know if the vmi is currently running pre or post copy migration



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

def mode
  @mode
end

#source_nodeObject

The source node that the VMI originated on



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

def source_node
  @source_node
end

#source_persistent_state_pvc_nameObject

If the VMI being migrated uses persistent features (backend-storage), its source PVC name is saved here



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

def source_persistent_state_pvc_name
  @source_persistent_state_pvc_name
end

#source_podObject

Returns the value of attribute source_pod.



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

def source_pod
  @source_pod
end

#source_stateObject

Returns the value of attribute source_state.



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

def source_state
  @source_state
end

#start_timestampObject

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.



61
62
63
# File 'lib/kubevirt/models/v1_virtual_machine_instance_migration_state.rb', line 61

def start_timestamp
  @start_timestamp
end

#target_attachment_pod_uidObject

The UID of the target attachment pod for hotplug volumes



64
65
66
# File 'lib/kubevirt/models/v1_virtual_machine_instance_migration_state.rb', line 64

def target_attachment_pod_uid
  @target_attachment_pod_uid
end

#target_cpu_setObject

If the VMI requires dedicated CPUs, this field will hold the dedicated CPU set on the target node



67
68
69
# File 'lib/kubevirt/models/v1_virtual_machine_instance_migration_state.rb', line 67

def target_cpu_set
  @target_cpu_set
end

#target_direct_migration_node_portsObject

The list of ports opened for live migration on the destination node



70
71
72
# File 'lib/kubevirt/models/v1_virtual_machine_instance_migration_state.rb', line 70

def target_direct_migration_node_ports
  @target_direct_migration_node_ports
end

#target_nodeObject

The target node that the VMI is moving to



73
74
75
# File 'lib/kubevirt/models/v1_virtual_machine_instance_migration_state.rb', line 73

def target_node
  @target_node
end

#target_node_addressObject

The address of the target node to use for the migration



76
77
78
# File 'lib/kubevirt/models/v1_virtual_machine_instance_migration_state.rb', line 76

def target_node_address
  @target_node_address
end

#target_node_domain_detectedObject

The Target Node has seen the Domain Start Event



79
80
81
# File 'lib/kubevirt/models/v1_virtual_machine_instance_migration_state.rb', line 79

def target_node_domain_detected
  @target_node_domain_detected
end

#target_node_domain_ready_timestampObject

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.



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

def target_node_domain_ready_timestamp
  @target_node_domain_ready_timestamp
end

#target_node_topologyObject

If the VMI requires dedicated CPUs, this field will hold the numa topology on the target node



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

def target_node_topology
  @target_node_topology
end

#target_persistent_state_pvc_nameObject

If the VMI being migrated uses persistent features (backend-storage), its target PVC name is saved here



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

def target_persistent_state_pvc_name
  @target_persistent_state_pvc_name
end

#target_podObject

The target pod that the VMI is moving to



91
92
93
# File 'lib/kubevirt/models/v1_virtual_machine_instance_migration_state.rb', line 91

def target_pod
  @target_pod
end

#target_stateObject

Returns the value of attribute target_state.



93
94
95
# File 'lib/kubevirt/models/v1_virtual_machine_instance_migration_state.rb', line 93

def target_state
  @target_state
end

Class Method Details

.acceptable_attribute_mapObject

Returns attribute mapping this model knows about



129
130
131
# File 'lib/kubevirt/models/v1_virtual_machine_instance_migration_state.rb', line 129

def self.acceptable_attribute_map
  attribute_map
end

.acceptable_attributesObject

Returns all the JSON keys this model knows about



134
135
136
# File 'lib/kubevirt/models/v1_virtual_machine_instance_migration_state.rb', line 134

def self.acceptable_attributes
  acceptable_attribute_map.values
end

.attribute_mapObject

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



96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
# File 'lib/kubevirt/models/v1_virtual_machine_instance_migration_state.rb', line 96

def self.attribute_map
  {
    :'abort_requested' => :'abortRequested',
    :'abort_status' => :'abortStatus',
    :'completed' => :'completed',
    :'end_timestamp' => :'endTimestamp',
    :'failed' => :'failed',
    :'failure_reason' => :'failureReason',
    :'migration_configuration' => :'migrationConfiguration',
    :'migration_network_type' => :'migrationNetworkType',
    :'migration_policy_name' => :'migrationPolicyName',
    :'migration_uid' => :'migrationUid',
    :'mode' => :'mode',
    :'source_node' => :'sourceNode',
    :'source_persistent_state_pvc_name' => :'sourcePersistentStatePVCName',
    :'source_pod' => :'sourcePod',
    :'source_state' => :'sourceState',
    :'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',
    :'target_state' => :'targetState'
  }
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



370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
# File 'lib/kubevirt/models/v1_virtual_machine_instance_migration_state.rb', line 370

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



172
173
174
175
# File 'lib/kubevirt/models/v1_virtual_machine_instance_migration_state.rb', line 172

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

.openapi_typesObject

Attribute type mapping.



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

def self.openapi_types
  {
    :'abort_requested' => :'Boolean',
    :'abort_status' => :'String',
    :'completed' => :'Boolean',
    :'end_timestamp' => :'Time',
    :'failed' => :'Boolean',
    :'failure_reason' => :'String',
    :'migration_configuration' => :'V1MigrationConfiguration',
    :'migration_network_type' => :'String',
    :'migration_policy_name' => :'String',
    :'migration_uid' => :'String',
    :'mode' => :'String',
    :'source_node' => :'String',
    :'source_persistent_state_pvc_name' => :'String',
    :'source_pod' => :'String',
    :'source_state' => :'V1VirtualMachineInstanceMigrationSourceState',
    :'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',
    :'target_state' => :'V1VirtualMachineInstanceMigrationTargetState'
  }
end

Instance Method Details

#==(o) ⇒ Object

Checks equality by comparing each attribute.

Parameters:

  • Object (Object)

    to be compared



323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
# File 'lib/kubevirt/models/v1_virtual_machine_instance_migration_state.rb', line 323

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 &&
      end_timestamp == o.end_timestamp &&
      failed == o.failed &&
      failure_reason == o.failure_reason &&
      migration_configuration == o.migration_configuration &&
      migration_network_type == o.migration_network_type &&
      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 &&
      source_state == o.source_state &&
      start_timestamp == o.start_timestamp &&
      target_attachment_pod_uid == o.target_attachment_pod_uid &&
      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 &&
      target_node_domain_ready_timestamp == o.target_node_domain_ready_timestamp &&
      target_node_topology == o.target_node_topology &&
      target_persistent_state_pvc_name == o.target_persistent_state_pvc_name &&
      target_pod == o.target_pod &&
      target_state == o.target_state
end

#eql?(o) ⇒ Boolean

Parameters:

  • Object (Object)

    to be compared

Returns:

  • (Boolean)

See Also:

  • `==` method


357
358
359
# File 'lib/kubevirt/models/v1_virtual_machine_instance_migration_state.rb', line 357

def eql?(o)
  self == o
end

#hashInteger

Calculates hash code according to all attributes.

Returns:

  • (Integer)

    Hash code



363
364
365
# File 'lib/kubevirt/models/v1_virtual_machine_instance_migration_state.rb', line 363

def hash
  [abort_requested, abort_status, completed, end_timestamp, failed, failure_reason, migration_configuration, migration_network_type, migration_policy_name, migration_uid, mode, source_node, source_persistent_state_pvc_name, source_pod, source_state, start_timestamp, target_attachment_pod_uid, target_cpu_set, target_direct_migration_node_ports, target_node, target_node_address, target_node_domain_detected, target_node_domain_ready_timestamp, target_node_topology, target_persistent_state_pvc_name, target_pod, target_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



308
309
310
311
312
# File 'lib/kubevirt/models/v1_virtual_machine_instance_migration_state.rb', line 308

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



392
393
394
395
396
397
398
399
400
401
402
403
404
# File 'lib/kubevirt/models/v1_virtual_machine_instance_migration_state.rb', line 392

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



316
317
318
319
# File 'lib/kubevirt/models/v1_virtual_machine_instance_migration_state.rb', line 316

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