- Resource: PolicyBasedRoute
- VirtualMachine
- InterconnectAttachment
- OtherRoutes
- Filter
- ProtocolVersion
- Warnings
- Code
- Methods
Resource: PolicyBasedRoute
Policy-based Routes are more powerful routes that route L4 network traffic based on not just destination IP, but also source IP, protocol and more. A Policy-based Route always take precedence when it conflicts with other types of routes.
JSON representation |
---|
{ "name": string, "createTime": string, "updateTime": string, "labels": { string: string, ... }, "description": string, "network": string, "filter": { object ( |
Fields | |
---|---|
name |
Immutable. A unique name of the resource in the form of |
createTime |
Output only. Time when the policy-based route was created. A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution and up to nine fractional digits. Examples: |
updateTime |
Output only. Time when the policy-based route was updated. A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution and up to nine fractional digits. Examples: |
labels |
User-defined labels. An object containing a list of |
description |
Optional. An optional description of this resource. Provide this field when you create the resource. |
network |
Required. Fully-qualified URL of the network that this route applies to, for example: projects/my-project/global/networks/my-network. |
filter |
Required. The filter to match L4 traffic. |
priority |
Optional. The priority of this policy-based route. Priority is used to break ties in cases where there are more than one matching policy-based routes found. In cases where multiple policy-based routes are matched, the one with the lowest-numbered priority value wins. The default value is 1000. The priority value must be from 1 to 65535, inclusive. |
warnings[] |
Output only. If potential misconfigurations are detected for this route, this field will be populated with warning messages. |
selfLink |
Output only. Server-defined fully-qualified URL for this resource. |
kind |
Output only. Type of this resource. Always networkconnectivity#policyBasedRoute for policy-based route resources. |
Union field target . Target specifies network endpoints to which this policy-based route applies to. If none of the target is specified, the PBR will be installed on all network endpoints (e.g. VMs, VPNs, and Interconnects) in the VPC. target can be only one of the following: |
|
virtualMachine |
Optional. VM instances to which this policy-based route applies to. |
interconnectAttachment |
Optional. The interconnect attachments that this policy-based route applies to. |
Union field
|
|
nextHopIlbIp |
Optional. The IP address of a global-access-enabled L4 ILB that is the next hop for matching packets. For this version, only nextHopIlbIp is supported. |
nextHopOtherRoutes |
Optional. Other routes that will be referenced to determine the next hop of the packet. |
VirtualMachine
VM instances to which this policy-based route applies to.
JSON representation |
---|
{ "tags": [ string ] } |
Fields | |
---|---|
tags[] |
Optional. A list of VM instance tags that this policy-based route applies to. VM instances that have ANY of tags specified here will install this PBR. |
InterconnectAttachment
InterconnectAttachment that this route applies to.
JSON representation |
---|
{ "region": string } |
Fields | |
---|---|
region |
Optional. Cloud region to install this policy-based route on for Interconnect attachments. Use |
OtherRoutes
The other routing cases.
Enums | |
---|---|
OTHER_ROUTES_UNSPECIFIED |
Default value. |
DEFAULT_ROUTING |
Use the routes from the default routing tables (system-generated routes, custom routes, peering route) to determine the next hop. This will effectively exclude matching packets being applied on other PBRs with a lower priority. |
Filter
Filter matches L4 traffic.
JSON representation |
---|
{
"ipProtocol": string,
"srcRange": string,
"destRange": string,
"protocolVersion": enum ( |
Fields | |
---|---|
ipProtocol |
Optional. The IP protocol that this policy-based route applies to. Valid values are 'TCP', 'UDP', and 'ALL'. Default is 'ALL'. |
srcRange |
Optional. The source IP range of outgoing packets that this policy-based route applies to. Default is "0.0.0.0/0" if protocol version is IPv4. |
destRange |
Optional. The destination IP range of outgoing packets that this policy-based route applies to. Default is "0.0.0.0/0" if protocol version is IPv4. |
protocolVersion |
Required. Internet protocol versions this policy-based route applies to. For this version, only IPV4 is supported. |
ProtocolVersion
The internet protocol version.
Enums | |
---|---|
PROTOCOL_VERSION_UNSPECIFIED |
Default value. |
IPV4 |
The PBR is for IPv4 internet protocol traffic. |
Warnings
Informational warning message.
JSON representation |
---|
{
"code": enum ( |
Fields | |
---|---|
code |
Output only. A warning code, if applicable. |
data |
Output only. Metadata about this warning in key: value format. The key should provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement. An object containing a list of |
warningMessage |
Output only. A human-readable description of the warning code. |
Code
Warning code for policy-based routing. Expect to add values in the future.
Enums | |
---|---|
WARNING_UNSPECIFIED |
Default value. |
RESOURCE_NOT_ACTIVE |
The policy-based route is not active and functioning. Common causes are the dependent network was deleted or the resource project was turned off. |
RESOURCE_BEING_MODIFIED |
The policy-based route is being modified (e.g. created/deleted) at this time. |
Methods |
|
---|---|
|
Creates a new policy-based route in a given project and location. |
|
Deletes a single policy-based route. |
|
Gets details of a single policy-based route. |
|
Lists policy-based routes in a given project and location. |