Delete VPN Tunnel

Last updated: 2020-06-04 18:16:38

    Note:

    This is a legacy API which has been hidden and will no longer be updated. We recommend using the new VPC API 3.0 which is standardized and faster.

    1. API Description

    This API (DeleteVpnConn) is used to delete VPN tunnel.
    Domain for API request: vpc.api.qcloud.com

    2. Input Parameters

    The following request parameter list only provides API request parameters. Common request parameters need to be added when the API is called. For more information, refer to Common Request Parameters. The Action field for this API is DeleteVpnConn.

    Parameter Name Required Type Description
    vpcId Yes string Virtual private cloud ID, which can be vpcId or unVpcId. unVpcId is recommended. For example: vpc-03vihbk9. Can be queried via the API DescribeVpcEx.
    vpnGwId Yes String VPN gateway ID assigned by the system, which can be vpnGwId or unVpnGwId. unVpnGwId is recommended. For example: vpngw-dystbrkv. Can be queried via the API DescribeVpnGw.
    vpnConnId Yes String VPN channel ID assigned by the system, which can be vpnConnId or unVpnConnId. unVpnConnId is recommended. For example: vpnx-ol6bcqp0. Can be queried via the API DescribeVpnConn.

    3. Output Parameters

    Parameter Name Type Description
    code Int Error code, 0: Succeeded; other values: Failed
    message String Error message
    data.taskId Int Task ID. The operation result can be queried with taskId. For more information, refer to API for Querying Task Execution Result.

    4. Error Codes

    The following error code list only provides the business logic error codes for this API. For additional common error codes, refer to VPC Error Codes.

    Error code Description
    InvalidVpc.NotFound VPC does not exist. Please check the information you entered. You can query the VPC via the API DescribeVpcEx.
    InvalidVpnGw.NotFound VPN gateway does not exist. Please check the information you entered. You can query the VPN gateway via the API DescribeVpnGw.
    InvalidVpnConnState Invalid VPN tunnel status
    InvalidVpnConn.NotFound Invalid VPN tunnel. VPN tunnel does not exist. Please check the information you entered. You can query the VPN channel via the API DescribeVpnConn.

    5. Example

    Input

      https://vpc.api.qcloud.com/v2/index.php?Action=DeleteVpnConn
      &<Common request parameters>
      &vpcId=vpc-03vihbk9
      &vpnGwId=vpngw-kfldykuz
      &vpnConnId=vpnx-ol6bcqp0

    Output

    {
        "code": 0,
        "message": "",
        "data": {
            "vpnGwId": "vpngw-kfldykuz",
            "vpcConnId": "vpnx-ol6bcqp0",
            "taskId": 12615,
            "state": 4
        }
    }

    Was this page helpful?

    Was this page helpful?

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