Class: OCI::DatabaseManagement::Models::ExternalMySqlDatabaseConnector

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

Overview

Details of external database connector.

Constant Summary collapse

LIFECYCLE_STATE_ENUM =
[
  LIFECYCLE_STATE_CREATING = 'CREATING'.freeze,
  LIFECYCLE_STATE_UPDATING = 'UPDATING'.freeze,
  LIFECYCLE_STATE_ACTIVE = 'ACTIVE'.freeze,
  LIFECYCLE_STATE_DELETING = 'DELETING'.freeze,
  LIFECYCLE_STATE_DELETED = 'DELETED'.freeze,
  LIFECYCLE_STATE_FAILED = 'FAILED'.freeze,
  LIFECYCLE_STATE_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
].freeze
SOURCE_DATABASE_TYPE_ENUM =
[
  SOURCE_DATABASE_TYPE_EXTERNAL = 'EXTERNAL'.freeze,
  SOURCE_DATABASE_TYPE_MDS = 'MDS'.freeze,
  SOURCE_DATABASE_TYPE_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
].freeze
CONNECTOR_TYPE_ENUM =
[
  CONNECTOR_TYPE_MACS = 'MACS'.freeze,
  CONNECTOR_TYPE_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
].freeze
NETWORK_PROTOCOL_ENUM =
[
  NETWORK_PROTOCOL_TCP = 'TCP'.freeze,
  NETWORK_PROTOCOL_TCPS = 'TCPS'.freeze,
  NETWORK_PROTOCOL_SOCKETS = 'SOCKETS'.freeze,
  NETWORK_PROTOCOL_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
].freeze
CREDENTIAL_TYPE_ENUM =
[
  CREDENTIAL_TYPE_MYSQL_EXTERNAL_NON_SSL_CREDENTIALS = 'MYSQL_EXTERNAL_NON_SSL_CREDENTIALS'.freeze,
  CREDENTIAL_TYPE_MYSQL_EXTERNAL_SSL_CREDENTIALS = 'MYSQL_EXTERNAL_SSL_CREDENTIALS'.freeze,
  CREDENTIAL_TYPE_MYSQL_EXTERNAL_SOCKET_CREDENTIALS = 'MYSQL_EXTERNAL_SOCKET_CREDENTIALS'.freeze,
  CREDENTIAL_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 = {}) ⇒ ExternalMySqlDatabaseConnector

Initializes the object

Parameters:

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

    Model attributes in the form of hash

Options Hash (attributes):

  • :name (String)

    The value to assign to the #name property

  • :compartment_id (String)

    The value to assign to the #compartment_id property

  • :associated_services (String)

    The value to assign to the #associated_services property

  • :external_database_id (String)

    The value to assign to the #external_database_id property

  • :id (String)

    The value to assign to the #id property

  • :time_updated (DateTime)

    The value to assign to the #time_updated property

  • :time_created (DateTime)

    The value to assign to the #time_created property

  • :lifecycle_state (String)

    The value to assign to the #lifecycle_state property

  • :source_database (String)

    The value to assign to the #source_database property

  • :source_database_type (String)

    The value to assign to the #source_database_type property

  • :macs_agent_id (String)

    The value to assign to the #macs_agent_id property

  • :connection_status (String)

    The value to assign to the #connection_status property

  • :time_connection_status_updated (DateTime)

    The value to assign to the #time_connection_status_updated property

  • :host_name (String)

    The value to assign to the #host_name property

  • :port (Integer)

    The value to assign to the #port property

  • :connector_type (String)

    The value to assign to the #connector_type property

  • :network_protocol (String)

    The value to assign to the #network_protocol property

  • :credential_type (String)

    The value to assign to the #credential_type property

  • :ssl_secret_id (String)

    The value to assign to the #ssl_secret_id property

  • :ssl_secret_name (String)

    The value to assign to the #ssl_secret_name property



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
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
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
312
313
314
315
316
317
318
319
320
321
322
# File 'lib/oci/database_management/models/external_my_sql_database_connector.rb', line 209

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

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

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

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

  self.external_database_id = attributes[:'externalDatabaseId'] if attributes[:'externalDatabaseId']

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

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

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

  self.time_updated = attributes[:'timeUpdated'] if attributes[:'timeUpdated']

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

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

  self.time_created = attributes[:'timeCreated'] if attributes[:'timeCreated']

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

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

  self.lifecycle_state = attributes[:'lifecycleState'] if attributes[:'lifecycleState']

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

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

  self.source_database = attributes[:'sourceDatabase'] if attributes[:'sourceDatabase']

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

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

  self.source_database_type = attributes[:'sourceDatabaseType'] if attributes[:'sourceDatabaseType']

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

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

  self.macs_agent_id = attributes[:'macsAgentId'] if attributes[:'macsAgentId']

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

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

  self.connection_status = attributes[:'connectionStatus'] if attributes[:'connectionStatus']

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

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

  self.time_connection_status_updated = attributes[:'timeConnectionStatusUpdated'] if attributes[:'timeConnectionStatusUpdated']

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

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

  self.host_name = attributes[:'hostName'] if attributes[:'hostName']

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

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

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

  self.connector_type = attributes[:'connectorType'] if attributes[:'connectorType']

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

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

  self.network_protocol = attributes[:'networkProtocol'] if attributes[:'networkProtocol']

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

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

  self.credential_type = attributes[:'credentialType'] if attributes[:'credentialType']

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

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

  self.ssl_secret_id = attributes[:'sslSecretId'] if attributes[:'sslSecretId']

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

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

  self.ssl_secret_name = attributes[:'sslSecretName'] if attributes[:'sslSecretName']

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

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

