Add CC Defense Rule - AddAntiCCRule
Overview
Add CC Defense Rule
Definition
Public Parameters
Parameter Name | Type | Description Information | Required |
---|---|---|---|
Action | string | Corresponding API command name, the current API is AddAntiCCRule . | Yes |
PublicKey | string | The user's public key can be obtained from Console (opens in a new tab) | Yes |
Signature | string | User signature generated based on public key and API command, see Signature Algorithm | Yes |
Request Parameters
Parameter Name | Type | Description Information | Required |
---|---|---|---|
ProjectId | string | Project ID. If not filled in, the default project is used, and the sub-account must be filled in. Please refer to the GetProjectList interface. | No |
Domain | string | Domain name to add protection rules | Yes |
Reqs | int | The number of requests within the statistical duration | Yes |
URL | string | uri, eg: /index.html | Yes |
Mode | string | Matching mode, equal: exact match; contains: includes | Yes |
Duration | int | Statistical duration, unit: seconds | Yes |
ActionType | string | Actions to be executed after matching, forbidden: intercept request; captcha: verification code; iptables: IP blocking | Yes |
Validity | int | Action Validity Period, Unit: Minutes | Yes |
Response Field
Field Name | Type | Description Information | Required |
---|---|---|---|
RetCode | int | Return status code. If it is 0, it means successful return. If it is not 0, it means failure. | Yes |
Action | string | Operation command name. | Yes |
Message | string | Returns an error message, providing detailed description when RetCode is non-zero. | No |
Id | int | Rule ID returned after successful addition | No |
Example
Request Example
https://api.surfercloud.com/?Action=AddAntiCCRule
&ProjectId=org-xxx
&Domain=www.test.com
&Reqs=55000
&URL=/index.html
&Mode=equal
&Duration=2800
&ActionType=forbidden
&Validity=5720
Response Example
{
"Action": "AddAntiCCRuleResponse",
"Id": 6,
"RetCode": 0
}