Network ResourcesDistributed Port Group Related Interfaces

GetIpAddressCapacity

GET/zstack/v1/ip-capacity

Headers

Authorization: OAuth the-session-uuid s

Curl 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=false

Request Parameters

NameTypeLocationDescriptionStarting Version
zoneUuidsListqueryOptional. The zone UUID list.0.6
l3NetworkUuidsListqueryOptional. The L3 network UUID list.0.6
ipRangeUuidsListqueryOptional. The IP range UUID list.0.6
allbooleanqueryOptional. Specifies whether to query all IP capacities in the system.0.6
systemTagsListqueryOptional. The system tags.0.6
userTagsListqueryOptional. 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"
}
NameTypeDescriptionStarting Version
totalCapacitylongThe total IP address capacity.0.6
availableCapacitylongThe available IP address capacity.0.6
usedIpAddressNumberlongThe number of used IP addresses.3.10.0
ipv4TotalCapacitylongThe total IPv4 address capacity.3.10.0
ipv4AvailableCapacitylongThe available IPv4 address capacity.3.10.0
ipv4UsedIpAddressNumberlongThe number of used IPv4 addresses.3.10.0
ipv6TotalCapacitylongThe total IPv6 address capacity.3.10.0
ipv6AvailableCapacitylongThe available IPv6 address capacity.3.10.0
ipv6UsedIpAddressNumberlongThe number of used IPv6 addresses.3.10.0
resourceTypeStringThe type of the queried resource (IP range, L3 network, or zone).3.9.0
successbooleanIndicates whether the operation is successful.0.6
errorErrorCodeThe error code. If not null, the operation fails, or vice versa. For more information, see error.0.6
capacityDataListSee capacityData.3.9.0
errorErrorCodeSee error.0.6

error

NameTypeDescriptionStarting Version
codeStringThe error code, which is a numbered or alphanumeric code that specifies an error. For example, SYS.1000, HOST.1001.0.6
descriptionStringThe brief description of the error.0.6
detailsStringThe details about the error.0.6
elaborationStringThe reserved field. Default value: null.0.6
opaqueLinkedHashMapThe reserved field. Default value: null.0.6
causeErrorCodeThe root error, which is the associated root cause of the current error. If no root error exists, this parameter is null.0.6

capacityData

NameTypeDescriptionStarting Version
resourceUuidStringThe resource UUID.3.9.0
totalCapacitylongThe total IP address capacity.3.9.0
availableCapacitylongThe available IP address capacity.3.9.0
usedIpAddressNumberlongThe number of used IP addresses.3.9.0
ipv4TotalCapacitylongThe total IPv4 address capacity.3.10.0
ipv4AvailableCapacitylongThe available IPv4 address capacity.3.10.0
ipv4UsedIpAddressNumberlongThe number of used IPv4 addresses.3.10.0
ipv6TotalCapacitylongThe total IPv6 address capacity.3.10.0
ipv6AvailableCapacitylongThe available IPv6 address capacity.3.10.0
ipv6UsedIpAddressNumberlongThe number of used IPv6 addresses.3.10.0

error

NameTypeDescriptionStarting Version
codeStringThe error code, which is a numbered or alphanumeric code that specifies an error. For example, SYS.1000, HOST.1001.0.6
descriptionStringThe brief description of the error.0.6
detailsStringThe details about the error.0.6
elaborationStringThe reserved field. Default value: null.0.6
opaqueLinkedHashMapThe reserved field. Default value: null.0.6
causeErrorCodeThe 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()