Instance Attribute Details

#associated_servicesString

OCI Services associated with this connector.

Returns:

  • (String)


57
58
59
# File 'lib/oci/database_management/models/external_my_sql_database_connector.rb', line 57

def associated_services
  @associated_services
end

#compartment_idString

OCID of compartment for the External MySQL connector.

Returns:

  • (String)


53
54
55
# File 'lib/oci/database_management/models/external_my_sql_database_connector.rb', line 53

def compartment_id
  @compartment_id
end

#connection_statusString

Connection Status

Returns:

  • (String)


93
94
95
# File 'lib/oci/database_management/models/external_my_sql_database_connector.rb', line 93

def connection_status
  @connection_status
end

#connector_typeString

Connector Type.

Returns:

  • (String)


109
110
111
# File 'lib/oci/database_management/models/external_my_sql_database_connector.rb', line 109

def connector_type
  @connector_type
end

#credential_typeString

Credential type used to connect to database.

Returns:

  • (String)


117
118
119
# File 'lib/oci/database_management/models/external_my_sql_database_connector.rb', line 117

def credential_type
  @credential_type
end

#external_database_idString

OCID of MySQL Database resource

Returns:

  • (String)


61
62
63
# File 'lib/oci/database_management/models/external_my_sql_database_connector.rb', line 61

def external_database_id
  @external_database_id
end

#host_nameString

Host name for Connector.

Returns:

  • (String)


101
102
103
# File 'lib/oci/database_management/models/external_my_sql_database_connector.rb', line 101

def host_name
  @host_name
end

#idString

[Required] OCID of MySQL Database Connector.

Returns:

  • (String)


65
66
67
# File 'lib/oci/database_management/models/external_my_sql_database_connector.rb', line 65

def id
  @id
end

#lifecycle_stateString

Indicates lifecycle state of the resource.

Returns:

  • (String)


77
78
79
# File 'lib/oci/database_management/models/external_my_sql_database_connector.rb', line 77

def lifecycle_state
  @lifecycle_state
end

#macs_agent_idString

Agent Id of the MACS agent.

Returns:

  • (String)


89
90
91
# File 'lib/oci/database_management/models/external_my_sql_database_connector.rb', line 89

def macs_agent_id
  @macs_agent_id
end

#nameString

External MySQL Database Connector Name.

Returns:

  • (String)


49
50
51
# File 'lib/oci/database_management/models/external_my_sql_database_connector.rb', line 49

def name
  @name
end

#network_protocolString

Network Protocol.

Returns:

  • (String)


113
114
115
# File 'lib/oci/database_management/models/external_my_sql_database_connector.rb', line 113

def network_protocol
  @network_protocol
end

#portInteger

Connector port.

Returns:

  • (Integer)


105
106
107
# File 'lib/oci/database_management/models/external_my_sql_database_connector.rb', line 105

def port
  @port
end

#source_databaseString

Name of MySQL Database.

Returns:

  • (String)


81
82
83
# File 'lib/oci/database_management/models/external_my_sql_database_connector.rb', line 81

def source_database
  @source_database
end

#source_database_typeString

Type of MySQL Database.

Returns:

  • (String)


85
86
87
# File 'lib/oci/database_management/models/external_my_sql_database_connector.rb', line 85

def source_database_type
  @source_database_type
end

#ssl_secret_idString

OCID of the SSL secret, if TCPS with SSL is used to connect to database.

Returns:

  • (String)


121
122
123
# File 'lib/oci/database_management/models/external_my_sql_database_connector.rb', line 121

def ssl_secret_id
  @ssl_secret_id
end

#ssl_secret_nameString

