Class: IntersightClient::HyperflexVmBackupInfo

Inherits:
MoBaseMo
  • Object
show all
Defined in:
lib/intersight_client/models/hyperflex_vm_backup_info.rb

Overview

Virtual Machine backup information.

Defined Under Namespace

Classes: EnumAttributeValidator

Instance Attribute Summary collapse

Attributes inherited from MoBaseMo

#account_moid, #ancestors, #create_time, #display_names, #domain_group_moid, #mod_time, #moid, #owners, #parent, #permission_resources, #shared_scope, #tags, #version_context

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ HyperflexVmBackupInfo

Initializes the object

Parameters:

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

    Model attributes in the form of hash



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
# File 'lib/intersight_client/models/hyperflex_vm_backup_info.rb', line 171

def initialize(attributes = {})
  if (!attributes.is_a?(Hash))
    fail ArgumentError, "The input argument (attributes) must be a hash in `IntersightClient::HyperflexVmBackupInfo` 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.acceptable_attribute_map.key?(k.to_sym))
      fail ArgumentError, "`#{k}` is not a valid attribute in `#{self.class.name}`. Please check the name to make sure it's valid. List of attributes: " + self.class.acceptable_attribute_map.keys.inspect
    end
    h[k.to_sym] = v
  }

  # call parent's initialize
  super(attributes)

  if attributes.key?(:'class_id')
    self.class_id = attributes[:'class_id']
  else
    self.class_id = 'hyperflex.VmBackupInfo'
  end

  if attributes.key?(:'object_type')
    self.object_type = attributes[:'object_type']
  else
    self.object_type = 'hyperflex.VmBackupInfo'
  end

  if attributes.key?(:'backup_status')
    self.backup_status = attributes[:'backup_status']
  else
    self.backup_status = 'InitializingProtection'
  end

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

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

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

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

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

  if attributes.key?(:'protection_status')
    self.protection_status = attributes[:'protection_status']
  else
    self.protection_status = 'PREPARE_FAILOVER_STARTED'
  end

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

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

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

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

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

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

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

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

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

Instance Attribute Details

#backup_statusObject

Description of the backup status of this VmBackupInfo. * InitializingProtection - Protection has started, but not completed. * Protected - Protection has completed successfully. * ExceedsInterval - Protection has not completed successfully in over two times the backup interval.



26
27
28
# File 'lib/intersight_client/models/hyperflex_vm_backup_info.rb', line 26

def backup_status
  @backup_status
end

#class_idObject

The fully-qualified name of the instantiated, concrete type. This property is used as a discriminator to identify the type of the payload when marshaling and unmarshaling data.



20
21
22
# File 'lib/intersight_client/models/hyperflex_vm_backup_info.rb', line 20

def class_id
  @class_id
end

#cluster_entity_referenceObject

Returns the value of attribute cluster_entity_reference.



28
29
30
# File 'lib/intersight_client/models/hyperflex_vm_backup_info.rb', line 28

def cluster_entity_reference
  @cluster_entity_reference
end

#cluster_id_protection_info_mapObject

Returns the value of attribute cluster_id_protection_info_map.



30
31
32
# File 'lib/intersight_client/models/hyperflex_vm_backup_info.rb', line 30

def cluster_id_protection_info_map
  @cluster_id_protection_info_map
end

#errorObject

Returns the value of attribute error.



32
33
34
# File 'lib/intersight_client/models/hyperflex_vm_backup_info.rb', line 32

def error
  @error
end

#local_snapshot_retention_countObject

Retention count from backup policy for local snapshots.



35
36
37
# File 'lib/intersight_client/models/hyperflex_vm_backup_info.rb', line 35

def local_snapshot_retention_count
  @local_snapshot_retention_count
end

#object_typeObject

The fully-qualified name of the instantiated, concrete type. The value should be the same as the ‘ClassId’ property.



23
24
25
# File 'lib/intersight_client/models/hyperflex_vm_backup_info.rb', line 23

def object_type
  @object_type
end

#power_onObject

The power state of the Virtual Machine.



38
39
40
# File 'lib/intersight_client/models/hyperflex_vm_backup_info.rb', line 38

def power_on
  @power_on
end

#protection_statusObject

