Queries virtual private clouds (VPCs) in a specified region.
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 | Read |
|
| none |
Request parameters
Parameter | Type | Required | Description | Example |
---|---|---|---|---|
VpcId | string | No | The ID of the VPC. 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 check the request without performing the operation. 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 number of the page to return. Default value: 1. | 1 |
PageSize | integer | No | The number of entries to return 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**** |
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****"
]
}
}
]
}
}
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. | - |
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 | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
2023-07-26 | The error codes of the API operation change. | see changesets | ||||||||||||
| ||||||||||||||
2023-07-26 | API Description Update,The error codes of the API operation change.,The input parameters of the API operation change. | see changesets | ||||||||||||
| ||||||||||||||
2023-06-13 | The error codes of the API operation change. | see changesets | ||||||||||||
|