Comment 18 for bug 1843211

Revision history for this message
Akihiro Motoki (amotoki) wrote :

I also looked into the code and tested the current behavior.
The response of "total_ips" is changed based on whether there is allocation_pools or not.
I agree this is confusing, but as Miguel pointed out this API is for admins and exists for three years,
so operators might have tools which depends on the current behavior.

Thus, my first suggestion is to update the description of "total_ips" in the API reference without changing the current behavior

On the other hand I agree the current response is not enough too from the following points:
- The response of "total_ips" is conditional (based on allocation_pools)
- The response of "used_ips" does not consider "allocation_pools". "used_ips" counts the number of IPs both from inside and outside of allocation pools of the subnet.

If we need to know the IP usage correctly, we need four information:
- The total number of IP addresses of a subnet
- The total number of IP addresses in allocation pools
- The number of used IP addresses of a subnet (<- it is same as the response of the current "used_ips" IIUC)
- The number of used IP addresses from allocation pools

We can add extra attributes to provide more detail information.