Query the List of VPCs

Last updated: 2020-06-04 17:11:17


    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 (DescribeVpcEx) is used to query the list of VPCs.
    API request domain name: vpc.api.qcloud.com

    When no parameter is input for this API, the information of the first 20 VPCs in default order is returned.

    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 DescribeVpcEx.

    Parameter name Required Type Description
    vpcId No String VPC ID assigned by the system. Both the the vpcId before upgrade and the upgraded unVpcId are supported.
    vpnName No String VPC name, supports fuzzy search.
    offset No Int Offset of the initial line. The default is 0.
    limit No Int Number of lines per page. The default is 20.
    orderField No String Sorts by a field. createTime and vpcName are supported. The default is createTime.
    orderDirection No String Ascending order (asc) or descending order (desc). The default is desc.

    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.
    totalCount Int Total number of the developer's VPCs.
    data.n Array VPC information array.
    data.n.vpcId String vpcId assigned by the system, for example: gz_vpc_266.
    data.n.unVpcId String New vpcID assigned by the system, for example: vpc-5gu2jxf4. This ID is derived from the VPC ID. The new vpcId is recommended.
    data.n.vpcName String VPC name.
    data.n.cidrBlock String VPC IP range, for example:
    data.n.subnetNum Int Number of subnets under the VPC.
    data.n.routeTableNum Int Number of route tables under the VPC.
    data.n.vpnGwNum Int Number of VPN gateways under the VPC.
    data.n.vpcPeerNum Int Number of peering connections under the VPC.
    data.n.vpcDeviceNum Int Number of CVMs under the VPC.
    data.n.classicLinkNum Int Number of basic network devices that are interconnected with the VPC.
    data.n.vpgNum Int Number of direct connect gateways under the VPC.
    data.n.natNum Int Number of NAT gateways under the VPC.
    data.n.createTime String Creation time of the VPC.
    data.n.isDefault Bool Whether the current VPC is the default VPC.

    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 resource does not exist. In this case, verify whether the resource information that you entered is correct.

    5. Sample


        &<Common Request Parameters>


        "code": 0,
        "message": "",
                "createTime":"2015-08-24 15:05:16"

    Was this page helpful?

    Was this page helpful?

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