Class: OCI::Core::Models::IPSecConnectionTunnel

Inherits:
Object
  • Object
show all
Defined in:
lib/oci/core/models/ip_sec_connection_tunnel.rb

Overview

Information about a single tunnel in an IPSec connection. This object does not include the tunnel’s shared secret (pre-shared key). That is in the IPSecConnectionTunnelSharedSecret object.

Constant Summary collapse

STATUS_ENUM =
[
  STATUS_UP = 'UP'.freeze,
  STATUS_DOWN = 'DOWN'.freeze,
  STATUS_DOWN_FOR_MAINTENANCE = 'DOWN_FOR_MAINTENANCE'.freeze,
  STATUS_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
].freeze
LIFECYCLE_STATE_ENUM =
[
  LIFECYCLE_STATE_PROVISIONING = 'PROVISIONING'.freeze,
  LIFECYCLE_STATE_AVAILABLE = 'AVAILABLE'.freeze,
  LIFECYCLE_STATE_TERMINATING = 'TERMINATING'.freeze,
  LIFECYCLE_STATE_TERMINATED = 'TERMINATED'.freeze,
  LIFECYCLE_STATE_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
].freeze
ROUTING_ENUM =
[
  ROUTING_BGP = 'BGP'.freeze,
  ROUTING_STATIC = 'STATIC'.freeze,
  ROUTING_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
].freeze

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ IPSecConnectionTunnel

Initializes the object

Parameters:

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

    Model attributes in the form of hash

Options Hash (attributes):

  • :compartment_id (String)

    The value to assign to the #compartment_id property

  • :id (String)

    The value to assign to the #id property

  • :vpn_ip (String)

    The value to assign to the #vpn_ip property

  • :cpe_ip (String)

    The value to assign to the #cpe_ip property

  • :status (String)

    The value to assign to the #status property

  • :lifecycle_state (String)

    The value to assign to the #lifecycle_state property

  • :display_name (String)

    The value to assign to the #display_name property

  • :bgp_session_info (OCI::Core::Models::BgpSessionInfo)

    The value to assign to the #bgp_session_info property

  • :routing (String)

    The value to assign to the #routing property

  • :time_created (DateTime)

    The value to assign to the #time_created property

  • :time_status_updated (DateTime)

    The value to assign to the #time_status_updated property



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

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

  self.vpn_ip = attributes[:'vpnIp'] if attributes[:'vpnIp']

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

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

  self.cpe_ip = attributes[:'cpeIp'] if attributes[:'cpeIp']

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

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

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

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

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

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

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

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

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

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

Instance Attribute Details

#bgp_session_infoOCI::Core::Models::BgpSessionInfo

Information for establishing the tunnel’s BGP session.



74
75
76
# File 'lib/oci/core/models/ip_sec_connection_tunnel.rb', line 74

def bgp_session_info
  @bgp_session_info
end

#compartment_idString

