Queries virtual private clouds (VPCs).
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:DescribeVpcs | list | *VPC acs:vpc:{#regionId}:{#accountId}:vpc/* *VPC acs:vpc:{#regionId}:{#accountId}:vpc/{#VPCId} |
| none |
Request parameters
Parameter | Type | Required | Description | Example |
---|---|---|---|---|
VpcId | string | No | The VPC ID. You can specify up to 20 VPC IDs. Separate multiple IDs with commas (,). | vpc-bp1b1xjllp3ve5yze**** |
RegionId | string | Yes | The region ID of the VPC. You can call the DescribeRegions operation to query the most recent region list. | cn-hangzhou |
VpcName | string | No | The name of the VPC. | Vpc-1 |
IsDefault | boolean | No | Specifies whether to query the default VPC in the specified region. Valid values:
| false |
DryRun | boolean | No | Specifies whether to perform only a dry run, without performing the actual request. Valid values:
| false |
ResourceGroupId | string | No | The ID of the resource group to which the VPC to be queried belongs. | rg-acfmxvfvazb4p**** |
PageNumber | integer | No | The page number. Default value: 1. | 1 |
PageSize | integer | No | The number of entries per page. Maximum value: 50. Default value: 10. | 10 |
VpcOwnerId | long | No | The ID of the Alibaba Cloud account to which the VPC belongs. | 253460731706911258 |
DhcpOptionsSetId | string | No | The ID of the DHCP options set. | dopt-o6w0df4epg9zo8isy**** |
EnableIpv6 | boolean | No | Query for VPCs in the specified region that have enabled IPv6 CIDR blocks. The value is empty by default, which means no filtering based on IPv6 availability is conducted. Valid values:
| false |
Tag | array<object> | No | The tags of the resource. | |
object | No | |||
Key | string | No | The key of tag N to add to the resource. You can specify at most 20 tag keys. The tag key cannot be an empty string. The tag key can be up to 128 characters in length. It cannot start with | FinanceDept |
Value | string | No | The value of tag N to add to the resource. You can specify at most 20 tag values. The tag value can be an empty string. The tag value can be up to 128 characters in length, and cannot contain | FinanceJoshua |
Response parameters
Examples
Sample success responses
JSON
format
{
"PageSize": 10,
"RequestId": "C6532AA8-D0F7-497F-A8EE-094126D441F5",
"PageNumber": 1,
"TotalCount": 2,
"Vpcs": {
"Vpc": [
{
"CreationTime": "2021-04-18T15:02:37Z",
"Status": "Available",
"VpcId": "vpc-bp1qpo0kug3a20qqe****",
"IsDefault": false,
"OwnerId": 253460731706911260,
"RegionId": "cn-hangzhou",
"VpcName": "vpc1",
"VRouterId": "vrt-bp1jcg5cmxjbl9xgc****",
"DhcpOptionsSetStatus": "Available",
"CidrBlock": "192.168.0.0/16",
"Description": "This is my VPC.",
"ResourceGroupId": "rg-acfmxazb4ph****",
"DhcpOptionsSetId": "dopt-o6w0df4epg9zo8isy****",
"Ipv6CidrBlock": "2408:XXXX:0:a600::/56",
"CenStatus": "Attached",
"Tags": {
"Tag": [
{
"Key": "env",
"Value": "internal"
}
]
},
"Ipv6CidrBlocks": {
"Ipv6CidrBlock": [
{
"Ipv6Isp": "BGP",
"Ipv6CidrBlock": "2408:XXXX:0:a600::/56"
}
]
},
"VSwitchIds": {
"VSwitchId": [
"vsw-bp1nhbnpv2blyz8dl****"
]
},
"SecondaryCidrBlocks": {
"SecondaryCidrBlock": [
"192.168.20.0/24"
]
},
"UserCidrs": {
"UserCidr": [
"10.0.0.0/8"
]
},
"NatGatewayIds": {
"NatGatewayIds": [
"nat-245xxxftwt45bg****"
]
},
"RouterTableIds": {
"RouterTableIds": [
"vtb-bp1krxxzp0c29fmon****"
]
},
"EnabledIpv6": false,
"DnsHostnameStatus": "DISABLED"
}
]
}
}
Error codes
HTTP status code | Error code | Error message | Description |
---|---|---|---|
400 | InvalidVpcIdNumber.NotSupported | The number of vpcIds exceeds the limit. | The value of the vpcId parameter has reached the upper limit. |
400 | InvalidAliuid | User Id is not valid. | - |
400 | InvalidResourceGroupId | The specified ResourceGroupId does not exist. | The specified resource group ID does not exist. |
400 | InvalidTagKey | The tag keys are not valid. | The tag index is invalid. |
400 | InvalidTagValue | The tag values are not valid. | The tag value is invalid. |
400 | InvalidResourceGroupId.NotFound | The Specified ResourceGroupId not exists. | - |
400 | OperationUnsupported.ResourceGroupId | %s | - |
400 | IellgalParameter.OwnerAccount | The specified parameter OwnerAccount is not valid. | The specified parameter OwnerAccount is illegal. |
400 | IllegalParam.OwnerId | The specified parameter VpcOwnerId is not valid. | - |
400 | InvalidAccount.NotFound | The account is invalid. | The operation failed because an invalid account is used. |
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-10-10 | The Error code has changed. The response structure of the API has changed | View Change Details |
2024-08-27 | The Error code has changed. The response structure of the API has changed | View Change Details |
2024-05-16 | The Error code has changed. The request parameters of the API has changed | View Change Details |
2024-04-09 | The Error code has changed. The response structure of the API has changed | View Change Details |
2023-07-26 | The Error code has changed | View Change Details |
2023-07-26 | API Description Update. The Error code has changed. The request parameters of the API has changed | View Change Details |
2023-06-13 | The Error code has changed | View Change Details |