Class: OCI::Mysql::Models::DbSystemEndpoint

Inherits:
Object
  • Object
show all
Defined in:
lib/oci/mysql/models/db_system_endpoint.rb

Overview

A particular functional endpoint for access to a DB System, and the properties that apply to it.

Constant Summary collapse

IP_ADDRESS_VERSION_ENUM =
[
  IP_ADDRESS_VERSION_IPV4 = 'IPV4'.freeze,
  IP_ADDRESS_VERSION_IPV6 = 'IPV6'.freeze,
  IP_ADDRESS_VERSION_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
].freeze
MODES_ENUM =
[
  MODES_READ = 'READ'.freeze,
  MODES_WRITE = 'WRITE'.freeze,
  MODES_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
].freeze
STATUS_ENUM =
[
  STATUS_ACTIVE = 'ACTIVE'.freeze,
  STATUS_INACTIVE = 'INACTIVE'.freeze,
  STATUS_UPDATING = 'UPDATING'.freeze,
  STATUS_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
].freeze
RESOURCE_TYPE_ENUM =
[
  RESOURCE_TYPE_DBSYSTEM = 'DBSYSTEM'.freeze,
  RESOURCE_TYPE_READ_REPLICA = 'READ_REPLICA'.freeze,
  RESOURCE_TYPE_LOAD_BALANCER = 'LOAD_BALANCER'.freeze,
  RESOURCE_TYPE_READ_ENDPOINT = 'READ_ENDPOINT'.freeze,
  RESOURCE_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 = {}) ⇒ DbSystemEndpoint

Initializes the object

Parameters:

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

    Model attributes in the form of hash

Options Hash (attributes):

  • :hostname (String)

    The value to assign to the #hostname property

  • :ip_address (String)

    The value to assign to the #ip_address property

  • :ip_address_version (String)

    The value to assign to the #ip_address_version property

  • :port (Integer)

    The value to assign to the #port property

  • :port_x (Integer)

    The value to assign to the #port_x property

  • :modes (Array<String>)

    The value to assign to the #modes property

  • :status (String)

    The value to assign to the #status property

  • :status_details (String)

    The value to assign to the #status_details property

  • :resource_type (String)

    The value to assign to the #resource_type property

  • :resource_id (String)

    The value to assign to the #resource_id property



134
135
136
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
# File 'lib/oci/mysql/models/db_system_endpoint.rb', line 134

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

  self.ip_address = attributes[:'ipAddress'] if attributes[:'ipAddress']

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

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

  self.ip_address_version = attributes[:'ipAddressVersion'] if attributes[:'ipAddressVersion']

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

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

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

  self.port_x = attributes[:'portX'] if attributes[:'portX']

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

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

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

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

  self.status_details = attributes[:'statusDetails'] if attributes[:'statusDetails']

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

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

  self.resource_type = attributes[:'resourceType'] if attributes[:'resourceType']

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

  self.resource_type = attributes[:'resource_type'] if attributes[:'resource_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']
end

Instance Attribute Details

#hostnameString

The network address of the DB System.

Returns:

  • (String)


42
43
44
# File 'lib/oci/mysql/models/db_system_endpoint.rb', line 42

def hostname
  @hostname
end

#ip_addressString

[Required] The IP address the DB System is configured to listen on.

Returns:

  • (String)


46
47
48
# File 'lib/oci/mysql/models/db_system_endpoint.rb', line 46

def ip_address
  @ip_address
end

#ip_address_versionString

The internet protocol (IP) version of the IP address.

Returns:

  • (String)


50
51
52
# File 'lib/oci/mysql/models/db_system_endpoint.rb', line 50

def ip_address_version
  @ip_address_version
end

#modesArray<String>

The access modes from the client that this endpoint supports.

Returns:

  • (Array<String>)


62
63
64
# File 'lib/oci/mysql/models/db_system_endpoint.rb', line 62

def modes
  @modes
end

#portInteger

[Required] The port the MySQL instance listens on.

Returns:

  • (Integer)


54
55
56
# File 'lib/oci/mysql/models/db_system_endpoint.rb', line 54

def port
  @port
end

#port_xInteger

[Required] The network port where to connect to use this endpoint using the X protocol.

Returns:

  • (Integer)


58
59
60
# File 'lib/oci/mysql/models/db_system_endpoint.rb', line 58

def port_x
  @port_x
end

#resource_idString

The OCID of the resource that this endpoint is attached to.

Returns:

  • (String)


80
81
82
# File 'lib/oci/mysql/models/db_system_endpoint.rb', line 80

def resource_id
  @resource_id
end

#resource_typeString

The type of endpoint that clients and connectors can connect to.

Returns:

  • (String)


76
77
78
# File 'lib/oci/mysql/models/db_system_endpoint.rb', line 76

def resource_type
  @resource_type
end

#statusString

The state of the endpoints, as far as it can seen from the DB System. There may be some inconsistency with the actual state of the MySQL service.

Returns:

  • (String)


68
69
70
# File 'lib/oci/mysql/models/db_system_endpoint.rb', line 68

def status
  @status
end

#status_detailsString

Additional information about the current endpoint status.

Returns:

  • (String)


72
73
74
# File 'lib/oci/mysql/models/db_system_endpoint.rb', line 72

def status_details
  @status_details
end

Class Method Details

.attribute_mapObject

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



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

def self.attribute_map
  {
    # rubocop:disable Style/SymbolLiteral
    'hostname': :'hostname',
    'ip_address': :'ipAddress',
    'ip_address_version': :'ipAddressVersion',
    'port': :'port',
    'port_x': :'portX',
    'modes': :'modes',
    'status': :'status',
    'status_details': :'statusDetails',
    'resource_type': :'resourceType',
    'resource_id': :'resourceId'
    # rubocop:enable Style/SymbolLiteral
  }
end

.swagger_typesObject

Attribute type mapping.



101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
# File 'lib/oci/mysql/models/db_system_endpoint.rb', line 101

def self.swagger_types
  {
    # rubocop:disable Style/SymbolLiteral
    'hostname': :'String',
    'ip_address': :'String',
    'ip_address_version': :'String',
    'port': :'Integer',
    'port_x': :'Integer',
    'modes': :'Array<String>',
    'status': :'String',
    'status_details': :'String',
    'resource_type': :'String',
    'resource_id': :'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



251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
# File 'lib/oci/mysql/models/db_system_endpoint.rb', line 251

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

  self.class == other.class &&
    hostname == other.hostname &&
    ip_address == other.ip_address &&
    ip_address_version == other.ip_address_version &&
    port == other.port &&
    port_x == other.port_x &&
    modes == other.modes &&
    status == other.status &&
    status_details == other.status_details &&
    resource_type == other.resource_type &&
    resource_id == other.resource_id
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



290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
# File 'lib/oci/mysql/models/db_system_endpoint.rb', line 290

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


270
271
272
# File 'lib/oci/mysql/models/db_system_endpoint.rb', line 270

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



279
280
281
# File 'lib/oci/mysql/models/db_system_endpoint.rb', line 279

def hash
  [hostname, ip_address, ip_address_version, port, port_x, modes, status, status_details, resource_type, resource_id].hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



323
324
325
326
327
328
329
330
331
332
# File 'lib/oci/mysql/models/db_system_endpoint.rb', line 323

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



317
318
319
# File 'lib/oci/mysql/models/db_system_endpoint.rb', line 317

def to_s
  to_hash.to_s
end