All Products
Search
Document Center

Virtual Private Cloud:DescribeVpcAttribute

Last Updated:Dec 02, 2023

Queries the configuration of a virtual private cloud (VPC).

debugging

You can run this interface directly in OpenAPI Explorer, saving you the trouble of calculating signatures. After running successfully, OpenAPI Explorer can automatically generate SDK code samples.

debugging

Authorization information

The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:

  • Operation: the value that you can use in the Action element to specify the operation on a resource.
  • Access level: the access level of each operation. The levels are read, write, and list.
  • Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
    • The required resource types are displayed in bold characters.
    • If the permissions cannot be granted at the resource level, All Resources is used in the Resource type column of the operation.
  • Condition Key: the condition key that is defined by the cloud service.
  • Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
OperationAccess levelResource typeCondition keyAssociated operation
vpc:DescribeVpcAttributeRead
  • VPC
    acs:vpc:{#regionId}:{#accountId}:vpc/{#VpcId}
  • vpc:tag
none

Request parameters

ParameterTypeRequiredDescriptionExample
VpcIdstringYes

The ID of the VPC that you want to query.

vpc-bp18sth14qii3pnv****
RegionIdstringYes

The ID of the region where the VPC is deployed.

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

cn-hangzhou
DryRunbooleanNo

Specifies whether to perform only a dry run, without performing the actual request. Valid values:

  • true: performs only a dry run. The system checks the request for potential issues, including missing parameter values, incorrect request syntax, and service limits. If the request fails the dry run, an error message is returned. If the request passes dry run, the DryRunOperation error code is returned.
  • false (default): performs a dry run and performs the actual request. If the request passes the dry run, a 2xx HTTP status code is returned and the operation is performed.
false
IsDefaultbooleanNo

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

  • false (default)
  • true
false

Response parameters

ParameterTypeDescriptionExample
object

The time when the VPC was created.

CreationTimestring

The time when the VPC was created.

2021-10-16T07:31:09Z
Statusstring

The status of the VPC. Valid values:

  • Available
  • Pending
Available
VpcIdstring

The ID of the VPC.

vpc-bp18sth14qii3pnvo****
IsDefaultboolean

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

  • true
  • false (default)
false
ClassicLinkEnabledboolean

Indicates whether the ClassicLink feature is enabled. Valid values:

  • true
  • false (default)
false
OwnerIdlong

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

283117732402483989
RegionIdstring

The ID of the region to which the VPC belongs.

cn-hangzhou
VpcNamestring

The name of the VPC.

doctest2
VRouterIdstring

The ID of the vRouter that belongs to the VPC.

vrt-bp1jso6ng1at0ajsc****
DhcpOptionsSetStatusstring

The status of the DHCP options set. Valid values:

  • Available
  • InUse
  • Deleted
  • Pending
Available
CidrBlockstring

The IPv4 CIDR block of the VPC.

192.168.0.0/16
RequestIdstring

The request ID.

7486AE4A-129D-43DB-A714-2432C074BA04
Descriptionstring

The description of the VPC.

VPC
ResourceGroupIdstring

The ID of the resource group.

rg-acfmxazbvgb4ph****
DhcpOptionsSetIdstring

The ID of the DHCP options set.

dopt-o6w0df4epg9zo8isy****
Ipv6CidrBlockstring

The IPv6 CIDR block of the VPC.

2408:XXXX:0:a600::/56
VSwitchIdsarray

The list of vSwitches deployed in the VPC.

string

The list of vSwitches deployed in the VPC.

{"VSwitchId": [ "vsw-bp14cagpfysr29feg****" ]}
UserCidrsarray

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

string

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

172.16.0.1/24
SecondaryCidrBlocksarray

The secondary IPv4 CIDR block of the VPC.

string

The secondary IPv4 CIDR block of the VPC.

192.168.0.0/16
AssociatedCensobject []

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.

CenOwnerIdlong

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

283117732402483989
CenIdstring

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

cen-7qthudw0ll6jmc****
CenStatusstring

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.

Attached
CloudResourcesobject []

The list of resources deployed in the VPC.

ResourceCountinteger

The number of resources deployed in the VPC.

1
ResourceTypestring

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

  • VSwitch
  • VRouter
  • RouteTable
VSwitch
Ipv6CidrBlocksobject []

The IPv6 CIDR block of the VPC.

Ipv6Ispstring

The type of the IPv6 CIDR block. Valid values:

  • BGP (default)
  • ChinaMobile
  • ChinaUnicom
  • ChinaTelecom
Note If your Alibaba Cloud account is allowed to activate single-ISP bandwidth, you can set this parameter to ChinaTelecom, ChinaUnicom, or ChinaMobile.
BGP
Ipv6CidrBlockstring

The IPv6 CIDR block of the VPC.

2408:XXXX:0:6a::/56
SupportIpv4Gatewayboolean

Indicates whether the VPC supports IPv4 gateways.

  • true
  • false
true
Ipv4GatewayIdstring

The ID of the IPv4 gateway.

ipv4gw-5tsnc6s4ogsedtp3k****
Tagsobject []

The information about the tags.

Keystring

The key of tag N added to the resource.

FinanceDept
Valuestring

The value of tag N added to the resource.

FinanceJoshua

Examples

Sample success responses

JSONformat

{
  "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": [
      "{\"VSwitchId\": [ \"vsw-bp14cagpfysr29feg****\" ]}"
    ]
  },
  "UserCidrs": {
    "UserCidr": [
      "172.16.0.1/24"
    ]
  },
  "SecondaryCidrBlocks": {
    "SecondaryCidrBlock": [
      "192.168.0.0/16"
    ]
  },
  "AssociatedCens": {
    "AssociatedCen": [
      {
        "CenOwnerId": 283117732402484000,
        "CenId": "cen-7qthudw0ll6jmc****",
        "CenStatus": "Attached"
      }
    ]
  },
  "CloudResources": {
    "CloudResourceSetType": [
      {
        "ResourceCount": 1,
        "ResourceType": "VSwitch"
      }
    ]
  },
  "Ipv6CidrBlocks": {
    "Ipv6CidrBlock": [
      {
        "Ipv6Isp": "BGP",
        "Ipv6CidrBlock": "2408:XXXX:0:6a::/56"
      }
    ]
  },
  "SupportIpv4Gateway": true,
  "Ipv4GatewayId": "ipv4gw-5tsnc6s4ogsedtp3k****",
  "Tags": {
    "Tag": [
      {
        "Key": "FinanceDept",
        "Value": "FinanceJoshua"
      }
    ]
  }
}

Error codes

HTTP status codeError codeError messageDescription
400IncorrectVpcStatusCurrent VPC status does not support this operation.This operation cannot be performed when the VPC is in the current state.
400Forbidden.VpcNotFoundSpecified VPC does not exist.-
404InvalidVpcId.NotFoundSpecified VPC does not exist.The specified VPC does not exist.
500InternalErrorThe request processing has failed due to some unknown error.An unknown error occurred.

For a list of error codes, visit the Service error codes.

Change history

Change timeSummary of changesOperation
2023-05-17The error codes of the API operation change.,The response structure of the API operation changes.see changesets
Change itemChange content
Error CodesThe error codes of the API operation change.
    delete Error Codes: 400
    delete Error Codes: 404
    delete Error Codes: 500
Output ParametersThe response structure of the API operation changes.