Description of the protection status of this VmBackupInfo. * PREPARE_FAILOVER_STARTED - The protection status is prepare failover started. * PREPARE_FAILOVER_FAILED - The protection status is prepare failover failed. * PREPARE_FAILOVER_COMPLETED - The protection status is prepaire failover completed. * FAILOVER_STARTED - The protection status is failover started. * FAILOVER_FAILED - The protection status is failover failed. * FAILOVER_COMPLETED - The protection status is failover completed. * PREPARE_REVERSEPROTECT_STARTED - The protection status is prepare reverse protect started. * PREPARE_REVERSEPROTECT_FAILED - The protection status is prepare reverse protect failed. * PREPARE_REVERSEPROTECT_COMPLETED - The protection status is prepair reverse protect completed. * REVERSEPROTECT_STARTED - The protection status is reverse protect started. * REVERSEPROTECT_FAILED - The protection status is reverse protect failed. * ACTIVE - The protection status is active. * CREATION_IN_PROGRESS - The protection status is failover in progress. * CREATION_FAILED - The protection status is creation failed. * LOCAL_RESTORE_STARTED - The protection status is local restore started. * LOCAL_RESTORE_FAILED - The protection status is local restore failed.



41
42
43
# File 'lib/intersight_client/models/hyperflex_vm_backup_info.rb', line 41

def protection_status
  @protection_status
end

#scheduleObject

Returns the value of attribute schedule.



43
44
45
# File 'lib/intersight_client/models/hyperflex_vm_backup_info.rb', line 43

def schedule
  @schedule
end

#snapshot_retention_countObject

Retention count from backup policy for remote snapshots.



46
47
48
# File 'lib/intersight_client/models/hyperflex_vm_backup_info.rb', line 46

def snapshot_retention_count
  @snapshot_retention_count
end

#src_backup_clusterObject

Returns the value of attribute src_backup_cluster.



58
59
60
# File 'lib/intersight_client/models/hyperflex_vm_backup_info.rb', line 58

def src_backup_cluster
  @src_backup_cluster
end

#src_clusterObject

Returns the value of attribute src_cluster.



60
61
62
# File 'lib/intersight_client/models/hyperflex_vm_backup_info.rb', line 60

def src_cluster
  @src_cluster
end

#src_cluster_nameObject

Name for the source cluster this Virtual Machine is residing on.



49
50
51
# File 'lib/intersight_client/models/hyperflex_vm_backup_info.rb', line 49

def src_cluster_name
  @src_cluster_name
end

#tgt_clusterObject

Returns the value of attribute tgt_cluster.



62
63
64
# File 'lib/intersight_client/models/hyperflex_vm_backup_info.rb', line 62

def tgt_cluster
  @tgt_cluster
end

#tgt_cluster_nameObject

Name for the target cluster this Virtual Machine is residing on.



52
53
54
# File 'lib/intersight_client/models/hyperflex_vm_backup_info.rb', line 52

def tgt_cluster_name
  @tgt_cluster_name
end

#vm_entity_referenceObject

Returns the value of attribute vm_entity_reference.



54
55
56
# File 'lib/intersight_client/models/hyperflex_vm_backup_info.rb', line 54

def vm_entity_reference
  @vm_entity_reference
end

#vm_infoObject

Returns the value of attribute vm_info.



56
57
58
# File 'lib/intersight_client/models/hyperflex_vm_backup_info.rb', line 56

def vm_info
  @vm_info
end

Class Method Details

.acceptable_attribute_mapObject

Returns the key-value map of all the JSON attributes this model knows about, including the ones defined in its parent(s)



116
117
118
# File 'lib/intersight_client/models/hyperflex_vm_backup_info.rb', line 116

def self.acceptable_attribute_map
  attribute_map.merge(superclass.acceptable_attribute_map)
end

.acceptable_attributesObject

Returns all the JSON keys this model knows about, including the ones defined in its parent(s)



111
112
113
# File 'lib/intersight_client/models/hyperflex_vm_backup_info.rb', line 111

def self.acceptable_attributes
  attribute_map.values.concat(superclass.acceptable_attributes)
end

.attribute_mapObject

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



87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
# File 'lib/intersight_client/models/hyperflex_vm_backup_info.rb', line 87

def self.attribute_map
  {
    :'class_id' => :'ClassId',
    :'object_type' => :'ObjectType',
    :'backup_status' => :'BackupStatus',
    :'cluster_entity_reference' => :'ClusterEntityReference',
    :'cluster_id_protection_info_map' => :'ClusterIdProtectionInfoMap',
    :'error' => :'Error',
    :'local_snapshot_retention_count' => :'LocalSnapshotRetentionCount',
    :'power_on' => :'PowerOn',
    :'protection_status' => :'ProtectionStatus',
    :'schedule' => :'Schedule',
    :'snapshot_retention_count' => :'SnapshotRetentionCount',
    :'src_cluster_name' => :'SrcClusterName',
    :'tgt_cluster_name' => :'TgtClusterName',
    :'vm_entity_reference' => :'VmEntityReference',
    :'vm_info' => :'VmInfo',
    :'src_backup_cluster' => :'SrcBackupCluster',
    :'src_cluster' => :'SrcCluster',
    :'tgt_cluster' => :'TgtCluster'
  }
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



