Network ResourcesDistributed Port Group Related Interfaces
GetFreeIp
GET zstack/v1/l3-networks/{l3NetworkUuid}/ip/freeGET zstack/v1/l3-networks/ip-ranges/{ipRangeUuid}/ip/freeHeaders
Authorization: OAuth the-session-uuidCurl Sample
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X GET http://localhost:8080/zstack/v1/l3-networks/ip/free?l3NetworkUuid=c8cd63a1882331a9a5ee83e5d9b265ec&ipRangeUuid=10fc8508fd723e63bcc57b8bb6d7a133&limit=100.0curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X GET http://localhost:8080/zstack/v1/l3-networks/c8cd63a1882331a9a5ee83e5d9b265ec/ip/free?l3NetworkUuid=c8cd63a1882331a9a5ee83e5d9b265ec&ipRangeUuid=10fc8508fd723e63bcc57b8bb6d7a133&limit=100.0curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X GET http://localhost:8080/zstack/v1/l3-networks/ip-ranges/10fc8508fd723e63bcc57b8bb6d7a133/ip/free?l3NetworkUuid=c8cd63a1882331a9a5ee83e5d9b265ec&ipRangeUuid=10fc8508fd723e63bcc57b8bb6d7a133&limit=100.0Request Parameters
Name | Type | Location | Description | Allowed Values | Starting Version |
|---|---|---|---|---|---|
l3NetworkUuid | String | query | The L3 network UUID.Note: Either l3NetworkUuid or ipRangeUuid is required. |
| 0.6 |
ipRangeUuid | String | query | The IP range UUID.Note: Either l3NetworkUuid or ipRangeUuid is required. |
| 0.6 |
start | String | query | Optional. The start IP address. |
| 0.6 |
ipRangeType | String | query | Optional. The address type. |
| 3.9.0 |
ipVersion | Integer | query | Optional. The IP version. |
| 3.10.0 |
limit | int | query | Optional. The maximum number of IP addresses to return. |
| 0.6 |
systemTags | List | query | Optional. The system tags. |
| 0.6 |
userTags | List | query | Optional. The user tags. |
| 0.6 |
API Response
Sample Response
{
"inventories": [
{
"ipRangeUuid": "662d600a4b644f98a0c49df2e5430d69",
"ip": "10.20.10.5",
"netmask": "255.255.255.0",
"gateway": "10.20.10.1"
},
{
"ipRangeUuid": "662d600a4b644f98a0c49df2e5430d69",
"ip": "10.20.10.6",
"netmask": "255.255.255.0",
"gateway": "10.20.10.1"
},
{
"ipRangeUuid": "662d600a4b644f98a0c49df2e5430d69",
"ip": "10.20.10.10",
"netmask": "255.255.255.0",
"gateway": "10.20.10.1"
}
]
}| Name | Type | Description | Starting Version |
|---|---|---|---|
| error | ErrorCode | The error code. If not null, the operation fails, or vice versa. For more information, see error. | 0.6 |
| inventory | L3NetworkInventory | See inventory. | 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 |
inventory
| Name | Type | Description | Starting Version |
|---|---|---|---|
| ipRangeUuid | String | The IP range UUID. | 0.6 |
| ip | String | 0.6 | |
| netmask | String | 0.6 | |
| gateway | String | 0.6 |
SDK Sample
Java SDK
GetFreeIpAction action = new GetFreeIpAction();
action.l3NetworkUuid = "c8cd63a1882331a9a5ee83e5d9b265ec";
action.ipRangeUuid = "10fc8508fd723e63bcc57b8bb6d7a133";
action.limit = 100.0;
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
GetFreeIpAction.Result res = action.call();Python SDK
GetFreeIpAction action = GetFreeIpAction()
action.l3NetworkUuid = "c8cd63a1882331a9a5ee83e5d9b265ec"
action.ipRangeUuid = "10fc8508fd723e63bcc57b8bb6d7a133"
action.limit = 100.0
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
GetFreeIpAction.Result res = action.call()