Queries the detailed information about a specified virtual private cloud (VPC).

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 DescribeVpcAttribute

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

VpcId String Yes vpc-bp18sth14qii3pnv****

The ID of the VPC that you want to query.

RegionId String Yes cn-hangzhou

The region ID of the VPC.

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

DryRun Boolean No false

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

  • true: checks the request without performing the operation. 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 the check, an error message is returned. If the request passes the check, the DryRunOperation error code is returned.
  • false: sends the request. After the request passes the check, a 2xx HTTP status code is returned and the operation is performed. This is the default value.
IsDefault Boolean No false

Specifies whether the VPC is the default VPC. Valid values:

  • false (default): no
  • true: yes

Response parameters

Parameter Type Example Description
CreationTime String 2021-10-16T07:31:09Z

The time when the VPC was created.

Status String Available

The status of the VPC. Valid values:

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

The ID of the VPC.

IsDefault Boolean false

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

  • true: yes
  • false (default): no
ClassicLinkEnabled Boolean false

Indicates whether the ClassicLink feature is enabled. Valid values:

  • true: yes
  • false (default): no
OwnerId Long 283117732402483989

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

RegionId String cn-hangzhou

The region ID of the VPC.

VpcName String doctest2

The name of the VPC.

VRouterId String vrt-bp1jso6ng1at0ajsc****

The ID of the vRouter that belongs to the VPC.

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.

RequestId String 7486AE4A-129D-43DB-A714-2432C074BA04

The ID of the request.

Description String VPC

The description of the VPC.

ResourceGroupId String rg-acfmxazbvgb4ph****

The ID of the resource group.

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.

VSwitchIds Array of String null

The list of vSwitches deployed in the VPC.

UserCidrs Array of String 172.16.0.1/24

The user CIDR block. Multiple CIDR blocks are separated by commas (,). At most three CIDR blocks are returned.

SecondaryCidrBlocks Array of String 192.168.0.0/16

The secondary IPv4 CIDR block of the VPC.

AssociatedCens Array of AssociatedCen

The list of Cloud Enterprise Network (CEN) instances to which the VPC is attached.

If the VPC is not attached to a CEN instance, the parameter is not returned.

AssociatedCen
CenOwnerId Long 283117732402483989

The ID of the Alibaba Cloud account to which the CEN instance belongs.

CenId String cen-7qthudw0ll6jmc****

The ID of the CEN instance to which the VPC is attached.

CenStatus String Attached

The status of the CEN instance to which the VPC is attached.

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

CloudResources Array of CloudResourceSetType

The list of resources deployed in the VPC.

CloudResourceSetType
ResourceCount Integer 1

The number of resources deployed in the VPC.

ResourceType String VSwitch

The type of resources deployed in the VPC. Valid values:

  • VSwitch: vSwitches
  • VRouter: vRouters
  • RouteTable: route tables
Ipv6CidrBlocks Array of Ipv6CidrBlock

The information about the IPv6 CIDR blocks of the VPC.

Ipv6CidrBlock
Ipv6Isp String BGP

The type of the IPv6 CIDR block. Valid values:

  • BGP (default): 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:6a::/56

The IPv6 CIDR block of the VPC.

SupportIpv4Gateway Boolean true

Indicates whether the VPC supports IPv4 gateways.

  • true: yes
  • false: no
Ipv4GatewayId String ipv4gw-5tsnc6s4ogsedtp3k****

The ID of the IPv4 gateway.

Examples

Sample requests

http(s)://[Endpoint]/?Action=DescribeVpcAttribute
&ResourceOwnerId=283117732402483989
&VpcId=vpc-bp18sth14qii3pnv****
&RegionId=cn-hangzhou
&DryRun=false
&IsDefault=false
&Common request parameters

Sample success responses

XML format

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

