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

NameDatatypeDescription
namestringImmutable. A unique name of the resource in the form of projects/{project_number}/locations/global/PolicyBasedRoutes/{policy_based_route_id}
descriptionstringOptional. An optional description of this resource. Provide this field when you create the resource.
createTimestringOutput only. Time when the policy-based route was created.
filterobjectFilter matches L4 traffic.
interconnectAttachmentobjectInterconnectAttachment that this route applies to.
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.
priorityintegerOptional. 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.
updateTimestringOutput only. Time when the policy-based route was updated.
virtualMachineobjectVM instances that this policy-based route applies to.
warningsarrayOutput only. If potential misconfigurations are detected for this route, this field will be populated with warning messages.

Methods

NameAccessible byRequired ParamsDescription
getSELECTpolicyBasedRoutesId, projectsIdGets details of a single policy-based route.
listSELECTprojectsIdLists policy-based routes in a given project and location.
createINSERTprojectsIdCreates a new policy-based route in a given project and location.
deleteDELETEpolicyBasedRoutesId, projectsIdDeletes a single policy-based route.

SELECT examples

Lists policy-based routes in a given project and location.

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

INSERT example

Use the following StackQL query and manifest file to create a new policy_based_routes resource.

/*+ create */
INSERT INTO google.networkconnectivity.policy_based_routes (
projectsId,
virtualMachine,
interconnectAttachment,
nextHopIlbIp,
nextHopOtherRoutes,
name,
labels,
description,
network,
filter,
priority
)
SELECT
'{{ projectsId }}',
'{{ virtualMachine }}',
'{{ interconnectAttachment }}',
'{{ nextHopIlbIp }}',
'{{ nextHopOtherRoutes }}',
'{{ name }}',
'{{ labels }}',
'{{ description }}',
'{{ network }}',
'{{ filter }}',
'{{ priority }}'
;

DELETE example

Deletes the specified policy_based_routes resource.

/*+ delete */
DELETE FROM google.networkconnectivity.policy_based_routes
WHERE policyBasedRoutesId = '{{ policyBasedRoutesId }}'
AND projectsId = '{{ projectsId }}';