Comment 3 for bug 1342192

Revision history for this message
Vincent Hou (houshengbo) wrote : Re: Add functionality to python-cinderclient to list > 1000 volumes

So far, if we request to list 500 out of 1500 volumes via the parameter 'limit', for example, we will get a reference link 'next' returned in the response to contain the link to request the next page. The size of the next page remains the same to the previous one, till we reach the last page. I guess what we need to do is to extend the support to other list operation for snapshot, backup, etc.

The pagination spec can be found here: http://docs.openstack.org/api/openstack-compute/2/content/Paginated_Collections-d1e664.html

The method _get_collection_links in cinder/api/common.py is used to provide the 'next' link, and 'volumes = self._view_builder.detail_list(req, limited_list)' and 'volumes = self._view_builder.summary_list(req, limited_list)' in the method _get_volumes in cinder/api/v2/volumes.py, will make sure the 'next' link is returned if available.

Please check:
https://github.com/openstack/cinder/blob/master/cinder/api/common.py#L251
https://github.com/openstack/cinder/blob/master/cinder/api/v2/volumes.py#L247
https://github.com/openstack/cinder/blob/master/cinder/api/v2/volumes.py#L249

Duncan, Gerry, Mike... do you think it makes sense?