383
384
385
# File 'lib/intersight_client/models/hyperflex_vm_backup_info.rb', line 383

def self.build_from_hash(attributes)
  new.build_from_hash(attributes)
end

.openapi_all_ofObject

List of class defined in allOf (OpenAPI v3)



157
158
159
160
161
162
# File 'lib/intersight_client/models/hyperflex_vm_backup_info.rb', line 157

def self.openapi_all_of
  [
  :'HyperflexVmBackupInfoAllOf',
  :'MoBaseMo'
  ]
end

.openapi_discriminator_nameObject

discriminator’s property name in OpenAPI v3



165
166
167
# File 'lib/intersight_client/models/hyperflex_vm_backup_info.rb', line 165

def self.openapi_discriminator_name
  :'ClassId'
end

.openapi_nullableObject

List of attributes with nullable: true



145
146
147
148
149
150
151
152
153
154
# File 'lib/intersight_client/models/hyperflex_vm_backup_info.rb', line 145

def self.openapi_nullable
  Set.new([
    :'cluster_entity_reference',
    :'cluster_id_protection_info_map',
    :'error',
    :'schedule',
    :'vm_entity_reference',
    :'vm_info',
  ])
end

.openapi_typesObject

Attribute type mapping.



121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
# File 'lib/intersight_client/models/hyperflex_vm_backup_info.rb', line 121

def self.openapi_types
  {
    :'class_id' => :'String',
    :'object_type' => :'String',
    :'backup_status' => :'String',
    :'cluster_entity_reference' => :'HyperflexEntityReference',
    :'cluster_id_protection_info_map' => :'Array<HyperflexMapClusterIdToProtectionInfo>',
    :'error' => :'HyperflexErrorStack',
    :'local_snapshot_retention_count' => :'Integer',
    :'power_on' => :'Boolean',
    :'protection_status' => :'String',
    :'schedule' => :'Array<HyperflexReplicationClusterReferenceToSchedule>',
    :'snapshot_retention_count' => :'Integer',
    :'src_cluster_name' => :'String',
    :'tgt_cluster_name' => :'String',
    :'vm_entity_reference' => :'HyperflexEntityReference',
    :'vm_info' => :'HyperflexVirtualMachine',
    :'src_backup_cluster' => :'HyperflexBackupClusterRelationship',
    :'src_cluster' => :'HyperflexClusterRelationship',
    :'tgt_cluster' => :'HyperflexClusterRelationship'
  }
end

Instance Method Details

#==(o) ⇒ Object

Checks equality by comparing each attribute.

Parameters:

  • Object (Object)

    to be compared



345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
# File 'lib/intersight_client/models/hyperflex_vm_backup_info.rb', line 345

def ==(o)
  return true if self.equal?(o)
  self.class == o.class &&
      class_id == o.class_id &&
      object_type == o.object_type &&
      backup_status == o.backup_status &&
      cluster_entity_reference == o.cluster_entity_reference &&
      cluster_id_protection_info_map == o.cluster_id_protection_info_map &&
      error == o.error &&
      local_snapshot_retention_count == o.local_snapshot_retention_count &&
      power_on == o.power_on &&
      protection_status == o.protection_status &&
      schedule == o.schedule &&
      snapshot_retention_count == o.snapshot_retention_count &&
      src_cluster_name == o.src_cluster_name &&
      tgt_cluster_name == o.tgt_cluster_name &&
      vm_entity_reference == o.vm_entity_reference &&
      vm_info == o.vm_info &&
      src_backup_cluster == o.src_backup_cluster &&
      src_cluster == o.src_cluster &&
      tgt_cluster == o.tgt_cluster && super(o)
end

#_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



414
415
416
417
418
419
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
# File 'lib/intersight_client/models/hyperflex_vm_backup_info.rb', line 414

def _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 = IntersightClient.const_get(type)
    klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
  end
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



485
486
487
488
489
490
491
492
493
494
495
496
497
# File 'lib/intersight_client/models/hyperflex_vm_backup_info.rb', line 485

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

