Class: IntersightClient::StorageHitachiVolumeAllOf

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

Overview

Definition of the list of properties defined in ‘storage.HitachiVolume’, excluding properties defined in parent classes.

Defined Under Namespace

Classes: EnumAttributeValidator

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ StorageHitachiVolumeAllOf

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

def initialize(attributes = {})
  if (!attributes.is_a?(Hash))
    fail ArgumentError, "The input argument (attributes) must be a hash in `IntersightClient::StorageHitachiVolumeAllOf` 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
  }

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

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

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

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

  if attributes.key?(:'data_reduction_mode')
    self.data_reduction_mode = attributes[:'data_reduction_mode']
  else
    self.data_reduction_mode = 'N/A'
  end

  if attributes.key?(:'data_reduction_status')
    self.data_reduction_status = attributes[:'data_reduction_status']
  else
    self.data_reduction_status = 'N/A'
  end

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

  if attributes.key?(:'emulation_type')
    self.emulation_type = attributes[:'emulation_type']
  else
    self.emulation_type = 'N/A'
  end

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

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

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

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

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

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

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

  if attributes.key?(:'raid_level')
    self.raid_level = attributes[:'raid_level']
  else
    self.raid_level = 'N/A'
  end

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

  if attributes.key?(:'status')
    self.status = attributes[:'status']
  else
    self.status = 'N/A'
  end

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

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

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

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

Instance Attribute Details

#arrayObject

Returns the value of attribute array.



71
72
73
# File 'lib/intersight_client/models/storage_hitachi_volume_all_of.rb', line 71

def array
  @array
end

#attributesObject

Returns the value of attribute attributes.



25
26
27
# File 'lib/intersight_client/models/storage_hitachi_volume_all_of.rb', line 25

def attributes
  @attributes
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/storage_hitachi_volume_all_of.rb', line 20

def class_id
  @class_id
end

#clpr_idObject

CLPR (Cache Logical Partition) number of this volume.



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

def clpr_id
  @clpr_id
end

#data_reduction_modeObject

Setting of the capacity saving function (dedupe and compression). * ‘N/A` - The capacity saving function is not available. * `Compression` - The capacity saving function (compression) is enabled. * `Compression Deduplication` - The capacity saving function (compression and deduplication) is enabled. * `Disabled` - The capacity saving function (compression and deduplication) is disabled.



31
32
33
# File 'lib/intersight_client/models/storage_hitachi_volume_all_of.rb', line 31

def data_reduction_mode
  @data_reduction_mode
end

#data_reduction_statusObject

Status of the capacity saving function. * ‘N/A` - The capacity saving function is not available. * `Enabled` - The capacity saving function is enabled. * `Disabled` - The capacity saving function is disabled. * `Enabling` - The capacity saving function is being enabled. * `Rehydrating` - The capacity saving function is being disabled. * `Deleting` - The volumes for which the capacity saving function is enabled are being deleted. * `Failed` - An attempt to enable the capacity saving function failed.



34
35
36
# File 'lib/intersight_client/models/storage_hitachi_volume_all_of.rb', line 34

def data_reduction_status
  @data_reduction_status
end

#drive_typeObject

Code indicating the drive type of the drive belonging to the volume.



37
38
39
# File 'lib/intersight_client/models/storage_hitachi_volume_all_of.rb', line 37

def drive_type
  @drive_type
end

#emulation_typeObject

The volume emulation type or the volume status information. * ‘N/A` - Not available. * `NOT DEFINED` - The volume is not implemented. * `DEFINING` - The volume is being created. * `REMOVING` - The volume is being removed. * `OPEN-V` - To be provided by Hitachi.



40
41
42
# File 'lib/intersight_client/models/storage_hitachi_volume_all_of.rb', line 40

def emulation_type
  @emulation_type
end

#is_full_allocation_enabledObject

Whether pages are reserved by the FullAllocation functionality.



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

def is_full_allocation_enabled
  @is_full_allocation_enabled
end

#labelObject

Label of the volume, as configured in the storage array.



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

def label
  @label
end

#namespace_idObject

Namespace ID registered in NVM Subsystem.



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

def namespace_id
  @namespace_id
end

#num_of_pathsObject

Number of paths set for the volume.



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

def num_of_paths
  @num_of_paths
end

#nvm_subsystem_idObject

NVM subsystem ID on storage system.



55
56
57
# File 'lib/intersight_client/models/storage_hitachi_volume_all_of.rb', line 55

def nvm_subsystem_id
  @nvm_subsystem_id
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/storage_hitachi_volume_all_of.rb', line 23

def object_type
  @object_type
end

#parity_group_idsObject

Returns the value of attribute parity_group_ids.



57
58
59
# File 'lib/intersight_client/models/storage_hitachi_volume_all_of.rb', line 57

def parity_group_ids
  @parity_group_ids
end

#parity_groupsObject

An array of relationships to storageHitachiParityGroup resources.



74
75
76
# File 'lib/intersight_client/models/storage_hitachi_volume_all_of.rb', line 74

def parity_groups
  @parity_groups
end

#poolObject

Returns the value of attribute pool.



76
77
78
# File 'lib/intersight_client/models/storage_hitachi_volume_all_of.rb', line 76

def pool
  @pool
end

#pool_idObject

ID of the pool with which the volume is associated.



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

def pool_id
  @pool_id
end

#raid_levelObject

RAID level for the volume. * ‘N/A` - RAID level is unknown or multiple RAID levels are being used. * `RAID1` - RAID1. * `RAID5` - RAID5. * `RAID6` - RAID6.



