Queries the configuration of a virtual private cloud (VPC).
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.
Operation | Access level | Resource type | Condition key | Associated operation |
---|---|---|---|---|
vpc:DescribeVpcAttribute | get |
|
| none |
Request parameters
Parameter | Type | Required | Description | Example |
---|---|---|---|---|
VpcId | string | Yes | The ID of the VPC that you want to query. | vpc-bp18sth14qii3pnv**** |
RegionId | string | Yes | 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 |
DryRun | boolean | No | Specifies whether to perform only a dry run, without performing the actual request. Valid values:
| false |
IsDefault | boolean | No | Specifies whether the VPC is the default VPC. Valid values:
| false |
Response parameters
Examples
Sample success responses
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
}
Error codes
HTTP status code | Error code | Error message | Description |
---|---|---|---|
400 | IncorrectVpcStatus | Current VPC status does not support this operation. | This operation cannot be performed when the VPC is in the current state. |
500 | InternalError | The 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 time | Summary of changes | Operation |
---|---|---|
2024-08-27 | The Error code has changed. The response structure of the API has changed | View Change Details |
2024-06-24 | The Error code has changed | View Change Details |
2024-04-09 | The Error code has changed. The response structure of the API has changed | View Change Details |
2024-01-05 | API Description Update. The Error code has changed. The response structure of the API has changed | View Change Details |
2023-05-17 | The Error code has changed. The response structure of the API has changed | View Change Details |