Queries virtual private clouds (VPCs) in a specified region.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer. OpenAPI Explorer dynamically generates the sample code of the operation for different SDKs.

Request parameters

Parameter Type Required Example Description
Action String Yes DescribeVpcs

The operation that you want to perform. Set the value to DescribeVpcs.

VpcId String No vpc-bp1b1xjllp3ve5yze****

The ID of the VPC.

You can specify up to 20 VPC IDs. Separate multiple IDs with commas (,).

RegionId String Yes cn-hangzhou

The region ID of the VPC.

You can call the DescribeRegions operation to query the most recent region list.

VpcName String No Vpc-1

The name of the VPC.

IsDefault Boolean No false

Specifies whether to query the default VPC in the specified region. Valid values:

  • true (default): yes
  • false: no
DryRun Boolean No false

Specifies whether to check the request without performing the operation. Valid values:

  • true: checks the request but does not query VPCs. The system checks whether your AccessKey pair is valid, whether the Resource Access Management (RAM) user is authorized, and whether the required parameters are set. If the request fails to pass the check, an error message is returned. If the request passes the check, the DryRunOperation error code is returned.
  • false (default): sends the request. If the request passes the check, a 2xx HTTP status code is returned and VPCs are queried.
ResourceGroupId String No rg-acfmxvfvazb4p****

The ID of the resource group to which the VPC to be queried belongs.

PageNumber Integer No 1

The number of the page to return. Default value: 1.

PageSize Integer No 10

The number of entries to return per page. Maximum value: 50. Default value: 10.

VpcOwnerId Long No 253460731706911258

The ID of the Alibaba Cloud account to which the VPC belongs.

DhcpOptionsSetId String No dopt-o6w0df4epg9zo8isy****

The ID of the DHCP options set.

Response parameters

Parameter Type Example Description
PageSize Integer 10

The number of entries returned per page.

RequestId String C6532AA8-D0F7-497F-A8EE-094126D441F5

The ID of the request.

PageNumber Integer 1

The number of the returned page.

TotalCount Integer 2

The number of entries returned.

Vpcs Array of Vpc

The details of the VPCs.

Vpc
CreationTime String 2021-04-18T15:02:37Z

The time when the VPC was created.

Status String Available

The status of the VPC. Valid values:

  • Pending: being configured
  • Available: available
VpcId String vpc-bp1qpo0kug3a20qqe****

The ID of the VPC.

IsDefault Boolean false

Indicates whether the VPC is the default VPC in the region. Valid values:

  • true: yes
  • false: no
OwnerId Long 253460731706911258

The ID of the Alibaba Cloud account to which the VPC belongs.

RegionId String cn-hangzhou

The ID of the region to which the VPC belongs.

VpcName String vpc1

The name of the VPC.

VRouterId String vrt-bp1jcg5cmxjbl9xgc****

The ID of the vRouter.

DhcpOptionsSetStatus String Available

The status of the DHCP options set. Valid values:

  • Available: available
  • InUse: in use
  • Deleted: deleted
  • Pending: being configured
CidrBlock String 192.168.0.0/16

The IPv4 CIDR block of the VPC.

Description String This is my VPC.

The description of the VPC.

ResourceGroupId String rg-acfmxazb4ph****

The ID of the resource group to which the VPC belongs.

DhcpOptionsSetId String dopt-o6w0df4epg9zo8isy****

The ID of the DHCP options set.

Ipv6CidrBlock String 2408:XXXX:0:a600::/56

The IPv6 CIDR block of the VPC.

CenStatus String Attached

The status of the Cloud Enterprise Network (CEN) instance to which the VPC is attached.

Attached is returned only if the VPC is attached to a CEN instance.

Tags Array of Tag

The tag information about the VPC.

Tag
Key String env

The key of the tag that is added to the VPC.

Value String internal

The value of the tag that is added to the VPC.

Ipv6CidrBlocks Array of Ipv6CidrBlock

The IPv6 CIDR blocks of the VPC.

Ipv6CidrBlock
Ipv6Isp String BGP

The type of IPv6 CIDR block. Valid values:

  • BGP: an IPv6 CIDR block provided by Alibaba Cloud over Border Gateway Protocol (BGP)
  • ChinaMobile: an IPv6 CIDR block provided by China Mobile (single ISP)
  • ChinaUnicom: an IPv6 CIDR block provided by China Unicom (single ISP)
  • ChinaTelecom: an IPv6 CIDR block provided by China Telecom (single ISP)
Note If your Alibaba Cloud account is allowed to activate single-ISP bandwidth, valid values are: ChinaTelecom, ChinaUnicom, and ChinaMobile.
Ipv6CidrBlock String 2408:XXXX:0:a600::/56

The IPv6 CIDR block of the VPC.

VSwitchIds Array of String vsw-bp1nhbnpv2blyz8dl****

The vSwitches in the VPC.

You can query up to 300 vSwitches in the VPC. The information about the latest vSwitches is returned. If you want to query the information about all vSwitches in a VPC, call the DescribeVSwitches operation.

SecondaryCidrBlocks Array of String 192.168.20.0/24

The secondary CIDR blocks of the VPC.

UserCidrs Array of String 10.0.0.0/8

