'Retrieve \'next\' link, if applicable. This is included if:
1) \'limit\' param is specified and equals the number of items.
2) \'limit\' param is specified but it exceeds CONF.api.max_limit,
in this case the number of items is CONF.api.max_limit.
3) \'limit\' param is NOT specified but the number of items is
CONF.api.max_limit.'

def _get_collection_links(self, request, items, collection_name, id_key='uuid'):

    links = []
    max_items = min(int(request.params.get('limit', CONF.api.max_limit)), CONF.api.max_limit)
    if (max_items and (max_items == len(items))):
        last_item = items[(-1)]
        if (id_key in last_item):
            last_item_id = last_item[id_key]
        elif ('id' in last_item):
            last_item_id = last_item['id']
        else:
            last_item_id = last_item['flavorid']
        links.append({'rel': 'next', 'href': self._get_next_link(request, last_item_id, collection_name)})
    return links
