def list_pool(arg, opts, shell_opts):

    search_string = ''
    if type(arg) == list or type(arg) == tuple:
        search_string = ' '.join(arg)

    v = get_vrf(opts.get('vrf_rt'), default_var='default_list_vrf_rt', abort=True)

    if v.rt == 'all':
        vrf_q = None
    else:
        vrf_q = {
            'operator': 'equals',
            'val1': 'vrf_rt',
            'val2': v.rt
        }

    offset = 0
    limit = 100
    while True:
        res = Pool.smart_search(search_string, { 'offset': offset, 'max_result': limit }, vrf_q)
        if offset == 0: # first time in loop?
            if shell_opts.show_interpretation:
                print "Query interpretation:"
                _parse_interp_pool(res['interpretation'])

            if len(res['result']) == 0:
                print "No matching pools found"
                return

            print "%-19s %-2s %-39s %-13s  %-8s %s" % (
                "Name", "#", "Description", "Default type", "4 / 6", "Implied VRF"
                )
            print "------------------------------------------------------------------------------------------------"

        for p in res['result']:
            if len(str(p.description)) > 38:
                desc = p.description[0:34] + "..."
            else:
                desc = p.description

            vrf_rt = '-'
            vrf_name = '-'
            if p.vrf is not None:
                vrf_rt = p.vrf.rt or '-'
                vrf_name = p.vrf.name

            tags = '-'
            if len(p.tags) > 0:
                tags = "#%d" % (len(p.tags))

            print "%-19s %-2s %-39s %-13s %-2s / %-3s  [RT: %s] %s" % (
                p.name, tags, desc, p.default_type,
                str(p.ipv4_default_prefix_length or '-'),
                str(p.ipv6_default_prefix_length or '-'),
                vrf_rt, vrf_name
            )
        if len(res['result']) < limit:
            break
        offset += limit
List pools matching a search criteria
dataset/ETHPy150Open SpriteLink/NIPAP/nipap-cli/nipap_cli/nipap_cli.py/list_pool