Class: OCI::Core::Models::DrgRouteRule
- Inherits:
-
Object
- Object
- OCI::Core::Models::DrgRouteRule
- Defined in:
- lib/oci/core/models/drg_route_rule.rb
Overview
A DRG route rule is a mapping between a destination IP address range and a DRG attachment. The map is used to route matching packets. Traffic will be routed across the attachments using Equal-cost multi-path routing (ECMP) if there are multiple rules with identical destinations and none of the rules conflict.
Constant Summary collapse
- DESTINATION_TYPE_ENUM =
[ DESTINATION_TYPE_CIDR_BLOCK = 'CIDR_BLOCK'.freeze, DESTINATION_TYPE_SERVICE_CIDR_BLOCK = 'SERVICE_CIDR_BLOCK'.freeze, DESTINATION_TYPE_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze ].freeze
- ROUTE_TYPE_ENUM =
[ ROUTE_TYPE_STATIC = 'STATIC'.freeze, ROUTE_TYPE_DYNAMIC = 'DYNAMIC'.freeze, ROUTE_TYPE_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze ].freeze
- ROUTE_PROVENANCE_ENUM =
[ ROUTE_PROVENANCE_STATIC = 'STATIC'.freeze, ROUTE_PROVENANCE_VCN = 'VCN'.freeze, ROUTE_PROVENANCE_VIRTUAL_CIRCUIT = 'VIRTUAL_CIRCUIT'.freeze, ROUTE_PROVENANCE_IPSEC_TUNNEL = 'IPSEC_TUNNEL'.freeze, ROUTE_PROVENANCE_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze ].freeze
Instance Attribute Summary collapse
-
#attributes ⇒ Object
Additional properties for the route, computed by the service.
-
#destination ⇒ String
[Required] Represents the range of IP addresses to match against when routing traffic.
-
#destination_type ⇒ String
[Required] The type of destination for the rule.
-
#id ⇒ String
[Required] The Oracle-assigned ID of the DRG route rule.
-
#is_blackhole ⇒ BOOLEAN
Indicates that if the next hop attachment does not exist, so traffic for this route is discarded without notification.
-
#is_conflict ⇒ BOOLEAN
Indicates that the route was not imported due to a conflict between route rules.
-
#next_hop_drg_attachment_id ⇒ String
[Required] The [OCID](docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the next hop DRG attachment responsible for reaching the network destination.
-
#route_provenance ⇒ String
[Required] The earliest origin of a route.
-
#route_type ⇒ String
You can specify static routes for the DRG route table using the API.
Class Method Summary collapse
-
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
-
.swagger_types ⇒ Object
Attribute type mapping.
Instance Method Summary collapse
-
#==(other) ⇒ Object
Checks equality by comparing each attribute.
-
#build_from_hash(attributes) ⇒ Object
Builds the object from hash.
- #eql?(other) ⇒ Boolean
-
#hash ⇒ Fixnum
Calculates hash code according to all attributes.
-
#initialize(attributes = {}) ⇒ DrgRouteRule
constructor
Initializes the object.
-
#to_hash ⇒ Hash
Returns the object in the form of hash.
-
#to_s ⇒ String
Returns the string representation of the object.
Constructor Details
#initialize(attributes = {}) ⇒ DrgRouteRule
Initializes the object
150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 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 198 199 200 201 |
# File 'lib/oci/core/models/drg_route_rule.rb', line 150 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.destination = attributes[:'destination'] if attributes[:'destination'] self.destination_type = attributes[:'destinationType'] if attributes[:'destinationType'] raise 'You cannot provide both :destinationType and :destination_type' if attributes.key?(:'destinationType') && attributes.key?(:'destination_type') self.destination_type = attributes[:'destination_type'] if attributes[:'destination_type'] self. = attributes[:'nextHopDrgAttachmentId'] if attributes[:'nextHopDrgAttachmentId'] raise 'You cannot provide both :nextHopDrgAttachmentId and :next_hop_drg_attachment_id' if attributes.key?(:'nextHopDrgAttachmentId') && attributes.key?(:'next_hop_drg_attachment_id') self. = attributes[:'next_hop_drg_attachment_id'] if attributes[:'next_hop_drg_attachment_id'] self.route_type = attributes[:'routeType'] if attributes[:'routeType'] raise 'You cannot provide both :routeType and :route_type' if attributes.key?(:'routeType') && attributes.key?(:'route_type') self.route_type = attributes[:'route_type'] if attributes[:'route_type'] self.is_conflict = attributes[:'isConflict'] unless attributes[:'isConflict'].nil? self.is_conflict = false if is_conflict.nil? && !attributes.key?(:'isConflict') # rubocop:disable Style/StringLiterals raise 'You cannot provide both :isConflict and :is_conflict' if attributes.key?(:'isConflict') && attributes.key?(:'is_conflict') self.is_conflict = attributes[:'is_conflict'] unless attributes[:'is_conflict'].nil? self.is_conflict = false if is_conflict.nil? && !attributes.key?(:'isConflict') && !attributes.key?(:'is_conflict') # rubocop:disable Style/StringLiterals self.is_blackhole = attributes[:'isBlackhole'] unless attributes[:'isBlackhole'].nil? self.is_blackhole = false if is_blackhole.nil? && !attributes.key?(:'isBlackhole') # rubocop:disable Style/StringLiterals raise 'You cannot provide both :isBlackhole and :is_blackhole' if attributes.key?(:'isBlackhole') && attributes.key?(:'is_blackhole') self.is_blackhole = attributes[:'is_blackhole'] unless attributes[:'is_blackhole'].nil? self.is_blackhole = false if is_blackhole.nil? && !attributes.key?(:'isBlackhole') && !attributes.key?(:'is_blackhole') # rubocop:disable Style/StringLiterals self.id = attributes[:'id'] if attributes[:'id'] self.route_provenance = attributes[:'routeProvenance'] if attributes[:'routeProvenance'] raise 'You cannot provide both :routeProvenance and :route_provenance' if attributes.key?(:'routeProvenance') && attributes.key?(:'route_provenance') self.route_provenance = attributes[:'route_provenance'] if attributes[:'route_provenance'] self.attributes = attributes[:'attributes'] if attributes[:'attributes'] end |
Instance Attribute Details
#attributes ⇒ Object
Additional properties for the route, computed by the service.
99 100 101 |
# File 'lib/oci/core/models/drg_route_rule.rb', line 99 def attributes @attributes end |
#destination ⇒ String
[Required] Represents the range of IP addresses to match against when routing traffic.
Potential values:
* An IP address range (IPv4 or IPv6) in CIDR notation. For example: `192.168.1.0/24`
or `2001:0db8:0123:45::/56`.
* When you're setting up a security rule for traffic destined for a particular `Service` through
a service gateway, this is the `cidrBlock` value associated with that {Service}. For example: `oci-phx-objectstorage`.
43 44 45 |
# File 'lib/oci/core/models/drg_route_rule.rb', line 43 def destination @destination end |
#destination_type ⇒ String
[Required] The type of destination for the rule. the type is required if direction = EGRESS.
Allowed values:
* `CIDR_BLOCK`: If the rule's `destination` is an IP address range in CIDR notation.
* `SERVICE_CIDR_BLOCK`: If the rule's `destination` is the `cidrBlock` value for a
{Service} (the rule is for traffic destined for a
particular `Service` through a service gateway).
55 56 57 |
# File 'lib/oci/core/models/drg_route_rule.rb', line 55 def destination_type @destination_type end |
#id ⇒ String
[Required] The Oracle-assigned ID of the DRG route rule.
84 85 86 |
# File 'lib/oci/core/models/drg_route_rule.rb', line 84 def id @id end |
#is_blackhole ⇒ BOOLEAN
Indicates that if the next hop attachment does not exist, so traffic for this route is discarded without notification.
79 80 81 |
# File 'lib/oci/core/models/drg_route_rule.rb', line 79 def is_blackhole @is_blackhole end |
#is_conflict ⇒ BOOLEAN
Indicates that the route was not imported due to a conflict between route rules.
74 75 76 |
# File 'lib/oci/core/models/drg_route_rule.rb', line 74 def is_conflict @is_conflict end |
#next_hop_drg_attachment_id ⇒ String
[Required] The [OCID](docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the next hop DRG attachment responsible for reaching the network destination.
A value of BLACKHOLE means traffic for this route is discarded without notification.
63 64 65 |
# File 'lib/oci/core/models/drg_route_rule.rb', line 63 def @next_hop_drg_attachment_id end |
#route_provenance ⇒ String
[Required] The earliest origin of a route. If a route is advertised to a DRG through an IPsec tunnel attachment, and is propagated to peered DRGs via RPC attachments, the route’s provenance in the peered DRGs remains IPSEC_TUNNEL, because that is the earliest origin.
No routes with a provenance IPSEC_TUNNEL or VIRTUAL_CIRCUIT will be exported to IPsec tunnel or virtual circuit attachments, regardless of the attachment’s export distribution.
94 95 96 |
# File 'lib/oci/core/models/drg_route_rule.rb', line 94 def route_provenance @route_provenance end |
#route_type ⇒ String
You can specify static routes for the DRG route table using the API. The DRG learns dynamic routes from the DRG attachments using various routing protocols.
69 70 71 |
# File 'lib/oci/core/models/drg_route_rule.rb', line 69 def route_type @route_type end |
Class Method Details
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 |
# File 'lib/oci/core/models/drg_route_rule.rb', line 102 def self.attribute_map { # rubocop:disable Style/SymbolLiteral 'destination': :'destination', 'destination_type': :'destinationType', 'next_hop_drg_attachment_id': :'nextHopDrgAttachmentId', 'route_type': :'routeType', 'is_conflict': :'isConflict', 'is_blackhole': :'isBlackhole', 'id': :'id', 'route_provenance': :'routeProvenance', 'attributes': :'attributes' # rubocop:enable Style/SymbolLiteral } end |
.swagger_types ⇒ Object
Attribute type mapping.
119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 |
# File 'lib/oci/core/models/drg_route_rule.rb', line 119 def self.swagger_types { # rubocop:disable Style/SymbolLiteral 'destination': :'String', 'destination_type': :'String', 'next_hop_drg_attachment_id': :'String', 'route_type': :'String', 'is_conflict': :'BOOLEAN', 'is_blackhole': :'BOOLEAN', 'id': :'String', 'route_provenance': :'String', 'attributes': :'Object' # rubocop:enable Style/SymbolLiteral } end |
Instance Method Details
#==(other) ⇒ Object
Checks equality by comparing each attribute.
249 250 251 252 253 254 255 256 257 258 259 260 261 262 |
# File 'lib/oci/core/models/drg_route_rule.rb', line 249 def ==(other) return true if equal?(other) self.class == other.class && destination == other.destination && destination_type == other.destination_type && == other. && route_type == other.route_type && is_conflict == other.is_conflict && is_blackhole == other.is_blackhole && id == other.id && route_provenance == other.route_provenance && attributes == other.attributes end |
#build_from_hash(attributes) ⇒ Object
Builds the object from hash
287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 |
# File 'lib/oci/core/models/drg_route_rule.rb', line 287 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
267 268 269 |
# File 'lib/oci/core/models/drg_route_rule.rb', line 267 def eql?(other) self == other end |
#hash ⇒ Fixnum
Calculates hash code according to all attributes.
276 277 278 |
# File 'lib/oci/core/models/drg_route_rule.rb', line 276 def hash [destination, destination_type, , route_type, is_conflict, is_blackhole, id, route_provenance, attributes].hash end |
#to_hash ⇒ Hash
Returns the object in the form of hash
320 321 322 323 324 325 326 327 328 329 |
# File 'lib/oci/core/models/drg_route_rule.rb', line 320 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_s ⇒ String
Returns the string representation of the object
314 315 316 |
# File 'lib/oci/core/models/drg_route_rule.rb', line 314 def to_s to_hash.to_s end |