Class: IntersightClient::HyperflexBaseClusterAllOf

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

Overview

Definition of the list of properties defined in ‘hyperflex.BaseCluster’, 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 = {}) ⇒ HyperflexBaseClusterAllOf

Initializes the object

Parameters:

  • (defaults to: {})

    Model attributes in the form of hash



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

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

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

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

  if attributes.key?(:'capacity_runway')
    self.capacity_runway = attributes[:'capacity_runway']
  else
    self.capacity_runway = 2147483647
  end

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

  if attributes.key?(:'cluster_purpose')
    self.cluster_purpose = attributes[:'cluster_purpose']
  else
    self.cluster_purpose = 'Storage'
  end

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

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

  if attributes.key?(:'deployment_type')
    self.deployment_type = attributes[:'deployment_type']
  else
    self.deployment_type = 'NA'
  end

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

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

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

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

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

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

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

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

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

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

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

Instance Attribute Details

#alarm_summaryObject

Returns the value of attribute alarm_summary.



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

def alarm_summary
  @alarm_summary
end

#associated_profileObject

Returns the value of attribute associated_profile.



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

def associated_profile
  @associated_profile
end

#capacity_runwayObject

The number of days remaining before the cluster’s storage utilization reaches the recommended capacity limit of 76%. Default value is math.MaxInt32 to indicate that the capacity runway is "Unknown" for a cluster that is not connected or with not sufficient data.



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

def capacity_runway
  @capacity_runway
end

#child_clustersObject

An array of relationships to hyperflexBaseCluster resources.



72
73
74
# File 'lib/intersight_client/models/hyperflex_base_cluster_all_of.rb', line 72

def child_clusters
  @child_clusters
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. The enum values provides the list of concrete types that can be instantiated from this abstract type.



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

def class_id
  @class_id
end

#cluster_nameObject

The name of this HyperFlex cluster.



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

def cluster_name
  @cluster_name
end

#cluster_purposeObject

This can be a Storage or Compute cluster. A storage cluster contains storage nodes that are used to persist data. A compute cluster contains compute nodes that are used for executing business logic. * ‘Storage` - Cluster of storage nodes used to persist data. * `Compute` - Cluster of compute nodes used to execute business logic. * `Unknown` - This cluster type is Unknown. Expect Compute or Storage as valid values.



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

def cluster_purpose
  @cluster_purpose
end

#compute_node_countObject

The number of compute nodes that belong to this cluster.



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

def compute_node_count
  @compute_node_count
end

#converged_node_countObject

The number of converged nodes that belong to this cluster.



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

def converged_node_count
  @converged_node_count
end

#deployment_typeObject

The deployment type of the HyperFlex cluster. The cluster can have one of the following configurations: 1. Datacenter: The HyperFlex cluster consists of UCS Fabric Interconnect-attached nodes on a single site. 2. Stretched Cluster: The HyperFlex cluster consists of UCS Fabric Interconnect-attached nodes distributed across multiple sites. 3. Edge: The HyperFlex cluster consists of 2-4 standalone nodes. If the cluster is running a HyperFlex Data Platform version less than 4.0 or if the deployment type cannot be determined, the deployment type is set as ‘NA’ (not available). * ‘NA` - The deployment type of the HyperFlex cluster is not available. * `Datacenter` - The deployment type of a HyperFlex cluster consisting of UCS Fabric Interconnect-attached nodes on the same site. * `Stretched Cluster` - The deployment type of a HyperFlex cluster consisting of UCS Fabric Interconnect-attached nodes across different sites. * `Edge` - The deployment type of a HyperFlex cluster consisting of 2 or more standalone nodes.



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

def deployment_type
  @deployment_type
end

#drive_typeObject

