edit-icon download-icon

DescribeVpcs

Last Updated: Apr 09, 2018

Description

Query the created VPCs in a specified region.

Request parameters

Name Type Required Description
Action String Yes

The action to perform.

Valid value: DescribeVpcs

VpcId String No

The ID of the VPC.

Up to 20 VPC IDs can be specified. Separate multiple VPC IDs by commas.

RegionId String Yes

The ID of the region where the VPC is located.

You can query the region ID by calling DescribeRegions API.

IsDefault Boolean No

Whether to query the default VPC in the specified region. Valid value:

  • true (Default): Query all VPCs in the specified region.
  • false: Do not query the default VPC.

PageNumber Integer No The number of pages to return. The default value is 1.
PageSize Integer No The number of rows per page. The maximum value is 50 and default value is 10.

Response parameters

Name Type Description
RequestId String The ID of the request.
Vpcs JSON string The detailed information of queried VPCs. For more information, see VpcSetType.
TotalCount String The number of queried entries.
PageNumber Integer The current page number.
PageSize Integer The number of entries on the current page.

Error codes

For more information, see VPC API Error Center.

Examples

Request example

  1. https://vpc.aliyuncs.com/?Action=DescribeVpcs
  2. &RegionId=cn-beijing
  3. &<CommonParameters>

Response example

XML format

  1. <DescribeVpcsResponse>
  2. <RequestId> DA1DAE87-43FA-472F-98BB-4FDBAA4A688D</RequestId>
  3. <Vpcs>
  4. <Vpc>
  5. <VpcId> vpc-257gq642n </VpcId>
  6. <RegionId>cn-beijing</RegionId>
  7. <VpcName></VpcName>
  8. <Description></Description>
  9. <VRouterId>vrt-25bezkd03</VRouterId>
  10. <Status>Available</Status>
  11. <UserCidrs></UserCidrs>
  12. <CidrBlock>172.16.0.0/16</CidrBlock>
  13. <VSwitchIds></VSwitchIds>
  14. <CreationTime> 2014-10-29T13:30:19Z</CreationTime>
  15. </Vpc>
  16. </Vpcs>
  17. </DescribeVpcsResponse>

JSON format

  1. {
  2. "PageNumber": 1,
  3. "PageSize": 10,
  4. "RequestId": "DA1DAE87-43FA-472F-98BB-4FDBAA4A688D",
  5. "TotalCount": 1,
  6. "Vpcs": {
  7. "Vpc": {
  8. "CidrBlock": "172.16.0.0/16",
  9. "CreationTime": "2014-10-29T13:30:19Z",
  10. "Description": "",
  11. "RegionId": "cn-beijing",
  12. "Status": "Available",
  13. "UserCidrs": {
  14. "UserCidr": []
  15. },
  16. "VRouterId": "vrt-25bezkd03",
  17. "VSwitchIds": {
  18. "VSwitchId": []
  19. },
  20. "VpcId": "vpc-257gq642n",
  21. "VpcName": ""
  22. }
  23. }
  24. }
Thank you! We've received your feedback.