Checks whether a private IP address in a specified vSwitch is available.


OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer. OpenAPI Explorer dynamically generates the sample code of the operation for different SDKs.

Request parameters

Parameter Type Required Example Description
RegionId String Yes cn-qingdao

The region ID of the vSwitch to which the private IP address that you want to query belongs.

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

VSwitchId String Yes vsw-m5ew3t46z2drmifnt****

The ID of the vSwitch to which the private IP address to be queried belongs.

PrivateIpAddress String Yes

To query whether a private IP address is available, the private IP address must belong to the vSwitch specified by the VSwitchId parameter.

IpVersion String No ipv4

The version of the private IP address. Valid values:

  • ipv4: IPv4 If you want to query an IPv4 address, this parameter is optional.
  • ipv6: IPv6 If you want to query an IPv6 address, this parameter is required.
Action String Yes CheckCanAllocateVpcPrivateIpAddress

The operation that you want to perform. Set the value to CheckCanAllocateVpcPrivateIpAddress.

Response parameters

Parameter Type Example Description
CanAllocate Boolean true

Indicates whether the private IP address is available. Valid values:

  • true: yes
  • false: no
RequestId String 93360B0-2969-40BF-8542-EBB34FD358AB

The ID of the request.


Sample requests

&Common request parameters

Sample success responses

XML format

HTTP/1.1 200 OK


JSON format

HTTP/1.1 200 OK

  "CanAllocate" : true,
  "RequestId" : "93360B0-2969-40BF-8542-EBB34FD358AB"

Error codes

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