Method: securityPolicies.getRule

Gets a rule at the specified priority.

HTTP request

GET https://compute.googleapis.com/compute/beta/projects/{project}/global/securityPolicies/{resourceId}/getRule

The URL uses gRPC Transcoding syntax.

Path parameters

Parameters
project

string

Project ID for this request.

resourceId

string

Name of the security policy to which the queried rule belongs.

Query parameters

Parameters
priority

integer

The priority of the rule to get from the security policy.

Request body

The request body must be empty.

Response body

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

Represents a rule that describes one or more match conditions along with the action to be taken when traffic matches this condition (allow or deny).

JSON representation
{
  "description": string,
  "priority": integer,
  "match": {
    "expr": {
      "expression": string,
      "title": string,
      "description": string,
      "location": string
    },
    "versionedExpr": enum,
    "config": {
      "srcIpRanges": [
        string
      ],
      "destIpRanges": [
        string
      ],
      "layer4Configs": [
        {
          "ipProtocol": string,
          "ports": [
            string
          ]
        }
      ]
    }
  },
  "action": string,
  "preview": boolean,
  "direction": enum,
  "targetResources": [
    string
  ],
  "enableLogging": boolean,
  "ruleTupleCount": integer,
  "rateLimitOptions": {
    "rateLimitThreshold": {
      "count": integer,
      "intervalSec": integer
    },
    "conformAction": string,
    "exceedAction": string,
    "enforceOnKey": enum,
    "enforceOnKeyName": string,
    "banThreshold": {
      "count": integer,
      "intervalSec": integer
    },
    "banDurationSec": integer
  },
  "targetServiceAccounts": [
    string
  ],
  "ruleNumber": string,
  "headerAction": {
    "requestHeadersToAdds": [
      {
        "headerName": string,
        "headerValue": string
      }
    ]
  },
  "redirectOptions": {
    "type": enum,
    "target": string
  },
  "kind": string
}
Fields
description

string

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

priority

integer

An integer indicating the priority of a rule in the list. The priority must be a positive value between 0 and 2147483647. Rules are evaluated from highest to lowest priority where 0 is the highest priority and 2147483647 is the lowest priority.

match

object

A match condition that incoming traffic is evaluated against. If it evaluates to true, the corresponding 'action' is enforced.

match.expr

object

User defined CEVAL expression. A CEVAL expression is used to specify match criteria such as origin.ip, source.region_code and