Class: OCI::DatabaseManagement::Models::MySqlDatabaseUsageMetrics

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

Overview

The list of aggregated metrics for Managed MySQL Databases in the fleet. MySQL support within OCI Database Management service has been deprecated as of January 29, 2026.

Constant Summary collapse

DATABASE_STATUS_ENUM =
[
  DATABASE_STATUS_UP = 'UP'.freeze,
  DATABASE_STATUS_DOWN = 'DOWN'.freeze,
  DATABASE_STATUS_UNKNOWN = 'UNKNOWN'.freeze,
  DATABASE_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 = {}) ⇒ MySqlDatabaseUsageMetrics

Initializes the object

Parameters:

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

    Model attributes in the form of hash

Options Hash (attributes):



134
135
136
137
138
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
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
# File 'lib/oci/database_management/models/my_sql_database_usage_metrics.rb', line 134

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.compartment_id = attributes[:'compartmentId'] if attributes[:'compartmentId']

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

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

  self.database_name = attributes[:'databaseName'] if attributes[:'databaseName']

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

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

  self.database_type = attributes[:'databaseType'] if attributes[:'databaseType']

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

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

  self.mds_deployment_type = attributes[:'mdsDeploymentType'] if attributes[:'mdsDeploymentType']

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

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

  self.mdslifecycle_state = attributes[:'mdslifecycleState'] if attributes[:'mdslifecycleState']

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

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

  self.database_version = attributes[:'databaseVersion'] if attributes[:'databaseVersion']

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

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

  self.db_id = attributes[:'dbId'] if attributes[:'dbId']

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

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

  self.database_status = attributes[:'databaseStatus'] if attributes[:'databaseStatus']

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

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

  self.heat_wave_management_type = attributes[:'heatWaveManagementType'] if attributes[:'heatWaveManagementType']

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

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

  self.is_heat_wave_enabled = attributes[:'isHeatWaveEnabled'] unless attributes[:'isHeatWaveEnabled'].nil?

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

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

  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.heat_wave_node_count = attributes[:'heatWaveNodeCount'] if attributes[:'heatWaveNodeCount']

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

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

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

Instance Attribute Details

#compartment_idString

[Required] The OCID of the compartment where the Managed MySQL Database resides.

Returns:

  • (String)


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

def compartment_id
  @compartment_id
end

#database_nameString

[Required] The display name of the Managed MySQL Database.

Returns:

  • (String)


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

def database_name
  @database_name
end

#database_statusString

[Required] The status of the MySQL Database. Indicates whether the status of the database is UP, DOWN, or UNKNOWN at the current time.

Returns:

  • (String)


51
52
53
# File 'lib/oci/database_management/models/my_sql_database_usage_metrics.rb', line 51

def database_status
  @database_status
end

#database_typeString

[Required] Indicates MySQL Database type, ONPREMISE or MySQL Database System.

Returns:

  • (String)


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

def database_type
  @database_type
end

#database_versionString

[Required] The version of the MySQL Database.

Returns:

  • (String)


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

def database_version
  @database_version
end

#db_idString

[Required] The OCID of the Managed MySQL Database.

Returns:

  • (String)


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

def db_id
  @db_id
end

#heat_wave_cluster_display_nameString

The name of the HeatWave cluster.

Returns:

  • (String)


63
64
65
# File 'lib/oci/database_management/models/my_sql_database_usage_metrics.rb', line 63

def heat_wave_cluster_display_name
  @heat_wave_cluster_display_name
end

#heat_wave_management_typeString

The selected management type for a HeatWave MySQL DB system.

Returns:

  • (String)


55
56
57
# File 'lib/oci/database_management/models/my_sql_database_usage_metrics.rb', line 55

def heat_wave_management_type
  @heat_wave_management_type
end

#heat_wave_node_countInteger

The number of nodes in the HeatWave cluster.

Returns:

  • (Integer)


67
68
69
# File 'lib/oci/database_management/models/my_sql_database_usage_metrics.rb', line 67

def heat_wave_node_count
  @heat_wave_node_count
end

#is_heat_wave_enabledBOOLEAN

Indicates whether HeatWave is enabled for the MySQL Database System or not.

