All Products
Search
Document Center

Virtual Private Cloud:DescribeVpcs

Last Updated:Jun 19, 2026

Queries created VPCs.

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

The table below describes the authorization required to call this API. You can define it in a Resource Access Management (RAM) policy. The table's columns are detailed below:

  • Action: The actions can be used in the Action element of RAM permission policy statements to grant permissions to perform the operation.

  • API: The API that you can call to perform the action.

  • Access level: The predefined level of access granted for each API. Valid values: create, list, get, update, and delete.

  • Resource type: The type of the resource that supports authorization to perform the action. It indicates if the action supports resource-level permission. The specified resource must be compatible with the action. Otherwise, the policy will be ineffective.

    • For APIs with resource-level permissions, required resource types are marked with an asterisk (*). Specify the corresponding Alibaba Cloud Resource Name (ARN) in the Resource element of the policy.

    • For APIs without resource-level permissions, it is shown as All Resources. Use an asterisk (*) in the Resource element of the policy.

  • Condition key: The condition keys defined by the service. The key allows for granular control, applying to either actions alone or actions associated with specific resources. In addition to service-specific condition keys, Alibaba Cloud provides a set of common condition keys applicable across all RAM-supported services.

  • Dependent action: The dependent actions required to run the action. To complete the action, the RAM user or the RAM role must have the permissions to perform all dependent actions.

Action

Access level

Resource type

Condition key

Dependent action

vpc:DescribeVpcs

list

VPC

