Query rule list based on domain name(Advanced Access Control)
Name | Description |
---|---|
*serviceTypeString | Service name.
WAF:Web Application Firewall
BOT:Bot Shield
API:API Shield
DDoS:DDoS Protection |
*domainListList | Related domain. |
Name | Description |
---|---|
codeString | Status code, success is '200'. |
messageString | Return message, success is 'Success'. |
dataResp | Data returned |
ruleIdString | Rule id. |
ruleNameString | Rule Name. |
ruleDescriptionString | Rule Description. |
actionString | Action.
0:Bypass
1:Block
2:Log |
deployContentList | Match Condition. |
matchConditionString | Matching condition type.
0:IP
1:IP Segment
2:URI
3:User-Agent
4:Cookie
5:Referer
6:HTTP Header
7:Area
8:HTTP Method
9:Path |
operatorString | Matching condition operation.
0:=
1:!=
2:Empty or doesn't exist
3:=(Regex)
4:!=(Regex) |
firstConditionString | First Condition. |
secondConditionString | Second Condition. |
Error code(code) | Description(message) | HTTP status | Semantic |
---|---|---|---|
22994001 | CUSTOMER_NOT_EXIST | 200 | customer not exist |
22995000 | INTERNAL_ERROR_CODE | 200 | internal error |
22994000 | PARAM_ERROR_CODE | 200 | param error |
22994100 | ACCESS_ERROR_NOT_OPEN | 200 | The Account is not open service |
#!/bin/bash
username="example_username"
apiKey="example_apiKey"
date=`env LANG="en_US.UTF-8" date -u "+%a, %d %b %Y %H:%M:%S GMT"`
password=`echo -en "$date" | openssl dgst -sha1 -hmac $apiKey -binary | openssl enc -base64`
curl -i --url https://api.cdnetworks.com/api/bot/exact/query-exact-rulelist-by-domain
-X "POST" \
-u "$username:$password" \
-H "Date: $date" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-d '{
"serviceType":"BOT",
"domainList":["xxx.com"]
}'
{
"message": "Success",
"code": "200",
"data": {
"totalNum": 13,
"list": [
{
"ruleId": 20619,
"ruleName": "20230209guoguo3",
"ruleDescription": "",
"ruleAction": "0",
"deployContent": [
{
"matchCondition": "0",
"operator": "0",
"firstCondition": [
"1.1.1.1",
"2.2.2.2",
"3.3.3.3"
],
"secondCondition": []
}
]
}
]
}
}