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  | 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, sub-accounts 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 |
| 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 |
| URL | string | uri, eg: /index.html | No |
| Mode | string | Matching mode, equal: exact match; contains: includes | No |
| Name | string | The translation of ‘Name’ in English is ‘Name’. | No |
| ExtendsRule.N | string | Extension rules, when they exist, URL rules are invalid, refer to AddWafProtectionRuleInfo.Rules. | No |
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.ucloud-global.com/?Action=AddAntiCCRule
&ProjectId=org-xxx
&Domain=www.test.com
&Reqs=55000
&URL=/index.html
&Mode=equal
&Duration=2800
&ActionType=forbidden
&Validity=5720
&Name=orNYqSGc
&ExtendsRule.n=LrRovfgGResponse Example
{
"Action": "AddAntiCCRuleResponse",
"Id": 6,
"RetCode": 0
}