Method: routes.get

Returns the specified Route resource. Gets a list of available routes by making a list() request.

HTTP request

GET https://www.googleapis.com/compute/beta/projects/{project}/global/routes/{resourceId}

The URL uses gRPC Transcoding syntax.

Path parameters

Parameters
project

string

Project ID for this request.

resourceId

string

Name of the Route resource to return.

Request body

The request body must be empty.

Response body

If successful, the response body contains data with the following structure:

Represents a Route resource. A route specifies how certain packets should be handled by the network. Routes are associated with instances by tags and the set of routes for a particular instance is called its routing table.

For each packet leaving an instance, the system searches that instance's routing table for a single best matching route. Routes match packets by destination IP address, preferring smaller or more specific ranges over larger ones. If there is a tie, the system selects the route with the smallest priority value. If there is still a tie, it uses the layer three and four packet headers to select just one of the remaining matching routes. The packet is then forwarded as specified by the nextHop field of the winning route - either to another instance destination, an instance gateway, or a Google Compute Engine-operated gateway.

Packets that do not match any route in the sending instance's routing table are dropped.

JSON representation
{
  "id": string,
  "creationTimestamp": string,
  "name": string,
  "description": string,
  "network": string,
  "tags": [
    string
  ],
  "destRange": string,
  "priority": number,
  "nextHopInstance": string,
  "nextHopIp": string,
  "nextHopNetwork": string,
  "nextHopGateway": string,
  "nextHopPeering": string,
  "nextHopIlb": string,
  "warnings": [
    {
      "code": enum,
      "message": string,
      "data": [
        {
          "key": string,
          "value": string
        }
      ]
    }
  ],
  "nextHopVpnTunnel": string,
  "selfLink": string,
  "kind": string
}
Fields
id

string (fixed64 format)

[Output Only] The unique identifier for the resource. This identifier is defined by the server.

creationTimestamp

string

[Output Only] Creation timestamp in RFC3339 text format.

name

string

Name of the resource. Provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.

description

string

An optional description of this resource. Provide this property when you create the resource.

network

string

Fully-qualified URL of the network that this route applies to.

tags[]

string

A list of instance tags to which this route applies.

destRange

string

The destination range of outgoing packets that this route applies to. Only IPv4 is supported.

priority

number (uint32 format)

The priority of this route. Priority is used to break ties in cases where there is more than one matching route of equal prefix length. In the case of two routes with equal prefix length, the one with the lowest-numbered priority value wins. Default value is 1000. Valid range is 0 through 65535.

nextHopInstance

string

The URL to an instance that should handle matching packets. You can specify this as a full or partial URL. For example:
https://www.googleapis.com/compute/v1/projects/project/zones/zone/instances/

nextHopIp

string

The network IP address of an instance that should handle matching packets. Only IPv4 is supported.

nextHopNetwork

string

The URL of the local network if it should handle matching packets.

nextHopGateway

string

The URL to a gateway that should handle matching packets. You can only specify the internet gateway using a full or partial valid URL:
projects/<project-id>/global/gateways/default-internet-gateway

nextHopPeering

string

[Output Only] The network peering name that should handle matching packets, which should conform to RFC1035.

nextHopIlb

string

The URL to a forwarding rule of type loadBalancingScheme=INTERNAL that should handle matching packets. You can only specify the forwarding rule as a partial or full URL. For example, the following are all valid URLs:

Note that this can only be used when the destinationRange is a public (non-RFC 1918) IP CIDR range.

warnings[]

object

[Output Only] If potential misconfigurations are detected for this route, this field will be populated with warning messages.

warnings[].code

enum

[Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.

warnings[].message

string

[Output Only] A human-readable description of the warning code.

warnings[].data[]

object

[Output Only] Metadata about this warning in key: value format. For example:

"data": [  {  "key": "scope",  "value": "zones/us-east1-d"  }

warnings[].data[].key

string

[Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding).

warnings[].data[].value

string

[Output Only] A warning data value corresponding to the key.

nextHopVpnTunnel

string

The URL to a VpnTunnel that should handle matching packets.

kind

string

[Output Only] Type of this resource. Always compute#routes for Route resources.

Authorization Scopes

Requires one of the following OAuth scopes:

  • https://www.googleapis.com/auth/compute
  • https://www.googleapis.com/auth/cloud-platform

For more information, see the Authentication Overview.

IAM Permissions

In addition to any permissions specified on the fields above, authorization requires one or more of the following Google IAM permissions:

  • compute.routes.get
Was this page helpful? Let us know how we did:

Send feedback about...

Compute Engine