Class: OCI::DatabaseManagement::Models::DiscoveredExternalDatabase

Inherits:
DiscoveredExternalDbSystemComponent show all
Defined in:
lib/oci/database_management/models/discovered_external_database.rb

Overview

The details of an external Oracle Database discovered in an external 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 DiscoveredExternalDbSystemComponent

OCI::DatabaseManagement::Models::DiscoveredExternalDbSystemComponent::COMPONENT_TYPE_ENUM, OCI::DatabaseManagement::Models::DiscoveredExternalDbSystemComponent::STATUS_ENUM

Instance Attribute Summary collapse

Attributes inherited from DiscoveredExternalDbSystemComponent

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

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from DiscoveredExternalDbSystemComponent

get_subtype

Constructor Details

#initialize(attributes = {}) ⇒ DiscoveredExternalDatabase

Initializes the object

Parameters:

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

    Model attributes in the form of hash

Options Hash (attributes):



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

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

  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?
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)


78
79
80
# File 'lib/oci/database_management/models/discovered_external_database.rb', line 78

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_external_database.rb', line 33

def compartment_id
  @compartment_id
end

#connectorOCI::DatabaseManagement::Models::ExternalDbSystemDiscoveryConnector



74
75
76
# File 'lib/oci/database_management/models/discovered_external_database.rb', line 74

def connector
  @connector
end

#db_editionString

The Oracle Database edition.

Returns:

  • (String)


51
52
53
# File 'lib/oci/database_management/models/discovered_external_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_external_database.rb', line 55

def db_id
  @db_id
end

#db_packsString

The database packs licensed for the external Oracle Database.

Returns:

  • (String)


59
60
61
# File 'lib/oci/database_management/models/discovered_external_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_external_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_external_database.rb', line 43

def db_type
  @db_type
end

#db_unique_nameString

[Required] The DB_UNIQUE_NAME of the external database.

Returns:

  • (String)


37
38
39
# File 'lib/oci/database_management/models/discovered_external_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_external_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)


82
83
84
# File 'lib/oci/database_management/models/discovered_external_database.rb', line 82

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_external_database.rb', line 47

def is_cluster
  @is_cluster
end

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

The list of Pluggable Databases.



71
72
73
# File 'lib/oci/database_management/models/discovered_external_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.



85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
# File 'lib/oci/database_management/models/discovered_external_database.rb', line 85

def self.attribute_map
  {
    # rubocop:disable Style/SymbolLiteral
    'component_id': :'componentId',
    'display_name': :'displayName',
    'component_name': :'componentName',
    'component_type': :'componentType',
    'resource_id': :'resourceId',
    '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',
    'connector': :'connector',
    'can_enable_all_current_pdbs': :'canEnableAllCurrentPdbs',
    'is_auto_enable_pluggable_database': :'isAutoEnablePluggableDatabase'
    # rubocop:enable Style/SymbolLiteral
  }
end

.swagger_typesObject

Attribute type mapping.



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

def self.swagger_types
  {
    # rubocop:disable Style/SymbolLiteral
    'component_id': :'String',
    'display_name': :'String',
    'component_name': :'String',
    'component_type': :'String',
    'resource_id': :'String',
    'is_selected_for_monitoring': :'BOOLEAN',
    'status': :'String',
    'associated_components': :'Array<OCI::DatabaseManagement::Models::AssociatedComponent>',
    '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::DiscoveredExternalPluggableDatabase>',
    'connector': :'OCI::DatabaseManagement::Models::ExternalDbSystemDiscoveryConnector',
    'can_enable_all_current_pdbs': :'BOOLEAN',
    'is_auto_enable_pluggable_database': :'BOOLEAN'
    # 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



286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
# File 'lib/oci/database_management/models/discovered_external_database.rb', line 286

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 &&
    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 &&
    connector == other.connector &&
    can_enable_all_current_pdbs == other.can_enable_all_current_pdbs &&
    is_auto_enable_pluggable_database == other.is_auto_enable_pluggable_database
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



336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
# File 'lib/oci/database_management/models/discovered_external_database.rb', line 336

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


316
317
318
# File 'lib/oci/database_management/models/discovered_external_database.rb', line 316

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



325
326
327
# File 'lib/oci/database_management/models/discovered_external_database.rb', line 325

def hash
  [component_id, display_name, component_name, component_type, resource_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, connector, can_enable_all_current_pdbs, is_auto_enable_pluggable_database].hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



369
370
371
372
373
374
375
376
377
378
# File 'lib/oci/database_management/models/discovered_external_database.rb', line 369

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



363
364
365
# File 'lib/oci/database_management/models/discovered_external_database.rb', line 363

def to_s
  to_hash.to_s
end