Class: OCI::DatabaseManagement::Models::DiscoveredExternalDbSystemComponent

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

Overview

The details of an external DB system component. This class has direct subclasses. If you are using this class as input to a service operations then you should favor using a subclass over the base class

Constant Summary collapse

COMPONENT_TYPE_ENUM =
[
  COMPONENT_TYPE_ASM = 'ASM'.freeze,
  COMPONENT_TYPE_ASM_INSTANCE = 'ASM_INSTANCE'.freeze,
  COMPONENT_TYPE_CLUSTER = 'CLUSTER'.freeze,
  COMPONENT_TYPE_CLUSTER_INSTANCE = 'CLUSTER_INSTANCE'.freeze,
  COMPONENT_TYPE_DATABASE = 'DATABASE'.freeze,
  COMPONENT_TYPE_DATABASE_INSTANCE = 'DATABASE_INSTANCE'.freeze,
  COMPONENT_TYPE_DATABASE_HOME = 'DATABASE_HOME'.freeze,
  COMPONENT_TYPE_DATABASE_NODE = 'DATABASE_NODE'.freeze,
  COMPONENT_TYPE_DBSYSTEM = 'DBSYSTEM'.freeze,
  COMPONENT_TYPE_LISTENER = 'LISTENER'.freeze,
  COMPONENT_TYPE_PLUGGABLE_DATABASE = 'PLUGGABLE_DATABASE'.freeze,
  COMPONENT_TYPE_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
].freeze
STATUS_ENUM =
[
  STATUS_NEW = 'NEW'.freeze,
  STATUS_EXISTING = 'EXISTING'.freeze,
  STATUS_MARKED_FOR_DELETION = 'MARKED_FOR_DELETION'.freeze,
  STATUS_UNKNOWN = 'UNKNOWN'.freeze,
  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 = {}) ⇒ DiscoveredExternalDbSystemComponent

Initializes the object

Parameters:

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

    Model attributes in the form of hash

Options Hash (attributes):



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

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

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

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

  self.display_name = attributes[:'displayName'] if attributes[:'displayName']

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

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

  self.component_name = attributes[:'componentName'] if attributes[:'componentName']

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

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

  self.component_type = attributes[:'componentType'] if attributes[:'componentType']

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

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

  self.resource_id = attributes[:'resourceId'] if attributes[:'resourceId']

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

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

  self.is_selected_for_monitoring = attributes[:'isSelectedForMonitoring'] unless attributes[:'isSelectedForMonitoring'].nil?

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

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

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

  self.associated_components = attributes[:'associatedComponents'] if attributes[:'associatedComponents']

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

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

Instance Attribute Details

#associated_componentsArray<OCI::DatabaseManagement::Models::AssociatedComponent>

The list of associated components.



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

def associated_components
  @associated_components
end

#component_idString

[Required] The identifier of the discovered DB system component.

Returns:

  • (String)


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

def component_id
  @component_id
end

#component_nameString

[Required] The name of the discovered DB system component.

Returns:

  • (String)


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

def component_name
  @component_name
end

#component_typeString

[Required] The external DB system component type.

Returns:

  • (String)


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

def component_type
  @component_type
end

#display_nameString

[Required] The user-friendly name for the discovered DB system component. The name does not have to be unique.

Returns:

  • (String)


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

def display_name
  @display_name
end

#is_selected_for_monitoringBOOLEAN

Indicates whether the DB system component should be provisioned as an OCI resource or not.

Returns:

  • (BOOLEAN)


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

def is_selected_for_monitoring
  @is_selected_for_monitoring
end

#resource_idString

The OCID of the existing OCI resource matching the discovered DB system component.

Returns:

  • (String)


54
55
56
# File 'lib/oci/database_management/models/discovered_external_db_system_component.rb', line 54

def resource_id
  @resource_id
end

#statusString

The state of the discovered DB system component.

Returns:

  • (String)


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

def status
  @status
end

Class Method Details

.attribute_mapObject

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



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

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'
    # rubocop:enable Style/SymbolLiteral
  }
end

.get_subtype(object_hash) ⇒ Object

Given the hash representation of a subtype of this class, use the info in the hash to return the class of the subtype.



105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
# File 'lib/oci/database_management/models/discovered_external_db_system_component.rb', line 105

def self.get_subtype(object_hash)
  type = object_hash[:'componentType'] # rubocop:disable Style/SymbolLiteral

  return 'OCI::DatabaseManagement::Models::DiscoveredExternalCluster' if type == 'CLUSTER'
  return 'OCI::DatabaseManagement::Models::DiscoveredExternalDbHome' if type == 'DATABASE_HOME'
  return 'OCI::DatabaseManagement::Models::DiscoveredExternalDatabase' if type == 'DATABASE'
  return 'OCI::DatabaseManagement::Models::DiscoveredExternalPluggableDatabase' if type == 'PLUGGABLE_DATABASE'
  return 'OCI::DatabaseManagement::Models::DiscoveredExternalClusterInstance' if type == 'CLUSTER_INSTANCE'
  return 'OCI::DatabaseManagement::Models::DiscoveredExternalListener' if type == 'LISTENER'
  return 'OCI::DatabaseManagement::Models::DiscoveredExternalDbNode' if type == 'DATABASE_NODE'
  return 'OCI::DatabaseManagement::Models::DiscoveredExternalAsm' if type == 'ASM'
  return 'OCI::DatabaseManagement::Models::DiscoveredExternalAsmInstance' if type == 'ASM_INSTANCE'

  # TODO: Log a warning when the subtype is not found.
  'OCI::DatabaseManagement::Models::DiscoveredExternalDbSystemComponent'
end

.swagger_typesObject

Attribute type mapping.



85
86
87
88
89
90
91
92
93
94
95
96
97
98
# File 'lib/oci/database_management/models/discovered_external_db_system_component.rb', line 85

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>'
    # 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



221
222
223
224
225
226
227
228
229
230
231
232
233
# File 'lib/oci/database_management/models/discovered_external_db_system_component.rb', line 221

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



258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
# File 'lib/oci/database_management/models/discovered_external_db_system_component.rb', line 258

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


238
239
240
# File 'lib/oci/database_management/models/discovered_external_db_system_component.rb', line 238

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



247
248
249
# File 'lib/oci/database_management/models/discovered_external_db_system_component.rb', line 247

def hash
  [component_id, display_name, component_name, component_type, resource_id, is_selected_for_monitoring, status, associated_components].hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



291
292
293
294
295
296
297
298
299
300
# File 'lib/oci/database_management/models/discovered_external_db_system_component.rb', line 291

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



285
286
287
# File 'lib/oci/database_management/models/discovered_external_db_system_component.rb', line 285

def to_s
  to_hash.to_s
end