Network ResourcesDistributed Port Group Related Interfaces
CheckIpAvailability
Headers
Authorization: OAuth the-session-uuidCurl Sample
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth 642bc388bc3040ce9ed0c477bd6b3874" \
-X GET http://localhost:8080/zstack/v1/l3-networks/44fc110c3d87326299b46975aacb1705/ip/192.168.10.100/availability?arpCheck=false&ipRangeCheck=trueRequest Parameters
| Name | Type | Location | Description | Allowed Values | Starting Version |
|---|---|---|---|---|---|
| l3NetworkUuid | String | url | The L3 network UUID. | 0.6 | |
| ip | String | url | The IP address. | 0.6 | |
| systemTags | List | query | Optional. The system tags. | 0.6 | |
| userTags | List | query | Optional. The user tags. | 0.6 | |
| arpCheck | Boolean | query | Optional. Specifies whether to use arping to check IP availability. | 4.10.16 | |
| ipRangeCheck | Boolean | query | Optional. Specifies whether to check IP availability within the IP range in the database. | 4.10.16 |
API Response
Sample Response
{
"available": true
}| Name | Type | Description | Starting Version |
|---|---|---|---|
| available | boolean | Indicates whether the IP address is available. | 0.6 |
| success | boolean | Indicates whether the operation is successful. | 0.6 |
| error | ErrorCode | The error code. If not null, the operation fails, or vice versa. For more information, see error. | 0.6 |
error
| Name | Type | Description | Starting Version |
|---|---|---|---|
| code | String | The error code, which is a numbered or alphanumeric code that specifies an error. For example, SYS.1000, HOST.1001. | 0.6 |
| description | String | The brief description of the error. | 0.6 |
| details | String | The details about the error. | 0.6 |
| elaboration | String | The reserved field. Default value: null. | 0.6 |
| opaque | LinkedHashMap | The reserved field. Default value: null. | 0.6 |
| cause | ErrorCode | The root error, which is the associated root cause of the current error. If no root error exists, this parameter is null. | 0.6 |
SDK Sample
Java SDK
CheckIpAvailabilityAction action = new CheckIpAvailabilityAction();
action.l3NetworkUuid = "44fc110c3d87326299b46975aacb1705";
action.ip = "192.168.10.100";
action.arpCheck = false;
action.ipRangeCheck = true;
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
CheckIpAvailabilityAction.Result res = action.call();Python SDK
action = CheckIpAvailabilityAction()
action.l3NetworkUuid = "44fc110c3d87326299b46975aacb1705"
action.ip = "192.168.10.100"
action.arpCheck = false
action.ipRangeCheck = true
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
res = action.call()