RouteRule

class oci.core.models.RouteRule(**kwargs)

Bases: object

A mapping between a destination IP address range and a virtual device to route matching packets to (a target).

Attributes

DESTINATION_TYPE_CIDR_BLOCK A constant which can be used with the destination_type property of a RouteRule.
DESTINATION_TYPE_SERVICE_CIDR_BLOCK A constant which can be used with the destination_type property of a RouteRule.
ROUTE_TYPE_LOCAL A constant which can be used with the route_type property of a RouteRule.
ROUTE_TYPE_STATIC A constant which can be used with the route_type property of a RouteRule.
cidr_block Gets the cidr_block of this RouteRule.
description Gets the description of this RouteRule.
destination Gets the destination of this RouteRule.
destination_type Gets the destination_type of this RouteRule.
network_entity_id [Required] Gets the network_entity_id of this RouteRule.
route_type Gets the route_type of this RouteRule.

Methods

__init__(**kwargs) Initializes a new RouteRule object with values from keyword arguments.
DESTINATION_TYPE_CIDR_BLOCK = 'CIDR_BLOCK'

A constant which can be used with the destination_type property of a RouteRule. This constant has a value of “CIDR_BLOCK”

DESTINATION_TYPE_SERVICE_CIDR_BLOCK = 'SERVICE_CIDR_BLOCK'

A constant which can be used with the destination_type property of a RouteRule. This constant has a value of “SERVICE_CIDR_BLOCK”

ROUTE_TYPE_LOCAL = 'LOCAL'

A constant which can be used with the route_type property of a RouteRule. This constant has a value of “LOCAL”

ROUTE_TYPE_STATIC = 'STATIC'

A constant which can be used with the route_type property of a RouteRule. This constant has a value of “STATIC”

__init__(**kwargs)

Initializes a new RouteRule object with values from keyword arguments. The following keyword arguments are supported (corresponding to the getters/setters of this class):

Parameters:
  • cidr_block (str) – The value to assign to the cidr_block property of this RouteRule.
  • destination (str) – The value to assign to the destination property of this RouteRule.
  • destination_type (str) – The value to assign to the destination_type property of this RouteRule. Allowed values for this property are: “CIDR_BLOCK”, “SERVICE_CIDR_BLOCK”, ‘UNKNOWN_ENUM_VALUE’. Any unrecognized values returned by a service will be mapped to ‘UNKNOWN_ENUM_VALUE’.
  • network_entity_id (str) – The value to assign to the network_entity_id property of this RouteRule.
  • description (str) – The value to assign to the description property of this RouteRule.
  • route_type (str) – The value to assign to the route_type property of this RouteRule. Allowed values for this property are: “STATIC”, “LOCAL”, ‘UNKNOWN_ENUM_VALUE’. Any unrecognized values returned by a service will be mapped to ‘UNKNOWN_ENUM_VALUE’.
cidr_block

Gets the cidr_block of this RouteRule. Deprecated. Instead use destination and destinationType. Requests that include both cidrBlock and destination will be rejected.

A destination IP address range in CIDR notation. Matching packets will be routed to the indicated network entity (the target).

Cannot be an IPv6 prefix.

Example: 0.0.0.0/0

Returns:The cidr_block of this RouteRule.
Return type:str
description

Gets the description of this RouteRule. An optional description of your choice for the rule.

Returns:The description of this RouteRule.
Return type:str
destination

Gets the destination of this RouteRule. Conceptually, this is the range of IP addresses used for matching when routing traffic. Required if you provide a destinationType.

Allowed values:

  • IP address range in CIDR notation. Can be an IPv4 CIDR block or IPv6 prefix. For example: 192.168.1.0/24

or 2001:0db8:0123:45::/56. If you set this to an IPv6 prefix, the route rule’s target can only be a DRG or internet gateway. IPv6 addressing is supported for all commercial and government regions. See IPv6 Addresses.

  • The cidrBlock value for a Service, if you’re setting up a route rule for traffic destined for a particular Service through a service gateway. For example: oci-phx-objectstorage.
Returns:The destination of this RouteRule.
Return type:str
destination_type

Gets the destination_type of this RouteRule. Type of destination for the rule. Required if you provide a destination.

  • 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).

Allowed values for this property are: “CIDR_BLOCK”, “SERVICE_CIDR_BLOCK”, ‘UNKNOWN_ENUM_VALUE’. Any unrecognized values returned by a service will be mapped to ‘UNKNOWN_ENUM_VALUE’.

Returns:The destination_type of this RouteRule.
Return type:str
network_entity_id

[Required] Gets the network_entity_id of this RouteRule. The OCID for the route rule’s target. For information about the type of targets you can specify, see Route Tables.

Returns:The network_entity_id of this RouteRule.
Return type:str
route_type

Gets the route_type of this RouteRule. A route rule can be STATIC if manually added to the route table, LOCAL if added by OCI to the route table.

Allowed values for this property are: “STATIC”, “LOCAL”, ‘UNKNOWN_ENUM_VALUE’. Any unrecognized values returned by a service will be mapped to ‘UNKNOWN_ENUM_VALUE’.

Returns:The route_type of this RouteRule.
Return type:str