Skip to main content
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="023f2e34-7806-443b-bfae-16c324569a3d",
    project_id=1,
    region_id=1,
    l7policy_id="023f2e34-7806-443b-bfae-16c324569a3d",
)
print(load_balancer_l7_rule.id)
{
  "compare_type": "CONTAINS",
  "id": "<string>",
  "invert": true,
  "key": "key",
  "operating_status": "DEGRADED",
  "project_id": 123,
  "provisioning_status": "ACTIVE",
  "region": "<string>",
  "region_id": 123,
  "tags": [
    "test_tag"
  ],
  "task_id": "<string>",
  "type": "COOKIE",
  "value": "<string>"
}

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

Example:

1

region_id
integer
required

Region ID

Example:

1

l7policy_id
string
required

L7 policy ID

Example:

"023f2e34-7806-443b-bfae-16c324569a3d"

l7rule_id
string
required

L7 rule ID

Example:

"023f2e34-7806-443b-bfae-16c324569a3d"

Response

200 - application/json

OK

compare_type
enum<string>
required

The comparison type for the L7 rule

Available options:
CONTAINS,
ENDS_WITH,
EQUAL_TO,
REGEX,
STARTS_WITH
Example:

"STARTS_WITH"

id
string
required

L7Rule ID

Example:

"0ca7bebd-7a54-4977-bca7-e4ac1e612ec7"

invert
boolean
required

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

Examples:

true

false

key
string | null
required

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

Example:

"key"

operating_status
enum<string>
required

L7 policy operating status

Available options:
DEGRADED,
DRAINING,
ERROR,
NO_MONITOR,
OFFLINE,
ONLINE
Example:

"ONLINE"

project_id
integer
required

Project ID

Example:

1337

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

"ACTIVE"

region
string
required

Region name

Example:

"Luxembourg 1"

region_id
integer
required

Region ID

Example:

7

tags
string[] | null
required

A list of simple strings assigned to the l7 rule

Example:
["test_tag"]
task_id
string<uuid4> | null
required

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>
required

The L7 rule type

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

"PATH"

value
string
required

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

Example:

"/images*"