CreateDirectConnectTunnel

Last updated: 2020-05-09 10:01:07

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.

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 parameter. The value used for this API: CreateDirectConnectTunnel.
Version Yes String Common parameter. The value used for this API: 2018-04-10.
Region No String Common parameter. 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

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

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

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

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

5. Developer Resources

API Explorer

This tool allows online call, signature authentication, SDK code generation and quick search of APIs to greatly improve the efficiency of using TencentCloud APIs.

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 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.
InvalidParameterValue Incorrect parameter value.
InvalidParameterValue.VlanConfLict VLAN conflict.
LimitExceeded Quota limit is reached.
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.

Was this page helpful?

Was this page helpful?

  • Not at all
  • Not very helpful
  • Somewhat helpful
  • Very helpful
  • Extremely helpful
Send Feedback
Help