REST Resource: projects.locations.tcpRoutes

Resource: TcpRoute

TcpRoute is the resource defining how TCP traffic should be routed by a Mesh/Gateway resource.

JSON representation
{
  "name": string,
  "selfLink": string,
  "createTime": string,
  "updateTime": string,
  "description": string,
  "rules": [
    {
      object (RouteRule)
    }
  ],
  "meshes": [
    string
  ],
  "gateways": [
    string
  ],
  "labels": {
    string: string,
    ...
  }
}
Fields
name

string

Required. Name of the TcpRoute resource. It matches pattern projects/*/locations/global/tcpRoutes/tcp_route_name>.

createTime

string (Timestamp format)

Output only. The timestamp when the resource was created.

A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution and up to nine fractional digits. Examples: "2014-10-02T15:01:23Z" and "2014-10-02T15:01:23.045123456Z".

updateTime

string (Timestamp format)

Output only. The timestamp when the resource was updated.

A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution and up to nine fractional digits. Examples: "2014-10-02T15:01:23Z" and "2014-10-02T15:01:23.045123456Z".

description

string

Optional. A free-text description of the resource. Max length 1024 characters.

rules[]

object (RouteRule)

Required. 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.

meshes[]

string

Optional. 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/<mesh_name>

The attached Mesh should be of a type SIDECAR

gateways[]

string

Optional. 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/<gateway_name>

labels

map (key: string, value: string)

Optional. Set of label tags associated with the TcpRoute resource.

An object containing a list of "key": value pairs. Example: { "name": "wrench", "mass": "1.3kg", "count": "3" }.

RouteRule

Specifies how to match traffic and how to route traffic when traffic is matched.

JSON representation
{
  "matches": [
    {
      object (RouteMatch)
    }
  ],
  "action": {
    object (RouteAction)
  }
}
Fields
matches[]

object (RouteMatch)

Optional. RouteMatch defines the predicate used to match requests to a given action. Multiple match types are "OR"ed for evaluation. If no routeMatch field is specified, this rule will unconditionally match traffic.

action

object (RouteAction)

Required. The detailed rule defining how to route matched traffic.

RouteMatch

RouteMatch defines the predicate used to match requests to a given action. Multiple match types are "OR"ed for evaluation. If no routeMatch field is specified, this rule will unconditionally match traffic.

JSON representation
{
  "address": string,
  "port": string
}
Fields
address

string

Required. Must be specified in the CIDR range format. A CIDR range consists of an IP Address and a prefix length to construct the subnet mask. By default, the prefix length is 32 (i.e. matches a single IP address). Only IPV4 addresses are supported. Examples: "10.0.0.1" - matches against this exact IP address. "10.0.0.0/8" - matches against any IP address within the 10.0.0.0 subnet and 255.255.255.0 mask. "0.0.0.0/0" - matches against any IP address'.

port

string

Required. Specifies the destination port to match against.

RouteAction

The specifications for routing traffic and applying associated policies.

JSON representation
{
  "destinations": [
    {
      object (RouteDestination)
    }
  ],
  "originalDestination": boolean
}
Fields
destinations[]

object (RouteDestination)

Optional. The destination services to which traffic should be forwarded. At least one destination service is required.

originalDestination

boolean

Optional. If true, Router will use the destination IP and port of the original connection as the destination of the request. Default is false.

RouteDestination

Describe the destination for traffic to be routed to.

JSON representation
{
  "serviceName": string,
  "weight": integer
}
Fields
serviceName

string

Required. The URL of a BackendService to route traffic to.

weight

integer

Optional. Specifies the proportion of requests forwarded to the backend referenced by the serviceName field. This is computed as: weight/Sum(weights in this destination list). For non-zero values, there may be some epsilon from the exact proportion defined here depending on the precision an implementation supports.

If only one serviceName is specified and it has a weight greater than 0, 100% of the traffic is forwarded to that backend.

If weights are specified for any one service name, they need to be specified for all of them.

If weights are unspecified for all services, then, traffic is distributed in equal proportions to all of them.

Methods

create

Creates a new TcpRoute in a given project and location.

delete

Deletes a single TcpRoute.

get

Gets details of a single TcpRoute.

list

Lists TcpRoute in a given project and location.

patch

Updates the parameters of a single TcpRoute.

setIamPolicy

Sets the access control policy on the specified resource.

testIamPermissions

Returns permissions that a caller has on the specified resource.