根据域名查询规则列表(精准访问控制)
参数名称 | 描述 |
---|---|
*serviceTypeString | 服务名称。
WAF:WEB应用防火墙
BOT:BotGuard爬虫管理
API:API安全与管理
DDoS: DMS |
*domainListList | 关联域名。 |
参数名称 | 描述 |
---|---|
codeString | 状态码,成功为“200”。 |
messageString | 返回信息,成功为“Success”。 |
dataResp | 返回数据。 |
ruleIdString | 规则ID。 |
ruleNameString | 规则名。 |
ruleDescriptionString | 规则描述。 |
actionString | 处理动作。
0:放行
1:拦截
2:监控 |
deployContentList | 匹配条件。 |
matchConditionString | 匹配条件类型。0:IP
1:IP段
2:URI
3:User-agent
4:Cookie
5:Referer
6:HTTP Header
7:区域
8:请求方法
9:路径 |
operatorString | 匹配条件操作。
0:=
1:!=
2:为空或不存在
3:=正则
4:!=正则 |
firstConditionString | 第一匹配条件值。 |
secondConditionString | 第二匹配条件值。 |
错误代码(code) | 描述(message) | HTTP状态码 | 语义 |
---|---|---|---|
22994001 | CUSTOMER_NOT_EXIST | 200 | 客户不存在 |
22995000 | INTERNAL_ERROR_CODE | 200 | 系统错误 |
22994000 | PARAM_ERROR_CODE | 200 | 参数错误 |
22994100 | ACCESS_ERROR_NOT_OPEN | 200 | 账号未开通服务 |
#!/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": []
}
]
}
]
}
}