[Required] The [OCID](docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the compartment containing the tunnel.

Returns:

  • (String)


37
38
39
# File 'lib/oci/core/models/ip_sec_connection_tunnel.rb', line 37

def compartment_id
  @compartment_id
end

#cpe_ipString

The IP address of the CPE’s VPN headend.

Example: ‘192.0.2.157`

Returns:

  • (String)


55
56
57
# File 'lib/oci/core/models/ip_sec_connection_tunnel.rb', line 55

def cpe_ip
  @cpe_ip
end

#display_nameString

A user-friendly name. Does not have to be unique, and it’s changeable. Avoid entering confidential information.

Returns:

  • (String)


69
70
71
# File 'lib/oci/core/models/ip_sec_connection_tunnel.rb', line 69

def display_name
  @display_name
end

#idString

Returns:

  • (String)


41
42
43
# File 'lib/oci/core/models/ip_sec_connection_tunnel.rb', line 41

def id
  @id
end

#lifecycle_stateString

[Required] The tunnel’s lifecycle state.

Returns:

  • (String)


63
64
65
# File 'lib/oci/core/models/ip_sec_connection_tunnel.rb', line 63

def lifecycle_state
  @lifecycle_state
end

#routingString

The type of routing used for this tunnel (either BGP dynamic routing or static routing).

Returns:

  • (String)


79
80
81
# File 'lib/oci/core/models/ip_sec_connection_tunnel.rb', line 79

def routing
  @routing
end

#statusString

The status of the tunnel based on IPSec protocol characteristics.

Returns:

  • (String)


59
60
61
# File 'lib/oci/core/models/ip_sec_connection_tunnel.rb', line 59

def status
  @status
end

#time_createdDateTime

The date and time the IPSec connection tunnel was created, in the format defined by RFC3339.

Example: ‘2016-08-25T21:10:29.600Z`

Returns:

  • (DateTime)


86
87
88
# File 'lib/oci/core/models/ip_sec_connection_tunnel.rb', line 86

def time_created
  @time_created
end

#time_status_updatedDateTime

When the status of the tunnel last changed, in the format defined by RFC3339.

Example: ‘2016-08-25T21:10:29.600Z`

Returns:

  • (DateTime)


93
94
95
# File 'lib/oci/core/models/ip_sec_connection_tunnel.rb', line 93

def time_status_updated
  @time_status_updated
end

#vpn_ipString

The IP address of Oracle’s VPN headend.

Example: ‘192.0.2.5`

Returns:

  • (String)


48
49
50
# File 'lib/oci/core/models/ip_sec_connection_tunnel.rb', line 48

def vpn_ip
  @vpn_ip
end

Class Method Details

.attribute_mapObject

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



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

def self.attribute_map
  {
    # rubocop:disable Style/SymbolLiteral
    'compartment_id': :'compartmentId',
    'id': :'id',
    'vpn_ip': :'vpnIp',
    'cpe_ip': :'cpeIp',
    'status': :'status',
    'lifecycle_state': :'lifecycleState',
    'display_name': :'displayName',
    'bgp_session_info': :'bgpSessionInfo',
    'routing': :'routing',
    'time_created': :'timeCreated',
    'time_status_updated': :'timeStatusUpdated'
    # rubocop:enable Style/SymbolLiteral
  }
end

.swagger_typesObject

Attribute type mapping.



115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
# File 'lib/oci/core/models/ip_sec_connection_tunnel.rb', line 115

def self.swagger_types
  {
    # rubocop:disable Style/SymbolLiteral
    'compartment_id': :'String',
    'id': :'String',
    'vpn_ip': :'String',
    'cpe_ip': :'String',
    'status': :'String',
    'lifecycle_state': :'String',
    'display_name': :'String',
    'bgp_session_info': :'OCI::Core::Models::BgpSessionInfo',
    'routing': :'String',
    'time_created': :'DateTime',
    'time_status_updated': :'DateTime'
    # 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



257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
# File 'lib/oci/core/models/ip_sec_connection_tunnel.rb', line 257

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

  self.class == other.class &&
    compartment_id == other.compartment_id &&
    id == other.id &&
    vpn_ip == other.vpn_ip &&
    cpe_ip == other.cpe_ip &&
    status == other.status &&
    lifecycle_state == other.lifecycle_state &&
    display_name == other.display_name &&
    bgp_session_info == other.bgp_session_info &&
    routing == other.routing &&
    time_created == other.time_created &&
    time_status_updated == other.time_status_updated
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



297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
# File 'lib/oci/core/models/ip_sec_connection_tunnel.rb', line 297

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


277
278
279
# File 'lib/oci/core/models/ip_sec_connection_tunnel.rb', line 277

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



286
287
288
# File 'lib/oci/core/models/ip_sec_connection_tunnel.rb', line 286

def hash
  [compartment_id, id, vpn_ip, cpe_ip, status, lifecycle_state, display_name, bgp_session_info, routing, time_created, time_status_updated].hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



330
331
332
333
334
335
336
337
338
339
# File 'lib/oci/core/models/ip_sec_connection_tunnel.rb', line 330

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



324
325
326
# File 'lib/oci/core/models/ip_sec_connection_tunnel.rb', line 324

def to_s
  to_hash.to_s
end