Class: OCI::Core::Models::CreateVirtualCircuitDetails

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

Overview

CreateVirtualCircuitDetails model.

Constant Summary collapse

ROUTING_POLICY_ENUM =
[
  ROUTING_POLICY_ORACLE_SERVICE_NETWORK = 'ORACLE_SERVICE_NETWORK'.freeze,
  ROUTING_POLICY_REGIONAL = 'REGIONAL'.freeze,
  ROUTING_POLICY_MARKET_LEVEL = 'MARKET_LEVEL'.freeze,
  ROUTING_POLICY_GLOBAL = 'GLOBAL'.freeze
].freeze
BGP_ADMIN_STATE_ENUM =
[
  BGP_ADMIN_STATE_ENABLED = 'ENABLED'.freeze,
  BGP_ADMIN_STATE_DISABLED = 'DISABLED'.freeze
].freeze
TYPE_ENUM =
[
  TYPE_PUBLIC = 'PUBLIC'.freeze,
  TYPE_PRIVATE = 'PRIVATE'.freeze
].freeze
IP_MTU_ENUM =
[
  IP_MTU_MTU_1500 = 'MTU_1500'.freeze,
  IP_MTU_MTU_9000 = 'MTU_9000'.freeze
].freeze

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ CreateVirtualCircuitDetails

Initializes the object

Parameters:

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

    Model attributes in the form of hash

