Class: OCI::VnMonitoring::Models::CrossConnectMapping

Inherits:
Object
  • Object
show all
Defined in:
lib/oci/vn_monitoring/models/cross_connect_mapping.rb

Overview

For use with Oracle Cloud Infrastructure FastConnect. Each VirtualCircuit runs on one or more cross-connects or cross-connect groups. A CrossConnectMapping contains the properties for an individual cross-connect or cross-connect group associated with a given virtual circuit.

The mapping includes information about the cross-connect or cross-connect group, the VLAN, and the BGP peering session.

If you're a customer who is colocated with Oracle, that means you own both the virtual circuit and the physical connection it runs on (cross-connect or cross-connect group), so you specify all the information in the mapping. There's one exception: for a public virtual circuit, Oracle specifies the BGP IPv4 addresses.

If you're a provider, then you own the physical connection that the customer's virtual circuit runs on, so you contribute information about the cross-connect or cross-connect group and VLAN.

Who specifies the BGP peering information in the case of customer connection via provider? If the BGP session goes from Oracle to the provider's edge router, then the provider also specifies the BGP peering information. If the BGP session instead goes from Oracle to the customer's edge router, then the customer specifies the BGP peering information. There's one exception: for a public virtual circuit, Oracle specifies the BGP IPv4 addresses.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ CrossConnectMapping

Initializes the object

Parameters:

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

    Model attributes in the form of hash

Options Hash (attributes):



123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
# File 'lib/oci/vn_monitoring/models/cross_connect_mapping.rb', line 123

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

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

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

  self.cross_connect_or_cross_connect_group_id = attributes[:'crossConnectOrCrossConnectGroupId'] if attributes[:'crossConnectOrCrossConnectGroupId']

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

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

  self.customer_bgp_peering_ip = attributes[:'customerBgpPeeringIp'] if attributes[:'customerBgpPeeringIp']

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

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

  self.oracle_bgp_peering_ip = attributes[:'oracleBgpPeeringIp'] if attributes[:'oracleBgpPeeringIp']

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

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

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

Instance Attribute Details

#bgp_md5_auth_keyString

The key for BGP MD5 authentication. Only applicable if your system requires MD5 authentication. If empty or not set (null), that means you don't use BGP MD5 authentication.

Returns:

  • (String)


41
42
43
# File 'lib/oci/vn_monitoring/models/cross_connect_mapping.rb', line 41

def bgp_md5_auth_key
  @bgp_md5_auth_key
end

#cross_connect_or_cross_connect_group_idString

The OCID of the cross-connect or cross-connect group for this mapping. Specified by the owner of the cross-connect or cross-connect group (the customer if the customer is colocated with Oracle, or the provider if the customer is connecting via provider).

Returns:

  • (String)


49
50
51
# File 'lib/oci/vn_monitoring/models/cross_connect_mapping.rb', line 49

def cross_connect_or_cross_connect_group_id
  @cross_connect_or_cross_connect_group_id
end

#customer_bgp_peering_ipString

The BGP IPv4 address for the router on the other end of the BGP session from Oracle. Specified by the owner of that router. If the session goes from Oracle to a customer, this is the BGP IPv4 address of the customer's edge router. If the session goes from Oracle to a provider, this is the BGP IPv4 address of the provider's edge router. Must use a subnet mask from /28 to /31.

There's one exception: for a public virtual circuit, Oracle specifies the BGP IPv4 addresses.

Example: 10.0.0.18/31

Returns:

  • (String)


62
63
64
# File 'lib/oci/vn_monitoring/models/cross_connect_mapping.rb', line 62

def customer_bgp_peering_ip
  @customer_bgp_peering_ip
end

#oracle_bgp_peering_ipString

The IPv4 address for Oracle's end of the BGP session. Must use a subnet mask from /28 to /31. If the session goes from Oracle to a customer's edge router, the customer specifies this information. If the session goes from Oracle to a provider's edge router, the provider specifies this.

There's one exception: for a public virtual circuit, Oracle specifies the BGP IPv4 addresses.

Example: 10.0.0.19/31

Returns:

  • (String)


74
75
76
# File 'lib/oci/vn_monitoring/models/cross_connect_mapping.rb', line 74

def oracle_bgp_peering_ip
  @oracle_bgp_peering_ip
end

#vlanInteger

The number of the specific VLAN (on the cross-connect or cross-connect group) that is assigned to this virtual circuit. Specified by the owner of the cross-connect or cross-connect group (the customer if the customer is colocated with Oracle, or the provider if the customer is connecting via provider).

Example: 200

Returns:

  • (Integer)


84
85
86
# File 'lib/oci/vn_monitoring/models/cross_connect_mapping.rb', line 84

def vlan
  @vlan
end

Class Method Details

.attribute_mapObject

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



87
88
89
90
91
92
93
94
95
96
97
# File 'lib/oci/vn_monitoring/models/cross_connect_mapping.rb', line 87

def self.attribute_map
  {
    # rubocop:disable Style/SymbolLiteral
    'bgp_md5_auth_key': :'bgpMd5AuthKey',
    'cross_connect_or_cross_connect_group_id': :'crossConnectOrCrossConnectGroupId',
    'customer_bgp_peering_ip': :'customerBgpPeeringIp',
    'oracle_bgp_peering_ip': :'oracleBgpPeeringIp',
    'vlan': :'vlan'
    # rubocop:enable Style/SymbolLiteral
  }
end

.swagger_typesObject

Attribute type mapping.



100
101
102
103
104
105
106
107
108
109
110
# File 'lib/oci/vn_monitoring/models/cross_connect_mapping.rb', line 100

def self.swagger_types
  {
    # rubocop:disable Style/SymbolLiteral
    'bgp_md5_auth_key': :'String',
    'cross_connect_or_cross_connect_group_id': :'String',
    'customer_bgp_peering_ip': :'String',
    'oracle_bgp_peering_ip': :'String',
    'vlan': :'Integer'
    # 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



163
164
165
166
167
168
169
170
171
172
# File 'lib/oci/vn_monitoring/models/cross_connect_mapping.rb', line 163

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

  self.class == other.class &&
    bgp_md5_auth_key == other.bgp_md5_auth_key &&
    cross_connect_or_cross_connect_group_id == other.cross_connect_or_cross_connect_group_id &&
    customer_bgp_peering_ip == other.customer_bgp_peering_ip &&
    oracle_bgp_peering_ip == other.oracle_bgp_peering_ip &&
    vlan == other.vlan
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



197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
# File 'lib/oci/vn_monitoring/models/cross_connect_mapping.rb', line 197

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


177
178
179
# File 'lib/oci/vn_monitoring/models/cross_connect_mapping.rb', line 177

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



186
187
188
# File 'lib/oci/vn_monitoring/models/cross_connect_mapping.rb', line 186

def hash
  [bgp_md5_auth_key, cross_connect_or_cross_connect_group_id, customer_bgp_peering_ip, oracle_bgp_peering_ip, vlan].hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



230
231
232
233
234
235
236
237
238
239
# File 'lib/oci/vn_monitoring/models/cross_connect_mapping.rb', line 230

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



224
225
226
# File 'lib/oci/vn_monitoring/models/cross_connect_mapping.rb', line 224

def to_s
  to_hash.to_s
end