from gcore import Gcore
client = Gcore(
api_key="My API Key",
)
waap_custom_rule = client.waap.domains.custom_rules.create(
domain_id=1,
action={},
conditions=[{}],
enabled=True,
name="name",
)
print(waap_custom_rule.id)
{
"name": "<string>",
"description": "<string>",
"enabled": true,
"action": {
"allow": {},
"block": {
"status_code": 403,
"action_duration": "12h"
},
"captcha": {},
"handshake": {},
"monitor": {},
"tag": {
"tags": [
"<string>"
]
}
},
"conditions": [
{
"ip": {
"negation": false,
"ip_address": "127.0.0.1"
},
"ip_range": {
"negation": false,
"lower_bound": "127.0.0.1",
"upper_bound": "127.0.0.1"
},
"url": {
"negation": false,
"match_type": "Contains",
"url": "/wp-admin/"
},
"user_agent": {
"negation": false,
"user_agent": "curl/",
"match_type": "Contains"
},
"header": {
"negation": false,
"header": "Origin",
"value": "<string>",
"match_type": "Contains"
},
"header_exists": {
"negation": false,
"header": "Origin"
},
"response_header": {
"negation": false,
"header": "<string>",
"value": "<string>",
"match_type": "Contains"
},
"response_header_exists": {
"negation": false,
"header": "<string>"
},
"http_method": {
"negation": false,
"http_method": "CONNECT"
},
"file_extension": {
"negation": false,
"file_extension": [
"pdf"
]
},
"content_type": {
"negation": false,
"content_type": [
"application/xml"
]
},
"country": {
"negation": false,
"country_code": [
"<string>"
]
},
"organization": {
"negation": false,
"organization": "UptimeRobot s.r.o"
},
"request_rate": {
"ips": [
"127.0.0.1"
],
"http_methods": [
"CONNECT"
],
"path_pattern": "/",
"requests": 21,
"time": 1800,
"user_defined_tag": "<string>"
},
"owner_types": {
"negation": false,
"owner_types": [
"COMMERCIAL"
]
},
"tags": {
"negation": false,
"tags": [
"<string>"
]
},
"session_request_count": {
"negation": false,
"request_count": 123
},
"user_defined_tags": {
"negation": false,
"tags": [
"<string>"
]
}
}
],
"id": 123
}
from gcore import Gcore
client = Gcore(
api_key="My API Key",
)
waap_custom_rule = client.waap.domains.custom_rules.create(
domain_id=1,
action={},
conditions=[{}],
enabled=True,
name="name",
)
print(waap_custom_rule.id)
{
"name": "<string>",
"description": "<string>",
"enabled": true,
"action": {
"allow": {},
"block": {
"status_code": 403,
"action_duration": "12h"
},
"captcha": {},
"handshake": {},
"monitor": {},
"tag": {
"tags": [
"<string>"
]
}
},
"conditions": [
{
"ip": {
"negation": false,
"ip_address": "127.0.0.1"
},
"ip_range": {
"negation": false,
"lower_bound": "127.0.0.1",
"upper_bound": "127.0.0.1"
},
"url": {
"negation": false,
"match_type": "Contains",
"url": "/wp-admin/"
},
"user_agent": {
"negation": false,
"user_agent": "curl/",
"match_type": "Contains"
},
"header": {
"negation": false,
"header": "Origin",
"value": "<string>",
"match_type": "Contains"
},
"header_exists": {
"negation": false,
"header": "Origin"
},
"response_header": {
"negation": false,
"header": "<string>",
"value": "<string>",
"match_type": "Contains"
},
"response_header_exists": {
"negation": false,
"header": "<string>"
},
"http_method": {
"negation": false,
"http_method": "CONNECT"
},
"file_extension": {
"negation": false,
"file_extension": [
"pdf"
]
},
"content_type": {
"negation": false,
"content_type": [
"application/xml"
]
},
"country": {
"negation": false,
"country_code": [
"<string>"
]
},
"organization": {
"negation": false,
"organization": "UptimeRobot s.r.o"
},
"request_rate": {
"ips": [
"127.0.0.1"
],
"http_methods": [
"CONNECT"
],
"path_pattern": "/",
"requests": 21,
"time": 1800,
"user_defined_tag": "<string>"
},
"owner_types": {
"negation": false,
"owner_types": [
"COMMERCIAL"
]
},
"tags": {
"negation": false,
"tags": [
"<string>"
]
},
"session_request_count": {
"negation": false,
"request_count": 123
},
"user_defined_tags": {
"negation": false,
"tags": [
"<string>"
]
}
}
],
"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 WAAP rule
Successful Response
An WAAP rule applied to a domain
Was this page helpful?