Options Hash (attributes):



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
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
# File 'lib/oci/core/models/create_virtual_circuit_details.rb', line 255

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

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

  self.bandwidth_shape_name = attributes[:'bandwidth_shape_name'] if attributes[:'bandwidth_shape_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.cross_connect_mappings = attributes[:'crossConnectMappings'] if attributes[:'crossConnectMappings']

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

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

  self.routing_policy = attributes[:'routingPolicy'] if attributes[:'routingPolicy']

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

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

  self.bgp_admin_state = attributes[:'bgpAdminState'] if attributes[:'bgpAdminState']

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

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

  self.is_bfd_enabled = attributes[:'isBfdEnabled'] unless attributes[:'isBfdEnabled'].nil?
  self.is_bfd_enabled = false if is_bfd_enabled.nil? && !attributes.key?(:'isBfdEnabled') # rubocop:disable Style/StringLiterals

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

  self.is_bfd_enabled = attributes[:'is_bfd_enabled'] unless attributes[:'is_bfd_enabled'].nil?
  self.is_bfd_enabled = false if is_bfd_enabled.nil? && !attributes.key?(:'isBfdEnabled') && !attributes.key?(:'is_bfd_enabled') # rubocop:disable Style/StringLiterals

  self.is_transport_mode = attributes[:'isTransportMode'] unless attributes[:'isTransportMode'].nil?
  self.is_transport_mode = false if is_transport_mode.nil? && !attributes.key?(:'isTransportMode') # rubocop:disable Style/StringLiterals

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

  self.is_transport_mode = attributes[:'is_transport_mode'] unless attributes[:'is_transport_mode'].nil?
  self.is_transport_mode = false if is_transport_mode.nil? && !attributes.key?(:'isTransportMode') && !attributes.key?(:'is_transport_mode') # rubocop:disable Style/StringLiterals

  self.customer_bgp_asn = attributes[:'customerBgpAsn'] if attributes[:'customerBgpAsn']

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

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

  self.customer_asn = attributes[:'customerAsn'] if attributes[:'customerAsn']

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

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

  self.defined_tags = attributes[:'definedTags'] if attributes[:'definedTags']

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

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

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

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

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

  self.gateway_id = attributes[:'gatewayId'] if attributes[:'gatewayId']

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

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

  self.provider_name = attributes[:'providerName'] if attributes[:'providerName']

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

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

  self.provider_service_id = attributes[:'providerServiceId'] if attributes[:'providerServiceId']

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

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

  self.provider_service_key_name = attributes[:'providerServiceKeyName'] if attributes[:'providerServiceKeyName']

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

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

  self.provider_service_name = attributes[:'providerServiceName'] if attributes[:'providerServiceName']

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

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

  self.public_prefixes = attributes[:'publicPrefixes'] if attributes[:'publicPrefixes']

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

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

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

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

  self.ip_mtu = attributes[:'ipMtu'] if attributes[:'ipMtu']

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

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

Instance Attribute Details

#bandwidth_shape_nameString

The provisioned data rate of the connection. To get a list of the available bandwidth levels (that is, shapes), see list_fast_connect_provider_virtual_circuit_bandwidth_shapes.

Example: 10 Gbps

Returns:

  • (String)


40
41
42
# File 'lib/oci/core/models/create_virtual_circuit_details.rb', line 40

def bandwidth_shape_name
  @bandwidth_shape_name
end

#bgp_admin_stateString

Set to ENABLED (the default) to activate the BGP session of the virtual circuit, set to DISABLED to deactivate the virtual circuit.

Returns:

  • (String)


64
65
66
# File 'lib/oci/core/models/create_virtual_circuit_details.rb', line 64

def bgp_admin_state
  @bgp_admin_state
end

#compartment_idString

[Required] The OCID of the compartment to contain the virtual circuit.

Returns:

  • (String)


45
46
47
# File 'lib/oci/core/models/create_virtual_circuit_details.rb', line 45

def compartment_id
  @compartment_id
end

#cross_connect_mappingsArray<OCI::Core::Models::CrossConnectMapping>

Create a CrossConnectMapping for each cross-connect or cross-connect group this virtual circuit will run on.



51
52
53
# File 'lib/oci/core/models/create_virtual_circuit_details.rb', line 51

def cross_connect_mappings
  @cross_connect_mappings
end

#customer_asnInteger

Your BGP ASN (either public or private). Provide this value only if there's a BGP session that goes from your edge router to Oracle. Otherwise, leave this empty or null. Can be a 2-byte or 4-byte ASN. Uses "asplain" format.

Example: 12345 (2-byte) or 1587232876 (4-byte)

Returns:

  • (Integer)


90
91
92
# File 'lib/oci/core/models/create_virtual_circuit_details.rb', line 90

def customer_asn
  @customer_asn
end

#customer_bgp_asnInteger

Deprecated. Instead use customerAsn. If you specify values for both, the request will be rejected.

Returns:

  • (Integer)


80
81
82
# File 'lib/oci/core/models/create_virtual_circuit_details.rb', line 80

def customer_bgp_asn
  @customer_bgp_asn
end

#defined_tagsHash<String, Hash<String, Object>>

Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags.

Example: {\"Operations\": {\"CostCenter\": \"42\"}}

Returns:

  • (Hash<String, Hash<String, Object>>)


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

def defined_tags
  @defined_tags
end

#display_nameString

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

Returns:

  • (String)


104
105
106
# File 'lib/oci/core/models/create_virtual_circuit_details.rb', line 104

def display_name
  @display_name
end

#freeform_tagsHash<String, String>

Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see Resource Tags.

Example: {\"Department\": \"Finance\"}

Returns:

  • (Hash<String, String>)


112
113
114
# File 'lib/oci/core/models/create_virtual_circuit_details.rb', line 112

def freeform_tags
  @freeform_tags
end

#gateway_idString

For private virtual circuits only. The OCID of the Drg that this virtual circuit uses.

Returns:

  • (String)


118
119
120
# File 'lib/oci/core/models/create_virtual_circuit_details.rb', line 118

def gateway_id
  @gateway_id
end

#ip_mtuString

The layer 3 IP MTU to use with this virtual circuit.

Returns:

  • (String)


168
169
170
# File 'lib/oci/core/models/create_virtual_circuit_details.rb', line 168

def ip_mtu
  @ip_mtu
end

#is_bfd_enabledBOOLEAN

Set to true to enable BFD for IPv4 BGP peering, or set to false to disable BFD. If this is not set, the default is false.

Returns:

  • (BOOLEAN)


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

def is_bfd_enabled
  @is_bfd_enabled
end

#is_transport_modeBOOLEAN

Set to true for the virtual circuit to carry only encrypted traffic, or set to false for the virtual circuit to carry unencrypted traffic. If this is not set, the default is false.

Returns:

  • (BOOLEAN)


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

def is_transport_mode
  @is_transport_mode
end

#provider_nameString

Deprecated. Instead use providerServiceId. To get a list of the provider names, see list_fast_connect_provider_services.

Returns:

  • (String)


125
126
127
# File 'lib/oci/core/models/create_virtual_circuit_details.rb', line 125

def provider_name
  @provider_name
end

#provider_service_idString

The OCID of the service offered by the provider (if you're connecting via a provider). To get a list of the available service offerings, see list_fast_connect_provider_services.

Returns:

  • (String)


132
133
134
# File 'lib/oci/core/models/create_virtual_circuit_details.rb', line 132

def provider_service_id
  @provider_service_id
end

#provider_service_key_nameString

The service key name offered by the provider (if the customer is connecting via a provider).

Returns:

  • (String)


137
138
139
# File 'lib/oci/core/models/create_virtual_circuit_details.rb', line 137

def provider_service_key_name
  @provider_service_key_name
end

#provider_service_nameString

Deprecated. Instead use providerServiceId. To get a list of the provider names, see list_fast_connect_provider_services.

Returns:

  • (String)


144
145
146
# File 'lib/oci/core/models/create_virtual_circuit_details.rb', line 144

def provider_service_name
  @provider_service_name
end

#public_prefixesArray<OCI::Core::Models::CreateVirtualCircuitPublicPrefixDetails>

For a public virtual circuit. The public IP prefixes (CIDRs) the customer wants to advertise across the connection.



150
151
152
# File 'lib/oci/core/models/create_virtual_circuit_details.rb', line 150

def public_prefixes
  @public_prefixes
end

#regionString

The Oracle Cloud Infrastructure region where this virtual circuit is located. Example: phx

Returns:

  • (String)


157
158
159
# File 'lib/oci/core/models/create_virtual_circuit_details.rb', line 157

def region
  @region
end

#routing_policyArray<String>

The routing policy sets how routing information about the Oracle cloud is shared over a public virtual circuit. Policies available are: ORACLE_SERVICE_NETWORK, REGIONAL, MARKET_LEVEL, and GLOBAL. See Route Filtering for details. By default, routing information is shared for all routes in the same market.

Returns:

  • (Array<String>)


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

def routing_policy
  @routing_policy
end

#typeString

[Required] The type of IP addresses used in this virtual circuit. PRIVATE means RFC 1918 addresses (10.0.0.0/8, 172.16/12, and 192.168/16).

Returns:

  • (String)


164
165
166
# File 'lib/oci/core/models/create_virtual_circuit_details.rb', line 164

def type
  @type
end

Class Method Details

.attribute_mapObject

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



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

def self.attribute_map
  {
    # rubocop:disable Style/SymbolLiteral
    'bandwidth_shape_name': :'bandwidthShapeName',
    'compartment_id': :'compartmentId',
    'cross_connect_mappings': :'crossConnectMappings',
    'routing_policy': :'routingPolicy',
    'bgp_admin_state': :'bgpAdminState',
    'is_bfd_enabled': :'isBfdEnabled',
    'is_transport_mode': :'isTransportMode',
    'customer_bgp_asn': :'customerBgpAsn',
    'customer_asn': :'customerAsn',
    'defined_tags': :'definedTags',
    'display_name': :'displayName',
    'freeform_tags': :'freeformTags',
    'gateway_id': :'gatewayId',
    'provider_name': :'providerName',
    'provider_service_id': :'providerServiceId',
    'provider_service_key_name': :'providerServiceKeyName',
    'provider_service_name': :'providerServiceName',
    'public_prefixes': :'publicPrefixes',
    'region': :'region',
    'type': :'type',
    'ip_mtu': :'ipMtu'
    # rubocop:enable Style/SymbolLiteral
  }
end

.swagger_typesObject

Attribute type mapping.



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

def self.swagger_types
  {
    # rubocop:disable Style/SymbolLiteral
    'bandwidth_shape_name': :'String',
    'compartment_id': :'String',
    'cross_connect_mappings': :'Array<OCI::Core::Models::CrossConnectMapping>',
    'routing_policy': :'Array<String>',
    'bgp_admin_state': :'String',
    'is_bfd_enabled': :'BOOLEAN',
    'is_transport_mode': :'BOOLEAN',
    'customer_bgp_asn': :'Integer',
    'customer_asn': :'Integer',
    'defined_tags': :'Hash<String, Hash<String, Object>>',
    'display_name': :'String',
    'freeform_tags': :'Hash<String, String>',
    'gateway_id': :'String',
    'provider_name': :'String',
    'provider_service_id': :'String',
    'provider_service_key_name': :'String',
    'provider_service_name': :'String',
    'public_prefixes': :'Array<OCI::Core::Models::CreateVirtualCircuitPublicPrefixDetails>',
    'region': :'String',
    'type': :'String',
    'ip_mtu': :'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



430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
# File 'lib/oci/core/models/create_virtual_circuit_details.rb', line 430

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

  self.class == other.class &&
    bandwidth_shape_name == other.bandwidth_shape_name &&
    compartment_id == other.compartment_id &&
    cross_connect_mappings == other.cross_connect_mappings &&
    routing_policy == other.routing_policy &&
    bgp_admin_state == other.bgp_admin_state &&
    is_bfd_enabled == other.is_bfd_enabled &&
    is_transport_mode == other.is_transport_mode &&
    customer_bgp_asn == other.customer_bgp_asn &&
    customer_asn == other.customer_asn &&
    defined_tags == other.defined_tags &&
    display_name == other.display_name &&
    freeform_tags == other.freeform_tags &&
    gateway_id == other.gateway_id &&
    provider_name == other.provider_name &&
    provider_service_id == other.provider_service_id &&
    provider_service_key_name == other.provider_service_key_name &&
    provider_service_name == other.provider_service_name &&
    public_prefixes == other.public_prefixes &&
    region == other.region &&
    type == other.type &&
    ip_mtu == other.ip_mtu
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



480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
# File 'lib/oci/core/models/create_virtual_circuit_details.rb', line 480

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


460
461
462
# File 'lib/oci/core/models/create_virtual_circuit_details.rb', line 460

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



469
470
471
# File 'lib/oci/core/models/create_virtual_circuit_details.rb', line 469

def hash
  [bandwidth_shape_name, compartment_id, cross_connect_mappings, routing_policy, bgp_admin_state, is_bfd_enabled, is_transport_mode, customer_bgp_asn, customer_asn, defined_tags, display_name, freeform_tags, gateway_id, provider_name, provider_service_id, provider_service_key_name, provider_service_name, public_prefixes, region, type, ip_mtu].hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



513
514
515
516
517
518
519
520
521
522
# File 'lib/oci/core/models/create_virtual_circuit_details.rb', line 513

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



507
508
509
# File 'lib/oci/core/models/create_virtual_circuit_details.rb', line 507

def to_s
  to_hash.to_s
end