All Products
Search
Document Center

Virtual Private Cloud:DescribeVpcAttribute

更新時間:Nov 13, 2024

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.

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:DescribeVpcAttributeget
  • 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.

28311773240248****
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.

VSwitchIdstring

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.

UserCidrstring

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.

SecondaryCidrBlockstring

The secondary IPv4 CIDR block of the VPC.

192.168.0.0/16
AssociatedCensarray<object>

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.

AssociatedCenobject
CenOwnerIdlong

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

28311773240248****
CenIdstring

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

cen-7qthudw0ll6jmc****
CenStatusstring

The status of the CEN instance.

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

Attached
CloudResourcesarray<object>

The list of resources deployed in the VPC.

CloudResourceSetTypeobject
ResourceCountinteger

The number of resources in the VPC.

1
ResourceTypestring

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

  • VSwitch
  • VRouter
  • RouteTable
VSwitch
Ipv6CidrBlocksarray<object>

The IPv6 CIDR block of the VPC.

Ipv6CidrBlockobject
Ipv6Ispstring

The IPv6 CIDR block type of the VPC. Valid values:

  • BGP (default)
  • ChinaMobile
  • ChinaUnicom
  • ChinaTelecom
Note If you are allowed to use single-ISP bandwidth, valid values are ChinaTelecom, ChinaUnicom, and 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****
Tagsarray<object>

The information about the tags.

Tagobject

The tags.

Keystring

The key of tag N.

FinanceDept
Valuestring

The value of tag N.

FinanceJoshua
AssociatedPropagationSourcesarray<object>

The route source associated with the VPC.

AssociatedPropagationSourcesobject
SourceTypestring

The source type.

  • CEN
  • VPN
  • TR
  • ECR
CEN
SourceOwnerIdlong

The account ID of the source.

153980532164****
SourceInstanceIdstring

The instance ID of the source.

cen-dc4vwznpwbobrl****
Statusstring

The binding status.

  • Attaching
  • Attached
  • Detaching
Attaching
RoutePropagatedboolean

Indicates whether routes are advertised to the VPC.

true
EnabledIpv6boolean

Indicates whether the VPC enables IPv6 .

  • true
  • false
false

Examples

Sample success responses

JSONformat

{
  "CreationTime": "2021-10-16T07:31:09Z",
  "Status": "Available",
  "VpcId": "vpc-bp18sth14qii3pnvo****",
  "IsDefault": false,
  "ClassicLinkEnabled": false,
  "OwnerId": 0,
  "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": 0,
        "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"
      }
    ]
  },
  "AssociatedPropagationSources": {
    "AssociatedPropagationSources": [
      {
        "SourceType": "CEN",
        "SourceOwnerId": 0,
        "SourceInstanceId": "cen-dc4vwznpwbobrl****",
        "Status": "Attaching",
        "RoutePropagated": true
      }
    ]
  },
  "EnabledIpv6": false
}

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.
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
2024-10-10The Error code has changed. The response structure of the API has changedView Change Details
2024-08-27The Error code has changed. The response structure of the API has changedView Change Details
2024-06-24The Error code has changedView Change Details
2024-04-09The Error code has changed. The response structure of the API has changedView Change Details
2024-01-05API Description Update. The Error code has changed. The response structure of the API has changedView Change Details
2023-05-17The Error code has changed. The response structure of the API has changedView Change Details