All Products
Search
Document Center

Virtual Private Cloud:CheckCanAllocateVpcPrivateIpAddress

Last Updated:Mar 22, 2024

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

Debugging

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

Authorization information

There is currently no authorization information disclosed in the API.

Request parameters

ParameterTypeRequiredDescriptionExample
RegionIdstringYes

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.

cn-qingdao
VSwitchIdstringYes

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

vsw-m5ew3t46z2drmifnt****
PrivateIpAddressstringYes

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

10.0.0.7
IpVersionstringNo

The version of the private IP address. Valid values:

  • ipv4 If you want to query an IPv4 address, this parameter is optional.
  • ipv6 If you want to query an IPv6 address, this parameter is required.
ipv4

Response parameters

ParameterTypeDescriptionExample
object

Schema object

CanAllocateboolean

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

  • true
  • false
true
RequestIdstring

The request ID.

93360B0-2969-40BF-8542-EBB34FD358AB

Examples

Sample success responses

JSONformat

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

Error codes

HTTP status codeError codeError messageDescription
400PARAMETER_ILLEGALParameter illegal.Parameter is ipVersion-
400ResourceNotFound.VSwitchIdThe specified resource vswitch is not found.-
400Mismatch.VSwitchAndPrivateIpAddressThe vswitch and privateIpAddress are mismatched.The specified private IP address does not match the vSwitch.

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

Change history

Change timeSummary of changesOperation
No change history