Class: OCI::DatabaseManagement::Models::DiscoveredCloudDbSystemComponent

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

Overview

The details of a cloud 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_EXISTING_BASIC = 'EXISTING_BASIC'.freeze,
  STATUS_EXISTING_PE = 'EXISTING_PE'.freeze,
  STATUS_EXISTING_BASIC_PE = 'EXISTING_BASIC_PE'.freeze,
  STATUS_MARKED_FOR_UPGRADE = 'MARKED_FOR_UPGRADE'.freeze,
  STATUS_MARKED_FOR_MIGRATION = 'MARKED_FOR_MIGRATION'.freeze,
  STATUS_MARKED_FOR_UPGRADE_MIGRATION = 'MARKED_FOR_UPGRADE_MIGRATION'.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 = {}) ⇒ DiscoveredCloudDbSystemComponent

Initializes the object

Parameters:

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

    Model attributes in the form of hash

Options Hash (attributes):



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
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
# File 'lib/oci/database_management/models/discovered_cloud_db_system_component.rb', line 151

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

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

  self.dbaas_id = attributes[:'dbaas_id'] if attributes[:'dbaas_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::AssociatedCloudComponent>

The list of associated components.



76
77
78
# File 'lib/oci/database_management/models/discovered_cloud_db_system_component.rb', line 76

def associated_components
  @associated_components
end

#component_idString

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

Returns:

  • (String)


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

def component_id
  @component_id
end

#component_nameString

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

Returns:

  • (String)


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

def component_name
  @component_name
end

#component_typeString

[Required] The cloud DB system component type.

Returns:

  • (String)


56
57
58
# File 'lib/oci/database_management/models/discovered_cloud_db_system_component.rb', line 56

def component_type
  @component_type
end

#dbaas_idString

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

Returns:

  • (String)


64
65
66
# File 'lib/oci/database_management/models/discovered_cloud_db_system_component.rb', line 64

def dbaas_id
  @dbaas_id
end

#display_nameString

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

Returns:

  • (String)


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

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)


68
69
70
# File 'lib/oci/database_management/models/discovered_cloud_db_system_component.rb', line 68

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)


60
61
62
# File 'lib/oci/database_management/models/discovered_cloud_db_system_component.rb', line 60

def resource_id
  @resource_id
end

#statusString

The state of the discovered DB system component.

Returns:

  • (String)


72
73
74
# File 'lib/oci/database_management/models/discovered_cloud_db_system_component.rb', line 72

def status
  @status
end

Class Method Details

.attribute_mapObject

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



79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
# File 'lib/oci/database_management/models/discovered_cloud_db_system_component.rb', line 79

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



117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
# File 'lib/oci/database_management/models/discovered_cloud_db_system_component.rb', line 117

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

  return 'OCI::DatabaseManagement::Models::DiscoveredCloudClusterInstance' if type == 'CLUSTER_INSTANCE'
  return 'OCI::DatabaseManagement::Models::DiscoveredCloudPluggableDatabase' if type == 'PLUGGABLE_DATABASE'
  return 'OCI::DatabaseManagement::Models::DiscoveredCloudCluster' if type == 'CLUSTER'
  return 'OCI::DatabaseManagement::Models::DiscoveredCloudAsm' if type == 'ASM'
  return 'OCI::DatabaseManagement::Models::DiscoveredCloudListener' if type == 'LISTENER'
  return 'OCI::DatabaseManagement::Models::DiscoveredCloudDbInstance' if type == 'DATABASE_INSTANCE'
  return 'OCI::DatabaseManagement::Models::DiscoveredCloudDatabase' if type == 'DATABASE'
  return 'OCI::DatabaseManagement::Models::DiscoveredCloudDbHome' if type == 'DATABASE_HOME'
  return 'OCI::DatabaseManagement::Models::DiscoveredCloudDbNode' if type == 'DATABASE_NODE'
  return 'OCI::DatabaseManagement::Models::DiscoveredCloudAsmInstance' if type == 'ASM_INSTANCE'

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

.swagger_typesObject

Attribute type mapping.



96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
# File 'lib/oci/database_management/models/discovered_cloud_db_system_component.rb', line 96

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



241
242
243
244
245
246
247
248
249
250
251
252
253
254
# File 'lib/oci/database_management/models/discovered_cloud_db_system_component.rb', line 241

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



279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
# File 'lib/oci/database_management/models/discovered_cloud_db_system_component.rb', line 279

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


259
260
261
# File 'lib/oci/database_management/models/discovered_cloud_db_system_component.rb', line 259

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



268
269
270
# File 'lib/oci/database_management/models/discovered_cloud_db_system_component.rb', line 268

def hash
  [component_id, display_name, component_name, component_type, resource_id, dbaas_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



312
313
314
315
316
317
318
319
320
321
# File 'lib/oci/database_management/models/discovered_cloud_db_system_component.rb', line 312

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



306
307
308
# File 'lib/oci/database_management/models/discovered_cloud_db_system_component.rb', line 306

def to_s
  to_hash.to_s
end