Class: OCI::Core::Models::CrossConnectMapping

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

Instance Attribute 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



56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
# File 'lib/oci/core/models/cross_connect_mapping.rb', line 56

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

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

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

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

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

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)


12
13
14
# File 'lib/oci/core/models/cross_connect_mapping.rb', line 12

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)


20
21
22
# File 'lib/oci/core/models/cross_connect_mapping.rb', line 20

def cross_connect_or_cross_connect_group_id
  @cross_connect_or_cross_connect_group_id
end

#customer_bgp_peering_ipString

The BGP IP 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 IP address of the customer’s edge router. If the session goes from Oracle to a provider, this is the BGP IP address of the provider’s edge router. Must use a /30 or /31 subnet mask.

Example: ‘10.0.0.18/31`

Returns:

  • (String)


31
32
33
# File 'lib/oci/core/models/cross_connect_mapping.rb', line 31

def customer_bgp_peering_ip
  @customer_bgp_peering_ip
end

#oracle_bgp_peering_ipString

The IP address for Oracle’s end of the BGP session. Must use a /30 or /31 subnet mask. 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.

Example: ‘10.0.0.19/31`

Returns:

  • (String)


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

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)


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

def vlan
  @vlan
end

Instance Method Details

#==(other_object) ⇒ Object

Checks equality by comparing each attribute.

Parameters:

  • other_object (Object)

    to be compared



86
87
88
89
90
91
92
93
94
# File 'lib/oci/core/models/cross_connect_mapping.rb', line 86

def ==(other_object)
  return true if self.equal?(other_object)
  self.class == other_object.class &&
      bgp_md5_auth_key == other_object.bgp_md5_auth_key &&
      cross_connect_or_cross_connect_group_id == other_object.cross_connect_or_cross_connect_group_id &&
      customer_bgp_peering_ip == other_object.customer_bgp_peering_ip &&
      oracle_bgp_peering_ip == other_object.oracle_bgp_peering_ip &&
      vlan == other_object.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



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

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_send("#{key}=", 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_send("#{key}=", 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


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

def eql?(other_object)
  self == other_object
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



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

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



136
137
138
139
140
141
142
143
144
# File 'lib/oci/core/models/cross_connect_mapping.rb', line 136

def to_hash
  hash = {}
  self.class.attribute_map.each_pair do |attr, param|
    value = public_send(attr)
    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



130
131
132
# File 'lib/oci/core/models/cross_connect_mapping.rb', line 130

def to_s
  to_hash.to_s
end