Queries a vSwitch.
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 |
---|---|---|---|---|
polardb:DescribeVSwitches | Read |
|
| none |
Request parameters
Parameter | Type | Required | Description | Example |
---|---|---|---|---|
RegionId | string | No | The ID of the region where the vSwitch belongs. | cn-hangzhou |
VpcId | string | No | The ID of the virtual private type (VPC) to which the vSwitch belongs. Note
You must specify at least one of the VpcId and DedicatedHostGroupId parameters.
| vpc-25cdvfeq58pl**** |
ZoneId | string | No | The ID of the zone to which the vSwitch belongs. | cn-hangzhou-d |
DedicatedHostGroupId | string | No | The dedicated cluster ID. Note
You must specify at least one of the VpcId and DedicatedHostGroupId parameters.
| dhg-4n**** |
PageNumber | integer | No | The page 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: 50. | 50 |
ResourceGroupId | string | No | The ID of the resource group to which the vSwitch belongs. | rg-bp67acfmxazb4ph**** |
Response parameters
Examples
Sample success responses
JSON
format
{
"RequestId": "9A572171-4E27-40D1-BD36-D26C9E71E29E",
"TotalCount": 1,
"PageNumber": 1,
"PageSize": 10,
"VSwitchs": [
{
"CidrBlock": "172.16.0.0/24",
"Description": "vSwitchDescription\t\n",
"IsDefault": true,
"IzNo": "cn-hangzhou-b\t\n",
"Status": "Available",
"VSwitchId": "vsw-25bcdxs7pv1****\t\n",
"VSwitchName": "vSwitch",
"AvailableIpAddressCount": 1
}
]
}
Error codes
HTTP status code | Error code | Error message |
---|---|---|
400 | InvalidVSwitchId.NotFound | Specified virtual switch is not found in specified VPC. |
400 | IncorrecttVpcId | The specified parameter VPCId is not valid. |
400 | InvalidIzNo.NotSupported | Specified VPC zone is not supported. |
For a list of error codes, visit the Service error codes.