tencent cloud

文档反馈

ModifyDDoSPolicy

最后更新时间:2022-10-19 18:00:44
This document is currently invalid. Please refer to the documentation page of the product.

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-09-01.
Region Yes String Common Params. For more information, please see the list of regions supported by the product.
PolicyId Yes Integer The policy ID.
ZoneId Yes String The site ID.
DDoSRule No DDoSRule Details of the DDoS mitigation configuration.

3. Output Parameters

Parameter Name Type Description
RequestId String The unique request ID, which is returned for each request. RequestId is required for locating a problem.

4. Example

Example1 Modifying the IP blocklist/allowlist

This example shows you how to add the IP 1.1.1.1 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": {
            "DDoSAllowBlockRules": [
                {
                    "Ip": "1.1.1.1",
                    "Type": "block",
                    "UpdateTime": 0
                }
            ]
        }
    }
}

Output Example

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

Example2 Modifying the connection protection settings

This example shows you how to set the maximum number of new connections to the origin per second to 10,000.

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"
    }
}

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.