Class: OCI::Core::Models::VirtualCircuit

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

Overview

For use with Oracle Cloud Infrastructure FastConnect.

A virtual circuit is an isolated network path that runs over one or more physical network connections to provide a single, logical connection between the edge router on the customer’s existing network and Oracle Cloud Infrastructure. Private virtual circuits support private peering, and public virtual circuits support public peering. For more information, see [FastConnect Overview](docs.us-phoenix-1.oraclecloud.com/Content/Network/Concepts/fastconnect.htm).

Each virtual circuit is made up of information shared between a customer, Oracle, and a provider (if the customer is using FastConnect via a provider). Who fills in a given property of a virtual circuit depends on whether the BGP session related to that virtual circuit goes from the customer’s edge router to Oracle, or from the provider’s edge router to Oracle. Also, in the case where the customer is using a provider, values for some of the properties may not be present immediately, but may get filled in as the provider and Oracle each do their part to provision the virtual circuit.

To use any of the API operations, you must be authorized in an IAM policy. If you’re not authorized, talk to an administrator. If you’re an administrator who needs to write policies to give users access, see [Getting Started with Policies](docs.us-phoenix-1.oraclecloud.com/Content/Identity/Concepts/policygetstarted.htm).

Constant Summary collapse

BGP_MANAGEMENT_ENUM =
[BGP_MANAGEMENT_CUSTOMER_MANAGED = 'CUSTOMER_MANAGED',
BGP_MANAGEMENT_PROVIDER_MANAGED = 'PROVIDER_MANAGED',
BGP_MANAGEMENT_ORACLE_MANAGED = 'ORACLE_MANAGED',
BGP_MANAGEMENT_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE']
BGP_SESSION_STATE_ENUM =
[BGP_SESSION_STATE_UP = 'UP',
BGP_SESSION_STATE_DOWN = 'DOWN',
BGP_SESSION_STATE_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE']
LIFECYCLE_STATE_ENUM =
[LIFECYCLE_STATE_PENDING_PROVIDER = 'PENDING_PROVIDER',
LIFECYCLE_STATE_VERIFYING = 'VERIFYING',
LIFECYCLE_STATE_PROVISIONING = 'PROVISIONING',
LIFECYCLE_STATE_PROVISIONED = 'PROVISIONED',
LIFECYCLE_STATE_FAILED = 'FAILED',
LIFECYCLE_STATE_INACTIVE = 'INACTIVE',
LIFECYCLE_STATE_TERMINATING = 'TERMINATING',
LIFECYCLE_STATE_TERMINATED = 'TERMINATED',
LIFECYCLE_STATE_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE']
PROVIDER_STATE_ENUM =
[PROVIDER_STATE_ACTIVE = 'ACTIVE',
PROVIDER_STATE_INACTIVE = 'INACTIVE',
PROVIDER_STATE_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE']
SERVICE_TYPE_ENUM =
[SERVICE_TYPE_COLOCATED = 'COLOCATED',
SERVICE_TYPE_LAYER2 = 'LAYER2',
SERVICE_TYPE_LAYER3 = 'LAYER3',
SERVICE_TYPE_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE']
TYPE_ENUM =
[TYPE_PUBLIC = 'PUBLIC',
TYPE_PRIVATE = 'PRIVATE',
TYPE_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE']

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ VirtualCircuit

Initializes the object

Parameters:

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

    Model attributes in the form of hash

Options Hash (attributes):

  • :bandwidth_shape_name (String)

    The value to assign to the #bandwidth_shape_name property

  • :bgp_management (String)

    The value to assign to the #bgp_management property

  • :bgp_session_state (String)

    The value to assign to the #bgp_session_state property

  • :compartment_id (String)

    The value to assign to the #compartment_id property

  • :cross_connect_mappings (Array<OCI::Core::Models::CrossConnectMapping>)

    The value to assign to the #cross_connect_mappings property

  • :customer_bgp_asn (Integer)

    The value to assign to the #customer_bgp_asn property

  • :display_name (String)

    The value to assign to the #display_name property

  • :gateway_id (String)

    The value to assign to the #gateway_id property

  • :id (String)

    The value to assign to the #id property

  • :lifecycle_state (String)

    The value to assign to the #lifecycle_state property

  • :oracle_bgp_asn (Integer)

    The value to assign to the #oracle_bgp_asn property

  • :provider_name (String)

    The value to assign to the #provider_name property

  • :provider_service_id (String)

    The value to assign to the #provider_service_id property

  • :provider_service_name (String)

    The value to assign to the #provider_service_name property

  • :provider_state (String)

    The value to assign to the #provider_state property

  • :public_prefixes (Array<String>)

    The value to assign to the #public_prefixes property

  • :reference_comment (String)

    The value to assign to the #reference_comment property

  • :region (String)

    The value to assign to the #region property

  • :service_type (String)

    The value to assign to the #service_type property

  • :time_created (DateTime)

    The value to assign to the #time_created property

  • :type (String)

    The value to assign to the #type property



210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
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
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
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
# File 'lib/oci/core/models/virtual_circuit.rb', line 210

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}

  if attributes[:'bandwidthShapeName']
    self.bandwidth_shape_name = attributes[:'bandwidthShapeName']
  end

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

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

  if attributes[:'bgpManagement']
    self.bgp_management = attributes[:'bgpManagement']
  end

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

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

  if attributes[:'bgpSessionState']
    self.bgp_session_state = attributes[:'bgpSessionState']
  end

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

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

  if attributes[:'compartmentId']
    self.compartment_id = attributes[:'compartmentId']
  end

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

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

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

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

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

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

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

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

  if attributes[:'displayName']
    self.display_name = attributes[:'displayName']
  end

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

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

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

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

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

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

  if attributes[:'lifecycleState']
    self.lifecycle_state = attributes[:'lifecycleState']
  end

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

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

  if attributes[:'oracleBgpAsn']
    self.oracle_bgp_asn = attributes[:'oracleBgpAsn']
  end

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

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

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

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

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

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

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

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

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

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

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

  if attributes[:'providerState']
    self.provider_state = attributes[:'providerState']
  end

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

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

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

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

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

  if attributes[:'referenceComment']
    self.reference_comment = attributes[:'referenceComment']
  end

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

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

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

  if attributes[:'serviceType']
    self.service_type = attributes[:'serviceType']
  end

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

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

  if attributes[:'timeCreated']
    self.time_created = attributes[:'timeCreated']
  end

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

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

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

end

Instance Attribute Details

#bandwidth_shape_nameString

The provisioned data rate of the connection.

Returns:

  • (String)


67
68
69
# File 'lib/oci/core/models/virtual_circuit.rb', line 67

def bandwidth_shape_name
  @bandwidth_shape_name
end

#bgp_managementString

BGP management option.

Returns:

  • (String)


72
73
74
# File 'lib/oci/core/models/virtual_circuit.rb', line 72

def bgp_management
  @bgp_management
end

#bgp_session_stateString

The state of the BGP session associated with the virtual circuit.

Returns:

  • (String)


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

def bgp_session_state
  @bgp_session_state
end

#compartment_idString

The OCID of the compartment containing the virtual circuit.

Returns:

  • (String)


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

def compartment_id
  @compartment_id
end

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

An array of mappings, each containing properties for a cross-connect or cross-connect group that is associated with this virtual circuit.



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

def cross_connect_mappings
  @cross_connect_mappings
end

#customer_bgp_asnInteger

The BGP ASN of the network at the other end of the BGP session from Oracle. If the session is between the customer’s edge router and Oracle, the value is the customer’s ASN. If the BGP session is between the provider’s edge router and Oracle, the value is the provider’s ASN.

Returns:

  • (Integer)


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

def customer_bgp_asn
  @customer_bgp_asn
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/virtual_circuit.rb', line 102

def display_name
  @display_name
end

#gateway_idString

The OCID of the customer’s Drg that this virtual circuit uses. Applicable only to private virtual circuits.

Returns:

  • (String)


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

def gateway_id
  @gateway_id
end

#idString

The virtual circuit’s Oracle ID (OCID).

Returns:

  • (String)


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

def id
  @id
end

#lifecycle_stateString

The virtual circuit’s current state. For information about the different states, see [FastConnect Overview](docs.us-phoenix-1.oraclecloud.com/Content/Network/Concepts/fastconnect.htm).

Returns:

  • (String)


119
120
121
# File 'lib/oci/core/models/virtual_circuit.rb', line 119

def lifecycle_state
  @lifecycle_state
end

#oracle_bgp_asnInteger

The Oracle BGP ASN.

Returns:

  • (Integer)


123
124
125
# File 'lib/oci/core/models/virtual_circuit.rb', line 123

def oracle_bgp_asn
  @oracle_bgp_asn
end

#provider_nameString

Deprecated. Instead use ‘providerServiceId`.

Returns:

  • (String)


128
129
130
# File 'lib/oci/core/models/virtual_circuit.rb', line 128

def provider_name
  @provider_name
end

#provider_service_idString

The OCID of the service offered by the provider (if the customer is connecting via a provider).

Returns:

  • (String)


133
134
135
# File 'lib/oci/core/models/virtual_circuit.rb', line 133

def provider_service_id
  @provider_service_id
end

#provider_service_nameString

Deprecated. Instead use ‘providerServiceId`.

Returns:

  • (String)


138
139
140
# File 'lib/oci/core/models/virtual_circuit.rb', line 138

def provider_service_name
  @provider_service_name
end

#provider_stateString

The provider’s state in relation to this virtual circuit (if the customer is connecting via a provider). ACTIVE means the provider has provisioned the virtual circuit from their end. INACTIVE means the provider has not yet provisioned the virtual circuit, or has de-provisioned it.

Returns:

  • (String)


147
148
149
# File 'lib/oci/core/models/virtual_circuit.rb', line 147

def provider_state
  @provider_state
end

#public_prefixesArray<String>

For a public virtual circuit. The public IP prefixes (CIDRs) the customer wants to advertise across the connection. Each prefix must be /24 or less specific.

Returns:

  • (Array<String>)


153
154
155
# File 'lib/oci/core/models/virtual_circuit.rb', line 153

def public_prefixes
  @public_prefixes
end

#reference_commentString

Provider-supplied reference information about this virtual circuit (if the customer is connecting via a provider).

Returns:

  • (String)


159
160
161
# File 'lib/oci/core/models/virtual_circuit.rb', line 159

def reference_comment
  @reference_comment
end

#regionString

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

Returns:

  • (String)


165
166
167
# File 'lib/oci/core/models/virtual_circuit.rb', line 165

def region
  @region
end

#service_typeString

Provider service type.

Returns:

  • (String)


170
171
172
# File 'lib/oci/core/models/virtual_circuit.rb', line 170

def service_type
  @service_type
end

#time_createdDateTime

The date and time the virtual circuit was created, in the format defined by RFC3339.

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

Returns:

  • (DateTime)


178
179
180
# File 'lib/oci/core/models/virtual_circuit.rb', line 178

def time_created
  @time_created
end

#typeString

Whether the virtual circuit supports private or public peering. For more information, see [FastConnect Overview](docs.us-phoenix-1.oraclecloud.com/Content/Network/Concepts/fastconnect.htm).

Returns:

  • (String)


184
185
186
# File 'lib/oci/core/models/virtual_circuit.rb', line 184

def type
  @type
end

Instance Method Details

#==(other_object) ⇒ Object

Checks equality by comparing each attribute.

Parameters:

  • other_object (Object)

    to be compared



472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
# File 'lib/oci/core/models/virtual_circuit.rb', line 472

def ==(other_object)
  return true if self.equal?(other_object)
  self.class == other_object.class &&
      bandwidth_shape_name == other_object.bandwidth_shape_name &&
      bgp_management == other_object.bgp_management &&
      bgp_session_state == other_object.bgp_session_state &&
      compartment_id == other_object.compartment_id &&
      cross_connect_mappings == other_object.cross_connect_mappings &&
      customer_bgp_asn == other_object.customer_bgp_asn &&
      display_name == other_object.display_name &&
      gateway_id == other_object.gateway_id &&
      id == other_object.id &&
      lifecycle_state == other_object.lifecycle_state &&
      oracle_bgp_asn == other_object.oracle_bgp_asn &&
      provider_name == other_object.provider_name &&
      provider_service_id == other_object.provider_service_id &&
      provider_service_name == other_object.provider_service_name &&
      provider_state == other_object.provider_state &&
      public_prefixes == other_object.public_prefixes &&
      reference_comment == other_object.reference_comment &&
      region == other_object.region &&
      service_type == other_object.service_type &&
      time_created == other_object.time_created &&
      type == other_object.type
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



513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
# File 'lib/oci/core/models/virtual_circuit.rb', line 513

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)
        self.public_method("#{key}=").call(attributes[self.class.attribute_map[key]].map{ |v| OCI::Internal::Util.convert_to_type($1, v) } )
      end
    elsif !attributes[self.class.attribute_map[key]].nil?
      self.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_object) ⇒ Boolean

Parameters:

  • other_object (Object)

    to be compared

Returns:

  • (Boolean)

See Also:

  • `==` method


500
501
502
# File 'lib/oci/core/models/virtual_circuit.rb', line 500

def eql?(other_object)
  self == other_object
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



506
507
508
# File 'lib/oci/core/models/virtual_circuit.rb', line 506

def hash
  [bandwidth_shape_name, bgp_management, bgp_session_state, compartment_id, cross_connect_mappings, customer_bgp_asn, display_name, gateway_id, id, lifecycle_state, oracle_bgp_asn, provider_name, provider_service_id, provider_service_name, provider_state, public_prefixes, reference_comment, region, service_type, time_created, type].hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



538
539
540
541
542
543
544
545
546
# File 'lib/oci/core/models/virtual_circuit.rb', line 538

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



532
533
534
# File 'lib/oci/core/models/virtual_circuit.rb', line 532

def to_s
  to_hash.to_s
end