The list of user CIDR blocks.

NatGatewayIds Array of String nat-245xxxftwt45bg****

The IDs of the NAT gateways.

RouterTableIds Array of String vtb-bp1krxxzp0c29fmon****

The IDs of the route tables.

Examples

Sample requests

http(s)://[Endpoint]/?Action=DescribeVpcs
&VpcId=vpc-bp1b1xjllp3ve5yze****
&RegionId=cn-hangzhou
&VpcName=Vpc-1
&IsDefault=false
&DryRun=false
&ResourceGroupId=rg-acfmxvfvazb4p****
&PageNumber=1
&PageSize=10
&VpcOwnerId=253460731706911258
&DhcpOptionsSetId=dopt-o6w0df4epg9zo8isy****
&Common request parameters

Sample success responses

XML format

HTTP/1.1 200 OK
Content-Type:application/xml

<DescribeVpcsResponse>
    <PageSize>10</PageSize>
    <RequestId>C6532AA8-D0F7-497F-A8EE-094126D441F5</RequestId>
    <PageNumber>1</PageNumber>
    <TotalCount>2</TotalCount>
    <Vpcs>
        <CreationTime>2021-04-18T15:02:37Z</CreationTime>
        <Status>Available</Status>
        <VpcId>vpc-bp1qpo0kug3a20qqe****</VpcId>
        <IsDefault>false</IsDefault>
        <OwnerId>253460731706911260</OwnerId>
        <RegionId>cn-hangzhou</RegionId>
        <VpcName>vpc1</VpcName>
        <VRouterId>vrt-bp1jcg5cmxjbl9xgc****</VRouterId>
        <DhcpOptionsSetStatus>Available</DhcpOptionsSetStatus>
        <CidrBlock>192.168.0.0/16</CidrBlock>
        <Description>This is my VPC.</Description>
        <ResourceGroupId>rg-acfmxazb4ph****</ResourceGroupId>
        <DhcpOptionsSetId>dopt-o6w0df4epg9zo8isy****</DhcpOptionsSetId>
        <Ipv6CidrBlock>2408:XXXX:0:a600::/56</Ipv6CidrBlock>
        <CenStatus>Attached</CenStatus>
        <Tags>
            <Key>env</Key>
            <Value>internal</Value>
        </Tags>
        <Ipv6CidrBlocks>
            <Ipv6Isp>BGP</Ipv6Isp>
            <Ipv6CidrBlock>2408:XXXX:0:a600::/56</Ipv6CidrBlock>
        </Ipv6CidrBlocks>
        <VSwitchIds>vsw-bp1nhbnpv2blyz8dl****</VSwitchIds>
        <SecondaryCidrBlocks>192.168.20.0/24</SecondaryCidrBlocks>
        <UserCidrs>10.0.0.0/8</UserCidrs>
        <NatGatewayIds>nat-245xxxftwt45bg****</NatGatewayIds>
        <RouterTableIds>vtb-bp1krxxzp0c29fmon****</RouterTableIds>
    </Vpcs>
</DescribeVpcsResponse>

JSON format

HTTP/1.1 200 OK
Content-Type:application/json

{
  "PageSize" : 10,
  "RequestId" : "C6532AA8-D0F7-497F-A8EE-094126D441F5",
  "PageNumber" : 1,
  "TotalCount" : 2,
  "Vpcs" : [ {
    "CreationTime" : "2021-04-18T15:02:37Z",
    "Status" : "Available",
    "VpcId" : "vpc-bp1qpo0kug3a20qqe****",
    "IsDefault" : false,
    "OwnerId" : 253460731706911260,
    "RegionId" : "cn-hangzhou",
    "VpcName" : "vpc1",
    "VRouterId" : "vrt-bp1jcg5cmxjbl9xgc****",
    "DhcpOptionsSetStatus" : "Available",
    "CidrBlock" : "192.168.0.0/16",
    "Description" : "This is my VPC.",
    "ResourceGroupId" : "rg-acfmxazb4ph****",
    "DhcpOptionsSetId" : "dopt-o6w0df4epg9zo8isy****",
    "Ipv6CidrBlock" : "2408:XXXX:0:a600::/56",
    "CenStatus" : "Attached",
    "Tags" : [ {
      "Key" : "env",
      "Value" : "internal"
    } ],
    "Ipv6CidrBlocks" : [ {
      "Ipv6Isp" : "BGP",
      "Ipv6CidrBlock" : "2408:XXXX:0:a600::/56"
    } ],
    "VSwitchIds" : [ "vsw-bp1nhbnpv2blyz8dl****" ],
    "SecondaryCidrBlocks" : [ "192.168.20.0/24" ],
    "UserCidrs" : [ "10.0.0.0/8" ],
    "NatGatewayIds" : [ "nat-245xxxftwt45bg****" ],
    "RouterTableIds" : [ "vtb-bp1krxxzp0c29fmon****" ]
  } ]
}

Error codes

HttpCode Error code Error message Description
400 InvalidResourceGroupId The specified ResourceGroupId does not exist. The error message returned because the specified resource group ID is invalid.
500 InternalError The request processing has failed due to some unknown error. The error message returned because some unknown errors occurred.

For a list of error codes, visit the API Error Center.