tencent cloud

APIs

CreateProtection

Unduh
Mode fokus
Ukuran font
Terakhir diperbarui: 2026-11-27 14:38:08

1. API Description

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

This API is used to create a DDoS Defender protection instance.

A protection instance is the basic unit that carries protection policies and protected resources in DDoS Defender. After creation, you can configure protection policies in the instance and bind cloud resources that need protection.

Prerequisites: The current Tencent Cloud root account has subscribed to a DDoS Defender plan. For details, see Purchase Guide.

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: CreateProtection.
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.
Name Yes String

Protection instance name.

Input limit: The protection instance name can contain up to 60 characters and must be unique under the same root account.

ProtectionLevel No String

Protection level of the protection instance.

Valid values:

  • advanced: Advanced protection;
  • ultimate: Ultimate protection, available only when the current root account has subscribed to any protection capacity add-on.

Available protection levels vary by subscription plan, and the types of protected resources and protection capacity that can be connected also vary accordingly. For details, see DDoS Protection Capacity Description.

Tags.N No Array of TagInfo

Tag. It is used for permission control and cost allocation of protection instances.

You need to first create the corresponding tag in the Tag Console before you can pass in the tag key and tag value here.

3. Output Parameters

Parameter Name Type Description
ProtectionId String

Protection instance ID.

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 Creating a Protection Instance

This example shows you how to create a protection instance named protection_name with the advanced protection level and bind a business tag to it.

Input Example

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

{
    "Name": "protection_name",
    "ProtectionLevel": "advanced",
    "Tags": [
        {
            "TagKey": "env",
            "TagValue": "production"
        }
    ]
}

Output Example

{
    "Response": {
        "ProtectionId": "prot-0004c045b8",
        "RequestId": "9kl50bew-89ga-44f4-91ce-78125d53vd2a"
    }
}

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.
LimitExceeded The quota limit is exceeded.
UnsupportedOperation The operation is not supported.

Bantuan dan Dukungan

Apakah halaman ini membantu?

masukan