tencent cloud

APIs

ModifyDDoSProtectionPolicy

ダウンロード
フォーカスモード
フォントサイズ
最終更新日: 2026-11-30 14:37:45

1. API Description

Domain name for API request: antiddos.intl.tencentcloudapi.com.

This API is used to modify the L3/4 DDoS protection policy of a protection instance by the protection instance ID.

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: ModifyDDoSProtectionPolicy.
Version Yes String Common Params. The value used for this API: 2025-09-03.
Region No String Common Params. This parameter is not required for this API.
ProtectionId Yes String

Protected instance ID.

ProtectionPolicy Yes ProtectionPolicy

Protection policy.

Partial modification is supported: For each sub-policy under ProtectionPolicy, sub-policies not passed in the input parameters remain unchanged.

3. Output Parameters

Parameter Name Type Description
RequestId String The unique request ID, generated by the server, will be returned for every request (if the request fails to reach the server for other reasons, the request will not obtain a RequestId). RequestId is required for locating a problem.

4. Example

Example1 Fully Modifying the DDoS Protection Policy by Protection Instance ID

This example shows you how to modify the DDoS protection policy of the protection instance prot-3xua1doxm4km in one operation: set the protection level to medium; drop traffic from 1.14.55.227; continue protecting TCP port 80 with rate limits of 100000000 bps and 100000 pps; drop packets whose payload contains EVIL_TEST_PAYLOAD; block the Hong Kong (China) region; enable ICMP and other protocol blocking; enable new connection, concurrent connection, and abnormal connection protection for source/destination IPs; and disable traffic signature validation.

Input Example

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

{
    "ProtectionId": "prot-3xua1doxm4km",
    "ProtectionPolicy": {
        "DefaultProtection": {
            "SensitivityLevel": "medium"
        },
        "IPACLRules": {
            "Rules": [
                {
                    "Action": "drop",
                    "IPs": [
                        "1.14.55.227"
                    ]
                }
            ]
        },
        "PortACLRules": {
            "Rules": [
                {
                    "SourcePortRange": {
                        "FromPort": 1,
                        "ToPort": 65535
                    },
                    "DestinationPortRange": {
                        "FromPort": 80,
                        "ToPort": 80
                    },
                    "Protocol": "tcp",
                    "Action": "forward"
                }
            ]
        },
        "SpeedLimitRules": {
            "Rules": [
                {
                    "IPProtocolNumbers": [
                        "6"
                    ],
                    "DestinationPortRanges": [
                        {
                            "FromPort": 80,
                            "ToPort": 80
                        }
                    ],
                    "Mode": "destination_ip",
                    "BandwidthLimit": 100000000,
                    "PacketRateLimit": 100000
                }
            ]
        },
        "PacketFilterRules": {
            "Rules": [
                {
                    "Action": "drop",
                    "Protocol": "tcp",
                    "PacketSizeRange": {
                        "Min": 0,
                        "Max": 1500
                    },
                    "SourcePortRange": {
                        "FromPort": 1,
                        "ToPort": 65535
                    },
                    "DestinationPortRange": {
                        "FromPort": 80,
                        "ToPort": 80
                    },
                    "PacketFilterConditions": [
                        {
                            "MatchBegin": "payload",
                            "Content": {
                                "Type": "string",
                                "Value": "EVIL_TEST_PAYLOAD",
                                "Offset": 0,
                                "Depth": 100
                            }
                        }
                    ]
                }
            ]
        },
        "GeoBlocking": {
            "GeoCode": [
                "CN-HK"
            ]
        },
        "ProtocolBlocking": {
            "TCPProtocol": "off",
            "UDPProtocol": "off",
            "ICMPProtocol": "on",
            "OtherProtocol": "on"
        },
        "ConnectionProtection": {
            "SourceIPNewConnectionLimit": 1000,
            "SourceIPConcurrentConnectionLimit": 2000,
            "DestinationIPNewConnectionLimit": 5000,
            "DestinationIPConcurrentConnectionLimit": 10000,
            "AbnormalConnectionLimit": {
                "AbnormalConnectThreshold": 1000,
                "AbnormalConnectCondition": {
                    "SynRatioThreshold": 80,
                    "SynCountThreshold": 1000,
                    "ConnectTimeout": 10,
                    "EmptyConnection": "on"
                }
            }
        },
        "TrafficSignature": {
            "Switch": "off",
            "TrafficSignatureKeys": [
                "0123456789abcdef-1A2B-0123456789abcdef0123456789abcdef01234567"
            ],
            "UdpCheckPortRanges": [
                {
                    "FromPort": 53,
                    "ToPort": 53
                }
            ],
            "TcpCheckPortRanges": [
                {
                    "FromPort": 80,
                    "ToPort": 80
                }
            ],
            "UdpTrafficSignatureOffset": 0,
            "TcpTrafficSignatureOffset": 0
        }
    }
}

Output Example

{
    "Response": {
        "RequestId": "ad0d5d7b-2f9b-4f68-a595-e4dfa8c3f787"
    }
}

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
InternalError Internal error.
InvalidParameter Parameter error.
InvalidParameterValue Parameter value error.
MissingParameter Missing parameter error.
ResourceInUse The resource is occupied.
ResourceNotFound Resources do not exist.
UnknownParameter Unknown parameter error.

ヘルプとサポート

この記事はお役に立ちましたか?

フィードバック