All Products
Search
Document Center

Virtual Private Cloud:DescribeVSwitchAttributes

Last Updated:Aug 26, 2024

Queries the detailed information about a vSwitch.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer.

Authorization information

The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:

  • Operation: the value that you can use in the Action element to specify the operation on a resource.
  • Access level: the access level of each operation. The levels are read, write, and list.
  • Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
    • The required resource types are displayed in bold characters.
    • If the permissions cannot be granted at the resource level, All Resources is used in the Resource type column of the operation.
  • Condition Key: the condition key that is defined by the cloud service.
  • Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
OperationAccess levelResource typeCondition keyAssociated operation
vpc:DescribeVSwitchAttributesget
  • VSwitch
    acs:vpc:{#regionId}:{#accountId}:vswitch/{#VSwitchId}
    none
none

Request parameters

ParameterTypeRequiredDescriptionExample
VSwitchIdstringYes

The ID of the vSwitch.

vsw-25naue4g****
RegionIdstringNo

The region ID of the virtual private cloud (VPC) to which the custom route table belongs.

You can call the DescribeRegions operation to query the most recent region list.

cn-hangzhou
DryRunbooleanNo

Specifies whether to perform only a dry run, without performing the actual request. Valid values:

  • true: performs only a dry run. The system checks the request for potential issues, including missing parameter values, incorrect request syntax, and service limits. If the request fails the dry run, an error message is returned. If the request passes the dry run, the DryRunOperation error code is returned.
  • false (default): sends a request and performs a dry run. If the request passes the dry run, a 2xx HTTP status code is returned and the operation is performed.
false

Response parameters

ParameterTypeDescriptionExample
object

The details about the vSwitch.

VpcIdstring

The ID of the VPC to which the vSwitch belongs.

vpc-257gq642n****
Statusstring

The status of the vSwitch. Valid values:

  • Pending
  • Available
Pending
CreationTimestring

The time when the vSwitch was created.

2021-08-22T10:40:25Z
IsDefaultboolean

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

  • true
  • false
false
AvailableIpAddressCountlong

The number of available IP addresses.

12
NetworkAclIdstring

The network access control list (ACL) rules.

1
OwnerIdlong

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

287683832402436789
VSwitchIdstring

The vSwitch ID.

vsw-25b7pv15t****
RequestIdstring

The request ID.

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

The CIDR block of the vSwitch.

192.168.0.1/24
Descriptionstring

The description of the vSwitch.

abc
ResourceGroupIdstring

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

rg-acfmxazb4ph****
ZoneIdstring

The ID of the zone to which the vSwitch belongs.

cn-beijing-a
Ipv6CidrBlockstring

The IPv6 CIDR block of the vSwitch.

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

The vSwitch name.

test
ShareTypestring

Indicates whether the vSwitch is shared.

  • If no value is returned, the vSwitch is a regular vSwitch.
  • If Shared is returned, the vSwitch is shared.
  • If Sharing is returned, the vSwitch is being shared.
Shared
EnabledIpv6boolean

Indicates whether IPv6 is enabled for the vSwitch. If you enable IPv6, you must configure the IPv6 CIDR block of the vSwitch. Valid values:

  • true
  • false
true
RouteTableobject

The information about the route table that is associated with the vSwitch.

RouteTableIdstring

The ID of the route table that is associated with the vSwitch.

vtb-bp145q7glnuzdv****
RouteTableTypestring

The type of the route table. Valid values:

  • System
  • Custom
System
Tagsarray<object>

The information about the tags.

object
Keystring

The key of tag N added to the resource.

FinanceDept
Valuestring

The value of tag N added to the resource.

FinanceJoshua

Examples

Sample success responses

JSONformat

{
  "VpcId": "vpc-257gq642n****",
  "Status": "Pending",
  "CreationTime": "2021-08-22T10:40:25Z",
  "IsDefault": false,
  "AvailableIpAddressCount": 12,
  "NetworkAclId": "1",
  "OwnerId": 287683832402436800,
  "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 codeError codeError message
400InvalidVSwitchId.NotFoundSpecified VSwitch can not found.

For a list of error codes, visit the Service error codes.

Change history

Change timeSummary of changesOperation
2023-07-05The Error code has changed. The response structure of the API has changedView Change Details
2023-05-22The Error code has changed. The response structure of the API has changedView Change Details