Queries a list of vSwitches.
Debugging
Request parameters
| Parameter | Type | Required | Example | Description |
| Action | String | Yes | DescribeVSwitches | The operation that you want to perform. Set the value to DescribeVSwitches. |
| RegionId | String | Yes | cn-hangzhou | The ID of the region where the vSwitches reside. |
| VpcId | String | No | vpc-25cdvfeq58pl**** | The ID of the virtual private cloud (VPC) to which the vSwitches belong. |
| PageNumber | Integer | No | 1 | The page number. Valid values: 1 to 100. Default value: 1. |
| PageSize | Integer | No | 10 | The number of entries per page. Valid values: 1 to 50. Default value: 50. |
| ZoneId | String | No | cn-hangzhou-d | The ID of the zone where the vSwitches are deployed. |
Response parameters
| Parameter | Type | Example | Description |
| RequestId | String | 473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83B | The request ID. |
| VSwitches | Object | The vSwitches. |
|
| VSwitch | Array of VSwitch | The information about a vSwitch. |
|
| Status | String | Available | The status of the vSwitch. Valid values:
|
| VSwitchId | String | vsw-25bcdxs7pv1**** | The ID of the vSwitch. |
| IsDefault | Boolean | true | Indicates whether the vSwitch is the default vSwitch. Valid values:
|
| CidrBlock | String | 172.16.0.0/24 | The IPv4 CIDR block of the vSwitch. |
| GmtCreate | String | 2022-01-18T12:43:57Z | The time when the vSwitch was created. |
| VSwitchName | String | vswitch | The name of the vSwitch. |
Examples
Sample requests
http(s)://[Endpoint]/?Action=DescribeVSwitches
&RegionId=cn-hangzhou
&VpcId=vpc-25cdvfeq58pl****
&ZoneId=cn-hangzhou-d
&PageNumber=1
&PageSize=10
&<Common request parameters>
Sample success responses
XML format
HTTP/1.1 200 OK
Content-Type:application/xml
<DescribeVSwitchesResponse>
<RequestId>473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83B</RequestId>
<VSwitches>
<VSwitch>
<Status>Available</Status>
<VSwitchId>vsw-25bcdxs7pv1****</VSwitchId>
<IsDefault>true</IsDefault>
<CidrBlock>172.16.0.0/24</CidrBlock>
<GmtCreate>2022-01-18T12:43:57Z</GmtCreate>
<VSwitchName>vswitch</VSwitchName>
</VSwitch>
</VSwitches>
</DescribeVSwitchesResponse>
JSON format
HTTP/1.1 200 OK
Content-Type:application/json
{
"RequestId" : "473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83B",
"VSwitches" : {
"VSwitch" : [ {
"Status" : "Available",
"VSwitchId" : "vsw-25bcdxs7pv1****",
"IsDefault" : true,
"CidrBlock" : "172.16.0.0/24",
"GmtCreate" : "2022-01-18T12:43:57Z",
"VSwitchName" : "vswitch"
} ]
}
}
Error codes
For a list of error codes, see Service error codes.