Class: OCI::DatabaseManagement::Models::DiscoveredCloudDatabase

Inherits:
DiscoveredCloudDbSystemComponent show all
Defined in:
lib/oci/database_management/models/discovered_cloud_database.rb

Overview

The details of a cloud Oracle Database discovered in a cloud DB system discovery run.

Constant Summary collapse

DB_TYPE_ENUM =
[
  DB_TYPE_CDB = 'CDB'.freeze,
  DB_TYPE_PDB = 'PDB'.freeze,
  DB_TYPE_NON_CDB = 'NON_CDB'.freeze,
  DB_TYPE_ACD = 'ACD'.freeze,
  DB_TYPE_ADB = 'ADB'.freeze,
  DB_TYPE_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
].freeze
DB_ROLE_ENUM =
[
  DB_ROLE_LOGICAL_STANDBY = 'LOGICAL_STANDBY'.freeze,
  DB_ROLE_PHYSICAL_STANDBY = 'PHYSICAL_STANDBY'.freeze,
  DB_ROLE_SNAPSHOT_STANDBY = 'SNAPSHOT_STANDBY'.freeze,
  DB_ROLE_PRIMARY = 'PRIMARY'.freeze,
  DB_ROLE_FAR_SYNC = 'FAR_SYNC'.freeze,
  DB_ROLE_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
].freeze

Constants inherited from DiscoveredCloudDbSystemComponent

OCI::DatabaseManagement::Models::DiscoveredCloudDbSystemComponent::COMPONENT_TYPE_ENUM, OCI::DatabaseManagement::Models::DiscoveredCloudDbSystemComponent::STATUS_ENUM

Instance Attribute Summary collapse

Attributes inherited from DiscoveredCloudDbSystemComponent

#associated_components, #component_id, #component_name, #component_type, #dbaas_id, #display_name, #is_selected_for_monitoring, #resource_id, #status

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from DiscoveredCloudDbSystemComponent

get_subtype

Constructor Details

#initialize(attributes = {}) ⇒ DiscoveredCloudDatabase

Initializes the object

Parameters:

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

    Model attributes in the form of hash

