Queries detailed information about a 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.

RegionId String Yes cn-hangzhou

The ID of the region where the VPC is deployed.

VpcId String Yes vpc-bp18sth14qii3pnv****

The ID of the VPC that you want to query.

DryRun Boolean No false

Specifies whether to precheck the request.

  • true: prechecks the API request. Resources are not queried. The system checks whether your AccessKey pair is valid, whether the RAM user is authorized, and whether required parameters are set. If the request fails the precheck, the corresponding error code is returned. If the request passes the precheck, the DryRunOperation error code is returned.
  • false: sends the request. This is the default value. If the request passes the precheck, a 2XX HTTP status code is returned and the resource is queried.
IsDefault Boolean No false

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

  • false: no (default)
  • true: yes

Response parameters

Parameter Type Example Description
AssociatedCens Array of AssociatedCen

The list of Cloud Enterprise Network (CEN) instances that are associated with the VPC.

If the VPC is not associated with a CEN instance, no value is returned.

AssociatedCen
CenId String cen-7qthudw0ll6jmc****

The ID of the CEN instance that is associated with the VPC.

CenOwnerId Long 111111111111

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

CenStatus String Attached

The state of the associated CEN instance.

Attached is returned only when the VPC is associated with a CEN instance.

CidrBlock String 192.168.0.0/16

The IPv4 CIDR block of the VPC.

ClassicLinkEnabled Boolean false

Indicates whether the ClassicLink feature is enabled. Valid values:

  • true: enabled
  • false (default) disabled
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
CreationTime String 2020-10-16T07:31:09Z

The time when the VPC was created.

Description String VPC

The description of the VPC.

DhcpOptionsSetId String dopt-o6w0df4epg9zo8isy****

The ID of the DHCP options set.

DhcpOptionsSetStatus String Available

The state of the DHCP options set. Valid values:

  • Available: The DHCP options set is available for use.
  • InUse: The DHCP options set is being used.
  • Deleted:The DHCP options set is deleted.
  • Pending: The DHCP options set is being configured.
Ipv6CidrBlock String 2408:XXXX:0:a600::/56

The IPv6 CIDR block of the VPC.

Ipv6CidrBlocks Array of Ipv6CidrBlock

The IPv6 CIDR block of the VPC.

Ipv6CidrBlock
Ipv6CidrBlock String 2408:XXXX:0:6a::/56

The IPv6 CIDR block of the VPC.

Ipv6Isp String BGP

The Internet service provider (ISP) for IPv6 addresses of the VPC. Valid values:

  • BGP(default): Alibaba Cloud BGP IPv6
  • ChinaMobile: China Mobile (single line)
  • ChinaUnicom: China Unicom (single line)
  • ChinaTelecom: China Telecom (single line)
Note If your Alibaba Cloud account is allowed to activate single-ISP bandwidth, you can set the parameter to ChinaTelecom, ChinaUnicom, and ChinaMobile.
IsDefault Boolean false

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

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

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

RegionId String cn-hangzhou

The ID of the region where the VPC is deployed.

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

The ID of the request.

ResourceGroupId String rg-acfmxazbvgb4ph****

The ID of the resource group.

SecondaryCidrBlocks List 192.168.0.0/16

The secondary IPv4 CIDR block of the VPC.

Status String Available

The state of the VPC. Valid values:

  • Available: The VPC is available.
  • Pending: The VPC is being configured.
UserCidrs List 172.16.0.1/24

The user CIDR block. Separate multiple CIDR blocks with commas (,). You can specify at most three CIDR blocks.

VRouterId String vrt-bp1jso6ng1at0ajsc****

The ID of the vRouter that belongs to the VPC.

VSwitchIds List {"VSwitchId": [ "vsw-bp14cagpfysr29feg****" ]}

The list of vSwitches deployed in the VPC.

VpcId String vpc-bp18sth14qii3pnvo****

The ID of the virtual private cloud (VPC).

VpcName String doctest2

The name of the VPC.

Examples

Sample requests

http(s)://vpc.aliyuncs.com/?Action=DescribeVpcAttribute
&RegionId=cn-hangzhou
&VpcId=vpc-bp18sth14qii3pnv****
&<Common request parameters>

Sample success responses

XML format

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

JSON format

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

Error codes

HttpCode Error code Error message Description
500 InternalError The request processing has failed due to some unknown error. The error message returned because unknown errors have occurred.
400 IncorrectVpcStatus Current VPC status does not support this operation. The error message returned because the state of the VPC does not support this operation.
404 InvalidVpcId.NotFound Specified VPC does not exist. The error message returned because the specified VPC does not exist.

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