Skip to main content

policy_based_routes

Creates, updates, deletes, gets or lists a policy_based_routes resource.

Overview

Namepolicy_based_routes
TypeResource
Idgoogle.networkconnectivity.policy_based_routes

Fields

The following fields are returned by SELECT queries:

Successful response

NameDatatypeDescription
namestringImmutable. A unique name of the resource in the form of projects/{project_number}/locations/global/PolicyBasedRoutes/{policy_based_route_id}
createTimestring (google-datetime)Output only. Time when the policy-based route was created.
descriptionstringOptional. An optional description of this resource. Provide this field when you create the resource.
filterobjectRequired. The filter to match L4 traffic. (id: Filter)
interconnectAttachmentobjectOptional. The interconnect attachments that this policy-based route applies to. (id: InterconnectAttachment)
kindstringOutput only. Type of this resource. Always networkconnectivity#policyBasedRoute for policy-based Route resources.
labelsobjectUser-defined labels.
networkstringRequired. Fully-qualified URL of the network that this route applies to, for example: projects/my-project/global/networks/my-network.
nextHopIlbIpstringOptional. 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.
nextHopOtherRoutesstringOptional. Other routes that will be referenced to determine the next hop of the packet.
priorityinteger (int32)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.
selfLinkstringOutput only. Server-defined fully-qualified URL for this resource.
updateTimestring (google-datetime)Output only. Time when the policy-based route was updated.
virtualMachineobjectOptional. VM instances that this policy-based route applies to. (id: VirtualMachine)
warningsarrayOutput only. If potential misconfigurations are detected for this route, this field will be populated with warning messages.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectprojectsId, policyBasedRoutesIdGets details of a single policy-based route.
listselectprojectsIdpageSize, pageToken, filter, orderByLists policy-based routes in a given project and location.
createinsertprojectsIdpolicyBasedRouteId, requestIdCreates a new policy-based route in a given project and location.
deletedeleteprojectsId, policyBasedRoutesIdrequestIdDeletes a single policy-based route.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
policyBasedRoutesIdstring
projectsIdstring
filterstring
orderBystring
pageSizeinteger (int32)
pageTokenstring
policyBasedRouteIdstring
requestIdstring

SELECT examples

Gets details of a single policy-based route.

SELECT
name,
createTime,
description,
filter,
interconnectAttachment,
kind,
labels,
network,
nextHopIlbIp,
nextHopOtherRoutes,
priority,
selfLink,
updateTime,
virtualMachine,
warnings
FROM google.networkconnectivity.policy_based_routes
WHERE projectsId = '{{ projectsId }}' -- required
AND policyBasedRoutesId = '{{ policyBasedRoutesId }}' -- required;

INSERT examples

Creates a new policy-based route in a given project and location.

INSERT INTO google.networkconnectivity.policy_based_routes (
data__virtualMachine,
data__interconnectAttachment,
data__nextHopIlbIp,
data__nextHopOtherRoutes,
data__name,
data__labels,
data__description,
data__network,
data__filter,
data__priority,
projectsId,
policyBasedRouteId,
requestId
)
SELECT
'{{ virtualMachine }}',
'{{ interconnectAttachment }}',
'{{ nextHopIlbIp }}',
'{{ nextHopOtherRoutes }}',
'{{ name }}',
'{{ labels }}',
'{{ description }}',
'{{ network }}',
'{{ filter }}',
{{ priority }},
'{{ projectsId }}',
'{{ policyBasedRouteId }}',
'{{ requestId }}'
RETURNING
name,
done,
error,
metadata,
response
;

DELETE examples

Deletes a single policy-based route.

DELETE FROM google.networkconnectivity.policy_based_routes
WHERE projectsId = '{{ projectsId }}' --required
AND policyBasedRoutesId = '{{ policyBasedRoutesId }}' --required
AND requestId = '{{ requestId }}';