Creates a custom frequency control rule for a website.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer. OpenAPI Explorer dynamically generates the sample code of the operation for different SDKs.

Request parameters

Parameter Type Required Example Description
RegionId String No cn-hangzhou

The region ID of the instance. Valid values:

  • cn-hangzhou: mainland China, which indicates an Anti-DDoS Pro instance
  • ap-southeast-1: outside mainland China, which indicates an Anti-DDoS Premium instance
ResourceGroupId String No rg-acfm2pz25js****

The ID of the resource group to which the instance belongs in Resource Management. This parameter is empty by default, which indicates that the instance belongs to the default resource group.

Domain String Yes www.aliyun.com

The domain name of the website.

Note A forwarding rule must be configured for the domain name. You can call the DescribeDomains operation to query all domain names.
Name String Yes testrule

The name of the custom frequency control rule. The name can be up to 128 characters in length and contain letters, digits, and underscores (_).

Act String Yes close

The action on the requests that trigger the custom frequency control rule. Valid values:

  • close: blocks the requests.
  • captcha: triggers CAPTCHA verification on the requests.
Count Integer Yes 60

The number of requests that are allowed from an individual IP address. Valid values: 2 to 2000.

Interval Integer Yes 20

The detection interval. Valid values: 5 to 10800. Unit: seconds.

Mode String Yes prefix

The matching mode. Valid values:

  • prefix: prefix match.
  • match: exact match.
Note If the URI of the check path contains parameters, you must set the value to prefix.
Ttl Integer Yes 60

The blocking duration. Valid values: 60 to 86400. Unit: seconds.

Uri String Yes /abc/a.php

The check path.

All Alibaba Cloud API operations must include common request parameters. For more information about common request parameters, see Common parameters.

For more information about sample requests, see the "Examples" section of this topic.

Response parameters

Parameter Type Example Description
RequestId String 0bcf28g5-d57c-11e7-9bs0-d89d6717dxbc

The ID of the request.

Examples

Sample requests

http(s)://[Endpoint]/?Action=CreateWebCCRule
&Act=close
&Count=60
&Domain=www.aliyun.com
&Interval=20
&Mode=prefix
&Name=testrule
&Ttl=60
&Uri=/abc/a.php
&<Common Request Parameters>

Sample success responses

XML format

HTTP/1.1 200 OK
Content-Type:application/xml

<?xml version="1.0" encoding="UTF-8" ?>
<CreateWebCCRuleResponse>
    <RequestId>0bcf28g5-d57c-11e7-9bs0-d89d6717dxbc</RequestId>
</CreateWebCCRuleResponse>

JSON format

HTTP/1.1 200 OK
Content-Type:application/json

{
  "RequestId" : "0bcf28g5-d57c-11e7-9bs0-d89d6717dxbc"
}

Error codes

For a list of error codes, visit the API Error Center.