tencent cloud

Feedback

DescribeVpcs

Last updated: 2023-08-18 14:27:57

1. API Description

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

This API is used to query the list of VPCs.

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

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 Params. The value used for this API: DescribeVpcs.
Version Yes String Common Params. The value used for this API: 2019-07-19.
Region No String Common Params. This parameter is not required for this API.
VpcIds.N No Array of String VPC instance ID, such as vpc-f49l6u0z. Each request supports a maximum of 100 instances. VpcIds and Filters cannot be specified at the same time.
Filters.N No Array of Filter Filter. VpcIds and Filters cannot be specified at the same time.
vpc-name - String - VPC instance name. Only fuzzy query by a single value is supported.
vpc-id - String - VPC instance ID, such as vpc-f49l6u0z.
cidr-block - String - VPC CIDR. Only fuzzy query by a single value is supported.
region - String - VPC region.
tag-key - String - Required: no - Filter by tag key.
tag:tag-key - String - Required: no - Filter by tag key-value pair.
Offset No Integer Offset
Limit No Integer Number of returned results.
EcmRegion No String Region
Sort No String Sorting method. time: sort in reverse chronological order; default: sort by network planning.

3. Output Parameters

Parameter Name Type Description
TotalCount Integer Number of eligible objects.
VpcSet Array of VpcInfo VPC object.
Note: this field may return null, indicating that no valid values can be obtained.
RequestId String The unique request ID, which is returned for each request. RequestId is required for locating a problem.

4. Example

Example1 Querying VPC list

Input Example

https://ecm.tencentcloudapi.com/?Action=DescribeVpcs
&VpcIds.0=vpc-07kqm4uj
&EcmRegion=ap-hangzhou-ecm
&<Common request parameters>

Output Example

{
    "Response": {
        "TotalCount": 1,
        "RequestId": "d15a17b7-703b-4757-ae1a-745af315abc4",
        "VpcSet": [
            {
                "EnableDhcp": true,
                "VpcId": "vpc-07kqm4uj",
                "Description": "",
                "DomainName": "",
                "Ipv6CidrBlock": "",
                "Region": "ap-hangzhou-ecm",
                "DhcpOptionsId": "",
                "InstanceCount": 2,
                "DnsServerSet": [],
                "EnableMulticast": false,
                "VpcName": "Default-VPC",
                "AssistantCidrSet": [],
                "TagSet": null,
                "SubnetCount": 1,
                "CreatedTime": "2020-06-17 12:09:46",
                "CidrBlock": "172.16.0.0/16",
                "IsDefault": true,
                "RegionName": "Hangzhou Zone 1"
            }
        ]
    }
}

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
FailedOperation.InternalOperationFailure Internal error.
InvalidParameter.Coexist The parameters cannot be specified at the same time.
InvalidParameter.InvalidDataFormat The data format is incorrect.
InvalidParameterValue The parameter value is incorrect.
InvalidParameterValue.FilterLimitExceeded The value of the Filter parameter exceeds the limit.
InvalidParameterValue.InvalidFilter The filter is invalid.
InvalidParameterValue.InvalidPublicParam The common parameter is invalid.
InvalidParameterValue.InvalidRegion The ECM region is invalid.
InvalidParameterValue.InvalidZoneInstanceCount The city or quantity is invalid.
InvalidParameterValue.Malformed The input parameter format is invalid.
UnauthorizedOperation.ForbiddenOperation You don't have the permission to perform this operation.
Contact Us

Contact our sales team or business advisors to help your business.

Technical Support

Open a ticket if you're looking for further assistance. Our Ticket is 7x24 avaliable.

7x24 Phone Support