from gcore import Gcore
client = Gcore(
api_key="My API Key",
)
waap_advanced_rule = client.waap.domains.advanced_rules.create(
domain_id=1,
action={},
enabled=True,
name="name",
source="request.rate_limit([], '.*events', 5, 200, [], [], '', 'ip') and not ('mb-web-ui' in request.headers['Cookie'] or 'mb-mobile-ios' in request.headers['Cookie'] or 'session-token' in request.headers['Cookie']) and not request.headers['session']",
)
print(waap_advanced_rule.id)
{
"name": "<string>",
"description": "<string>",
"enabled": true,
"action": {
"allow": {},
"block": {
"status_code": 403,
"action_duration": "12h"
},
"captcha": {},
"handshake": {},
"monitor": {},
"tag": {
"tags": [
"<string>"
]
}
},
"source": "request.rate_limit([], '.*events', 5, 200, [], [], '', 'ip') and not ('mb-web-ui' in request.headers['Cookie'] or 'mb-mobile-ios' in request.headers['Cookie'] or 'session-token' in request.headers['Cookie']) and not request.headers['session']",
"phase": "access",
"id": 123
}
from gcore import Gcore
client = Gcore(
api_key="My API Key",
)
waap_advanced_rule = client.waap.domains.advanced_rules.create(
domain_id=1,
action={},
enabled=True,
name="name",
source="request.rate_limit([], '.*events', 5, 200, [], [], '', 'ip') and not ('mb-web-ui' in request.headers['Cookie'] or 'mb-mobile-ios' in request.headers['Cookie'] or 'session-token' in request.headers['Cookie']) and not request.headers['session']",
)
print(waap_advanced_rule.id)
{
"name": "<string>",
"description": "<string>",
"enabled": true,
"action": {
"allow": {},
"block": {
"status_code": 403,
"action_duration": "12h"
},
"captcha": {},
"handshake": {},
"monitor": {},
"tag": {
"tags": [
"<string>"
]
}
},
"source": "request.rate_limit([], '.*events', 5, 200, [], [], '', 'ip') and not ('mb-web-ui' in request.headers['Cookie'] or 'mb-mobile-ios' in request.headers['Cookie'] or 'session-token' in request.headers['Cookie']) and not request.headers['session']",
"phase": "access",
"id": 123
}
API key for authentication. Make sure to include the word apikey
, followed by a single space and then your token.
Example: apikey 1234$abcdef
The domain ID
x > 0
A request to create a new advanced rule
Successful Response
An advanced WAAP rule applied to a domain
Was this page helpful?