Queries the configurations of a VSwitch.

Make the API call

You can use OpenAPI Explorer to make API calls, search for API calls, perform debugging, and generate SDK example code.

Request parameters

Parameter Type Required? Example value Description
Action String Yes DescribeVSwitchAttributes

The name of this action. Value: DescribeVSwitchAttributes.

RegionId String Yes cn-hangzhou

The ID of the region to which the VSwitch belongs. To query the region ID, call DescribeRegions.

VSwitchId String Yes vsw-25naue4g****

The ID of the VSwitch to be queried.

DryRun Boolean No false

Indicates whether to check this request only. Valid values:

  • true: Sends a check request without querying the resource status. The system checks whether the AccessKey is valid, whether the RAM user is authorized, and whether the required parameters are set. If the check fails, corresponding errors are returned. If the check succeeds, the error code DryRunOperation is returned.
  • false (default): Sends a normal request, returns the 2XX HTTP status code after the check, and queries the resource status directly.

Response parameters

Parameter Type Example value Description
AvailableIpAddressCount Long 12

The number of available IP addresses.

CidrBlock String 192.168.0.1/24

The IPv4 CIDR block of the VSwitch.

CreationTime String 2017-08-22T10:40:25Z

The creation time of the VSwitch.

Description String abc

The description of the VSwitch.

Ipv6CidrBlock String 2408:4004:0:6axx::/56

The IPv6 CIDR block of the VSwitch.

IsDefault Boolean false

Indicates whether the VSwitch is a default VSwitch.

  • true: The specified VSwitch is a default VSwitch.
  • false: The specified VSwitch is not a default VSwitch.
RequestId String 7B48B4B9-1EAD-469F-B488-594DAB4B6A1A

The ID of the request.

ResourceGroupId String rg-acfmxazb4pbgfh****

The ID of the resource group.

RouteTable

The route table information of the VSwitch.

RouteTableId String vtb-bp145q7glnuzdv****

The ID of the route table associated with the VSwitch.

RouteTableType String System

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

  • System: System route table.
  • Custom: Custom route table.
Status String Pending

The status of the VSwitch. Valid values:

  • Pending: The VSwitch is being configured.
  • Available: The VSwitch is available.
VSwitchId String vsw-25b7pcdfvv15t****

The ID of the VSwitch.

VSwitchName String  test

The name of the VSwitch.

VpcId String  vpc-257gqcfv642n****

The ID of the VPC to which the VSwitch belongs.

ZoneId String  cn-beijing-a

The zone to which the VSwitch belongs.

Examples

Request example


https://vpc.aliyuncs.com/?Action=DescribeVSwitchAttributes
&VSwitchId=vsw-25nauecdfv4g****
&<CommonParameters>

Response example

XML format

<DescribeVSwitchAttributesResponse>
	  <RouteTable>
		    <RouteTableId>vtb-hp3ngu1hkdutfakqn****</RouteTableId>
		    <RouteTableType>System</RouteTableType>
	  </RouteTable>
	  <Description></Description>
	  <IsDefault>false</IsDefault>
	  <AvailableIpAddressCount>251</AvailableIpAddressCount>
	  <ResourceGroupId>rg-acfmy45w7w2****</ResourceGroupId>
	  <ZoneId>cn-huhehaote-a</ZoneId>
	  <VSwitchId>vsw-hp3lyltb1dosj540y****</VSwitchId>
	  <VpcId>vpc-hp34hflqqsjh3a3q7****</VpcId>
	  <CreationTime>2019-01-07T04:54:14Z</CreationTime>
	  <Status>Available</Status>
	  <CidrBlock>192.168.0.0/24</CidrBlock>
	  <RequestId>A31F062D-81F0-48BC-9771-915D6622D26A</RequestId>
	  <VSwitchName>doc1</VSwitchName>
	  <Ipv6CidrBlock>2408:4004:0:2900::/64</Ipv6CidrBlock>
	  <CloudResources></CloudResources>
</DescribeVSwitchAttributesResponse>

JSON format

{
	"RouteTable":{
		"RouteTableId":"vtb-hp3ngu1hkdutfakqn****",
		"RouteTableType":"System"
	},
	"Description":"",
	"IsDefault":false,
	"AvailableIpAddressCount":251,
	"ResourceGroupId":"rg-acfmy45w7w2****",
	"ZoneId":"cn-huhehaote-a",
	"VSwitchId":"vsw-hp3lyltb1dosj540y****",
	"VpcId":"vpc-hp34hflqqsjh3a3q7****",
	"CreationTime":"2019-01-07T04:54:14Z",
	"Status":"Available",
	"CidrBlock":"192.168.0.0/24",
	"RequestId":"A31F062D-81F0-48BC-9771-915D6622D26A",
	"Ipv6CidrBlock":"2408:4004:0:2900::/64",
	"VSwitchName":"doc1",
	"CloudResources":{
		"CloudResourceSetType":[]
	}
}

Errors

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