def search_pool(self, auth, query, search_options=None):

        if search_options is None:
            search_options = {}

        #
        # sanitize search options and set default if option missing
        #

        # max_result
        if 'max_result' not in search_options:
            search_options['max_result'] = 50
        else:
            try:
                search_options['max_result'] = int(search_options['max_result'])
            except (ValueError, TypeError):
                raise NipapValueError('Invalid value for option' +
                    ''' 'max_result'. Only integer values allowed.''')

        # offset
        if 'offset' not in search_options:
            search_options['offset'] = 0
        else:
            try:
                search_options['offset'] = int(search_options['offset'])
            except (ValueError, TypeError):
                raise NipapValueError('Invalid value for option' +
                    ''' 'offset'. Only integer values allowed.''')

        self._logger.debug('search_pool search_options: %s' % str(search_options))

        where, opt = self._expand_pool_query(query)
        sql = """SELECT DISTINCT (po.id),
                        po.id,
                        po.name,
                        po.description,
                        po.default_type,
                        po.ipv4_default_prefix_length,
                        po.ipv6_default_prefix_length,
                        po.member_prefixes_v4,
                        po.member_prefixes_v6,
                        po.used_prefixes_v4,
                        po.used_prefixes_v6,
                        po.free_prefixes_v4,
                        po.free_prefixes_v6,
                        po.total_prefixes_v4,
                        po.total_prefixes_v6,
                        po.total_addresses_v4,
                        po.total_addresses_v6,
                        po.used_addresses_v4,
                        po.used_addresses_v6,
                        po.free_addresses_v4,
                        po.free_addresses_v6,
                        po.tags,
                        po.avps,
                        vrf.id AS vrf_id,
                        vrf.rt AS vrf_rt,
                        vrf.name AS vrf_name,
                        (SELECT array_agg(prefix::text) FROM (SELECT prefix FROM ip_net_plan WHERE pool_id=po.id ORDER BY prefix) AS a) AS prefixes
                FROM ip_net_pool AS po
                LEFT OUTER JOIN ip_net_plan AS inp ON (inp.pool_id = po.id)
                LEFT OUTER JOIN ip_net_vrf AS vrf ON (vrf.id = inp.vrf_id)
                WHERE """ + where + """ ORDER BY po.name
                LIMIT """ + str(search_options['max_result']) + """ OFFSET """ + str(search_options['offset'])

        self._execute(sql, opt)

        result = list()
        for row in self._curs_pg:
            result.append(dict(row))

        return { 'search_options': search_options, 'result': result }
Search pool list for pools matching `query`.
dataset/ETHPy150Open SpriteLink/NIPAP/nipap/nipap/backend.py/Nipap.search_pool