grpc_routes
Creates, updates, deletes, gets or lists a grpc_routes
resource.
Overview
Name | grpc_routes |
Type | Resource |
Id | google.networkservices.grpc_routes |
Fields
The following fields are returned by SELECT
queries:
- get
- list
Successful response
Name | Datatype | Description |
---|---|---|
name | string | Identifier. Name of the GrpcRoute resource. It matches pattern projects/*/locations/global/grpcRoutes/ |
createTime | string (google-datetime) | Output only. The timestamp when the resource was created. |
description | string | Optional. A free-text description of the resource. Max length 1024 characters. |
gateways | array | Optional. Gateways defines a list of gateways this GrpcRoute 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/ |
hostnames | array | Required. Service hostnames with an optional port for which this route describes traffic. Format: [:] Hostname is the fully qualified domain name of a network host. This matches the RFC 1123 definition of a hostname with 2 notable exceptions: - IPs are not allowed. - A hostname may be prefixed with a wildcard label (*. ). The wildcard label must appear by itself as the first label. Hostname can be "precise" which is a domain name without the terminating dot of a network host (e.g. foo.example.com ) or "wildcard", which is a domain name prefixed with a single wildcard label (e.g. *.example.com ). Note that as per RFC1035 and RFC1123, a label must consist of lower case alphanumeric characters or '-', and must start and end with an alphanumeric character. No other punctuation is allowed. The routes associated with a Mesh or Gateway must have unique hostnames. If you attempt to attach multiple routes with conflicting hostnames, the configuration will be rejected. For example, while it is acceptable for routes for the hostnames *.foo.bar.com and *.bar.com to be associated with the same route, it is not possible to associate two routes both with *.bar.com or both with bar.com . If a port is specified, then gRPC clients must use the channel URI with the port to match this rule (i.e. "xds:///service:123"), otherwise they must supply the URI without a port (i.e. "xds:///service"). |
labels | object | Optional. Set of label tags associated with the GrpcRoute resource. |
meshes | array | Optional. Meshes defines a list of meshes this GrpcRoute 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/ |
rules | array | Required. A list of detailed rules defining how to route traffic. Within a single GrpcRoute, the GrpcRoute.RouteAction associated with the first matching GrpcRoute.RouteRule will be executed. At least one rule must be supplied. |
selfLink | string | Output only. Server-defined URL of this resource |
updateTime | string (google-datetime) | Output only. The timestamp when the resource was updated. |
Successful response
Name | Datatype | Description |
---|---|---|
name | string | Identifier. Name of the GrpcRoute resource. It matches pattern projects/*/locations/global/grpcRoutes/ |
createTime | string (google-datetime) | Output only. The timestamp when the resource was created. |
description | string | Optional. A free-text description of the resource. Max length 1024 characters. |
gateways | array | Optional. Gateways defines a list of gateways this GrpcRoute 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/ |
hostnames | array | Required. Service hostnames with an optional port for which this route describes traffic. Format: [:] Hostname is the fully qualified domain name of a network host. This matches the RFC 1123 definition of a hostname with 2 notable exceptions: - IPs are not allowed. - A hostname may be prefixed with a wildcard label (*. ). The wildcard label must appear by itself as the first label. Hostname can be "precise" which is a domain name without the terminating dot of a network host (e.g. foo.example.com ) or "wildcard", which is a domain name prefixed with a single wildcard label (e.g. *.example.com ). Note that as per RFC1035 and RFC1123, a label must consist of lower case alphanumeric characters or '-', and must start and end with an alphanumeric character. No other punctuation is allowed. The routes associated with a Mesh or Gateway must have unique hostnames. If you attempt to attach multiple routes with conflicting hostnames, the configuration will be rejected. For example, while it is acceptable for routes for the hostnames *.foo.bar.com and *.bar.com to be associated with the same route, it is not possible to associate two routes both with *.bar.com or both with bar.com . If a port is specified, then gRPC clients must use the channel URI with the port to match this rule (i.e. "xds:///service:123"), otherwise they must supply the URI without a port (i.e. "xds:///service"). |
labels | object | Optional. Set of label tags associated with the GrpcRoute resource. |
meshes | array | Optional. Meshes defines a list of meshes this GrpcRoute 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/ |
rules | array | Required. A list of detailed rules defining how to route traffic. Within a single GrpcRoute, the GrpcRoute.RouteAction associated with the first matching GrpcRoute.RouteRule will be executed. At least one rule must be supplied. |
selfLink | string | Output only. Server-defined URL of this resource |
updateTime | string (google-datetime) | Output only. The timestamp when the resource was updated. |
Methods
The following methods are available for this resource:
Name | Accessible by | Required Params | Optional Params | Description |
---|---|---|---|---|
get | select | projectsId , locationsId , grpcRoutesId | Gets details of a single GrpcRoute. | |
list | select | projectsId , locationsId | pageSize , pageToken , returnPartialSuccess | Lists GrpcRoutes in a given project and location. |
create | insert | projectsId , locationsId | grpcRouteId | Creates a new GrpcRoute in a given project and location. |
patch | update | projectsId , locationsId , grpcRoutesId | updateMask | Updates the parameters of a single GrpcRoute. |
delete | delete | projectsId , locationsId , grpcRoutesId | Deletes a single GrpcRoute. |
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.
Name | Datatype | Description |
---|---|---|
grpcRoutesId | string | |
locationsId | string | |
projectsId | string | |
grpcRouteId | string | |
pageSize | integer (int32) | |
pageToken | string | |
returnPartialSuccess | boolean | |
updateMask | string (google-fieldmask) |
SELECT
examples
- get
- list
Gets details of a single GrpcRoute.
SELECT
name,
createTime,
description,
gateways,
hostnames,
labels,
meshes,
rules,
selfLink,
updateTime
FROM google.networkservices.grpc_routes
WHERE projectsId = '{{ projectsId }}' -- required
AND locationsId = '{{ locationsId }}' -- required
AND grpcRoutesId = '{{ grpcRoutesId }}' -- required;
Lists GrpcRoutes in a given project and location.
SELECT
name,
createTime,
description,
gateways,
hostnames,
labels,
meshes,
rules,
selfLink,
updateTime
FROM google.networkservices.grpc_routes
WHERE projectsId = '{{ projectsId }}' -- required
AND locationsId = '{{ locationsId }}' -- required
AND pageSize = '{{ pageSize }}'
AND pageToken = '{{ pageToken }}'
AND returnPartialSuccess = '{{ returnPartialSuccess }}';
INSERT
examples
- create
- Manifest
Creates a new GrpcRoute in a given project and location.
INSERT INTO google.networkservices.grpc_routes (
data__name,
data__labels,
data__description,
data__hostnames,
data__meshes,
data__gateways,
data__rules,
projectsId,
locationsId,
grpcRouteId
)
SELECT
'{{ name }}',
'{{ labels }}',
'{{ description }}',
'{{ hostnames }}',
'{{ meshes }}',
'{{ gateways }}',
'{{ rules }}',
'{{ projectsId }}',
'{{ locationsId }}',
'{{ grpcRouteId }}'
RETURNING
name,
done,
error,
metadata,
response
;
# Description fields are for documentation purposes
- name: grpc_routes
props:
- name: projectsId
value: string
description: Required parameter for the grpc_routes resource.
- name: locationsId
value: string
description: Required parameter for the grpc_routes resource.
- name: name
value: string
description: >
Identifier. Name of the GrpcRoute resource. It matches pattern `projects/*/locations/global/grpcRoutes/`
- name: labels
value: object
description: >
Optional. Set of label tags associated with the GrpcRoute resource.
- name: description
value: string
description: >
Optional. A free-text description of the resource. Max length 1024 characters.
- name: hostnames
value: array
description: >
Required. Service hostnames with an optional port for which this route describes traffic. Format: [:] Hostname is the fully qualified domain name of a network host. This matches the RFC 1123 definition of a hostname with 2 notable exceptions: - IPs are not allowed. - A hostname may be prefixed with a wildcard label (`*.`). The wildcard label must appear by itself as the first label. Hostname can be "precise" which is a domain name without the terminating dot of a network host (e.g. `foo.example.com`) or "wildcard", which is a domain name prefixed with a single wildcard label (e.g. `*.example.com`). Note that as per RFC1035 and RFC1123, a label must consist of lower case alphanumeric characters or '-', and must start and end with an alphanumeric character. No other punctuation is allowed. The routes associated with a Mesh or Gateway must have unique hostnames. If you attempt to attach multiple routes with conflicting hostnames, the configuration will be rejected. For example, while it is acceptable for routes for the hostnames `*.foo.bar.com` and `*.bar.com` to be associated with the same route, it is not possible to associate two routes both with `*.bar.com` or both with `bar.com`. If a port is specified, then gRPC clients must use the channel URI with the port to match this rule (i.e. "xds:///service:123"), otherwise they must supply the URI without a port (i.e. "xds:///service").
- name: meshes
value: array
description: >
Optional. Meshes defines a list of meshes this GrpcRoute 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/`
- name: gateways
value: array
description: >
Optional. Gateways defines a list of gateways this GrpcRoute 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/`
- name: rules
value: array
description: >
Required. A list of detailed rules defining how to route traffic. Within a single GrpcRoute, the GrpcRoute.RouteAction associated with the first matching GrpcRoute.RouteRule will be executed. At least one rule must be supplied.
- name: grpcRouteId
value: string
UPDATE
examples
- patch
Updates the parameters of a single GrpcRoute.
UPDATE google.networkservices.grpc_routes
SET
data__name = '{{ name }}',
data__labels = '{{ labels }}',
data__description = '{{ description }}',
data__hostnames = '{{ hostnames }}',
data__meshes = '{{ meshes }}',
data__gateways = '{{ gateways }}',
data__rules = '{{ rules }}'
WHERE
projectsId = '{{ projectsId }}' --required
AND locationsId = '{{ locationsId }}' --required
AND grpcRoutesId = '{{ grpcRoutesId }}' --required
AND updateMask = '{{ updateMask}}'
RETURNING
name,
done,
error,
metadata,
response;
DELETE
examples
- delete
Deletes a single GrpcRoute.
DELETE FROM google.networkservices.grpc_routes
WHERE projectsId = '{{ projectsId }}' --required
AND locationsId = '{{ locationsId }}' --required
AND grpcRoutesId = '{{ grpcRoutesId }}' --required;