All Products
Search
Document Center

PolarDB:DescribeVSwitches

Last Updated:Jun 17, 2024

Queries 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
polardb:DescribeVSwitchesRead
  • All Resources
    *
    none
none

Request parameters

ParameterTypeRequiredDescriptionExample
RegionIdstringNo

The ID of the region where the vSwitch belongs.

cn-hangzhou
VpcIdstringNo

The ID of the virtual private type (VPC) to which the vSwitch belongs.

Note You must specify at least one of the VpcId and DedicatedHostGroupId parameters.
vpc-25cdvfeq58pl****
ZoneIdstringNo

The ID of the zone to which the vSwitch belongs.

cn-hangzhou-d
DedicatedHostGroupIdstringNo

The dedicated cluster ID.

Note You must specify at least one of the VpcId and DedicatedHostGroupId parameters.
dhg-4n****
PageNumberintegerNo

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

1
PageSizeintegerNo

The number of entries to return per page. Maximum value: 50. Default value: 50.

50
ResourceGroupIdstringNo

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

rg-bp67acfmxazb4ph****

Response parameters

ParameterTypeDescriptionExample
object
RequestIdstring

The request ID.

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

The number of returned entries.

1
PageNumberinteger

The page number.

1
PageSizeinteger

The number of entries per page.

10
VSwitchsobject []

The details of the vSwitch.

CidrBlockstring

The IPv4 CIDR block of the vSwitch.

172.16.0.0/24
Descriptionstring

The descriptions of the vSwitch.

vSwitchDescription
IsDefaultboolean

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

  • true
  • false
true
IzNostring

The zone to which the NAT gateway belongs.

cn-hangzhou-b
Statusstring

The status of the vSwitch. Valid values:

  • Pending: The vSwitch is being configured.
  • Available: The vSwitch is available.
Available
VSwitchIdstring

The vSwitch ID.

vsw-25bcdxs7pv1****
VSwitchNamestring

The name of the vSwitch.

vSwitch
AvailableIpAddressCountlong

The number of available IP addresses in the vSwitch.

1

Examples

Sample success responses

JSONformat

{
  "RequestId": "9A572171-4E27-40D1-BD36-D26C9E71E29E",
  "TotalCount": 1,
  "PageNumber": 1,
  "PageSize": 10,
  "VSwitchs": [
    {
      "CidrBlock": "172.16.0.0/24",
      "Description": "vSwitchDescription\t\n",
      "IsDefault": true,
      "IzNo": "cn-hangzhou-b\t\n",
      "Status": "Available",
      "VSwitchId": "vsw-25bcdxs7pv1****\t\n",
      "VSwitchName": "vSwitch",
      "AvailableIpAddressCount": 1
    }
  ]
}

Error codes

HTTP status codeError codeError message
400InvalidVSwitchId.NotFoundSpecified virtual switch is not found in specified VPC.
400IncorrecttVpcIdThe specified parameter VPCId is not valid.
400InvalidIzNo.NotSupportedSpecified VPC zone is not supported.

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