Network ResourcesDistributed Port Group Related Interfaces
GetIpAddressCapacity
Headers
Authorization: OAuth the-session-uuid sCurl Sample
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X GET http://localhost:8080/zstack/v1/ip-capacity?ipRangeUuids=6bf57331ebe433389c6c230153ac5d8d&all=falseRequest Parameters
| Name | Type | Location | Description | Starting Version |
|---|---|---|---|---|
| zoneUuids | List | query | Optional. The zone UUID list. | 0.6 |
| l3NetworkUuids | List | query | Optional. The L3 network UUID list. | 0.6 |
| ipRangeUuids | List | query | Optional. The IP range UUID list. | 0.6 |
| all | boolean | query | Optional. Specifies whether to query all IP capacities in the system. | 0.6 |
| systemTags | List | query | Optional. The system tags. | 0.6 |
| userTags | List | query | Optional. The user tags. | 0.6 |
API Response
Sample Response
{
"totalCapacity": 20.0,
"availableCapacity": 15.0,
"usedIpAddressNumber": 5.0,
"ipv4TotalCapacity": 0.0,
"ipv4AvailableCapacity": 0.0,
"ipv4UsedIpAddressNumber": 0.0,
"ipv6TotalCapacity": 0.0,
"ipv6AvailableCapacity": 0.0,
"ipv6UsedIpAddressNumber": 0.0,
"capacityData": [
{
"resourceUuid": "68b9a1c74c4c33c7b818e4c14bdea0a7",
"totalCapacity": 20.0,
"availableCapacity": 15.0,
"usedIpAddressNumber": 5.0,
"ipv4TotalCapacity": 0.0,
"ipv4AvailableCapacity": 0.0,
"ipv4UsedIpAddressNumber": 0.0,
"ipv6TotalCapacity": 0.0,
"ipv6AvailableCapacity": 0.0,
"ipv6UsedIpAddressNumber": 0.0
}
],
"resourceType": "L3NetworkVO"
}| Name | Type | Description | Starting Version |
|---|---|---|---|
| totalCapacity | long | The total IP address capacity. | 0.6 |
| availableCapacity | long | The available IP address capacity. | 0.6 |
| usedIpAddressNumber | long | The number of used IP addresses. | 3.10.0 |
| ipv4TotalCapacity | long | The total IPv4 address capacity. | 3.10.0 |
| ipv4AvailableCapacity | long | The available IPv4 address capacity. | 3.10.0 |
| ipv4UsedIpAddressNumber | long | The number of used IPv4 addresses. | 3.10.0 |
| ipv6TotalCapacity | long | The total IPv6 address capacity. | 3.10.0 |
| ipv6AvailableCapacity | long | The available IPv6 address capacity. | 3.10.0 |
| ipv6UsedIpAddressNumber | long | The number of used IPv6 addresses. | 3.10.0 |
| resourceType | String | The type of the queried resource (IP range, L3 network, or zone). | 3.9.0 |
| 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 |
| capacityData | List | See capacityData. | 3.9.0 |
| error | ErrorCode | 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 |
capacityData
| Name | Type | Description | Starting Version |
|---|---|---|---|
| resourceUuid | String | The resource UUID. | 3.9.0 |
| totalCapacity | long | The total IP address capacity. | 3.9.0 |
| availableCapacity | long | The available IP address capacity. | 3.9.0 |
| usedIpAddressNumber | long | The number of used IP addresses. | 3.9.0 |
| ipv4TotalCapacity | long | The total IPv4 address capacity. | 3.10.0 |
| ipv4AvailableCapacity | long | The available IPv4 address capacity. | 3.10.0 |
| ipv4UsedIpAddressNumber | long | The number of used IPv4 addresses. | 3.10.0 |
| ipv6TotalCapacity | long | The total IPv6 address capacity. | 3.10.0 |
| ipv6AvailableCapacity | long | The available IPv6 address capacity. | 3.10.0 |
| ipv6UsedIpAddressNumber | long | The number of used IPv6 addresses. | 3.10.0 |
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
GetIpAddressCapacityAction action = new GetIpAddressCapacityAction();
action.ipRangeUuids = asList("6bf57331ebe433389c6c230153ac5d8d");
action.all = false;
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
GetIpAddressCapacityAction.Result res = action.call();Python SDK
GetIpAddressCapacityAction action = GetIpAddressCapacityAction()
action.ipRangeUuids = [6bf57331ebe433389c6c230153ac5d8d]
action.all = false
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
GetIpAddressCapacityAction.Result res = action.call()