tencent cloud

Feedback

ModifyDDoSPolicy

Last updated: 2023-03-09 17:41:42

1. API Description

Domain name for API request: teo.tencentcloudapi.com.

This API is used to modify DDoS mitigation configuration.

A maximum of 20 requests can be initiated per second for this API.

We recommend you to use API Explorer
Try it
API Explorer provides a range of capabilities, including online call, signature authentication, SDK code generation, and API quick search. It enables you to view the request, response, and auto-generated examples.

2. Input Parameters

The following request parameter list only provides API request parameters and some common parameters. For the complete common parameter list, see Common Request Parameters.

Parameter Name Required Type Description
Action Yes String Common Params. The value used for this API: ModifyDDoSPolicy.
Version Yes String Common Params. The value used for this API: 2022-01-06.
Region No String Common Params. This parameter is not required for this API.
PolicyId Yes Integer ID of the policy group
ZoneId Yes String Top-level domain name
DdosRule No DdosRule Detailed DDoS mitigation configuration

3. Output Parameters

Parameter Name Type Description
PolicyId Integer ID of the policy group
RequestId String The unique request ID, which is returned for each request. RequestId is required for locating a problem.

4. Example

Example1 Modifying connection protection configuration

This example shows you how to set the 10K connections per second limit on new connections.

Input Example

POST / HTTP/1.1
Host: teo.tencentcloudapi.com
Content-Type: application/json
X-TC-Action: ModifyDDoSPolicy
<Common request parameters>

{
    "PolicyId": 1,
    "ZoneId": "zone-27filz8zp3vi",
    "DdosRule": {
        "DdosAntiPly": {
            "AbnormalConnectNum": 0,
            "AbnormalSynNum": 0,
            "AbnormalSynRatio": 0,
            "ConnectTimeout": 0,
            "DestinationConnectLimit": 0,
            "DestinationCreateLimit": 0,
            "DropIcmp": "on",
            "DropOther": "off",
            "DropTcp": "off",
            "DropUdp": "off",
            "EmptyConnectProtect": 0,
            "SourceConnectLimit": 0,
            "SourceCreateLimit": 10000,
            "UdpShard": "off"
        }
    }
}

Output Example

{
    "Response": {
        "RequestId": "cb1f63d0-9173-4a1e-adb9-bd1ee2642b58",
        "PolicyId": 1
    }
}

Example2 Modifying IP blocklist/allowlist

This example shows you how to add an IP to the blocklist.

Input Example

POST / HTTP/1.1
Host: teo.tencentcloudapi.com
Content-Type: application/json
X-TC-Action: ModifyDDoSPolicy
<Common request parameters>

{
    "PolicyId": 1,
    "ZoneId": "zone-27filz8zp3vi",
    "DdosRule": {
        "DdosAllowBlock": {
            "UserAllowBlockIp": [
                {
                    "Ip": "1.1.1.1",
                    "Mask": 0,
                    "Ip2": "",
                    "Mask2": 0,
                    "Type": "block",
                    "UpdateTime": 0
                }
            ]
        }
    }
}

Output Example

{
    "Response": {
        "RequestId": "cb1f63d0-9173-4a1e-adb9-bd1ee2642b58",
        "PolicyId": 1
    }
}

5. Developer Resources

SDK

TencentCloud API 3.0 integrates SDKs that support various programming languages to make it easier for you to call APIs.

Command Line Interface

6. Error Code

The following only lists the error codes related to the API business logic. For other error codes, see Common Error Codes.

Error Code Description
InvalidParameter.Security Invalid parameter.
OperationDenied Operation denied.
Contact Us

Contact our sales team or business advisors to help your business.

Technical Support

Open a ticket if you're looking for further assistance. Our Ticket is 7x24 avaliable.

7x24 Phone Support