CreateDirectConnectGateway

Last updated: 2021-05-12 10:21:35

1. API Description

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

This API is used to create a direct connect gateway.

A maximum of 20 requests can be initiated per second for this API.

Note: This API supports Finance regions. If the common parameter Region is a Finance region, a domain name with the Finance region needs to be specified, for example: vpc.ap-shanghai-fsi.tencentcloudapi.com

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 parameter. The value used for this API: CreateDirectConnectGateway.
Version Yes String Common parameter. The value used for this API: 2017-03-12.
Region Yes String Common parameter. For more information, please see the list of regions supported by the product.
DirectConnectGatewayName Yes String The name of the direct connect gateway.
NetworkType Yes String The type of the associated network. Valid values:
  • VPC
  • CCN
  • NetworkInstanceId Yes String
  • When the NetworkType is VPC, this value is the VPC instance ID
  • When the NetworkType is CCN, this value is the CCN instance ID
  • GatewayType No String The type of the gateway. Valid values:
  • NORMAL - (Default) Standard type. Note: CCN only supports the standard type
  • NAT - NAT type
  • NAT gateway supports network address translation. The specified type cannot be modified. A VPC can create one NAT direct connect gateway and one non-NAT direct connect gateway
    ModeType No String CCN route publishing method. Valid values: standard and exquisite. This parameter is only valid for the CCN direct connect gateway.

    3. Output Parameters

    Parameter Name Type Description
    DirectConnectGateway DirectConnectGateway The object of the direct connect gateway.
    RequestId String The unique request ID, which is returned for each request. RequestId is required for locating a problem.

    4. Example

    Example1 Creating an NAT direct connect gateway associated with a VPC

    Input Example

    https://vpc.tencentcloudapi.com/?Action=CreateDirectConnectGateway
    &DirectConnectGatewayName=test
    &NetworkType=VPC
    &NetworkInstanceId=vpc-m7sr81gh
    &GatewayType=NAT
    &<Common request parameters>
    

    Output Example

    {
      "Response": {
        "DirectConnectGateway": {
          "DirectConnectGatewayId": "dcg-gjug0kul",
          "DirectConnectGatewayName": "test",
          "DirectConnectGatewayIp": "10.21.0.5",
          "EnableBGPCommunity": false,
          "VpcId": "vpc-m7sr81gh",
          "CcnId": "",
          "EnableBGP": false,
          "CcnRouteType": "BGP",
          "NetworkType": "VPC",
          "NetworkInstanceId": "vpc-m7sr81gh",
          "GatewayType": "NAT",
          "VXLANSupport": [
            true
          ],
          "NatGatewayId": "nat-m7dr11gc",
          "CreateTime": "2020-09-22 00:00:00"
        },
        "RequestId": "b8351d12-3c82-4d4b-9d88-972e02ca4620"
      }
    }
    

    Example2 Creating a standard direct connect gateway associated with a CCN

    Input Example

    https://vpc.tencentcloudapi.com/?Action=CreateDirectConnectGateway
    &DirectConnectGatewayName=test
    &NetworkType=CCN
    &NetworkInstanceId=ccn-8j0phqix
    &GatewayType=NORMAL
    &<Common request parameters>
    

    Output Example

    {
      "Response": {
        "DirectConnectGateway": {
          "DirectConnectGatewayId": "dcg-3vwxt61v",
          "DirectConnectGatewayName": "test",
          "VpcId": "vpc-ilii3ejt",
          "NetworkType": "CCN",
          "NetworkInstanceId": "ccn-c1aopa13",
          "GatewayType": "NORMAL",
          "EnableBGPCommunity": true,
          "EnableBGP": true,
          "CcnId": "ccn-8j0phqix",
          "CcnRouteType": "BGP",
          "NatGatewayId": "",
          "DirectConnectGatewayIp": "10.21.0.5",
          "VXLANSupport": [
            true
          ],
          "CreateTime": "0000-00-00 00:00:00"
        },
        "RequestId": "b8351d12-3c82-4d4b-9d88-972e02ca4620"
      }
    }
    

    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
    InvalidParameterValue.Malformed Invalid input parameter format.
    LimitExceeded Quota limit is reached.
    ResourceNotFound The resource does not exist.
    UnsupportedOperation.UnableCrossBorder Cross border is not supported.