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_PARTIAL_UP = 'PARTIAL_UP'.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_POLICY = 'POLICY'.freeze,
  ROUTING_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
].freeze
ORACLE_CAN_INITIATE_ENUM =
[
  ORACLE_CAN_INITIATE_INITIATOR_OR_RESPONDER = 'INITIATOR_OR_RESPONDER'.freeze,
  ORACLE_CAN_INITIATE_RESPONDER_ONLY = 'RESPONDER_ONLY'.freeze,
  ORACLE_CAN_INITIATE_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
].freeze
NAT_TRANSLATION_ENABLED_ENUM =
[
  NAT_TRANSLATION_ENABLED_ENABLED = 'ENABLED'.freeze,
  NAT_TRANSLATION_ENABLED_DISABLED = 'DISABLED'.freeze,
  NAT_TRANSLATION_ENABLED_AUTO = 'AUTO'.freeze,
  NAT_TRANSLATION_ENABLED_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
].freeze
DPD_MODE_ENUM =
[
  DPD_MODE_INITIATE_AND_RESPOND = 'INITIATE_AND_RESPOND'.freeze,
  DPD_MODE_RESPOND_ONLY = 'RESPOND_ONLY'.freeze,
  DPD_MODE_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):



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
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
# File 'lib/oci/core/models/ip_sec_connection_tunnel.rb', line 230

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

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

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

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

  self.oracle_can_initiate = attributes[:'oracleCanInitiate'] if attributes[:'oracleCanInitiate']

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

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

  self.nat_translation_enabled = attributes[:'natTranslationEnabled'] if attributes[:'natTranslationEnabled']

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

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

  self.dpd_mode = attributes[:'dpdMode'] if attributes[:'dpdMode']

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

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

  self.dpd_timeout_in_sec = attributes[:'dpdTimeoutInSec'] if attributes[:'dpdTimeoutInSec']

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

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

  self.phase_one_details = attributes[:'phaseOneDetails'] if attributes[:'phaseOneDetails']

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

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

  self.phase_two_details = attributes[:'phaseTwoDetails'] if attributes[:'phaseTwoDetails']

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

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

Instance Attribute Details

#bgp_session_infoOCI::Core::Models::BgpSessionInfo



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

def bgp_session_info
  @bgp_session_info
end

#compartment_idString

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

Returns:

  • (String)


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

def compartment_id
  @compartment_id
end

#cpe_ipString

The IP address of the CPE’s VPN headend.

Example: 203.0.113.22

Returns:

  • (String)


83
84
85
# File 'lib/oci/core/models/ip_sec_connection_tunnel.rb', line 83

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)


102
103
104
# File 'lib/oci/core/models/ip_sec_connection_tunnel.rb', line 102

def display_name
  @display_name
end

#dpd_modeString

dpd mode

Returns:

  • (String)


139
140
141
# File 'lib/oci/core/models/ip_sec_connection_tunnel.rb', line 139

def dpd_mode
  @dpd_mode
end

#dpd_timeout_in_secInteger

Dead peer detection (DPD) timeout in seconds.

Returns:

  • (Integer)


143
144
145
# File 'lib/oci/core/models/ip_sec_connection_tunnel.rb', line 143

def dpd_timeout_in_sec
  @dpd_timeout_in_sec
end

#encryption_domain_configOCI::Core::Models::EncryptionDomainConfig



108
109
110
# File 'lib/oci/core/models/ip_sec_connection_tunnel.rb', line 108

def encryption_domain_config
  @encryption_domain_config
end

#idString

Returns:

  • (String)


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

def id
  @id
end

#ike_versionString

Internet Key Exchange protocol version.

Returns:

  • (String)


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

def ike_version
  @ike_version
end

#lifecycle_stateString

[Required] The tunnel’s lifecycle state.

Returns:

  • (String)


96
97
98
# File 'lib/oci/core/models/ip_sec_connection_tunnel.rb', line 96

def lifecycle_state
  @lifecycle_state
end

#nat_translation_enabledString

Whether NAT-T Enabled on the tunnel

Returns:

  • (String)


135
136
137
# File 'lib/oci/core/models/ip_sec_connection_tunnel.rb', line 135

def nat_translation_enabled
  @nat_translation_enabled
end

#oracle_can_initiateString

Indicates whether Oracle can either initiate the tunnel or respond, or respond only.

Returns:

  • (String)


131
132
133
# File 'lib/oci/core/models/ip_sec_connection_tunnel.rb', line 131

def oracle_can_initiate
  @oracle_can_initiate
end

#phase_one_detailsOCI::Core::Models::TunnelPhaseOneDetails