#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



390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
# File 'lib/intersight_client/models/hyperflex_vm_backup_info.rb', line 390

def build_from_hash(attributes)
  return nil unless attributes.is_a?(Hash)
  super(attributes)
  HyperflexVmBackupInfo.openapi_types.each_pair do |key, type|
    if attributes[HyperflexVmBackupInfo.attribute_map[key]].nil? && HyperflexVmBackupInfo.openapi_nullable.include?(key)
      self.send("#{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[HyperflexVmBackupInfo.attribute_map[key]].is_a?(Array)
        self.send("#{key}=", attributes[HyperflexVmBackupInfo.attribute_map[key]].map { |v| _deserialize($1, v) })
      end
    elsif !attributes[HyperflexVmBackupInfo.attribute_map[key]].nil?
      self.send("#{key}=", _deserialize(type, attributes[HyperflexVmBackupInfo.attribute_map[key]]))
    end
  end

  self
end

#eql?(o) ⇒ Boolean

Parameters:

  • Object (Object)

    to be compared

Returns:

  • (Boolean)

See Also:

  • `==` method


370
371
372
# File 'lib/intersight_client/models/hyperflex_vm_backup_info.rb', line 370

def eql?(o)
  self == o
end

#hashInteger

Calculates hash code according to all attributes.

Returns:

  • (Integer)

    Hash code



376
377
378
# File 'lib/intersight_client/models/hyperflex_vm_backup_info.rb', line 376

def hash
  [class_id, object_type, backup_status, cluster_entity_reference, cluster_id_protection_info_map, error, local_snapshot_retention_count, power_on, protection_status, schedule, snapshot_retention_count, src_cluster_name, tgt_cluster_name, vm_entity_reference, vm_info, src_backup_cluster, src_cluster, tgt_cluster].hash
end

#list_invalid_propertiesObject

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

Returns:

  • Array for valid properties with the reasons



274
275
276
277
278
279
280
281
282
283
284
285
# File 'lib/intersight_client/models/hyperflex_vm_backup_info.rb', line 274

def list_invalid_properties
  invalid_properties = super
  if @class_id.nil?
    invalid_properties.push('invalid value for "class_id", class_id cannot be nil.')
  end

  if @object_type.nil?
    invalid_properties.push('invalid value for "object_type", object_type cannot be nil.')
  end

  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



461
462
463
# File 'lib/intersight_client/models/hyperflex_vm_backup_info.rb', line 461

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



467
468
469
470
471
472
473
474
475
476
477
478
479
# File 'lib/intersight_client/models/hyperflex_vm_backup_info.rb', line 467

def to_hash
  hash = super
  HyperflexVmBackupInfo.attribute_map.each_pair do |attr, param|
    value = self.send(attr)
    if value.nil?
      is_nullable = HyperflexVmBackupInfo.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



455
456
457
# File 'lib/intersight_client/models/hyperflex_vm_backup_info.rb', line 455

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



289
290
291
292
293
294
295
296
297
298
299
300
301
# File 'lib/intersight_client/models/hyperflex_vm_backup_info.rb', line 289

def valid?
  return false if @class_id.nil?
  class_id_validator = EnumAttributeValidator.new('String', ["hyperflex.VmBackupInfo"])
  return false unless class_id_validator.valid?(@class_id)
  return false if @object_type.nil?
  object_type_validator = EnumAttributeValidator.new('String', ["hyperflex.VmBackupInfo"])
  return false unless object_type_validator.valid?(@object_type)
  backup_status_validator = EnumAttributeValidator.new('String', ["InitializingProtection", "Protected", "ExceedsInterval"])
  return false unless backup_status_validator.valid?(@backup_status)
  protection_status_validator = EnumAttributeValidator.new('String', ["PREPARE_FAILOVER_STARTED", "PREPARE_FAILOVER_FAILED", "PREPARE_FAILOVER_COMPLETED", "FAILOVER_STARTED", "FAILOVER_FAILED", "FAILOVER_COMPLETED", "PREPARE_REVERSEPROTECT_STARTED", "PREPARE_REVERSEPROTECT_FAILED", "PREPARE_REVERSEPROTECT_COMPLETED", "REVERSEPROTECT_STARTED", "REVERSEPROTECT_FAILED", "ACTIVE", "CREATION_IN_PROGRESS", "CREATION_FAILED", "LOCAL_RESTORE_STARTED", "LOCAL_RESTORE_FAILED"])
  return false unless protection_status_validator.valid?(@protection_status)
  true && super
end