Class: OCI::VnMonitoring::Models::RemotePeeringConnectionDrgAttachmentNetworkDetails

Inherits:
DrgAttachmentNetworkDetails show all
Defined in:
lib/oci/vn_monitoring/models/remote_peering_connection_drg_attachment_network_details.rb

Overview

Specifies the DRG attachment to another DRG.

Constant Summary

Constants inherited from DrgAttachmentNetworkDetails

DrgAttachmentNetworkDetails::TYPE_ENUM

Instance Attribute Summary collapse

Attributes inherited from DrgAttachmentNetworkDetails

#id, #type

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from DrgAttachmentNetworkDetails

get_subtype

Constructor Details

#initialize(attributes = {}) ⇒ RemotePeeringConnectionDrgAttachmentNetworkDetails

Initializes the object

Parameters:

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

    Model attributes in the form of hash

Options Hash (attributes):

  • :id (String)

    The value to assign to the #id proprety

  • :peer_region_name (String)

    The value to assign to the #peer_region_name property

  • :peer_attachment_route_target (String)

    The value to assign to the #peer_attachment_route_target property

  • :import_route_target (String)

    The value to assign to the #import_route_target property

  • :export_route_target (String)

    The value to assign to the #export_route_target property

  • :mpls_label (Integer)

    The value to assign to the #mpls_label property

  • :regional_oci_asn (String)

    The value to assign to the #regional_oci_asn property

  • :ingress_vip (String)

    The value to assign to the #ingress_vip property



94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
# File 'lib/oci/vn_monitoring/models/remote_peering_connection_drg_attachment_network_details.rb', line 94

def initialize(attributes = {})
  return unless attributes.is_a?(Hash)

  attributes['type'] = 'REMOTE_PEERING_CONNECTION'

  super(attributes)

  # convert string to symbol for hash key
  attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }

  self.peer_region_name = attributes[:'peerRegionName'] if attributes[:'peerRegionName']

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

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

  self.peer_attachment_route_target = attributes[:'peerAttachmentRouteTarget'] if attributes[:'peerAttachmentRouteTarget']

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

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

  self.import_route_target = attributes[:'importRouteTarget'] if attributes[:'importRouteTarget']

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

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

  self.export_route_target = attributes[:'exportRouteTarget'] if attributes[:'exportRouteTarget']

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

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

  self.mpls_label = attributes[:'mplsLabel'] if attributes[:'mplsLabel']

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

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

  self.regional_oci_asn = attributes[:'regionalOciAsn'] if attributes[:'regionalOciAsn']

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

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

  self.ingress_vip = attributes[:'ingressVip'] if attributes[:'ingressVip']

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

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

Instance Attribute Details

#export_route_targetString

Routes which are exported to the attachment are exported to the route reflectors with the route target set to the value of the attachment's export route target.

Returns:

  • (String)


31
32
33
# File 'lib/oci/vn_monitoring/models/remote_peering_connection_drg_attachment_network_details.rb', line 31

def export_route_target
  @export_route_target
end

#import_route_targetString

Routes which may be imported from the attachment (subject to import policy) appear in the route reflectors tagged with the attachment's import route target.

Returns:

  • (String)


25
26
27
# File 'lib/oci/vn_monitoring/models/remote_peering_connection_drg_attachment_network_details.rb', line 25

def import_route_target
  @import_route_target
end

#ingress_vipString

IPv4 address used to encapsulate ingress traffic to the DRG through this attachment

Returns:

  • (String)


44
45
46
# File 'lib/oci/vn_monitoring/models/remote_peering_connection_drg_attachment_network_details.rb', line 44

def ingress_vip
  @ingress_vip
end

#mpls_labelInteger

The MPLS label of the DRG attachment.

Returns:

  • (Integer)


35
36
37
# File 'lib/oci/vn_monitoring/models/remote_peering_connection_drg_attachment_network_details.rb', line 35

def mpls_label
  @mpls_label
end

#peer_attachment_route_targetString

The attachment route target.

Returns:

  • (String)


19
20
21
# File 'lib/oci/vn_monitoring/models/remote_peering_connection_drg_attachment_network_details.rb', line 19

def peer_attachment_route_target
  @peer_attachment_route_target
end

#peer_region_nameString

The remote Oracle Cloud Infrastructure region name.

Returns:

  • (String)


15
16
17
# File 'lib/oci/vn_monitoring/models/remote_peering_connection_drg_attachment_network_details.rb', line 15

def peer_region_name
  @peer_region_name
end

#regional_oci_asnString

The BGP ASN to use for the IPSec connection's route target.

Returns:

  • (String)


40
41
42
# File 'lib/oci/vn_monitoring/models/remote_peering_connection_drg_attachment_network_details.rb', line 40

def regional_oci_asn
  @regional_oci_asn
end

Class Method Details

.attribute_mapObject

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



47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
# File 'lib/oci/vn_monitoring/models/remote_peering_connection_drg_attachment_network_details.rb', line 47

def self.attribute_map
  {
    # rubocop:disable Style/SymbolLiteral
    'type': :'type',
    'id': :'id',
    'peer_region_name': :'peerRegionName',
    'peer_attachment_route_target': :'peerAttachmentRouteTarget',
    'import_route_target': :'importRouteTarget',
    'export_route_target': :'exportRouteTarget',
    'mpls_label': :'mplsLabel',
    'regional_oci_asn': :'regionalOciAsn',
    'ingress_vip': :'ingressVip'
    # rubocop:enable Style/SymbolLiteral
  }
end

.swagger_typesObject

Attribute type mapping.



64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
# File 'lib/oci/vn_monitoring/models/remote_peering_connection_drg_attachment_network_details.rb', line 64

def self.swagger_types
  {
    # rubocop:disable Style/SymbolLiteral
    'type': :'String',
    'id': :'String',
    'peer_region_name': :'String',
    'peer_attachment_route_target': :'String',
    'import_route_target': :'String',
    'export_route_target': :'String',
    'mpls_label': :'Integer',
    'regional_oci_asn': :'String',
    'ingress_vip': :'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



154
155
156
157
158
159
160
161
162
163
164
165
166
167
# File 'lib/oci/vn_monitoring/models/remote_peering_connection_drg_attachment_network_details.rb', line 154

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

  self.class == other.class &&
    type == other.type &&
    id == other.id &&
    peer_region_name == other.peer_region_name &&
    peer_attachment_route_target == other.peer_attachment_route_target &&
    import_route_target == other.import_route_target &&
    export_route_target == other.export_route_target &&
    mpls_label == other.mpls_label &&
    regional_oci_asn == other.regional_oci_asn &&
    ingress_vip == other.ingress_vip
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



192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
# File 'lib/oci/vn_monitoring/models/remote_peering_connection_drg_attachment_network_details.rb', line 192

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


172
173
174
# File 'lib/oci/vn_monitoring/models/remote_peering_connection_drg_attachment_network_details.rb', line 172

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



181
182
183
# File 'lib/oci/vn_monitoring/models/remote_peering_connection_drg_attachment_network_details.rb', line 181

def hash
  [type, id, peer_region_name, peer_attachment_route_target, import_route_target, export_route_target, mpls_label, regional_oci_asn, ingress_vip].hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



225
226
227
228
229
230
231
232
233
234
# File 'lib/oci/vn_monitoring/models/remote_peering_connection_drg_attachment_network_details.rb', line 225

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



219
220
221
# File 'lib/oci/vn_monitoring/models/remote_peering_connection_drg_attachment_network_details.rb', line 219

def to_s
  to_hash.to_s
end