tencent cloud

文档反馈

CreateProxy

最后更新时间:2023-07-13 15:25:41

1. API Description

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

This API is used to create/replicate an acceleration connection with the specified configuration. To replicate a connection, the basic configuration parameters need to be set for the new connection, and ClonedProxyId is needed to identify the replicated connection.

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: CreateProxy.
Version Yes String Common Params. The value used for this API: 2018-05-29.
Region No String Common Params. This parameter is not required.
ProjectId Yes Integer Project ID of connection.
ProxyName Yes String Name of the connection
AccessRegion Yes String Access region.
Bandwidth Yes Integer Connection bandwidth cap. Unit: Mbps.
Concurrent Yes Integer Connection concurrence cap, which indicates the maximum number of simultaneous online connections. Unit: 10,000 connections.
RealServerRegion No String Origin server region. If GroupId exists, the origin server region is the one of connection group, and this field is not required. If GroupId does not exist, this field is reuqired.
ClientToken No String A unique string supplied by the client to ensure that the request is idempotent. Its maximum length is 64 ASCII characters. If this parameter is not specified, the idem-potency of the request cannot be guaranteed.
For more information, please see How to Ensure Idempotence.
GroupId No String Connection group ID. This parameter is required when the connection is created in the connection group. Otherwise, this field is ignored.
TagSet.N No Array of TagPair List of tags to be added for connection.
ClonedProxyId No String ID of the replicated connection. Only a running connection can be replicated.
The connection is to be replicated if this parameter is set.
BillingType No Integer Billing mode (0: bill-by-bandwidth, 1: bill-by-traffic. Default value: bill-by-bandwidth)
IPAddressVersion No String IP version. Valid values: IPv4 (default), IPv6.
NetworkType No String Network type. normal: general BGP; cn2: dedicated BGP; triple: Non-BGP (provided by the top 3 ISPs in the Chinese mainland).
PackageType No String Package type of connection groups. Valid values: Thunder (general), Accelerator (specific for games), and CrossBorder (cross-MLC-border connection).
Http3Supported No Integer (Disused) HTTP3.0 is supported by default when IPAddressVersion is IPv4.

3. Output Parameters

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

4. Example

Example1 Creating a connection

Input Example

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

{
    "AccessRegion": "SouthChina",
    "ProjectId": "0",
    "Concurrent": "2",
    "Bandwidth": "10",
    "ProxyName": "test",
    "GroupId": "lg-xxxx"
}

Output Example

{
    "Response": {
        "InstanceId": "link-11112222",
        "RequestId": "c7bfcad5-3f20-472f-9afc-13a66faebad8"
    }
}

Example2 Example 2: Creating a connection

Input Example

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

{
    "Http3Supported": "0",
    "BillingType": "0",
    "AccessRegion": "Shanghai",
    "Concurrent": "2",
    "ProjectId": "0",
    "RealServerRegion": "Guangzhou",
    "ProxyName": "test",
    "Bandwidth": "10",
    "PackageType": "Thunder",
    "NetworkType": "normal",
    "IPAddressVersion": "IPv4"
}

Output Example

{
    "Response": {
        "RequestId": "db2dd9d4-ba60-48a2-a9ed-cd18c6e58dd0",
        "InstanceId": "link-aogd6x07"
    }
}

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
AuthFailure CAM signature/authentication error.
AuthFailure.NotEnterpriseAuthorization Not an organizational customer.
AuthFailure.UnauthorizedOperation The sub-account is not authorized for this operation.
FailedOperation Operation failed.
FailedOperation.AccountBalanceInsufficient Unable to create this connection: insufficient account balance.
FailedOperation.DuplicatedRequest Repeated request. Please check the value of ClientToken.
FailedOperation.LimitNumofListener Limit on the number of listeners exceeded.
FailedOperation.ProxySellOut The line is sold out or the resource is insufficient. Please submit a ticket.
FailedOperation.TagResourcesFailed Failed to add the tag to the resource.
FailedOperation.UnTagResourcesFailed Failed to unbind the tag.
FailedOperation.UserNotAuthenticated The current account has not completed identity verification.
FailedOperation.UserNotConfirmProtocol Protocol not activated.
InternalError Internal error.
InvalidParameter Incorrect parameter.
InvalidParameterValue Incorrect parameter value.
InvalidParameterValue.FeatureConflict The features to be enabled conflict with each other.
InvalidParameterValue.InvalidBandwidth The bandwidth value is not in the range.
InvalidParameterValue.InvalidConcurrency The number of concurrences is not in the range.
InvalidParameterValue.InvalidTags The tag is not found or you have no access permission to it.
InvalidParameterValue.ProjectIdNotBelong The project does not belong to this user.
InvalidParameterValue.ProxyAndGroupFeatureConflict Cross-MLC-border connection is not supported in this connection group.
InvalidParameterValue.ProxyAndRegionFeatureConflict The configuration of the cross-MLC-border connection is not supported in this region.
LimitExceeded.TagQuota Insufficient tags
MissingParameter Missing parameter.
ResourceNotFound The resource does not exist.
ResourceUnavailable The resource is unavailable.
ResourceUnavailable.AccountViolation Restricted resources found in your account. Check your inbox and email for details.
UnauthorizedOperation Unauthorized operation.
UnknownParameter Unknown parameter.