'Get IP availability stats on a per subnet basis.
Returns a list of network summaries which internally contains a list
of subnet summaries. The used_ip and total_ip counts are returned at
both levels.'

@classmethod
def get_network_ip_availabilities(cls, context, filters=None):

    subnet_total_ips_dict = cls._generate_subnet_total_ips_dict(context, filters)
    record_and_count_query = cls._build_network_used_ip_query(context, filters)
    result_dict = {}
    for row in record_and_count_query:
        cls._add_result(row, result_dict, subnet_total_ips_dict.get(row.subnet_id, 0))
    net_ip_availabilities = list(six.viewvalues(result_dict))
    return net_ip_availabilities
