Class: OCI::DatabaseManagement::Models::DatabaseUsageMetrics

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

Overview

The list of aggregated metrics for Managed Databases in the fleet.

Constant Summary collapse

DATABASE_TYPE_ENUM =
[
  DATABASE_TYPE_EXTERNAL_SIDB = 'EXTERNAL_SIDB'.freeze,
  DATABASE_TYPE_EXTERNAL_RAC = 'EXTERNAL_RAC'.freeze,
  DATABASE_TYPE_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
].freeze
DATABASE_SUB_TYPE_ENUM =
[
  DATABASE_SUB_TYPE_CDB = 'CDB'.freeze,
  DATABASE_SUB_TYPE_PDB = 'PDB'.freeze,
  DATABASE_SUB_TYPE_NON_CDB = 'NON_CDB'.freeze,
  DATABASE_SUB_TYPE_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
].freeze

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ DatabaseUsageMetrics

Initializes the object

Parameters:

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

    Model attributes in the form of hash

Options Hash (attributes):



95
96
97
98
99
100
101
102
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
129
130
131
132
133
134
135
136
137
138
# File 'lib/oci/database_management/models/database_usage_metrics.rb', line 95

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.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.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_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.database_sub_type = attributes[:'databaseSubType'] if attributes[:'databaseSubType']

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

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

  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_container_id = attributes[:'databaseContainerId'] if attributes[:'databaseContainerId']

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

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

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

Instance Attribute Details

#compartment_idString

The [OCID](docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the compartment where the Managed Database resides.

Returns:

  • (String)


30
31
32
# File 'lib/oci/database_management/models/database_usage_metrics.rb', line 30

def compartment_id
  @compartment_id
end

#database_container_idString

The [OCID](docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the parent Container Database, in the case of a Pluggable Database.

Returns:

  • (String)


46
47
48
# File 'lib/oci/database_management/models/database_usage_metrics.rb', line 46

def database_container_id
  @database_container_id
end

#database_nameString

The display name of the Managed Database.

Returns:

  • (String)


42
43
44
# File 'lib/oci/database_management/models/database_usage_metrics.rb', line 42

def database_name
  @database_name
end

#database_sub_typeString

The subtype of the Oracle Database. Indicates whether the database is a Container Database, Pluggable Database, or a Non-container Database.

Returns:

  • (String)


38
39
40
# File 'lib/oci/database_management/models/database_usage_metrics.rb', line 38

def database_sub_type
  @database_sub_type
end

#database_typeString

The type of Oracle Database installation.

Returns:

  • (String)


34
35
36
# File 'lib/oci/database_management/models/database_usage_metrics.rb', line 34

def database_type
  @database_type
end

#db_idString

Returns:

  • (String)


26
27
28
# File 'lib/oci/database_management/models/database_usage_metrics.rb', line 26

def db_id
  @db_id
end

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

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



50
51
52
# File 'lib/oci/database_management/models/database_usage_metrics.rb', line 50

def metrics
  @metrics
end

Class Method Details

.attribute_mapObject

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



53
54
55
56
57
58
59
60
61
62
63
64
65
# File 'lib/oci/database_management/models/database_usage_metrics.rb', line 53

def self.attribute_map
  {
    # rubocop:disable Style/SymbolLiteral
    'db_id': :'dbId',
    'compartment_id': :'compartmentId',
    'database_type': :'databaseType',
    'database_sub_type': :'databaseSubType',
    'database_name': :'databaseName',
    'database_container_id': :'databaseContainerId',
    'metrics': :'metrics'
    # rubocop:enable Style/SymbolLiteral
  }
end

.swagger_typesObject

Attribute type mapping.



68
69
70
71
72
73
74
75
76
77
78
79
80
# File 'lib/oci/database_management/models/database_usage_metrics.rb', line 68

def self.swagger_types
  {
    # rubocop:disable Style/SymbolLiteral
    'db_id': :'String',
    'compartment_id': :'String',
    'database_type': :'String',
    'database_sub_type': :'String',
    'database_name': :'String',
    'database_container_id': :'String',
    'metrics': :'Array<OCI::DatabaseManagement::Models::FleetMetricDefinition>'
    # 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



173
174
175
176
177
178
179
180
181
182
183
184
# File 'lib/oci/database_management/models/database_usage_metrics.rb', line 173

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

  self.class == other.class &&
    db_id == other.db_id &&
    compartment_id == other.compartment_id &&
    database_type == other.database_type &&
    database_sub_type == other.database_sub_type &&
    database_name == other.database_name &&
    database_container_id == other.database_container_id &&
    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



209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
# File 'lib/oci/database_management/models/database_usage_metrics.rb', line 209

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


189
190
191
# File 'lib/oci/database_management/models/database_usage_metrics.rb', line 189

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



198
199
200
# File 'lib/oci/database_management/models/database_usage_metrics.rb', line 198

def hash
  [db_id, compartment_id, database_type, database_sub_type, database_name, database_container_id, metrics].hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



242
243
244
245
246
247
248
249
250
251
# File 'lib/oci/database_management/models/database_usage_metrics.rb', line 242

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



236
237
238
# File 'lib/oci/database_management/models/database_usage_metrics.rb', line 236

def to_s
  to_hash.to_s
end