146
147
148
# File 'lib/oci/core/models/ip_sec_connection_tunnel.rb', line 146

def phase_one_details
  @phase_one_details
end

#phase_two_detailsOCI::Core::Models::TunnelPhaseTwoDetails



149
150
151
# File 'lib/oci/core/models/ip_sec_connection_tunnel.rb', line 149

def phase_two_details
  @phase_two_details
end

#routingString

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

Returns:

  • (String)


113
114
115
# File 'lib/oci/core/models/ip_sec_connection_tunnel.rb', line 113

def routing
  @routing
end

#statusString

The status of the tunnel based on IPSec protocol characteristics.

Returns:

  • (String)


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

def status
  @status
end

#time_createdDateTime

The date and time the IPSec connection tunnel was created, in the format defined by [RFC3339](tools.ietf.org/html/rfc3339).

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

Returns:

  • (DateTime)


120
121
122
# File 'lib/oci/core/models/ip_sec_connection_tunnel.rb', line 120

def time_created
  @time_created
end

#time_status_updatedDateTime

When the status of the tunnel last changed, in the format defined by [RFC3339](tools.ietf.org/html/rfc3339).

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

Returns:

  • (DateTime)


127
128
129
# File 'lib/oci/core/models/ip_sec_connection_tunnel.rb', line 127

def time_status_updated
  @time_status_updated
end

#vpn_ipString

The IP address of Oracle’s VPN headend.

Example: 203.0.113.21

Returns:

  • (String)


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

def vpn_ip
  @vpn_ip
end

Class Method Details

.attribute_mapObject

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



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
# File 'lib/oci/core/models/ip_sec_connection_tunnel.rb', line 152

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',
    'encryption_domain_config': :'encryptionDomainConfig',
    'routing': :'routing',
    'time_created': :'timeCreated',
    'time_status_updated': :'timeStatusUpdated',
    'oracle_can_initiate': :'oracleCanInitiate',
    'nat_translation_enabled': :'natTranslationEnabled',
    'dpd_mode': :'dpdMode',
    'dpd_timeout_in_sec': :'dpdTimeoutInSec',
    'phase_one_details': :'phaseOneDetails',
    'phase_two_details': :'phaseTwoDetails'
    # rubocop:enable Style/SymbolLiteral
  }
end

.swagger_typesObject

Attribute type mapping.



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
# File 'lib/oci/core/models/ip_sec_connection_tunnel.rb', line 179

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',
    'encryption_domain_config': :'OCI::Core::Models::EncryptionDomainConfig',
    'routing': :'String',
    'time_created': :'DateTime',
    'time_status_updated': :'DateTime',
    'oracle_can_initiate': :'String',
    'nat_translation_enabled': :'String',
    'dpd_mode': :'String',
    'dpd_timeout_in_sec': :'Integer',
    'phase_one_details': :'OCI::Core::Models::TunnelPhaseOneDetails',
    'phase_two_details': :'OCI::Core::Models::TunnelPhaseTwoDetails'
    # 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



437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
# File 'lib/oci/core/models/ip_sec_connection_tunnel.rb', line 437

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 &&
    encryption_domain_config == other.encryption_domain_config &&
    routing == other.routing &&
    time_created == other.time_created &&
    time_status_updated == other.time_status_updated &&
    oracle_can_initiate == other.oracle_can_initiate &&
    nat_translation_enabled == other.nat_translation_enabled &&
    dpd_mode == other.dpd_mode &&
    dpd_timeout_in_sec == other.dpd_timeout_in_sec &&
    phase_one_details == other.phase_one_details &&
    phase_two_details == other.phase_two_details
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



485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
# File 'lib/oci/core/models/ip_sec_connection_tunnel.rb', line 485

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


465
466
467
# File 'lib/oci/core/models/ip_sec_connection_tunnel.rb', line 465

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



474
475
476
# File 'lib/oci/core/models/ip_sec_connection_tunnel.rb', line 474

def hash
  [compartment_id, id, vpn_ip, cpe_ip, status, ike_version, lifecycle_state, display_name, bgp_session_info, encryption_domain_config, routing, time_created, time_status_updated, oracle_can_initiate, nat_translation_enabled, dpd_mode, dpd_timeout_in_sec, phase_one_details, phase_two_details].hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



518
519
520
521
522
523
524
525
526
527
# File 'lib/oci/core/models/ip_sec_connection_tunnel.rb', line 518

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



512
513
514
# File 'lib/oci/core/models/ip_sec_connection_tunnel.rb', line 512

def to_s
  to_hash.to_s
end