All Products
Search
Document Center

Virtual Private Cloud:DescribeVSwitches

Last Updated:Aug 04, 2026

Queries networkable information. Internal networking is performed by vSwitch.

Operation description

The DescribeVSwitches operation may return the Throttling.DeepPageSkip error code during frequent deep paging or page skipping. Reduce the query frequency or use sequential paging.

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

The table below describes the authorization required to call this API. You can define it in a Resource Access Management (RAM) policy. The table's columns are detailed below:

  • Action: The actions can be used in the Action element of RAM permission policy statements to grant permissions to perform the operation.

  • API: The API that you can call to perform the action.

  • Access level: The predefined level of access granted for each API. Valid values: create, list, get, update, and delete.

  • Resource type: The type of the resource that supports authorization to perform the action. It indicates if the action supports resource-level permission. The specified resource must be compatible with the action. Otherwise, the policy will be ineffective.

    • For APIs with resource-level permissions, required resource types are marked with an asterisk (*). Specify the corresponding Alibaba Cloud Resource Name (ARN) in the Resource element of the policy.

    • For APIs without resource-level permissions, it is shown as All Resources. Use an asterisk (*) in the Resource element of the policy.

  • Condition key: The condition keys defined by the service. The key allows for granular control, applying to either actions alone or actions associated with specific resources. In addition to service-specific condition keys, Alibaba Cloud provides a set of common condition keys applicable across all RAM-supported services.

  • Dependent action: The dependent actions required to run the action. To complete the action, the RAM user or the RAM role must have the permissions to perform all dependent actions.

Action

Access level

Resource type

Condition key

Dependent action

vpc:DescribeVSwitches

list

*VSwitch

