Adds an HTTP-based ACL rule for a specified domain.
Debugging
Request parameters
Parameter | Type | Required | Example | Description |
---|---|---|---|---|
Action | Boolean | No | CreateAclRule |
The operation that you want to perform. Valid values: CreateAclRule. |
Domain | String | No | rstest.cdn.com |
The domain that you want to add to WAF. |
InstanceId | String | No | waf_elasticity-cn-0xldbqtm005 |
The ID of the WAF instance. Note You can callDescribePayInfo to view your WAF instance ID.
|
Rules | String | No | {"conditions":[{"key":"URL","contain":1,"value":"asfas"}],"continueComponent":{"post_action_cc":1,"post_action_waf":1,"post_action_sa":1,"post_action_block_geo":"0","post_action_data_risk_control":"1"},"action":"1","name":"lei123"} |
The details of the HTTP-based ACL rule, in JSON format. The following table describes the structure.
|
Region | String | Yes | cn |
The ID of the region to which the WAF instance belongs. Set the value to:
|
Specifies the mapping between a field and logical operators.
Field |
Logical operator |
---|---|
IP |
Belongs to, does not belong to |
Referer |
Contains, does not contain, is equal to, is not equal to, is less than, length is equal to, and length is greater than |
User-Agent |
Contains, does not contain, is equal to, is not equal to, is less than, length is equal to, and length is greater than |
Param |
Contains, does not contain, is equal to, is not equal to, is less than, length is equal to, and length is greater than |
Cookie |
Contains, does not contain, is equal to, is not equal to, is less than, has a length of, is greater than, and does not exist |
Content-Type |
Contains, does not contain, is equal to, is not equal to, is less than, length is equal to, and length is greater than |
X-Forwarded-For |
Contains, does not contain, is equal to, is not equal to, is less than, has a length of, is greater than, and does not exist |
Content-Length |
Value less than, value equal to, and value greater than |
Post-Body |
Contains, does not contain, equals, is not equal to |
Http-Method |
Equal to, not equal to |
Header |
Contains, does not contain, is equal to, is not equal to, is less than, has a length of, is greater than, and does not exist |
Response parameters
Parameter | Type | Example | Description |
---|---|---|---|
RequestId | String | D7861F61-5B61-46CE-A47C-6B19160D5EB0 |
The GUID generated by Alibaba Cloud for the request. |
Result |
The returned result. |
||
Status | Integer | env |
Request execution status:
|
WafTaskId | String | aliyun.waf.20180712214032277.qmxI9a |
The ID of the WAF request. |
Samples
Sample request
https://wafopenapi.cn-hangzhou.aliyuncs.com/? Action=CreateAclRule
&Domain=www.aliyun.com
&ServiceOn=1
&Rules={...}
&Common request parameters
Sample success responses
XML
format
<CreateAclRuleResponse>
<RequestId>D7861F61-5B61-46CE-A47C-6B19160D5EB0</RequestId>
<Result>
<Status>2</Status>
<WafTaskId>aliyun.waf.20180712214032277.qmxI9a</WafTaskId>
</Result>
</CreateAclRuleResponse>
JSON
format
{
"Result":{
"Status":2,
"WafTaskId":"aliyun.waf.20180712214032277.qmxI9a"
},
"RequestId":"D7861F61-5B61-46CE-A47C-6B19160D5EB0"
}
Error codes.
For a list of error codes, visit the API Error Center.