Queries vSwitches.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer. OpenAPI Explorer dynamically generates the sample code of the operation for different SDKs.

Request parameters

Parameter Type Required Example Description
Action String Yes DescribeVSwitches

The operation that you want to perform. Set the value to DescribeVSwitches.

VpcId String No vpc-25cdvfeq58pl****

The ID of the VPC to which the vSwitches belong.

VSwitchId String No vsw-23dscddcffvf3****

The ID of the vSwitch that you want to query.

ZoneId String No cn-hangzhou-d

The ID of the zone to which the vSwitch belongs. You can call the DescribeZones operation to query the most recent zone list.

RegionId String No cn-hangzhou

The ID of the region to which the vSwitch belongs. You can call the DescribeRegions operation to query the most recent region list.

VSwitchName String No vSwitch

The name of the vSwitch.

DryRun Boolean No true

Specifies whether to check the request without performing the operation. Valid values:

  • true: checks the request without performing the operation. The system checks the required parameters, request syntax, and limits. If the request fails the check, an error message is returned. If the request passes the check, the DryRunOperation error code is returned.
  • false (default): sends the request. If the request passes the check, a 2xx HTTP status code is returned and the operation is performed.
IsDefault Boolean No true

Specifies whether to query the default vSwitches in the specified region. Valid values:

  • true: yes
  • false: no

If you do not set this parameter, the system queries all vSwitches in the specified region by default.

RouteTableId String No vtb-bp145q7glnuzdvzu2****

The ID of the route table.

ResourceGroupId String No rg-bp67acfmxazb4ph****

The ID of the resource group to which the vSwitch belongs.

PageNumber Integer No 1

The number of the page to return. Default value: 1.

PageSize Integer No 10

The number of entries to return on each page. Maximum value: 50. Default value: 10.

VSwitchOwnerId Long No 25460731706911258

The ID of the Alibaba Cloud account to which the vSwitch belongs.

Response parameters

Parameter Type Example Description
PageSize Integer 10

The number of entries returned per page.

RequestId String 9A572171-4E27-40D1-BD36-D26C9E71E29E

The ID of the request.

PageNumber Integer 1

The page number of the returned page.

TotalCount Integer 1

The number of entries returned.

VSwitches Array of VSwitch

The details about the vSwitch.

VSwitch
VpcId String vpc-257gcdcdq64****

The ID of the VPC to which the vSwitch belongs.

Status String Available

The status of the vSwitch. Valid values:

  • Pending: being configured
  • Available: available
CreationTime String 2022-01-18T12:43:57Z

The time when the vSwitch was created.

IsDefault Boolean true

Indicates whether the vSwitch is the default vSwitch. Valid values:

  • true: yes
  • false: no
AvailableIpAddressCount Long 1

The number of available IP addresses in the vSwitch.

NetworkAclId String nacl-a2do9e413e0spzasx****

The ID of the network access control list (ACL).

OwnerId Long 253460731706911258

The ID of the Alibaba Cloud account to which the vSwitch belongs.

VSwitchId String vsw-25bcdxs7pv1****

The ID of the vSwitch.

CidrBlock String 172.16.0.0/24

The IPv4 CIDR block of the vSwitch.

Description String VSwitchDescription

The description of the vSwitch.

ResourceGroupId String rg-acfmxazb4ph6aiy****

The ID of the resource group to which the vSwitch belongs.

ZoneId String cn-hangzhou-d

The ID of the zone to which the vSwitch belongs.

Ipv6CidrBlock String 2408:4002:10c4:4e03::/64

The IPv6 CIDR block of the vSwitch.

VSwitchName String vSwitch

The name of the vSwitch.

Tags Array of Tag

The tag information about the vSwitch.

Tag
Key String department

The key of the tag added to the vSwitch.

Value String dev

The value of the tag added to the vSwitch.

RouteTable Object

The information about the route table.

RouteTableId String vrt-bp145q7glnuzdv****

The ID of the route table associated with the vSwitch.

RouteTableType String System

The type of the route table. Valid values:

  • System: a system route table
  • Custom: a custom route table

