All Products
Search
Document Center

Virtual Private Cloud:DescribeVSwitchAttributes

Last Updated:Sep 08, 2026

Queries the configuration information of a specified vSwitch by calling the DescribeVSwitchAttributes operation.

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:DescribeVSwitchAttributes

get

*VSwitch

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

None None

Request parameters

Parameter

Type

Required

Description

Example

VSwitchId

string

Yes

The ID of the vSwitch to query.

vsw-25naue4g****

RegionId

string

No

The region ID of the VPC to which the route table belongs.

You can call the DescribeRegions operation to query the region ID.

cn-hangzhou

DryRun

boolean

No

Specifies whether to perform a dry run. Valid values:

  • true: performs a dry run without querying the vSwitch configuration. The system checks the required parameters, request format, and service limits. If the check fails, the corresponding error is returned. If the check succeeds, the error code DryRunOperation is returned.

  • false (default): performs a dry run and sends the request. After the request passes the check, an HTTP 2xx status code is returned and the vSwitch configuration is queried.

false

Response elements

Element

Type

Description

Example

object

The details of the vSwitch.

VpcId

string

The ID of the VPC to which the vSwitch belongs.

vpc-257gq642n****

Status

string

The status of the vSwitch. Valid values:

  • Pending: being configured.

  • Available: active.

Pending

CreationTime

string

The time when the vSwitch was created.

2021-08-22T10:40:25Z

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.

false

AvailableIpAddressCount

integer

The active IP address count.

12

NetworkAclId

string

The network ACL rules.

1

OwnerId

integer

The Alibaba Cloud account ID of the resource ownership.

Important This value is of the Long type. Precision loss may occur in certain programming languages. Use this value with caution.

28768383240243****

VSwitchId

string

The ID of the vSwitch.

vsw-25b7pv15t****

RequestId

string

The request ID.

7B48B4B9-1EAD-469F-B488-594DAB4B6A1A

CidrBlock

string

The private network address range of the vSwitch.

192.168.0.1/24

Description

string

The description of the vSwitch.

abc

ResourceGroupId

string

The resource group ID.

rg-acfmxazb4ph****

ZoneId

string

The zone to which the vSwitch belongs.

cn-beijing-a

Ipv6CidrBlock

string

The IPv6 CIDR block of the vSwitch.

2408:XXXX:3c5:44e::/64

VSwitchName

string

The name of the vSwitch.

test

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

RouteTable

object

The route table information of the vSwitch.

RouteTableId

string

The ID of the route table associated with the vSwitch.

vtb-bp145q7glnuzdv****

RouteTableType

string

The type of the route table. Valid values:

  • System: system route table.

  • Custom: custom route table.

System

Tags

object

Tag

array<object>

The tag list.

object

The tag list.

Key

string

The tag key.

FinanceDept

Value

string

The tag value.

FinanceJoshua

Examples

Success response

JSON format

{
  "VpcId": "vpc-257gq642n****",
  "Status": "Pending",
  "CreationTime": "2021-08-22T10:40:25Z",
  "IsDefault": false,
  "AvailableIpAddressCount": 12,
  "NetworkAclId": "1",
  "OwnerId": 0,
  "VSwitchId": "vsw-25b7pv15t****",
  "RequestId": "7B48B4B9-1EAD-469F-B488-594DAB4B6A1A",
  "CidrBlock": "192.168.0.1/24",
  "Description": "abc",
  "ResourceGroupId": "rg-acfmxazb4ph****",
  "ZoneId": "cn-beijing-a",
  "Ipv6CidrBlock": "2408:XXXX:3c5:44e::/64",
  "VSwitchName": "test",
  "ShareType": "Shared",
  "EnabledIpv6": true,
  "RouteTable": {
    "RouteTableId": "vtb-bp145q7glnuzdv****",
    "RouteTableType": "System"
  },
  "Tags": {
    "Tag": [
      {
        "Key": "FinanceDept",
        "Value": "FinanceJoshua"
      }
    ]
  }
}

Error codes

HTTP status code

Error code

Error message

Description

400 InvalidVSwitchId.NotFound Specified VSwitch can not found.

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.