acs:vpc:{#regionId}:{#accountId}:vswitch/*

  • vpc:VPC
None

Request parameters

Parameter

Type

Required

Description

Example

VpcId

string

No

The ID of the VPC to which the vSwitches that you want to query belong.

Note

Specify at least one of the RegionId and VpcId parameters.

vpc-25cdvfeq58pl****

VSwitchId

string

No

The ID of the vSwitch that you want to query.

vsw-23dscddcffvf3****

ZoneId

string

No

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

cn-hangzhou-d

RegionId

string

No

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

Note

Specify at least one of the RegionId and VpcId parameters.

cn-hangzhou

VSwitchName

string

No

The name of the vSwitch.

The name must be 1 to 128 characters in length and cannot start with http:// or https://.

vSwitch

DryRun

boolean

No

Specifies whether to perform a dry run. Valid values:

  • true: performs a dry run. The system checks the required parameters, request syntax, and business restrictions. If the check fails, the corresponding error is returned. If the check succeeds, the DryRunOperation error code is returned.

  • false (default): performs a dry run and sends the request. If the check succeeds, an HTTP 2xx status code is returned and the operation is performed.

true

IsDefault

boolean

No

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

  • true: queries the default vSwitch in the specified region.

  • false: does not query the default vSwitch in the specified region.

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

true

RouteTableId

string

No

The ID of the route table.

vtb-bp145q7glnuzdvzu2****

ResourceGroupId

string

No

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

rg-bp67acfmxazb4ph****

PageNumber

integer

No

The page number. Default value: 1.

1

PageSize

integer

No

The number of entries per page for paging queries. Maximum value: 50. Default value: 10.

10

VSwitchOwnerId

integer

No

The Alibaba Cloud account ID of the resource ownership.

2546073170691****

EnableIpv6

boolean

No

Specifies whether to query vSwitches that have IPv6 CIDR blocks enabled in the specified region. Valid values:

  • true: queries vSwitches that have IPv6 CIDR blocks enabled in the specified region.

  • false: does not query vSwitches that have IPv6 CIDR blocks enabled in the specified region.

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

false

Tag

array<object>

No

The tags of the resource.

object

No

The tag.

Key

string

No

The tag key of the resource. You can specify up to 20 tag keys. The tag key cannot be an empty string.

The tag key can be up to 128 characters in length and cannot start with aliyun or acs:. It cannot contain http:// or https://.

FinanceDept

Value

string

No

The tag value of the resource. You can specify up to 20 tag values. The tag value can be an empty string.

The tag value can be up to 128 characters in length and cannot start with aliyun or acs:. It cannot contain http:// or https://.

FinanceJoshua

Response elements

Element

Type

Description

Example

object

The response parameters.

PageSize

integer

The number of entries per page.

10

RequestId

string

The request ID.

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

PageNumber

integer

The page number.

1

TotalCount

integer

The total number of entries returned.

1

VSwitches

object

VSwitch

array<object>

The details of the vSwitches.

array<object>

The vSwitch struct.

VpcId

string

The ID of the VPC to which the vSwitch belongs.

vpc-257gcdcdq64****

Status

string

The status of the vSwitch. Valid values:

  • Pending: being configured.

  • Available: available.

Available

CreationTime

string

The time when the vSwitch was created.

2022-01-18T12:43:57Z

IsDefault

boolean

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

  • true: The vSwitch is the default vSwitch.

  • false: The vSwitch is not the default vSwitch.

true

AvailableIpAddressCount

integer

The number of available IP addresses in the vSwitch.

1

NetworkAclId

string

The ID of the network ACL.

nacl-a2do9e413e0spzasx****

OwnerId

integer

The Alibaba Cloud account ID of the resource ownership.

25346073170691****

VSwitchId

string

The ID of the vSwitch.

vsw-25bcdxs7pv1****

CidrBlock

string

The IPv4 CIDR block of the vSwitch.

172.16.0.0/24

Description

string

The description of the vSwitch.

VSwitchDescription

ResourceGroupId

string

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

rg-acfmxazb4ph6aiy****

ZoneId

string

The zone to which the vSwitch belongs.

cn-hangzhou-d

Ipv6CidrBlock

string

The IPv6 CIDR block of the vSwitch.

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

VSwitchName

string

The name of the vSwitch.

vSwitch

ShareType

string

The sharing type of the vSwitch.

  • If the value is empty, the vSwitch is a private vSwitch.

  • If the value is Shared, the vSwitch is a shared vSwitch.

  • If the value is Sharing, the vSwitch is being shared with other accounts.

Shared

EnabledIpv6

boolean

Indicates whether the IPv6 CIDR block is enabled for the vSwitch. Valid values:

  • true: enabled.

  • false: not enabled.

true

Tags

object

Tag

array<object>

The tag information of the vSwitch.

object

The tag information struct.

Key

string

The tag key of the vSwitch.

department

Value

string

The tag value of the vSwitch.

dev

RouteTable

object

The route table information.

RouteTableId

string

The ID of the route table associated with the vSwitch.

vrt-bp145q7glnuzdv****

RouteTableType

string

The type of the route table associated with the vSwitch. Valid values:

  • System: system route table.

  • Custom: custom route table.

System

Examples

Success response

JSON format

{
  "PageSize": 10,
  "RequestId": "9A572171-4E27-40D1-BD36-D26C9E71E29E",
  "PageNumber": 1,
  "TotalCount": 1,
  "VSwitches": {
    "VSwitch": [
      {
        "VpcId": "vpc-257gcdcdq64****",
        "Status": "Available",
        "CreationTime": "2022-01-18T12:43:57Z",
        "IsDefault": true,
        "AvailableIpAddressCount": 1,
        "NetworkAclId": "nacl-a2do9e413e0spzasx****",
        "OwnerId": 0,
        "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",
        "ShareType": "Shared",
        "EnabledIpv6": true,
        "Tags": {
          "Tag": [
            {
              "Key": "department",
              "Value": "dev"
            }
          ]
        },
        "RouteTable": {
          "RouteTableId": "vrt-bp145q7glnuzdv****",
          "RouteTableType": "System"
        }
      }
    ]
  }
}

Error codes

HTTP status code

Error code

Error message

Description

400 Forbidden.VpcNotFound Specified VPC can not found. The specified VPC does not exist.
400 InvalidTagKey The tag keys are not valid. The tag index is invalid.
400 InvalidTagValue The tag values are not valid. The tag value is invalid.
400 IellgalParameter.OwnerAccount The specified parameter OwnerAccount is not valid. The specified parameter OwnerAccount is illegal.
400 IllegalParam.OwnerId The specified parameter VSwitchOwnerId is not valid.
400 InvalidVpcIdNumber.NotSupported The number of vpcIds exceeds the limit. The value of the vpcId parameter has reached the upper limit.
400 InvalidVSwitchIdNumber.NotSupported The number of vSwitchIds exceeds the limit.
400 Throttling.DeepPageSkip Deep page skip throttled. Please reduce the page skip frequency or use sequential pagination. The number of deep pagination skip operations has triggered rate limiting. Reduce the frequency of deep page jumps, or use sequential paging.
404 InvalidVSwitchId.NotFound VSwitch not exist.

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.