Class: OCI::DatabaseManagement::Models::OptimizerDatabase

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

Overview

The subset information of the Managed Database resource, which is used by Optimizer Statistics.

Constant Summary collapse

DB_TYPE_ENUM =
[
  DB_TYPE_EXTERNAL_SIDB = 'EXTERNAL_SIDB'.freeze,
  DB_TYPE_EXTERNAL_RAC = 'EXTERNAL_RAC'.freeze,
  DB_TYPE_CLOUD_SIDB = 'CLOUD_SIDB'.freeze,
  DB_TYPE_CLOUD_RAC = 'CLOUD_RAC'.freeze,
  DB_TYPE_SHARED = 'SHARED'.freeze,
  DB_TYPE_DEDICATED = 'DEDICATED'.freeze,
  DB_TYPE_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
].freeze
DB_SUB_TYPE_ENUM =
[
  DB_SUB_TYPE_CDB = 'CDB'.freeze,
  DB_SUB_TYPE_PDB = 'PDB'.freeze,
  DB_SUB_TYPE_NON_CDB = 'NON_CDB'.freeze,
  DB_SUB_TYPE_ACD = 'ACD'.freeze,
  DB_SUB_TYPE_ADB = 'ADB'.freeze,
  DB_SUB_TYPE_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
].freeze
DB_DEPLOYMENT_TYPE_ENUM =
[
  DB_DEPLOYMENT_TYPE_ONPREMISE = 'ONPREMISE'.freeze,
  DB_DEPLOYMENT_TYPE_BM = 'BM'.freeze,
  DB_DEPLOYMENT_TYPE_VM = 'VM'.freeze,
  DB_DEPLOYMENT_TYPE_EXADATA = 'EXADATA'.freeze,
  DB_DEPLOYMENT_TYPE_EXADATA_CC = 'EXADATA_CC'.freeze,
  DB_DEPLOYMENT_TYPE_AUTONOMOUS = 'AUTONOMOUS'.freeze,
  DB_DEPLOYMENT_TYPE_EXADATA_XS = 'EXADATA_XS'.freeze,
  DB_DEPLOYMENT_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 = {}) ⇒ OptimizerDatabase

Initializes the object

Parameters:

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

    Model attributes in the form of hash

Options Hash (attributes):

  • :id (String)

    The value to assign to the #id property

  • :name (String)

    The value to assign to the #name property

  • :db_type (String)

    The value to assign to the #db_type property

  • :db_sub_type (String)

    The value to assign to the #db_sub_type property

  • :db_deployment_type (String)

    The value to assign to the #db_deployment_type property

  • :db_version (String)

    The value to assign to the #db_version property

  • :compartment_id (String)

    The value to assign to the #compartment_id property



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
# File 'lib/oci/database_management/models/optimizer_database.rb', line 115

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

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

  self.db_type = attributes[:'dbType'] if attributes[:'dbType']

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

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

  self.db_sub_type = attributes[:'dbSubType'] if attributes[:'dbSubType']

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

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

  self.db_deployment_type = attributes[:'dbDeploymentType'] if attributes[:'dbDeploymentType']

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

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

  self.db_version = attributes[:'dbVersion'] if attributes[:'dbVersion']

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

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

  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']
end

Instance Attribute Details

#compartment_idString

[Required] The OCID of the compartment in which the Managed Database resides.

Returns:

  • (String)


70
71
72
# File 'lib/oci/database_management/models/optimizer_database.rb', line 70

def compartment_id
  @compartment_id
end

#db_deployment_typeString

[Required] The infrastructure used to deploy the Oracle Database.

Returns:

  • (String)


62
63
64
# File 'lib/oci/database_management/models/optimizer_database.rb', line 62

def db_deployment_type
  @db_deployment_type
end

#db_sub_typeString

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

Returns:

  • (String)


58
59
60
# File 'lib/oci/database_management/models/optimizer_database.rb', line 58

def db_sub_type
  @db_sub_type
end

#db_typeString

[Required] The type of Oracle Database installation.

Returns:

  • (String)


52
53
54
# File 'lib/oci/database_management/models/optimizer_database.rb', line 52

def db_type
  @db_type
end

#db_versionString

[Required] The version of the Oracle Database.

Returns:

  • (String)


66
67
68
# File 'lib/oci/database_management/models/optimizer_database.rb', line 66

def db_version
  @db_version
end

#idString

[Required] The OCID of the Managed Database.

Returns:

  • (String)


44
45
46
# File 'lib/oci/database_management/models/optimizer_database.rb', line 44

def id
  @id
end

#nameString

[Required] The name of the Managed Database.

Returns:

  • (String)


48
49
50
# File 'lib/oci/database_management/models/optimizer_database.rb', line 48

def name
  @name
end

Class Method Details

.attribute_mapObject

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



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

def self.attribute_map
  {
    # rubocop:disable Style/SymbolLiteral
    'id': :'id',
    'name': :'name',
    'db_type': :'dbType',
    'db_sub_type': :'dbSubType',
    'db_deployment_type': :'dbDeploymentType',
    'db_version': :'dbVersion',
    'compartment_id': :'compartmentId'
    # rubocop:enable Style/SymbolLiteral
  }
end

.swagger_typesObject

Attribute type mapping.



88
89
90
91
92
93
94
95
96
97
98
99
100
# File 'lib/oci/database_management/models/optimizer_database.rb', line 88

def self.swagger_types
  {
    # rubocop:disable Style/SymbolLiteral
    'id': :'String',
    'name': :'String',
    'db_type': :'String',
    'db_sub_type': :'String',
    'db_deployment_type': :'String',
    'db_version': :'String',
    'compartment_id': :'String'
    # 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



202
203
204
205
206
207
208
209
210
211
212
213
# File 'lib/oci/database_management/models/optimizer_database.rb', line 202

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

  self.class == other.class &&
    id == other.id &&
    name == other.name &&
    db_type == other.db_type &&
    db_sub_type == other.db_sub_type &&
    db_deployment_type == other.db_deployment_type &&
    db_version == other.db_version &&
    compartment_id == other.compartment_id
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



238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
# File 'lib/oci/database_management/models/optimizer_database.rb', line 238

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


218
219
220
# File 'lib/oci/database_management/models/optimizer_database.rb', line 218

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



227
228
229
# File 'lib/oci/database_management/models/optimizer_database.rb', line 227

def hash
  [id, name, db_type, db_sub_type, db_deployment_type, db_version, compartment_id].hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



271
272
273
274
275
276
277
278
279
280
# File 'lib/oci/database_management/models/optimizer_database.rb', line 271

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



265
266
267
# File 'lib/oci/database_management/models/optimizer_database.rb', line 265

def to_s
  to_hash.to_s
end