Class: OCI::DatabaseManagement::Models::HeatWaveClusterUsageMetrics

Inherits:
Object
  • Object
show all
Defined in:
lib/oci/database_management/models/heat_wave_cluster_usage_metrics.rb

Overview

The list of aggregated metrics for a HeatWave cluster in the fleet.

Constant Summary collapse

STATUS_ENUM =
[
  STATUS_UP = 'UP'.freeze,
  STATUS_DOWN = 'DOWN'.freeze,
  STATUS_UNKNOWN = 'UNKNOWN'.freeze,
  STATUS_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
].freeze

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ HeatWaveClusterUsageMetrics

Initializes the object

Parameters:

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

    Model attributes in the form of hash

Options Hash (attributes):



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
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
# File 'lib/oci/database_management/models/heat_wave_cluster_usage_metrics.rb', line 104

def initialize(attributes = {})
  return unless attributes.is_a?(Hash)

  # convert string to symbol for hash key
  attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }

  self.status = attributes[:'status'] if attributes[:'status']

  self.db_system_id = attributes[:'dbSystemId'] if attributes[:'dbSystemId']

  raise 'You cannot provide both :dbSystemId and :db_system_id' if attributes.key?(:'dbSystemId') && attributes.key?(:'db_system_id')

  self.db_system_id = attributes[:'db_system_id'] if attributes[:'db_system_id']

  self.db_system_name = attributes[:'dbSystemName'] if attributes[:'dbSystemName']

  raise 'You cannot provide both :dbSystemName and :db_system_name' if attributes.key?(:'dbSystemName') && attributes.key?(:'db_system_name')

  self.db_system_name = attributes[:'db_system_name'] if attributes[:'db_system_name']

  self.heat_wave_cluster_display_name = attributes[:'heatWaveClusterDisplayName'] if attributes[:'heatWaveClusterDisplayName']

  raise 'You cannot provide both :heatWaveClusterDisplayName and :heat_wave_cluster_display_name' if attributes.key?(:'heatWaveClusterDisplayName') && attributes.key?(:'heat_wave_cluster_display_name')

  self.heat_wave_cluster_display_name = attributes[:'heat_wave_cluster_display_name'] if attributes[:'heat_wave_cluster_display_name']

  self.node_count = attributes[:'nodeCount'] if attributes[:'nodeCount']

  raise 'You cannot provide both :nodeCount and :node_count' if attributes.key?(:'nodeCount') && attributes.key?(:'node_count')

  self.node_count = attributes[:'node_count'] if attributes[:'node_count']

  self.is_lakehouse_enabled = attributes[:'isLakehouseEnabled'] unless attributes[:'isLakehouseEnabled'].nil?

  raise 'You cannot provide both :isLakehouseEnabled and :is_lakehouse_enabled' if attributes.key?(:'isLakehouseEnabled') && attributes.key?(:'is_lakehouse_enabled')

  self.is_lakehouse_enabled = attributes[:'is_lakehouse_enabled'] unless attributes[:'is_lakehouse_enabled'].nil?

  self.heat_wave_node_shape = attributes[:'heatWaveNodeShape'] if attributes[:'heatWaveNodeShape']

  raise 'You cannot provide both :heatWaveNodeShape and :heat_wave_node_shape' if attributes.key?(:'heatWaveNodeShape') && attributes.key?(:'heat_wave_node_shape')

  self.heat_wave_node_shape = attributes[:'heat_wave_node_shape'] if attributes[:'heat_wave_node_shape']

  self.memory_size = attributes[:'memorySize'] if attributes[:'memorySize']

  raise 'You cannot provide both :memorySize and :memory_size' if attributes.key?(:'memorySize') && attributes.key?(:'memory_size')

  self.memory_size = attributes[:'memory_size'] if attributes[:'memory_size']

  self.metrics = attributes[:'metrics'] if attributes[:'metrics']
end

Instance Attribute Details

#db_system_idString

[Required] The OCID of the MySQL Database System associated with the HeatWave cluster.

Returns:

  • (String)


25
26
27
# File 'lib/oci/database_management/models/heat_wave_cluster_usage_metrics.rb', line 25

def db_system_id
  @db_system_id
end

#db_system_nameString

[Required] The name of the MySQL Database System associated with the HeatWave cluster.

Returns:

  • (String)


29
30
31
# File 'lib/oci/database_management/models/heat_wave_cluster_usage_metrics.rb', line 29

def db_system_name
  @db_system_name
end

#heat_wave_cluster_display_nameString

[Required] The name of the HeatWave cluster.

Returns:

  • (String)


33
34
35
# File 'lib/oci/database_management/models/heat_wave_cluster_usage_metrics.rb', line 33

def heat_wave_cluster_display_name
  @heat_wave_cluster_display_name
end

#heat_wave_node_shapeString

[Required] The shape of the nodes in the HeatWave cluster.

Returns:

  • (String)


45
46
47
# File 'lib/oci/database_management/models/heat_wave_cluster_usage_metrics.rb', line 45

def heat_wave_node_shape
  @heat_wave_node_shape
end

#is_lakehouse_enabledBOOLEAN

[Required] Indicates whether Lakehouse is enabled for the HeatWave cluster or not.

Returns:

  • (BOOLEAN)


41
42
43
# File 'lib/oci/database_management/models/heat_wave_cluster_usage_metrics.rb', line 41

def is_lakehouse_enabled
  @is_lakehouse_enabled
end

#memory_sizeInteger

[Required] The total memory belonging to the HeatWave cluster in GBs.

Returns:

  • (Integer)


