Queries the configuration of a specified VPC.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
vpc:DescribeVpcAttribute |
get |
*VPC
|
|
None |
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| VpcId |
string |
Yes |
The ID of the VPC. |
vpc-bp18sth14qii3pnv**** |
| RegionId |
string |
Yes |
The region ID of the VPC. You can call the DescribeRegions operation to query the region ID. |
cn-hangzhou |
| DryRun |
boolean |
No |
Specifies whether to perform only a dry run for this request. Valid values:
|
false |
| IsDefault |
boolean |
No |
Specifies whether the VPC is the default VPC. Valid values:
|
false |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
The creation time of the VPC. |
||
| CreationTime |
string |
The time when the VPC was created. The time is displayed in UTC and follows the ISO 8601 standard in the YYYY-MM-DDThh:mm:ssZ format. |
2021-10-16T07:31:09Z |
| Status |
string |
The status of the VPC. Valid values:
|
Available |
| VpcId |
string |
The ID of the VPC. |
vpc-bp18sth14qii3pnvo**** |
| IsDefault |
boolean |
Indicates whether the VPC is the default VPC. Valid values:
|
false |
ClassicLinkEnabled
deprecated
|
boolean |
Indicates whether the ClassicLink feature is enabled. Valid values:
|
false |
| OwnerId |
integer |
The ID of the account to which the VPC belongs. |
28311773240248**** |
| RegionId |
string |
The region ID of the VPC. |
cn-hangzhou |
| VpcName |
string |
The name of the VPC. |
doctest2 |
| VRouterId |
string |
The ID of the vRouter of the VPC. |
vrt-bp1jso6ng1at0ajsc**** |
| DhcpOptionsSetStatus |
string |
The status of the DHCP options set. Valid values:
|
Available |
| CidrBlock |
string |
The IPv4 CIDR block of the VPC. |
192.168.0.0/16 |
| RequestId |
string |
The request ID. |
7486AE4A-129D-43DB-A714-2432C074BA04 |
| Description |
string |
The description of the VPC. |
VPC |
| ResourceGroupId |
string |
The ID of the resource group. |
rg-acfmxazbvgb4ph**** |
| 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 |
| VSwitchIds |
object |
||
| VSwitchId |
array |
The list of vSwitches in the VPC. |
|
|
string |
The list of vSwitches in the VPC. |
{"VSwitchId": [ "vsw-bp14cagpfysr29feg****" ]} |
|
| UserCidrs |
object |
||
| UserCidr |
array |
The CIDR blocks of the user-side network. If multiple CIDR blocks are defined, they are separated by commas (,) in the response. A maximum of three CIDR blocks are supported. |
|
|
string |
The CIDR blocks of the user-side network. If multiple CIDR blocks are defined, they are separated by commas (,) in the response. A maximum of three CIDR blocks are supported. |
172.16.0.1/24 |
|
| SecondaryCidrBlocks |
object |
||
| SecondaryCidrBlock |
array |
The secondary IPv4 CIDR blocks of the VPC. |
|
|
string |
The secondary IPv4 CIDR blocks of the VPC. |
192.168.0.0/16 |
|
| AssociatedCens |
object |
||
| AssociatedCen |
array<object> |
The list of associated Cloud Enterprise Network (CEN) instances. If the VPC is not associated with a CEN instance, this parameter is not returned. |
|
|
object |
The ID of the account to which the CEN instance belongs. |
||
| CenOwnerId |
integer |
The ID of the account to which the CEN instance belongs. |
28311773240248**** |
| CenId |
string |
The instance ID of the CEN instance attached to the VPC. |
cen-7qthudw0ll6jmc**** |
| CenStatus |
string |
The status of the VPC associated with the CEN instance. This parameter returns Attached only when the VPC is associated with a CEN instance. |
Attached |
| CloudResources |
object |
||
| CloudResourceSetType |
array<object> |
The list of resources in the VPC. |
|
|
object |
The resource count in the VPC. |
||
| ResourceCount |
integer |
The resource count in the VPC. |
1 |
| ResourceType |
string |
The type of resource in the VPC. Valid values:
|
VSwitch |
| Ipv6CidrBlocks |
object |
||
| Ipv6CidrBlock |
array<object> |
The IPv6 CIDR block information of the VPC. |
|
|
object |
The IPv6 CIDR block information of the VPC. |
||
| Ipv6Isp |
string |
The ISP type of the IPv6 CIDR block of the VPC. Valid values:
Note
If you are added to the whitelist for single-line bandwidth, you can set this parameter to ChinaTelecom, ChinaUnicom, or ChinaMobile. |
BGP |
| Ipv6CidrBlock |
string |
The IPv6 CIDR block of the VPC. |
2408:XXXX:0:6a::/56 |
| SupportIpv4Gateway |
boolean |
Indicates whether the VPC operates in the centralized control mode with the IPv4 gateway. Valid values:
Note
For more information, see IPv4 gateway. |
true |
| Ipv4GatewayId |
string |
The instance ID of the IPv4 gateway. |
ipv4gw-5tsnc6s4ogsedtp3k**** |
| Tags |
object |
||
| Tag |
array<object> |
The list of tags. |
|
|
object |
The list of tags. |
||
| Key |
string |
The tag key. |
FinanceDept |
| Value |
string |
The tag value. |
FinanceJoshua |
| AssociatedPropagationSources |
object |
||
| AssociatedPropagationSources |
array<object> |
The route propagation sources associated with the VPC. |
|
|
object |
|||
| SourceType |
string |
The type of the propagation source. Valid values:
|
CEN |
| SourceOwnerId |
integer |
The ID of the account to which the propagation source belongs. |
153980532164**** |
| SourceInstanceId |
string |
The instance ID of the propagation source. |
cen-dc4vwznpwbobrl**** |
| Status |
string |
The association status. Valid values:
|
Attaching |
| RoutePropagated |
boolean |
Indicates whether routes are propagated to the VPC. |
true |
| EnabledIpv6 |
boolean |
Indicates whether IPv6 is enabled. Valid values:
|
false |
| DnsHostnameStatus |
string |
Indicates whether the DNS hostname feature is enabled. |
DISABLED |
Examples
Success response
JSON format
{
"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,
"DnsHostnameStatus": "DISABLED"
}
Error codes
|
HTTP status code |
Error code |
Error message |
Description |
|---|---|---|---|
| 400 | IncorrectVpcStatus | Current VPC status does not support this operation. | |
| 400 | Forbidden.VpcNotFound | Specified VPC does not exist. | |
| 500 | InternalError | The request processing has failed due to some unknown error. | |
| 404 | InvalidVpcId.NotFound | Specified VPC does not exist. |
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.