Delete a VPC

Last updated: 2020-06-08 13:19:12

    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 (DeleteVpc) is used to delete VPCs.
    API request domain name: vpc.api.qcloud.com

    (1) Before deleting a VPC, make sure that there are no resources in it, such as CVMs, cloud databases, NoSQL databases, VPN gateways, direct connect gateways, load balancers, peering connections, and basic network devices linked with it.
    (2) The deletion of VPCs is irreversible. Please proceed with caution.

    2. Input Parameters

    Below is a list of API request parameters. You need to add common request parameters to your request when calling this API. For more information, see the Common Request Parameters page. The Action field for this API is DeleteVpc.

    Parameter name Required Type Description
    vpcId Yes String VPC ID assigned by the system. Both the vpcId before upgrade and the upgraded unVpcId are supported.

    3. Output Parameters

    Parameter name Type Description
    code Int Common error code. 0: Successful; other values: Failed. For more information, see Common Error Codes.
    message String Module error message, which depends on the API.

    4. Error Codes

    The following error codes only include business logic error codes for this API. For additional common error codes, see VPC Error Codes.

    Error code Description
    InvalidVpc.NotFound Invalid VPC. This error code indicates that the VPC does not exist. In this case, verify whether the resource information that you entered is correct.
    InvalidVpc.CannotDelete A VPC that contains resources cannot be deleted.

    5. Sample

    Input

    
      https://vpc.api.qcloud.com/v2/index.php?Action=DeleteVpc
        & <Common request parameters>
      &vpcId=vpc-2ari9m7h
    

    Output

    
    {
        "code": 0,
        "message": ""
    }
    

    Was this page helpful?

    Was this page helpful?

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