acs:vpc:{#regionId}:{#accountId}:vpc/*

VPC

acs:vpc:{#regionId}:{#accountId}:vpc/{#VPCId}

  • vpc:tag
None

Request parameters

Parameter

Type

Required

Description

Example

VpcId

string

No

The ID of the VPC.

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

vpc-bp1b1xjllp3ve5yze****

RegionId

string

Yes

The region ID of the VPC.

You can call the DescribeRegions operation to query the region ID.

cn-hangzhou

VpcName

string

No

The name of the VPC.

Vpc-1

IsDefault

boolean

No

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

  • true (default): Queries the default VPC in the specified region.

  • false: Does not query the default VPC.

false

DryRun

boolean

No

Specifies whether to perform a dry run. Valid values:

  • true: performs a dry run. The system checks the request for potential issues, including invalid AccessKey pairs, unauthorized RAM users, and missing parameter values. If the check fails, the corresponding error is returned. If the check succeeds, the DryRunOperation error code is returned.

  • false (default): sends a normal request. If the check succeeds, an HTTP 2xx status code is returned and the resource is queried.

false

ResourceGroupId

string

No

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

rg-acfmxvfvazb4p****

PageNumber

integer

No

The page number. Default value: 1.

1

PageSize

integer

No

The number of entries per page for paging. Maximum value: 50. Default value: 10.

10

VpcOwnerId

integer

No

The Alibaba Cloud account ID of the VPC owner.

253460731706911258

DhcpOptionsSetId

string

No

The ID of the DHCP options set.

dopt-o6w0df4epg9zo8isy****

EnableIpv6

boolean

No

Specifies whether to query VPCs that have IPv6 CIDR blocks enabled in the specified region. The default value is empty, which means no filtering is performed based on IPv6 enablement. Valid values:

  • false: IPv6 is not enabled.

  • true: IPv6 is enabled.

false

Tag

array<object>

No

The tags of the resource.

object

No

The tag.

Key

string

No

The tag key of the resource. You can specify up to 20 tag keys. The tag key cannot be an empty string.

The tag key can be up to 128 characters in length. It cannot start with aliyun or acs:, and cannot contain http:// or https://.

FinanceDept

Value

string

No

The tag value of the resource. You can specify up to 20 tag values. The tag value can be an empty string.

The tag value can be up to 128 characters in length. It cannot start with aliyun or acs:, and cannot contain http:// or https://.

FinanceJoshua

Response elements

Element

Type

Description

Example

object

The returned information.

PageSize

integer

The number of entries per page for paging.

10

RequestId

string

The request ID.

C6532AA8-D0F7-497F-A8EE-094126D441F5

PageNumber

integer

The page number.

1

TotalCount

integer

The total number of entries returned.

2

Vpcs

object

Vpc

array<object>

The details of the VPC.

array<object>

The details of the VPC.

CreationTime

string

The time when the VPC was created.

2021-04-18T15:02:37Z

Status

string

The status of the VPC. Valid values:

  • Pending

  • Available

Available

VpcId

string

The VPC ID.

vpc-bp1qpo0kug3a20qqe****

IsDefault

boolean

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

  • true

  • false

false

OwnerId

integer

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

253460731706911258

RegionId

string

The ID of the region to which the VPC belongs.

cn-hangzhou

VpcName

string

The name of the VPC.

vpc1

VRouterId

string

The ID of the vRouter.

vrt-bp1jcg5cmxjbl9xgc****

DhcpOptionsSetStatus

string

The status of the DHCP options set. Valid values:

  • Available

  • InUse

  • Deleted

  • Pending

Available

CidrBlock

string

The IPv4 CIDR block of the VPC.

192.168.0.0/16

Description

string

The description of the VPC.

This is my VPC.

ResourceGroupId

string

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

rg-acfmxazb4ph****

DhcpOptionsSetId

string

The ID of the DHCP options set.

dopt-o6w0df4epg9zo8isy****

Ipv6CidrBlock

string

The IPv6 CIDR block of the VPC.

2408:XXXX:0:a600::/56

CenStatus

string

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

Valid values:

  • Attached: The VPC is attached to a CEN instance.

  • Detached: The VPC is not attached to a CEN instance.

Attached

Tags

object

Tag

array<object>

The tag information about the VPC.

object

Key

string

The key of tag N.

FinanceDept

Value

string

The value of tag N.

FinanceJoshua

Ipv6CidrBlocks

object

Ipv6CidrBlock

array<object>

The IPv6 CIDR block of the VPC.

object

Ipv6Isp

string

The type of IPv6 CIDR block. Valid values:

  • BGP

  • ChinaMobile

  • ChinaUnicom

  • ChinaTelecom Note

Note

If your Alibaba Cloud account is allowed to activate single-ISP bandwidth, you can set this parameter to ChinaTelecom,ChinaUnicom, or ChinaMobile.

BGP

Ipv6CidrBlock

string

The IPv6 CIDR block of the VPC.

2408:XXXX:0:a600::/56

VSwitchIds

object

VSwitchId

array

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.

string

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.

vsw-bp1nhbnpv2blyz8dl****

SecondaryCidrBlocks

object

SecondaryCidrBlock

array

The information about the secondary CIDR block.

string

The secondary CIDR block of the VPC.

192.168.20.0/24

UserCidrs

object

UserCidr

array

The list of user CIDR blocks.

string

The list of user CIDR blocks.

10.0.0.0/8

NatGatewayIds

object

NatGatewayIds

array

The ID of the Internet NAT gateway.

string

The ID of the Internet NAT gateway.

nat-245xxxftwt45bg****

RouterTableIds

object

RouterTableIds

array

The information about the route table.

string

The ID of the route table.

vtb-bp1krxxzp0c29fmon****

EnabledIpv6

boolean

Indicates whether the IPv6 is enabled.

Valid values:

  • false: false

  • true: true

false

DnsHostnameStatus

string

Indicates whether the Domain Name System (DNS) feature is enabled.

DISABLED

Examples

Success response

JSON format

{
  "PageSize": 10,
  "RequestId": "C6532AA8-D0F7-497F-A8EE-094126D441F5",
  "PageNumber": 1,
  "TotalCount": 2,
  "Vpcs": {
    "Vpc": [
      {
        "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": {
          "Tag": [
            {
              "Key": "FinanceDept",
              "Value": "FinanceJoshua"
            }
          ]
        },
        "Ipv6CidrBlocks": {
          "Ipv6CidrBlock": [
            {
              "Ipv6Isp": "BGP",
              "Ipv6CidrBlock": "2408:XXXX:0:a600::/56"
            }
          ]
        },
        "VSwitchIds": {
          "VSwitchId": [
            "vsw-bp1nhbnpv2blyz8dl****"
          ]
        },
        "SecondaryCidrBlocks": {
          "SecondaryCidrBlock": [
            "192.168.20.0/24"
          ]
        },
        "UserCidrs": {
          "UserCidr": [
            "10.0.0.0/8"
          ]
        },
        "NatGatewayIds": {
          "NatGatewayIds": [
            "nat-245xxxftwt45bg****"
          ]
        },
        "RouterTableIds": {
          "RouterTableIds": [
            "vtb-bp1krxxzp0c29fmon****"
          ]
        },
        "EnabledIpv6": false,
        "DnsHostnameStatus": "DISABLED"
      }
    ]
  }
}

Error codes

HTTP status code

Error code

Error message

Description

400 InvalidVpcIdNumber.NotSupported The number of vpcIds exceeds the limit. The value of the vpcId parameter has reached the upper limit.
400 InvalidAliuid User Id is not valid.
400 InvalidResourceGroupId The specified ResourceGroupId does not exist. The specified resource group ID does not exist.
400 InvalidTagKey The tag keys are not valid. The tag index is invalid.
400 InvalidTagValue The tag values are not valid. The tag value is invalid.
400 InvalidResourceGroupId.NotFound The Specified ResourceGroupId not exists.
400 OperationUnsupported.ResourceGroupId %s
400 IellgalParameter.OwnerAccount The specified parameter OwnerAccount is not valid. The specified parameter OwnerAccount is illegal.
400 IllegalParam.OwnerId The specified parameter VpcOwnerId is not valid.
400 InvalidAccount.NotFound The account is invalid. The operation failed because an invalid account is used.
500 InternalError The request processing has failed due to some unknown error.

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.