GET
/
cloud
/
v1
/
l7policies
/
{project_id}
/
{region_id}
/
{l7policy_id}
/
rules
/
{l7rule_id}
Python
import os
from gcore import Gcore

client = Gcore(
    api_key=os.environ.get("GCORE_API_KEY"),  # This is the default and can be omitted
)
load_balancer_l7_rule = client.cloud.load_balancers.l7_policies.rules.get(
    l7rule_id="l7rule_id",
    project_id=0,
    region_id=0,
    l7policy_id="l7policy_id",
)
print(load_balancer_l7_rule.id)
{
  "compare_type": "STARTS_WITH",
  "created_at": "2020-11-16T13:48:25+0000",
  "id": "0ca7bebd-7a54-4977-bca7-e4ac1e612ec7",
  "invert": false,
  "key": "key",
  "operating_status": "ONLINE",
  "project_id": 1,
  "provisioning_status": "ACTIVE",
  "region": "Luxembourg",
  "region_id": 1,
  "tags": [
    "test_tag"
  ],
  "type": "PATH",
  "updated_at": "2020-11-16T13:48:26+0000",
  "value": "/images*"
}

Authorizations

Authorization
string
header
required

API key for authentication. Make sure to include the word apikey, followed by a single space and then your token. Example: apikey 1234$abcdef

Path Parameters

project_id
integer
required

Project ID

region_id
integer
required

Region ID

l7policy_id
string
required

L7 policy ID

l7rule_id
string
required

L7 rule ID

Response

Returned L7 rule

L7Rule schema All the rules associated with a given policy are logically ANDed together. A request must match all the policy’s rules to match the policy. If you need to express a logical OR operation between rules, then do this by creating multiple policies with the same action.

compare_type
enum<string>

The comparison type for the L7 rule

Available options:
CONTAINS,
ENDS_WITH,
EQUAL_TO,
REGEX,
STARTS_WITH
id
string

L7Rule ID

invert
boolean

When true the logic of the rule is inverted. For example, with invert true, 'equal to' would become 'not equal to'. Default is false.

key
string

The key to use for the comparison. For example, the name of the cookie to evaluate.

operating_status
enum<string>

L7 policy operating status

Available options:
DEGRADED,
DRAINING,
ERROR,
NO_MONITOR,
OFFLINE,
ONLINE
project_id
integer

Project ID

provisioning_status
enum<string>
Available options:
ACTIVE,
DELETED,
ERROR,
PENDING_CREATE,
PENDING_DELETE,
PENDING_UPDATE
region
string

Region name

region_id
integer

Region ID

tags
string[]

A list of simple strings assigned to the l7 rule

task_id
string

The UUID of the active task that currently holds a lock on the resource. This lock prevents concurrent modifications to ensure consistency. If null, the resource is not locked.

type
enum<string>

The L7 rule type

Available options:
COOKIE,
FILE_TYPE,
HEADER,
HOST_NAME,
PATH,
SSL_CONN_HAS_CERT,
SSL_DN_FIELD,
SSL_VERIFY_RESULT
value
string

The value to use for the comparison. For example, the file type to compare.