Returns:

  • (BOOLEAN)


59
60
61
# File 'lib/oci/database_management/models/my_sql_database_usage_metrics.rb', line 59

def is_heat_wave_enabled
  @is_heat_wave_enabled
end

#mds_deployment_typeString

[Required] The type of MySQL Database System.

Returns:

  • (String)


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

def mds_deployment_type
  @mds_deployment_type
end

#mdslifecycle_stateString

[Required] The lifecycle state of the MySQL Database System.

Returns:

  • (String)


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

def mdslifecycle_state
  @mdslifecycle_state
end

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

[Required] A list of the database health metrics like CPU, Storage, and Memory.



71
72
73
# File 'lib/oci/database_management/models/my_sql_database_usage_metrics.rb', line 71

def metrics
  @metrics
end

Class Method Details

.attribute_mapObject

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



74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
# File 'lib/oci/database_management/models/my_sql_database_usage_metrics.rb', line 74

def self.attribute_map
  {
    # rubocop:disable Style/SymbolLiteral
    'compartment_id': :'compartmentId',
    'database_name': :'databaseName',
    'database_type': :'databaseType',
    'mds_deployment_type': :'mdsDeploymentType',
    'mdslifecycle_state': :'mdslifecycleState',
    'database_version': :'databaseVersion',
    'db_id': :'dbId',
    'database_status': :'databaseStatus',
    'heat_wave_management_type': :'heatWaveManagementType',
    'is_heat_wave_enabled': :'isHeatWaveEnabled',
    'heat_wave_cluster_display_name': :'heatWaveClusterDisplayName',
    'heat_wave_node_count': :'heatWaveNodeCount',
    'metrics': :'metrics'
    # rubocop:enable Style/SymbolLiteral
  }
end

.swagger_typesObject

Attribute type mapping.



95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
# File 'lib/oci/database_management/models/my_sql_database_usage_metrics.rb', line 95

def self.swagger_types
  {
    # rubocop:disable Style/SymbolLiteral
    'compartment_id': :'String',
    'database_name': :'String',
    'database_type': :'String',
    'mds_deployment_type': :'String',
    'mdslifecycle_state': :'String',
    'database_version': :'String',
    'db_id': :'String',
    'database_status': :'String',
    'heat_wave_management_type': :'String',
    'is_heat_wave_enabled': :'BOOLEAN',
    'heat_wave_cluster_display_name': :'String',
    'heat_wave_node_count': :'Integer',
    'metrics': :'Array<OCI::DatabaseManagement::Models::MySqlFleetMetricDefinition>'
    # 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



235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
# File 'lib/oci/database_management/models/my_sql_database_usage_metrics.rb', line 235

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

  self.class == other.class &&
    compartment_id == other.compartment_id &&
    database_name == other.database_name &&
    database_type == other.database_type &&
    mds_deployment_type == other.mds_deployment_type &&
    mdslifecycle_state == other.mdslifecycle_state &&
    database_version == other.database_version &&
    db_id == other.db_id &&
    database_status == other.database_status &&
    heat_wave_management_type == other.heat_wave_management_type &&
    is_heat_wave_enabled == other.is_heat_wave_enabled &&
    heat_wave_cluster_display_name == other.heat_wave_cluster_display_name &&
    heat_wave_node_count == other.heat_wave_node_count &&
    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



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/oci/database_management/models/my_sql_database_usage_metrics.rb', line 277

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


257
258
259
# File 'lib/oci/database_management/models/my_sql_database_usage_metrics.rb', line 257

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



266
267
268
# File 'lib/oci/database_management/models/my_sql_database_usage_metrics.rb', line 266

def hash
  [compartment_id, database_name, database_type, mds_deployment_type, mdslifecycle_state, database_version, db_id, database_status, heat_wave_management_type, is_heat_wave_enabled, heat_wave_cluster_display_name, heat_wave_node_count, metrics].hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



310
311
312
313
314
315
316
317
318
319
# File 'lib/oci/database_management/models/my_sql_database_usage_metrics.rb', line 310

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



304
305
306
# File 'lib/oci/database_management/models/my_sql_database_usage_metrics.rb', line 304

def to_s
  to_hash.to_s
end