Examples

Sample requests

http(s)://[Endpoint]/?Action=DescribeVSwitches
&ResourceOwnerId=253460731706911258
&VpcId=vpc-25cdvfeq58pl****
&VSwitchId=vsw-23dscddcffvf3****
&ZoneId=cn-hangzhou-d
&RegionId=cn-hangzhou
&VSwitchName=vSwitch
&DryRun=true
&IsDefault=true
&RouteTableId=vtb-bp145q7glnuzdvzu2****
&ResourceGroupId=rg-bp67acfmxazb4ph****
&PageNumber=1
&PageSize=10
&VSwitchOwnerId=25460731706911258
&Common request parameters

Sample success responses

XML format

HTTP/1.1 200 OK
Content-Type:application/xml

<DescribeVSwitchesResponse>
    <PageSize>10</PageSize>
    <RequestId>9A572171-4E27-40D1-BD36-D26C9E71E29E</RequestId>
    <PageNumber>1</PageNumber>
    <TotalCount>1</TotalCount>
    <VSwitches>
        <VpcId>vpc-257gcdcdq64****</VpcId>
        <Status>Available</Status>
        <CreationTime>2022-01-18T12:43:57Z</CreationTime>
        <IsDefault>true</IsDefault>
        <AvailableIpAddressCount>1</AvailableIpAddressCount>
        <NetworkAclId>nacl-a2do9e413e0spzasx****</NetworkAclId>
        <OwnerId>253460731706911260</OwnerId>
        <VSwitchId>vsw-25bcdxs7pv1****</VSwitchId>
        <CidrBlock>172.16.0.0/24</CidrBlock>
        <Description>VSwitchDescription</Description>
        <ResourceGroupId>rg-acfmxazb4ph6aiy****</ResourceGroupId>
        <ZoneId>cn-hangzhou-d</ZoneId>
        <Ipv6CidrBlock>2408:4002:10c4:4e03::/64</Ipv6CidrBlock>
        <VSwitchName>vSwitch</VSwitchName>
        <Tags>
            <Key>department</Key>
            <Value>dev</Value>
        </Tags>
        <RouteTable>
            <RouteTableId>vrt-bp145q7glnuzdv****</RouteTableId>
            <RouteTableType>System</RouteTableType>
        </RouteTable>
    </VSwitches>
</DescribeVSwitchesResponse>

JSON format

HTTP/1.1 200 OK
Content-Type:application/json

{
  "PageSize" : 10,
  "RequestId" : "9A572171-4E27-40D1-BD36-D26C9E71E29E",
  "PageNumber" : 1,
  "TotalCount" : 1,
  "VSwitches" : [ {
    "VpcId" : "vpc-257gcdcdq64****",
    "Status" : "Available",
    "CreationTime" : "2022-01-18T12:43:57Z",
    "IsDefault" : true,
    "AvailableIpAddressCount" : 1,
    "NetworkAclId" : "nacl-a2do9e413e0spzasx****",
    "OwnerId" : 253460731706911260,
    "VSwitchId" : "vsw-25bcdxs7pv1****",
    "CidrBlock" : "172.16.0.0/24",
    "Description" : "VSwitchDescription",
    "ResourceGroupId" : "rg-acfmxazb4ph6aiy****",
    "ZoneId" : "cn-hangzhou-d",
    "Ipv6CidrBlock" : "2408:4002:10c4:4e03::/64",
    "VSwitchName" : "vSwitch",
    "Tags" : [ {
      "Key" : "department",
      "Value" : "dev"
    } ],
    "RouteTable" : {
      "RouteTableId" : "vrt-bp145q7glnuzdv****",
      "RouteTableType" : "System"
    }
  } ]
}

Error codes

HttpCode Error code Error message Description
400 Forbidden.VpcNotFound Specified VPC can not found. The error message returned because the specified VPC does not exist.
404 InvalidVSwitchId.NotFound VSwitch not exist. The error message returned because the specified vSwitch does not exist. Check whether the specified ID is valid.

For a list of error codes, visit the API Error Center.