<DescribeVpcAttributeResponse>
    <CreationTime>2021-10-16T07:31:09Z</CreationTime>
    <Status>Available</Status>
    <VpcId>vpc-bp18sth14qii3pnvo****</VpcId>
    <IsDefault>false</IsDefault>
    <ClassicLinkEnabled>false</ClassicLinkEnabled>
    <OwnerId>283117732402484000</OwnerId>
    <RegionId>cn-hangzhou</RegionId>
    <VpcName>doctest2</VpcName>
    <VRouterId>vrt-bp1jso6ng1at0ajsc****</VRouterId>
    <DhcpOptionsSetStatus>Available</DhcpOptionsSetStatus>
    <CidrBlock>192.168.0.0/16</CidrBlock>
    <RequestId>7486AE4A-129D-43DB-A714-2432C074BA04</RequestId>
    <Description>VPC</Description>
    <ResourceGroupId>rg-acfmxazbvgb4ph****</ResourceGroupId>
    <DhcpOptionsSetId>dopt-o6w0df4epg9zo8isy****</DhcpOptionsSetId>
    <Ipv6CidrBlock>2408:XXXX:0:a600::/56</Ipv6CidrBlock>
    <VSwitchIds>{"VSwitchId": [ "vsw-bp14cagpfysr29feg****" ]}</VSwitchIds>
    <UserCidrs>172.16.0.1/24</UserCidrs>
    <SecondaryCidrBlocks>192.168.0.0/16</SecondaryCidrBlocks>
    <AssociatedCens>
        <CenOwnerId>283117732402484000</CenOwnerId>
        <CenId>cen-7qthudw0ll6jmc****</CenId>
        <CenStatus>Attached</CenStatus>
    </AssociatedCens>
    <CloudResources>
        <ResourceCount>1</ResourceCount>
        <ResourceType>VSwitch</ResourceType>
    </CloudResources>
    <Ipv6CidrBlocks>
        <Ipv6Isp>BGP</Ipv6Isp>
        <Ipv6CidrBlock>2408:XXXX:0:6a::/56</Ipv6CidrBlock>
    </Ipv6CidrBlocks>
    <SupportIpv4Gateway>true</SupportIpv4Gateway>
    <Ipv4GatewayId>ipv4gw-5tsnc6s4ogsedtp3k****</Ipv4GatewayId>
</DescribeVpcAttributeResponse>

JSON format

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

{
  "CreationTime" : "2021-10-16T07:31:09Z",
  "Status" : "Available",
  "VpcId" : "vpc-bp18sth14qii3pnvo****",
  "IsDefault" : false,
  "ClassicLinkEnabled" : false,
  "OwnerId" : 283117732402484000,
  "RegionId" : "cn-hangzhou",
  "VpcName" : "doctest2",
  "VRouterId" : "vrt-bp1jso6ng1at0ajsc****",
  "DhcpOptionsSetStatus" : "Available",
  "CidrBlock" : "192.168.0.0/16",
  "RequestId" : "7486AE4A-129D-43DB-A714-2432C074BA04",
  "Description" : "VPC",
  "ResourceGroupId" : "rg-acfmxazbvgb4ph****",
  "DhcpOptionsSetId" : "dopt-o6w0df4epg9zo8isy****",
  "Ipv6CidrBlock" : "2408:XXXX:0:a600::/56",
  "VSwitchIds" : [ "{\"VSwitchId\": [ \"vsw-bp14cagpfysr29feg****\" ]}" ],
  "UserCidrs" : [ "172.16.0.1/24" ],
  "SecondaryCidrBlocks" : [ "192.168.0.0/16" ],
  "AssociatedCens" : [ {
    "CenOwnerId" : 283117732402484000,
    "CenId" : "cen-7qthudw0ll6jmc****",
    "CenStatus" : "Attached"
  } ],
  "CloudResources" : [ {
    "ResourceCount" : 1,
    "ResourceType" : "VSwitch"
  } ],
  "Ipv6CidrBlocks" : [ {
    "Ipv6Isp" : "BGP",
    "Ipv6CidrBlock" : "2408:XXXX:0:6a::/56"
  } ],
  "SupportIpv4Gateway" : true,
  "Ipv4GatewayId" : "ipv4gw-5tsnc6s4ogsedtp3k****"
}

Error codes

HttpCode Error code Error message Description
400 IncorrectVpcStatus Current VPC status does not support this operation. The error message returned because this operation cannot be performed when the VPC is in the current state.
404 InvalidVpcId.NotFound Specified VPC does not exist. The error message returned because the specified VPC does not exist.
500 InternalError The request processing has failed due to some unknown error. The error message returned because an unknown error occurred.

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