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
IKE_VERSION_ENUM =
[
  IKE_VERSION_V1 = 'V1'.freeze,
  IKE_VERSION_V2 = 'V2'.freeze,
  IKE_VERSION_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

  • :ike_version (String)

    The value to assign to the #ike_version 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



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
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
# File 'lib/oci/core/models/ip_sec_connection_tunnel.rb', line 165

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

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

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

  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.



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

def bgp_session_info
  @bgp_session_info
end

#compartment_idString

[Required] The OCID of the compartment containing the tunnel.

Returns:

  • (String)


44
45
46
# File 'lib/oci/core/models/ip_sec_connection_tunnel.rb', line 44

def compartment_id
  @compartment_id
end

#cpe_ipString

The IP address of the CPE's VPN headend.

Example: 192.0.2.157

Returns:

  • (String)


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

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)


81
82
83
# File 'lib/oci/core/models/ip_sec_connection_tunnel.rb', line 81

def display_name
  @display_name
end

#idString

[Required] The OCID of the tunnel.

Returns:

  • (String)


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

def id
  @id
end

#ike_versionString

Internet Key Exchange protocol version.

Returns:

  • (String)


71
72
73
# File 'lib/oci/core/models/ip_sec_connection_tunnel.rb', line 71

def ike_version
  @ike_version
end

#lifecycle_stateString

[Required] The tunnel's lifecycle state.

Returns:

  • (String)


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

def lifecycle_state
  @lifecycle_state
end

#routingString

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

Returns:

  • (String)


91
92
93
# File 'lib/oci/core/models/ip_sec_connection_tunnel.rb', line 91

def routing
  @routing
end

#statusString

The status of the tunnel based on IPSec protocol characteristics.

Returns:

  • (String)


66
67
68
# File 'lib/oci/core/models/ip_sec_connection_tunnel.rb', line 66

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)


98
99
100
# File 'lib/oci/core/models/ip_sec_connection_tunnel.rb', line 98

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)


105
106
107
# File 'lib/oci/core/models/ip_sec_connection_tunnel.rb', line 105

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)


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

def vpn_ip
  @vpn_ip
end

Class Method Details

.attribute_mapObject

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



108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
# File 'lib/oci/core/models/ip_sec_connection_tunnel.rb', line 108

def self.attribute_map
  {
    # rubocop:disable Style/SymbolLiteral
    'compartment_id': :'compartmentId',
    'id': :'id',
    'vpn_ip': :'vpnIp',
    'cpe_ip': :'cpeIp',
    'status': :'status',
    'ike_version': :'ikeVersion',
    '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.



128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
# File 'lib/oci/core/models/ip_sec_connection_tunnel.rb', line 128

def self.swagger_types
  {
    # rubocop:disable Style/SymbolLiteral
    'compartment_id': :'String',
    'id': :'String',
    'vpn_ip': :'String',
    'cpe_ip': :'String',
    'status': :'String',
    'ike_version': :'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



291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
# File 'lib/oci/core/models/ip_sec_connection_tunnel.rb', line 291

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 &&
    ike_version == other.ike_version &&
    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



332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
# File 'lib/oci/core/models/ip_sec_connection_tunnel.rb', line 332

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


312
313
314
# File 'lib/oci/core/models/ip_sec_connection_tunnel.rb', line 312

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



321
322
323
# File 'lib/oci/core/models/ip_sec_connection_tunnel.rb', line 321

def hash
  [compartment_id, id, vpn_ip, cpe_ip, status, ike_version, 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



365
366
367
368
369
370
371
372
373
374
# File 'lib/oci/core/models/ip_sec_connection_tunnel.rb', line 365

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



359
360
361
# File 'lib/oci/core/models/ip_sec_connection_tunnel.rb', line 359

def to_s
  to_hash.to_s
end