Options Hash (attributes):



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

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

  attributes['componentType'] = 'DATABASE'

  super(attributes)

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

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

  self.db_unique_name = attributes[:'db_unique_name'] if attributes[:'db_unique_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.is_cluster = attributes[:'isCluster'] unless attributes[:'isCluster'].nil?

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

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

  self.db_edition = attributes[:'dbEdition'] if attributes[:'dbEdition']

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

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

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

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

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

  self.db_role = attributes[:'dbRole'] if attributes[:'dbRole']

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

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

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

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

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

  self.db_instances = attributes[:'dbInstances'] if attributes[:'dbInstances']

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

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

  self.can_enable_all_current_pdbs = attributes[:'canEnableAllCurrentPdbs'] unless attributes[:'canEnableAllCurrentPdbs'].nil?

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

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

  self.is_auto_enable_pluggable_database = attributes[:'isAutoEnablePluggableDatabase'] unless attributes[:'isAutoEnablePluggableDatabase'].nil?

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

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

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

Instance Attribute Details

#can_enable_all_current_pdbsBOOLEAN

Indicates whether Diagnostics & Management should be enabled for all the current pluggable databases in the container database.

Returns:

  • (BOOLEAN)


79
80
81
# File 'lib/oci/database_management/models/discovered_cloud_database.rb', line 79

def can_enable_all_current_pdbs
  @can_enable_all_current_pdbs
end

#compartment_idString

[Required] The OCID of the compartment.

Returns:

  • (String)


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

def compartment_id
  @compartment_id
end

#connectorOCI::DatabaseManagement::Models::CloudDbSystemDiscoveryConnector



86
87
88
# File 'lib/oci/database_management/models/discovered_cloud_database.rb', line 86

def connector
  @connector
end

#db_editionString

The Oracle Database edition.

Returns:

  • (String)


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

def db_edition
  @db_edition
end

#db_idString

The Oracle Database ID.

Returns:

  • (String)


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

def db_id
  @db_id
end

#db_instancesArray<OCI::DatabaseManagement::Models::DiscoveredCloudDbInstance>

The list of database instances.



75
76
77
# File 'lib/oci/database_management/models/discovered_cloud_database.rb', line 75

def db_instances
  @db_instances
end

#db_packsString

The database packs licensed for the cloud Oracle Database.

Returns:

  • (String)


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

def db_packs
  @db_packs
end

#db_roleString

The role of the Oracle Database in Oracle Data Guard configuration.

Returns:

  • (String)


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

def db_role
  @db_role
end

#db_typeString

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

Returns:

  • (String)


43
44
45
# File 'lib/oci/database_management/models/discovered_cloud_database.rb', line 43

def db_type
  @db_type
end

#db_unique_nameString

[Required] The DB_UNIQUE_NAME of the cloud database.

Returns:

  • (String)


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

def db_unique_name
  @db_unique_name
end

#db_versionString

The Oracle Database version.

Returns:

  • (String)


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

def db_version
  @db_version
end

#is_auto_enable_pluggable_databaseBOOLEAN

Indicates whether Diagnostics & Management should be enabled automatically for all the pluggable databases in the container database.

Returns:

  • (BOOLEAN)


83
84
85
# File 'lib/oci/database_management/models/discovered_cloud_database.rb', line 83

def is_auto_enable_pluggable_database
  @is_auto_enable_pluggable_database
end

#is_clusterBOOLEAN

Indicates whether the Oracle Database is part of a cluster.

Returns:

  • (BOOLEAN)


47
48
49
# File 'lib/oci/database_management/models/discovered_cloud_database.rb', line 47

def is_cluster
  @is_cluster
end

#pluggable_databasesArray<OCI::DatabaseManagement::Models::DiscoveredCloudPluggableDatabase>

The list of Pluggable Databases.



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

def pluggable_databases
  @pluggable_databases
end

Class Method Details

.attribute_mapObject

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



89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
# File 'lib/oci/database_management/models/discovered_cloud_database.rb', line 89

def self.attribute_map
  {
    # rubocop:disable Style/SymbolLiteral
    'component_id': :'componentId',
    'display_name': :'displayName',
    'component_name': :'componentName',
    'component_type': :'componentType',
    'resource_id': :'resourceId',
    'dbaas_id': :'dbaasId',
    'is_selected_for_monitoring': :'isSelectedForMonitoring',
    'status': :'status',
    'associated_components': :'associatedComponents',
    'compartment_id': :'compartmentId',
    'db_unique_name': :'dbUniqueName',
    'db_type': :'dbType',
    'is_cluster': :'isCluster',
    'db_edition': :'dbEdition',
    'db_id': :'dbId',
    'db_packs': :'dbPacks',
    'db_role': :'dbRole',
    'db_version': :'dbVersion',
    'pluggable_databases': :'pluggableDatabases',
    'db_instances': :'dbInstances',
    'can_enable_all_current_pdbs': :'canEnableAllCurrentPdbs',
    'is_auto_enable_pluggable_database': :'isAutoEnablePluggableDatabase',
    'connector': :'connector'
    # rubocop:enable Style/SymbolLiteral
  }
end

.swagger_typesObject

Attribute type mapping.



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

def self.swagger_types
  {
    # rubocop:disable Style/SymbolLiteral
    'component_id': :'String',
    'display_name': :'String',
    'component_name': :'String',
    'component_type': :'String',
    'resource_id': :'String',
    'dbaas_id': :'String',
    'is_selected_for_monitoring': :'BOOLEAN',
    'status': :'String',
    'associated_components': :'Array<OCI::DatabaseManagement::Models::AssociatedCloudComponent>',
    'compartment_id': :'String',
    'db_unique_name': :'String',
    'db_type': :'String',
    'is_cluster': :'BOOLEAN',
    'db_edition': :'String',
    'db_id': :'String',
    'db_packs': :'String',
    'db_role': :'String',
    'db_version': :'String',
    'pluggable_databases': :'Array<OCI::DatabaseManagement::Models::DiscoveredCloudPluggableDatabase>',
    'db_instances': :'Array<OCI::DatabaseManagement::Models::DiscoveredCloudDbInstance>',
    'can_enable_all_current_pdbs': :'BOOLEAN',
    'is_auto_enable_pluggable_database': :'BOOLEAN',
    'connector': :'OCI::DatabaseManagement::Models::CloudDbSystemDiscoveryConnector'
    # 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



302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
# File 'lib/oci/database_management/models/discovered_cloud_database.rb', line 302

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

  self.class == other.class &&
    component_id == other.component_id &&
    display_name == other.display_name &&
    component_name == other.component_name &&
    component_type == other.component_type &&
    resource_id == other.resource_id &&
    dbaas_id == other.dbaas_id &&
    is_selected_for_monitoring == other.is_selected_for_monitoring &&
    status == other.status &&
    associated_components == other.associated_components &&
    compartment_id == other.compartment_id &&
    db_unique_name == other.db_unique_name &&
    db_type == other.db_type &&
    is_cluster == other.is_cluster &&
    db_edition == other.db_edition &&
    db_id == other.db_id &&
    db_packs == other.db_packs &&
    db_role == other.db_role &&
    db_version == other.db_version &&
    pluggable_databases == other.pluggable_databases &&
    db_instances == other.db_instances &&
    can_enable_all_current_pdbs == other.can_enable_all_current_pdbs &&
    is_auto_enable_pluggable_database == other.is_auto_enable_pluggable_database &&
    connector == other.connector
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



354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
# File 'lib/oci/database_management/models/discovered_cloud_database.rb', line 354

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


334
335
336
# File 'lib/oci/database_management/models/discovered_cloud_database.rb', line 334

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



343
344
345
# File 'lib/oci/database_management/models/discovered_cloud_database.rb', line 343

def hash
  [component_id, display_name, component_name, component_type, resource_id, dbaas_id, is_selected_for_monitoring, status, associated_components, compartment_id, db_unique_name, db_type, is_cluster, db_edition, db_id, db_packs, db_role, db_version, pluggable_databases, db_instances, can_enable_all_current_pdbs, is_auto_enable_pluggable_database, connector].hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



387
388
389
390
391
392
393
394
395
396
# File 'lib/oci/database_management/models/discovered_cloud_database.rb', line 387

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



381
382
383
# File 'lib/oci/database_management/models/discovered_cloud_database.rb', line 381

def to_s
  to_hash.to_s
end