Queries the vSwitches that are deployed in a specified virtual private cloud (VPC) in a region.
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 region ID. |
| VpcId | String | Yes | vpc-bp17gig441u0msmd78**** | VPC ID |
Response parameters
| Parameter | Type | Example | Description |
|---|---|---|---|
| TotalCount | Integer | 10 | The total number of entries returned. By default, this parameter is not returned. |
| RequestId | String | BD65C0AD-D3C6-48D3-8D93-38D2015C**** | The ID of the request. |
| NextToken | String | "" | The token that marks the end of the current returned page. If this parameter is empty, it indicates that you have retrieved all the data. |
| MaxResults | Integer | 10 | The maximum number of entries returned on a single page. |
| VSwitches | Array of VSwitches | The list of the queried vSwitches. |
|
| VpcId | String | vpc-bp17gig441u0msmd6**** | The ID of the VPC in which the vSwitch is deployed. |
| VSwitchId | String | vsw-bp1g24p9no0iqir46**** | The ID of the vSwitch. |
| Status | String | Available | The status of the vSwitch. Valid values:
|
| IsDefault | Boolean | false | Indicates whether the vSwitch is the default vSwitch. Valid values:
|
| VSwitchName | String | vsw-test | The name of the vSwitch. |
| ZoneId | String | cn-hangzhou-k | The ID of the zone where the vSwitch is deployed. |
Examples
Sample requests
http(s)://[Endpoint]/?Action=DescribeVSwitches
&RegionId=cn-hangzhou
&VpcId=vpc-bp17gig441u0msmd78****
&<Common request parameters>
Sample success responses
XML format
HTTP/1.1 200 OK
Content-Type:application/xml
<DescribeVSwitchesResponse>
<TotalCount>10</TotalCount>
<RequestId>BD65C0AD-D3C6-48D3-8D93-38D2015C****</RequestId>
<NextToken>""</NextToken>
<MaxResults>10</MaxResults>
<VSwitches>
<VpcId>vpc-bp17gig441u0msmd6****</VpcId>
<VSwitchId>vsw-bp1g24p9no0iqir46****</VSwitchId>
<Status>Available</Status>
<IsDefault>false</IsDefault>
<VSwitchName>vsw-test</VSwitchName>
<ZoneId>cn-hangzhou-k</ZoneId>
</VSwitches>
</DescribeVSwitchesResponse>
JSON format
HTTP/1.1 200 OK
Content-Type:application/json
{
"TotalCount" : 10,
"RequestId" : "BD65C0AD-D3C6-48D3-8D93-38D2015C****",
"NextToken" : """",
"MaxResults" : 10,
"VSwitches" : [ {
"VpcId" : "vpc-bp17gig441u0msmd6****",
"VSwitchId" : "vsw-bp1g24p9no0iqir46****",
"Status" : "Available",
"IsDefault" : false,
"VSwitchName" : "vsw-test",
"ZoneId" : "cn-hangzhou-k"
} ]
}
Error codes
For a list of error codes, see Service error codes.