Name of the SSL secret, if TCPS with SSL is used to connect to database.

Returns:

  • (String)


125
126
127
# File 'lib/oci/database_management/models/external_my_sql_database_connector.rb', line 125

def ssl_secret_name
  @ssl_secret_name
end

#time_connection_status_updatedDateTime

Time when connection status was last updated.

Returns:

  • (DateTime)


97
98
99
# File 'lib/oci/database_management/models/external_my_sql_database_connector.rb', line 97

def time_connection_status_updated
  @time_connection_status_updated
end

#time_createdDateTime

Connector creation time.

Returns:

  • (DateTime)


73
74
75
# File 'lib/oci/database_management/models/external_my_sql_database_connector.rb', line 73

def time_created
  @time_created
end

#time_updatedDateTime

Connector update time.

Returns:

  • (DateTime)


69
70
71
# File 'lib/oci/database_management/models/external_my_sql_database_connector.rb', line 69

def time_updated
  @time_updated
end

Class Method Details

.attribute_mapObject

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



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

def self.attribute_map
  {
    # rubocop:disable Style/SymbolLiteral
    'name': :'name',
    'compartment_id': :'compartmentId',
    'associated_services': :'associatedServices',
    'external_database_id': :'externalDatabaseId',
    'id': :'id',
    'time_updated': :'timeUpdated',
    'time_created': :'timeCreated',
    'lifecycle_state': :'lifecycleState',
    'source_database': :'sourceDatabase',
    'source_database_type': :'sourceDatabaseType',
    'macs_agent_id': :'macsAgentId',
    'connection_status': :'connectionStatus',
    'time_connection_status_updated': :'timeConnectionStatusUpdated',
    'host_name': :'hostName',
    'port': :'port',
    'connector_type': :'connectorType',
    'network_protocol': :'networkProtocol',
    'credential_type': :'credentialType',
    'ssl_secret_id': :'sslSecretId',
    'ssl_secret_name': :'sslSecretName'
    # rubocop:enable Style/SymbolLiteral
  }
end

.swagger_typesObject

Attribute type mapping.



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

def self.swagger_types
  {
    # rubocop:disable Style/SymbolLiteral
    'name': :'String',
    'compartment_id': :'String',
    'associated_services': :'String',
    'external_database_id': :'String',
    'id': :'String',
    'time_updated': :'DateTime',
    'time_created': :'DateTime',
    'lifecycle_state': :'String',
    'source_database': :'String',
    'source_database_type': :'String',
    'macs_agent_id': :'String',
    'connection_status': :'String',
    'time_connection_status_updated': :'DateTime',
    'host_name': :'String',
    'port': :'Integer',
    'connector_type': :'String',
    'network_protocol': :'String',
    'credential_type': :'String',
    'ssl_secret_id': :'String',
    'ssl_secret_name': :'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



396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
# File 'lib/oci/database_management/models/external_my_sql_database_connector.rb', line 396

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

  self.class == other.class &&
    name == other.name &&
    compartment_id == other.compartment_id &&
    associated_services == other.associated_services &&
    external_database_id == other.external_database_id &&
    id == other.id &&
    time_updated == other.time_updated &&
    time_created == other.time_created &&
    lifecycle_state == other.lifecycle_state &&
    source_database == other.source_database &&
    source_database_type == other.source_database_type &&
    macs_agent_id == other.macs_agent_id &&
    connection_status == other.connection_status &&
    time_connection_status_updated == other.time_connection_status_updated &&
    host_name == other.host_name &&
    port == other.port &&
    connector_type == other.connector_type &&
    network_protocol == other.network_protocol &&
    credential_type == other.credential_type &&
    ssl_secret_id == other.ssl_secret_id &&
    ssl_secret_name == other.ssl_secret_name
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



445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
# File 'lib/oci/database_management/models/external_my_sql_database_connector.rb', line 445

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


425
426
427
# File 'lib/oci/database_management/models/external_my_sql_database_connector.rb', line 425

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



434
435
436
# File 'lib/oci/database_management/models/external_my_sql_database_connector.rb', line 434

def hash
  [name, compartment_id, associated_services, external_database_id, id, time_updated, time_created, lifecycle_state, source_database, source_database_type, macs_agent_id, connection_status, time_connection_status_updated, host_name, port, connector_type, network_protocol, credential_type, ssl_secret_id, ssl_secret_name].hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



478
479
480
481
482
483
484
485
486
487
# File 'lib/oci/database_management/models/external_my_sql_database_connector.rb', line 478

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



472
473
474
# File 'lib/oci/database_management/models/external_my_sql_database_connector.rb', line 472

def to_s
  to_hash.to_s
end