The type of the drives used for storage in this cluster. * ‘NA` - The drive type of the HyperFlex cluster is not available. * `All-Flash` - Indicates that this HyperFlex cluster contains flash drives only. * `Hybrid` - Indicates that this HyperFlex cluster contains both flash and hard disk drives.



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

def drive_type
  @drive_type
end

#hx_versionObject

The HyperFlex Data or Application Platform version of this cluster.



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

def hx_version
  @hx_version
end

#hypervisor_versionObject

The version of hypervisor running on this cluster.



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

def hypervisor_version
  @hypervisor_version
end

#object_typeObject

The fully-qualified name of the instantiated, concrete type. The value should be the same as the ‘ClassId’ property. The enum values provides the list of concrete types that can be instantiated from this abstract type.



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

def object_type
  @object_type
end

#parent_clusterObject

Returns the value of attribute parent_cluster.



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

def parent_cluster
  @parent_cluster
end

#storage_capacityObject

The storage capacity in this cluster.



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

def storage_capacity
  @storage_capacity
end

#storage_node_countObject

The number of storage nodes that belong to this cluster.



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

def storage_node_count
  @storage_node_count
end

#storage_utilizationObject

The storage utilization is computed based on total capacity and current capacity utilization.



61
62
63
# File 'lib/intersight_client/models/hyperflex_base_cluster_all_of.rb', line 61

def storage_utilization
  @storage_utilization
end

#utilization_percentageObject

The storage utilization percentage is computed based on total capacity and current capacity utilization.



64
65
66
# File 'lib/intersight_client/models/hyperflex_base_cluster_all_of.rb', line 64

def utilization_percentage
  @utilization_percentage
end

#utilization_trend_percentageObject

The storage utilization trend percentage represents the trend in percentage computed using the first and last point from historical data.



67
68
69
# File 'lib/intersight_client/models/hyperflex_base_cluster_all_of.rb', line 67

def utilization_trend_percentage
  @utilization_trend_percentage
end

Class Method Details

.acceptable_attribute_mapObject

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



130
131
132
# File 'lib/intersight_client/models/hyperflex_base_cluster_all_of.rb', line 130

def self.acceptable_attribute_map
  attribute_map
end

.acceptable_attributesObject

Returns all the JSON keys this model knows about



125
126
127
# File 'lib/intersight_client/models/hyperflex_base_cluster_all_of.rb', line 125

def self.acceptable_attributes
  attribute_map.values
end

.attribute_mapObject

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



99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
# File 'lib/intersight_client/models/hyperflex_base_cluster_all_of.rb', line 99

def self.attribute_map
  {
    :'class_id' => :'ClassId',
    :'object_type' => :'ObjectType',
    :'alarm_summary' => :'AlarmSummary',
    :'capacity_runway' => :'CapacityRunway',
    :'cluster_name' => :'ClusterName',
    :'cluster_purpose' => :'ClusterPurpose',
    :'compute_node_count' => :'ComputeNodeCount',
    :'converged_node_count' => :'ConvergedNodeCount',
    :'deployment_type' => :'DeploymentType',
    :'drive_type' => :'DriveType',
    :'hx_version' => :'HxVersion',
    :'hypervisor_version' => :'HypervisorVersion',
    :'storage_capacity' => :'StorageCapacity',
    :'storage_node_count' => :'StorageNodeCount',
    :'storage_utilization' => :'StorageUtilization',
    :'utilization_percentage' => :'UtilizationPercentage',
    :'utilization_trend_percentage' => :'UtilizationTrendPercentage',
    :'associated_profile' => :'AssociatedProfile',
    :'child_clusters' => :'ChildClusters',
    :'parent_cluster' => :'ParentCluster'
  }
end

.build_from_hash(attributes) ⇒ Object

Builds the object from hash

Parameters:

  • Model attributes in the form of hash

Returns:

  • Returns the model itself



399
400
401
# File 'lib/intersight_client/models/hyperflex_base_cluster_all_of.rb', line 399

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

.openapi_nullableObject

List of attributes with nullable: true



161
162
163
164
165
166
# File 'lib/intersight_client/models/hyperflex_base_cluster_all_of.rb', line 161

def self.openapi_nullable
  Set.new([
    :'alarm_summary',
    :'child_clusters',
  ])
end

.openapi_typesObject

Attribute type mapping.



135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
# File 'lib/intersight_client/models/hyperflex_base_cluster_all_of.rb', line 135

def self.openapi_types
  {
    :'class_id' => :'String',
    :'object_type' => :'String',
    :'alarm_summary' => :'HyperflexAlarmSummary',
    :'capacity_runway' => :'Integer',
    :'cluster_name' => :'String',
    :'cluster_purpose' => :'String',
    :'compute_node_count' => :'Integer',
    :'converged_node_count' => :'Integer',
    :'deployment_type' => :'String',
    :'drive_type' => :'String',
    :'hx_version' => :'String',
    :'hypervisor_version' => :'String',
    :'storage_capacity' => :'Integer',
    :'storage_node_count' => :'Integer',
    :'storage_utilization' => :'Float',
    :'utilization_percentage' => :'Float',
    :'utilization_trend_percentage' => :'Float',
    :'associated_profile' => :'PolicyAbstractProfileRelationship',
    :'child_clusters' => :'Array<HyperflexBaseClusterRelationship>',
    :'parent_cluster' => :'HyperflexBaseClusterRelationship'
  }
end

Instance Method Details

#==(o) ⇒ Object

Checks equality by comparing each attribute.

Parameters:

  • to be compared



359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
# File 'lib/intersight_client/models/hyperflex_base_cluster_all_of.rb', line 359

def ==(o)
  return true if self.equal?(o)
  self.class == o.class &&
      class_id == o.class_id &&
      object_type == o.object_type &&
      alarm_summary == o.alarm_summary &&
      capacity_runway == o.capacity_runway &&
      cluster_name == o.cluster_name &&
      cluster_purpose == o.cluster_purpose &&
      compute_node_count == o.compute_node_count &&
      converged_node_count == o.converged_node_count &&
      deployment_type == o.deployment_type &&
      drive_type == o.drive_type &&
      hx_version == o.hx_version &&
      hypervisor_version == o.hypervisor_version &&
      storage_capacity == o.storage_capacity &&
      storage_node_count == o.storage_node_count &&
      storage_utilization == o.storage_utilization &&
      utilization_percentage == o.utilization_percentage &&
      utilization_trend_percentage == o.utilization_trend_percentage &&
      associated_profile == o.associated_profile &&
      child_clusters == o.child_clusters &&
      parent_cluster == o.parent_cluster
end

#_deserialize(type, value) ⇒ Object

Deserializes the data based on type

Parameters:

  • type Data type

  • value Value to be deserialized

Returns:

  • Deserialized data



429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
# File 'lib/intersight_client/models/hyperflex_base_cluster_all_of.rb', line 429

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:

  • Any valid value

Returns:

  • Returns the value in the form of hash



500
501
502
503
504
505
506
507
508
509
510
511
512
# File 'lib/intersight_client/models/hyperflex_base_cluster_all_of.rb', line 500

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:

  • Model attributes in the form of hash

Returns:

  • Returns the model itself



406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
# File 'lib/intersight_client/models/hyperflex_base_cluster_all_of.rb', line 406

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

  self
end

#eql?(o) ⇒ Boolean

Parameters:

  • to be compared

Returns:

See Also:

  • `==` method


386
387
388
# File 'lib/intersight_client/models/hyperflex_base_cluster_all_of.rb', line 386

def eql?(o)
  self == o
end

#hashInteger

Calculates hash code according to all attributes.

Returns:

  • Hash code



392
393
394
# File 'lib/intersight_client/models/hyperflex_base_cluster_all_of.rb', line 392

def hash
  [class_id, object_type, alarm_summary, capacity_runway, cluster_name, cluster_purpose, compute_node_count, converged_node_count, deployment_type, drive_type, hx_version, hypervisor_version, storage_capacity, storage_node_count, storage_utilization, utilization_percentage, utilization_trend_percentage, associated_profile, child_clusters, parent_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



276
277
278
279
280
281
282
283
284
285
286
287
# File 'lib/intersight_client/models/hyperflex_base_cluster_all_of.rb', line 276

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:

  • Returns the object in the form of hash



476
477
478
# File 'lib/intersight_client/models/hyperflex_base_cluster_all_of.rb', line 476

def to_body
  to_hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • Returns the object in the form of hash



482
483
484
485
486
487
488
489
490
491
492
493
494
# File 'lib/intersight_client/models/hyperflex_base_cluster_all_of.rb', line 482

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



470
471
472
# File 'lib/intersight_client/models/hyperflex_base_cluster_all_of.rb', line 470

def to_s
  to_hash.to_s
end

#valid?Boolean

Check to see if the all the properties in the model are valid

Returns:

  • true if the model is valid



291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
# File 'lib/intersight_client/models/hyperflex_base_cluster_all_of.rb', line 291

def valid?
  return false if @class_id.nil?
  class_id_validator = EnumAttributeValidator.new('String', ["hyperflex.Cluster", "hyperflex.HxapCluster"])
  return false unless class_id_validator.valid?(@class_id)
  return false if @object_type.nil?
  object_type_validator = EnumAttributeValidator.new('String', ["hyperflex.Cluster", "hyperflex.HxapCluster"])
  return false unless object_type_validator.valid?(@object_type)
  cluster_purpose_validator = EnumAttributeValidator.new('String', ["Storage", "Compute", "Unknown"])
  return false unless cluster_purpose_validator.valid?(@cluster_purpose)
  deployment_type_validator = EnumAttributeValidator.new('String', ["NA", "Datacenter", "Stretched Cluster", "Edge"])
  return false unless deployment_type_validator.valid?(@deployment_type)
  drive_type_validator = EnumAttributeValidator.new('String', ["NA", "All-Flash", "Hybrid"])
  return false unless drive_type_validator.valid?(@drive_type)
  true
end