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_list = client.cloud.load_balancers.l7_policies.rules.list(
l7policy_id="023f2e34-7806-443b-bfae-16c324569a3d",
project_id=1,
region_id=1,
)
print(load_balancer_l7_rule_list.count){
"count": 1,
"results": [
{
"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>"
}
]
}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_list = client.cloud.load_balancers.l7_policies.rules.list(
l7policy_id="023f2e34-7806-443b-bfae-16c324569a3d",
project_id=1,
region_id=1,
)
print(load_balancer_l7_rule_list.count){
"count": 1,
"results": [
{
"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>"
}
]
}API key for authentication. Make sure to include the word apikey, followed by a single space and then your token.
Example: apikey 1234$abcdef
Project ID
Region ID
L7 policy ID
OK
Number of objects
x >= 0Objects
Show child attributes
The comparison type for the L7 rule
CONTAINS, ENDS_WITH, EQUAL_TO, REGEX, STARTS_WITH L7Rule ID
When true the logic of the rule is inverted. For example, with invert true, 'equal to' would become 'not equal to'. Default is false.
The key to use for the comparison. For example, the name of the cookie to evaluate.
"key"
L7 policy operating status
DEGRADED, DRAINING, ERROR, NO_MONITOR, OFFLINE, ONLINE Project ID
ACTIVE, DELETED, ERROR, PENDING_CREATE, PENDING_DELETE, PENDING_UPDATE Region name
Region ID
A list of simple strings assigned to the l7 rule
["test_tag"]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.
The L7 rule type
COOKIE, FILE_TYPE, HEADER, HOST_NAME, PATH, SSL_CONN_HAS_CERT, SSL_DN_FIELD, SSL_VERIFY_RESULT The value to use for the comparison. For example, the file type to compare.
Was this page helpful?