49
50
51
# File 'lib/oci/database_management/models/heat_wave_cluster_usage_metrics.rb', line 49

def memory_size
  @memory_size
end

#metricsArray<OCI::DatabaseManagement::Models::HeatWaveFleetMetricDefinition>

[Required] A list of the HeatWave cluster health metrics like CPU and Memory.



53
54
55
# File 'lib/oci/database_management/models/heat_wave_cluster_usage_metrics.rb', line 53

def metrics
  @metrics
end

#node_countInteger

[Required] The number of nodes in the HeatWave cluster.

Returns:

  • (Integer)


37
38
39
# File 'lib/oci/database_management/models/heat_wave_cluster_usage_metrics.rb', line 37

def node_count
  @node_count
end

#statusString

[Required] The status of the HeatWave cluster. Indicates whether the status of the cluster is UP, DOWN, or UNKNOWN at the current time.

Returns:

  • (String)


21
22
23
# File 'lib/oci/database_management/models/heat_wave_cluster_usage_metrics.rb', line 21

def status
  @status
end

Class Method Details

.attribute_mapObject

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



56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
# File 'lib/oci/database_management/models/heat_wave_cluster_usage_metrics.rb', line 56

def self.attribute_map
  {
    # rubocop:disable Style/SymbolLiteral
    'status': :'status',
    'db_system_id': :'dbSystemId',
    'db_system_name': :'dbSystemName',
    'heat_wave_cluster_display_name': :'heatWaveClusterDisplayName',
    'node_count': :'nodeCount',
    'is_lakehouse_enabled': :'isLakehouseEnabled',
    'heat_wave_node_shape': :'heatWaveNodeShape',
    'memory_size': :'memorySize',
    'metrics': :'metrics'
    # rubocop:enable Style/SymbolLiteral
  }
end

.swagger_typesObject

Attribute type mapping.



73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
# File 'lib/oci/database_management/models/heat_wave_cluster_usage_metrics.rb', line 73

def self.swagger_types
  {
    # rubocop:disable Style/SymbolLiteral
    'status': :'String',
    'db_system_id': :'String',
    'db_system_name': :'String',
    'heat_wave_cluster_display_name': :'String',
    'node_count': :'Integer',
    'is_lakehouse_enabled': :'BOOLEAN',
    'heat_wave_node_shape': :'String',
    'memory_size': :'Integer',
    'metrics': :'Array<OCI::DatabaseManagement::Models::HeatWaveFleetMetricDefinition>'
    # rubocop:enable Style/SymbolLiteral
  }
end

Instance Method Details

#==(other) ⇒ Object

Checks equality by comparing each attribute.

Parameters:

  • other (Object)

    the other object to be compared



177
178
179
180
181
182
183
184
185
186
187
188
189
190
# File 'lib/oci/database_management/models/heat_wave_cluster_usage_metrics.rb', line 177

def ==(other)
  return true if equal?(other)

  self.class == other.class &&
    status == other.status &&
    db_system_id == other.db_system_id &&
    db_system_name == other.db_system_name &&
    heat_wave_cluster_display_name == other.heat_wave_cluster_display_name &&
    node_count == other.node_count &&
    is_lakehouse_enabled == other.is_lakehouse_enabled &&
    heat_wave_node_shape == other.heat_wave_node_shape &&
    memory_size == other.memory_size &&
    metrics == other.metrics
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



215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
# File 'lib/oci/database_management/models/heat_wave_cluster_usage_metrics.rb', line 215

def build_from_hash(attributes)
  return nil unless attributes.is_a?(Hash)

  self.class.swagger_types.each_pair do |key, type|
    if type =~ /^Array<(.*)>/i
      # check to ensure the input is an array given that the the attribute
      # is documented as an array but the input is not
      if attributes[self.class.attribute_map[key]].is_a?(Array)
        public_method("#{key}=").call(
          attributes[self.class.attribute_map[key]]
            .map { |v| OCI::Internal::Util.convert_to_type(Regexp.last_match(1), v) }
        )
      end
    elsif !attributes[self.class.attribute_map[key]].nil?
      public_method("#{key}=").call(
        OCI::Internal::Util.convert_to_type(type, attributes[self.class.attribute_map[key]])
      )
    end
    # or else data not found in attributes(hash), not an issue as the data can be optional
  end

  self
end

#eql?(other) ⇒ Boolean

Parameters:

  • other (Object)

    the other object to be compared

Returns:

  • (Boolean)

See Also:

  • `==` method


195
196
197
# File 'lib/oci/database_management/models/heat_wave_cluster_usage_metrics.rb', line 195

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



204
205
206
# File 'lib/oci/database_management/models/heat_wave_cluster_usage_metrics.rb', line 204

def hash
  [status, db_system_id, db_system_name, heat_wave_cluster_display_name, node_count, is_lakehouse_enabled, heat_wave_node_shape, memory_size, metrics].hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



248
249
250
251
252
253
254
255
256
257
# File 'lib/oci/database_management/models/heat_wave_cluster_usage_metrics.rb', line 248

def to_hash
  hash = {}
  self.class.attribute_map.each_pair do |attr, param|
    value = public_method(attr).call
    next if value.nil? && !instance_variable_defined?("@#{attr}")

    hash[param] = _to_hash(value)
  end
  hash
end

#to_sString

Returns the string representation of the object

Returns:

  • (String)

    String presentation of the object



242
243
244
# File 'lib/oci/database_management/models/heat_wave_cluster_usage_metrics.rb', line 242

def to_s
  to_hash.to_s
end