Skip to main content

tcp_routes

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

Overview

Nametcp_routes
TypeResource
Idgoogle.networkservices.tcp_routes

Fields

NameDatatypeDescription
namestringIdentifier. Name of the TcpRoute resource. It matches pattern projects/*/locations/global/tcpRoutes/tcp_route_name>.
descriptionstringOptional. A free-text description of the resource. Max length 1024 characters.
createTimestringOutput only. The timestamp when the resource was created.
gatewaysarrayOptional. Gateways defines a list of gateways this TcpRoute is attached to, as one of the routing rules to route the requests served by the gateway. Each gateway reference should match the pattern: projects/*/locations/global/gateways/
labelsobjectOptional. Set of label tags associated with the TcpRoute resource.
meshesarrayOptional. Meshes defines a list of meshes this TcpRoute is attached to, as one of the routing rules to route the requests served by the mesh. Each mesh reference should match the pattern: projects/*/locations/global/meshes/ The attached Mesh should be of a type SIDECAR
rulesarrayRequired. Rules that define how traffic is routed and handled. At least one RouteRule must be supplied. If there are multiple rules then the action taken will be the first rule to match.
selfLinkstringOutput only. Server-defined URL of this resource
updateTimestringOutput only. The timestamp when the resource was updated.

Methods

NameAccessible byRequired ParamsDescription
getSELECTlocationsId, projectsId, tcpRoutesIdGets details of a single TcpRoute.
listSELECTlocationsId, projectsIdLists TcpRoute in a given project and location.
createINSERTlocationsId, projectsIdCreates a new TcpRoute in a given project and location.
deleteDELETElocationsId, projectsId, tcpRoutesIdDeletes a single TcpRoute.
patchUPDATElocationsId, projectsId, tcpRoutesIdUpdates the parameters of a single TcpRoute.

SELECT examples

Lists TcpRoute in a given project and location.

SELECT
name,
description,
createTime,
gateways,
labels,
meshes,
rules,
selfLink,
updateTime
FROM google.networkservices.tcp_routes
WHERE locationsId = '{{ locationsId }}'
AND projectsId = '{{ projectsId }}';

INSERT example

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

/*+ create */
INSERT INTO google.networkservices.tcp_routes (
locationsId,
projectsId,
name,
description,
rules,
meshes,
gateways,
labels
)
SELECT
'{{ locationsId }}',
'{{ projectsId }}',
'{{ name }}',
'{{ description }}',
'{{ rules }}',
'{{ meshes }}',
'{{ gateways }}',
'{{ labels }}'
;

UPDATE example

Updates a tcp_routes resource.

/*+ update */
UPDATE google.networkservices.tcp_routes
SET
name = '{{ name }}',
description = '{{ description }}',
rules = '{{ rules }}',
meshes = '{{ meshes }}',
gateways = '{{ gateways }}',
labels = '{{ labels }}'
WHERE
locationsId = '{{ locationsId }}'
AND projectsId = '{{ projectsId }}'
AND tcpRoutesId = '{{ tcpRoutesId }}';

DELETE example

Deletes the specified tcp_routes resource.

/*+ delete */
DELETE FROM google.networkservices.tcp_routes
WHERE locationsId = '{{ locationsId }}'
AND projectsId = '{{ projectsId }}'
AND tcpRoutesId = '{{ tcpRoutesId }}';