tencent cloud

Feedback

CreateDirectConnectTunnel

Last updated: 2022-10-18 10:39:13

1. API Description

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

This API is used to create a dedicated tunnel.

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: CreateDirectConnectTunnel.
Version Yes String Common Params. The value used for this API: 2018-04-10.
Region No String Common Params. This parameter is not required for this API.
DirectConnectId Yes String Direct Connect ID, such as dc-kd7d06of.
DirectConnectTunnelName Yes String Dedicated tunnel name.
DirectConnectOwnerAccount No String Connection owner, who is the current customer by default.
The developer account ID should be entered for shared connections.
NetworkType No String Network type. Valid values: VPC, BMVPC, CCN. Default value: VPC.
VPC: Virtual Private Cloud.
BMVPC: BM VPC.
CCN: Cloud Connect Network.
NetworkRegion No String Network region.
VpcId No String Unified VPC ID or BMVPC ID.
DirectConnectGatewayId No String Direct connect gateway ID, such as dcg-d545ddf.
Bandwidth No Integer Direct Connect bandwidth in Mbps.
Default value: connection bandwidth value.
RouteType No String BGP: BGP routing.
STATIC: Static routing.
Default value: BGP routing.
BgpPeer No BgpPeer BgpPeer, which is BGP information on the user side and includes Asn and AuthKey.
RouteFilterPrefixes.N No Array of RouteFilterPrefix Static routing, i.e., IP range of the user's IDC.
Vlan No Integer VLAN. Value range: 0-3,000.
0: sub-interface not enabled.
Default value: Non-zero.
TencentAddress No String TencentAddress: Tencent-side IP address.
CustomerAddress No String CustomerAddress: User-side IP address.
TencentBackupAddress No String TencentBackupAddress, i.e., Tencent-side standby IP address
CloudAttachId No String Cloud Attached Connection Service ID
BfdEnable No Integer Whether to enable BFD
NqaEnable No Integer Whether to enable NQA
BfdInfo No BFDInfo BFD configuration information
NqaInfo No NQAInfo NQA configuration information

3. Output Parameters

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

4. Example

Example1 Dedicated tunnel using BGP routing and VPC

Input Example

https://dc.tencentcloudapi.com/?Action=CreateDirectConnectTunnel
&DirectConnectId=dc-abcdefgh
&DirectConnectTunnelName=Test
&NetworkType=VPC
&NetworkRegion=ap-guangzhou
&VpcId=vpc-abcdefgh
&DirectConnectGatewayId=dcg-abcdefgh
&Bandwidth=100
&RouteType=BGP
&Vlan=100
&TencentAddress=192.168.1.2/30
&CustomerAddress=192.168.1.1/30
&BgpPeer.Asn=65128
&BgpPeer.AuthKey=abcdefg
&<Common request parameters>

Output Example

{
    "Response": {
        "DirectConnectTunnelIdSet": [
            "dcx-abcdefgh"
        ],
        "RequestId": "24a0d7e5-4c13-49be-aa16-94f698fbef3e"
    }
}

Example2 Dedicated tunnel using static routing and BM VPC

Input Example

https://dc.tencentcloudapi.com/?Action=CreateDirectConnectTunnel
&DirectConnectId=dc-abcdefgh
&DirectConnectTunnelName=Test
&NetworkType=BMVPC
&NetworkRegion=ap-guangzhou
&VpcId=vpc-abcdefgh
&Bandwidth=100
&RouteType=STATIC
&Vlan=100
&TencentAddress=192.168.1.2/30
&CustomerAddress=192.168.1.1/30
&RouteFilterPrefixes.0.Cidr=192.168.0.0/24
&RouteFilterPrefixes.1.Cidr=192.168.0.0/24
&RouteFilterPrefixes.2.Cidr=192.168.0.0/24
&<Common request parameters>

Output Example

{
    "Response": {
        "DirectConnectTunnelIdSet": [
            "dcx-abcdefgh"
        ],
        "RequestId": "24a0d7e5-4c13-49be-aa16-94f698fbef3e"
    }
}

Example3 Dedicated tunnel using BGP routing and shared connection

Input Example

https://dc.tencentcloudapi.com/?Action=CreateDirectConnectTunnel
&DirectConnectId=dc-abcdefgh
&DirectConnectTunnelName=Test
&DirectConnectOwnerAccount=240791248
&NetworkType=VPC
&NetworkRegion=ap-guangzhou
&VpcId=vpc-abcdefgh
&DirectConnectGatewayId=dcg-abcdefgh
&Bandwidth=100
&RouteType=BGP
&Vlan=100
&TencentAddress=192.168.1.2/30
&CustomerAddress=192.168.1.1/30
&BgpPeer.Asn=65128
&BgpPeer.AuthKey=abcdefg
&<Common request parameters>

Output Example

{
    "Response": {
        "DirectConnectTunnelIdSet": [
            "dcx-abcdefgh"
        ],
        "RequestId": "24a0d7e5-4c13-49be-aa16-94f698fbef3e"
    }
}

Example4 Dedicated tunnel using BGP routing and CCN

Input Example

https://dc.tencentcloudapi.com/?Action=CreateDirectConnectTunnel
&DirectConnectId=dc-abcdefgh
&DirectConnectTunnelName=Test
&NetworkType=CCN
&NetworkRegion=ap-guangzhou
&DirectConnectGatewayId=dcg-abcdefgh
&Bandwidth=100
&RouteType=BGP
&Vlan=100
&TencentAddress=192.168.1.2/30
&CustomerAddress=192.168.1.1/30
&BgpPeer.Asn=65128
&BgpPeer.AuthKey=abcdefg
&<Common request parameters>

Output Example

{
    "Response": {
        "DirectConnectTunnelIdSet": [
            "dcx-abcdefgh"
        ],
        "RequestId": "24a0d7e5-4c13-49be-aa16-94f698fbef3e"
    }
}

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 An internal error occurred.
InvalidParameter Invalid parameter.
InvalidParameter.AddressError Wrong IP address.
InvalidParameter.DirectConnectIdIsNotUin The connection does not belong to this account.
InvalidParameter.UinIsNotExist The account ID does not exist.
InvalidParameter.VlanConflict VLAN conflict.
InvalidParameterValue The parameter value is invalid.
InvalidParameterValue.VlanConfLict VLAN conflict.
LimitExceeded The quota limit is exceeded.
LimitExceeded.DirectConnectLimitExceeded The number of connections has reached the upper limit.
LimitExceeded.DirectConnectTunnelLimitExceeded The number of the dedicated tunnels of the connection has reached the upper limit.
MissingParameter Missing parameter.
ResourceInUse.DcVpcIsExist The connection VPC already exists.
ResourceUnavailable.InsufficientBalance Your account is in arrears, and the service cannot be activated. Please top up your account first.
UnsupportedOperation Unsupported operation.
UnsupportedOperation.CrossBorderDirectConnectTunnel Cross-border dedicated tunnel is not allowed. Please contact us.
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