POST
/
cloud
/
v1
/
l7policies
/
{project_id}
/
{region_id}
/
{l7policy_id}
/
rules
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
)
task_id_list = client.cloud.load_balancers.l7_policies.rules.create(
    l7policy_id="l7policy_id",
    project_id=0,
    region_id=0,
    compare_type="REGEX",
    type="PATH",
    value="/images*",
)
print(task_id_list.tasks)
{
  "tasks": [
    "d478ae29-dedc-4869-82f0-96104425f565"
  ]
}

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

Body

application/json

CreateL7Rule schema

compare_type
enum<string>
required

The comparison type for the L7 rule

Available options:
CONTAINS,
ENDS_WITH,
EQUAL_TO,
REGEX,
STARTS_WITH
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
value
string
required

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

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.

tags
string[]

A list of simple strings assigned to the l7 rule

Response

200 - application/json

List of created tasks

tasks
string[]
required

List of task IDs

Examples:
["d478ae29-dedc-4869-82f0-96104425f565"]