edit-icon download-icon


Last Updated: Apr 09, 2018


Query the created VSwitches.

Request parameters

Name Type Required Description
Action String Yes

The action to perform.

Valid value: DescribeVSwitches

RegionId String Yes

The ID of the region where the VSwitch is located.

You can obtain the region ID by calling the DescribeRegions API.

VpcId String No The ID of the VPC.
VSwitchId String No

The ID of the VSwitch.

Up to 20 VSwitch IDs can be specified. Separate multiple VSwitch IDs by commas.

ZoneId String No The ID of the zone.
IsDefault Boolean No

Whether to query the default VSwitch in the specified region. Valid value:

  • true (default value): Query all VSwitches in the specified region.

  • false: Do not query the default VSwitch.

PageNumber Integer No The number of pages to return. The default value is 1.
PageSize Integer No The number of rows per page. The maximum value is 50 and default value is 10.

Response parameters

Name Type Description
RequestId String The ID of the request.
VSwitches JSON String The detailed information of the VSwitches. For more information, see VSwitchSetType.
TotalCount Integer The number of queried entries.
PageNumber Integer The current page number.
PageSize Integer The number of entries on the current page.

Error codes

See VPC API Error Center.


Request example

  1. https://vpc.aliyuncs.com/?Action=DescribeVSwitches
  2. &VpcId=vpc-25eq58pl3
  3. &<CommonParameters>

Response example

XML format

  1. <DescribeVSwitchesResponse>
  2. <RequestId>9A572171-4E27-40D1-BD36-D26C9E71E29E</RequestId>
  3. <VSwitches>
  4. <VSwitch>
  5. <VSwitchId> vsw-25b7pv15t </VSwitchId>
  6. <Status>Available</Status>
  7. <CidrBlock></CidrBlock>
  8. <ZoneId>cn-beijing-a</ZoneId>
  9. <AvailableIpAddressCount>246</AvailableIpAddressCount>
  10. <VpcId>vpc-257gq642n</VpcId>
  11. <Description></Description>
  12. <VSwitchName></VSwitchName>
  13. <CreationTime> 2014-10-29T15:21:02Z </CreationTime>
  14. </VSwitch>
  15. </VSwitches>
  16. </DescribeVSwitchesResponse>

JSON format

  1. {
  2. "PageNumber": 1,
  3. "PageSize": 10,
  4. "RequestId": "9A572171-4E27-40D1-BD36-D26C9E71E29E",
  5. "TotalCount": 1,
  6. "VSwitches": {
  7. "VSwitch": [
  8. {
  9. "AvailableIpAddressCount": 246,
  10. "CidrBlock": "",
  11. "CreationTime": "2014-10-29T15:21:02Z",
  12. "Description": "",
  13. "Status": "Available",
  14. "VSwitchId": "vsw-25b7pv15t",
  15. "VSwitchName": "",
  16. "VpcId": "vpc-257gq642n",
  17. "ZoneId": "cn-beijing-a"
  18. }
  19. ]
  20. }
  21. }
Thank you! We've received your feedback.