63
64
65
# File 'lib/intersight_client/models/storage_hitachi_volume_all_of.rb', line 63

def raid_level
  @raid_level
end

#raid_typeObject

RAID type drive configuration.



66
67
68
# File 'lib/intersight_client/models/storage_hitachi_volume_all_of.rb', line 66

def raid_type
  @raid_type
end

#registered_deviceObject

Returns the value of attribute registered_device.



78
79
80
# File 'lib/intersight_client/models/storage_hitachi_volume_all_of.rb', line 78

def registered_device
  @registered_device
end

#statusObject

Status information of the volume. * ‘N/A` - The volume status is not available. * `NML` - The volume is in normal status. * `BLK` - The volume is in blocked state. * `BSY` - The volume status is being changed. * `Unknown` - The volume status is unknown (not supported).



69
70
71
# File 'lib/intersight_client/models/storage_hitachi_volume_all_of.rb', line 69

def status
  @status
end

Class Method Details

.acceptable_attribute_mapObject

Returns the key-value map of all the JSON attributes this model knows about



136
137
138
# File 'lib/intersight_client/models/storage_hitachi_volume_all_of.rb', line 136

def self.acceptable_attribute_map
  attribute_map
end

.acceptable_attributesObject

Returns all the JSON keys this model knows about



131
132
133
# File 'lib/intersight_client/models/storage_hitachi_volume_all_of.rb', line 131

def self.acceptable_attributes
  attribute_map.values
end

.attribute_mapObject

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



103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
# File 'lib/intersight_client/models/storage_hitachi_volume_all_of.rb', line 103

def self.attribute_map
  {
    :'class_id' => :'ClassId',
    :'object_type' => :'ObjectType',
    :'attributes' => :'Attributes',
    :'clpr_id' => :'ClprId',
    :'data_reduction_mode' => :'DataReductionMode',
    :'data_reduction_status' => :'DataReductionStatus',
    :'drive_type' => :'DriveType',
    :'emulation_type' => :'EmulationType',
    :'is_full_allocation_enabled' => :'IsFullAllocationEnabled',
    :'label' => :'Label',
    :'namespace_id' => :'NamespaceId',
    :'num_of_paths' => :'NumOfPaths',
    :'nvm_subsystem_id' => :'NvmSubsystemId',
    :'parity_group_ids' => :'ParityGroupIds',
    :'pool_id' => :'PoolId',
    :'raid_level' => :'RaidLevel',
    :'raid_type' => :'RaidType',
    :'status' => :'Status',
    :'array' => :'Array',
    :'parity_groups' => :'ParityGroups',
    :'pool' => :'Pool',
    :'registered_device' => :'RegisteredDevice'
  }
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



452
453
454
# File 'lib/intersight_client/models/storage_hitachi_volume_all_of.rb', line 452

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

.openapi_nullableObject

List of attributes with nullable: true



169
170
171
172
173
174
175
# File 'lib/intersight_client/models/storage_hitachi_volume_all_of.rb', line 169

def self.openapi_nullable
  Set.new([
    :'attributes',
    :'parity_group_ids',
    :'parity_groups',
  ])
end

.openapi_typesObject

Attribute type mapping.



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

def self.openapi_types
  {
    :'class_id' => :'String',
    :'object_type' => :'String',
    :'attributes' => :'Array<String>',
    :'clpr_id' => :'Integer',
    :'data_reduction_mode' => :'String',
    :'data_reduction_status' => :'String',
    :'drive_type' => :'String',
    :'emulation_type' => :'String',
    :'is_full_allocation_enabled' => :'Boolean',
    :'label' => :'String',
    :'namespace_id' => :'String',
    :'num_of_paths' => :'Integer',
    :'nvm_subsystem_id' => :'String',
    :'parity_group_ids' => :'Array<String>',
    :'pool_id' => :'String',
    :'raid_level' => :'String',
    :'raid_type' => :'String',
    :'status' => :'String',
    :'array' => :'StorageHitachiArrayRelationship',
    :'parity_groups' => :'Array<StorageHitachiParityGroupRelationship>',
    :'pool' => :'StorageHitachiPoolRelationship',
    :'registered_device' => :'AssetDeviceRegistrationRelationship'
  }
end

Instance Method Details

#==(o) ⇒ Object

Checks equality by comparing each attribute.

Parameters:

  • Object (Object)

    to be compared



410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
# File 'lib/intersight_client/models/storage_hitachi_volume_all_of.rb', line 410

def ==(o)
  return true if self.equal?(o)
  self.class == o.class &&
      class_id == o.class_id &&
      object_type == o.object_type &&
      attributes == o.attributes &&
      clpr_id == o.clpr_id &&
      data_reduction_mode == o.data_reduction_mode &&
      data_reduction_status == o.data_reduction_status &&
      drive_type == o.drive_type &&
      emulation_type == o.emulation_type &&
      is_full_allocation_enabled == o.is_full_allocation_enabled &&
      label == o.label &&
      namespace_id == o.namespace_id &&
      num_of_paths == o.num_of_paths &&
      nvm_subsystem_id == o.nvm_subsystem_id &&
      parity_group_ids == o.parity_group_ids &&
      pool_id == o.pool_id &&
      raid_level == o.raid_level &&
      raid_type == o.raid_type &&
      status == o.status &&
      array == o.array &&
      parity_groups == o.parity_groups &&
      pool == o.pool &&
      registered_device == o.registered_device
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



482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
# File 'lib/intersight_client/models/storage_hitachi_volume_all_of.rb', line 482

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



553
554
555
556
557
558
559
560
561
562
563
564
565
# File 'lib/intersight_client/models/storage_hitachi_volume_all_of.rb', line 553

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



459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
# File 'lib/intersight_client/models/storage_hitachi_volume_all_of.rb', line 459

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

  self
end

#eql?(o) ⇒ Boolean

Parameters:

  • Object (Object)

    to be compared

Returns:

  • (Boolean)

See Also:

  • `==` method


439
440
441
# File 'lib/intersight_client/models/storage_hitachi_volume_all_of.rb', line 439

def eql?(o)
  self == o
end

#hashInteger

Calculates hash code according to all attributes.

Returns:

  • (Integer)

    Hash code



445
446
447
# File 'lib/intersight_client/models/storage_hitachi_volume_all_of.rb', line 445

def hash
  [class_id, object_type, attributes, clpr_id, data_reduction_mode, data_reduction_status, drive_type, emulation_type, is_full_allocation_enabled, label, namespace_id, num_of_paths, nvm_subsystem_id, parity_group_ids, pool_id, raid_level, raid_type, status, array, parity_groups, pool, registered_device].hash
end

#list_invalid_propertiesObject

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

Returns:

  • Array for valid properties with the reasons



303
304
305
306
307
308
309
310
311
312
313
314
# File 'lib/intersight_client/models/storage_hitachi_volume_all_of.rb', line 303

def list_invalid_properties
  invalid_properties = Array.new
  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



529
530
531
# File 'lib/intersight_client/models/storage_hitachi_volume_all_of.rb', line 529

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



535
536
537
538
539
540
541
542
543
544
545
546
547
# File 'lib/intersight_client/models/storage_hitachi_volume_all_of.rb', line 535

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



523
524
525
# File 'lib/intersight_client/models/storage_hitachi_volume_all_of.rb', line 523

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



318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
# File 'lib/intersight_client/models/storage_hitachi_volume_all_of.rb', line 318

def valid?
  return false if @class_id.nil?
  class_id_validator = EnumAttributeValidator.new('String', ["storage.HitachiVolume"])
  return false unless class_id_validator.valid?(@class_id)
  return false if @object_type.nil?
  object_type_validator = EnumAttributeValidator.new('String', ["storage.HitachiVolume"])
  return false unless object_type_validator.valid?(@object_type)
  data_reduction_mode_validator = EnumAttributeValidator.new('String', ["N/A", "Compression", "Compression Deduplication", "Disabled"])
  return false unless data_reduction_mode_validator.valid?(@data_reduction_mode)
  data_reduction_status_validator = EnumAttributeValidator.new('String', ["N/A", "Enabled", "Disabled", "Enabling", "Rehydrating", "Deleting", "Failed"])
  return false unless data_reduction_status_validator.valid?(@data_reduction_status)
  emulation_type_validator = EnumAttributeValidator.new('String', ["N/A", "NOT DEFINED", "DEFINING", "REMOVING", "OPEN-V"])
  return false unless emulation_type_validator.valid?(@emulation_type)
  raid_level_validator = EnumAttributeValidator.new('String', ["N/A", "RAID1", "RAID5", "RAID6"])
  return false unless raid_level_validator.valid?(@raid_level)
  status_validator = EnumAttributeValidator.new('String', ["N/A", "NML", "BLK", "BSY", "Unknown"])
  return false unless status_validator.valid?(@status)
  true
end