Method: routers.getRoutePolicy

Returns specified Route Policy

HTTP request

GET https://compute.googleapis.com/compute/beta/projects/{project}/regions/{region}/routers/{router}/getRoutePolicy

The URL uses gRPC Transcoding syntax.

Path parameters

Parameters
project

string

Project ID for this request.

region

string

Name of the region for this request.

router

string

Name of the Router resource to query for the route policy. The name should conform to RFC1035.

Query parameters

Parameters
policy

string

The Policy name for this request. Name must conform to RFC1035

Request body

The request body must be empty.

Response body

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

JSON representation
{
  "resource": {
    "name": string,
    "type": enum,
    "terms": [
      {
        "priority": integer,
        "match": {
          "expression": string,
          "title": string,
          "description": string,
          "location": string
        },
        "actions": [
          {
            "expression": string,
            "title": string,
            "description": string,
            "location": string
          }
        ]
      }
    ],
    "fingerprint": string,
    "description": string
  }
}
Fields
resource

object

resource.name

string

Route Policy name, which must be a resource ID segment and unique within all the router's Route Policies. Name should conform to RFC1035.

resource.type

enum

resource.terms[]

object

routers.list of terms (the order in the list is not important, they are evaluated in order of priority). Order of policies is not retained and might change when getting policy later.

resource.terms[].priority

integer

The evaluation priority for this term, which must be between 0 (inclusive) and 2^31 (exclusive), and unique within the list.

resource.terms[].match

object

CEL expression evaluated against a route to determine if this term applies. When not set, the term applies to all routes.

resource.terms[].match.expression

string

Textual representation of an expression in Common Expression Language syntax.

resource.terms[].match.title

string

Optional. Title for the expression, i.e. a short string describing its purpose. This can be used e.g. in UIs which allow to enter the expression.

resource.terms[].match.description

string

Optional. Description of the expression. This is a longer text which describes the expression, e.g. when hovered over it in a UI.

resource.terms[].match.location

string

Optional. String indicating the location of the expression for error reporting, e.g. a file name and a position in the file.

resource.terms[].actions[]

object

CEL expressions to evaluate to modify a route when this term matches.

resource.terms[].actions[].expression

string

Textual representation of an expression in Common Expression Language syntax.

resource.terms[].actions[].title

string

Optional. Title for the expression, i.e. a short string describing its purpose. This can be used e.g. in UIs which allow to enter the expression.

resource.terms[].actions[].description

string

Optional. Description of the expression. This is a longer text which describes the expression, e.g. when hovered over it in a UI.

resource.terms[].actions[].location

string

Optional. String indicating the location of the expression for error reporting, e.g. a file name and a position in the file.

resource.fingerprint

string (bytes format)

A fingerprint for the Route Policy being applied to this Router, which is essentially a hash of the Route Policy used for optimistic locking. The fingerprint is initially generated by Compute Engine and changes after every request to modify or update Route Policy. You must always provide an up-to-date fingerprint hash in order to update or change labels.

To see the latest fingerprint, make a getRoutePolicy() request to retrieve a Route Policy.

A base64-encoded string.

resource.description

string

An optional description of route policy.

Authorization scopes

Requires one of the following OAuth scopes:

  • https://www.googleapis.com/auth/compute.readonly
  • 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 IAM permissions:

  • compute.routers.getRoutePolicy

To find predefined roles that contain those permissions, see Compute Engine IAM Roles.