GET volumes API sorting enhancements common utilities
This change is to support updating the v2 /volumes and /volumes/detail
APIs to support multiple sort keys and sort directions using the single
'sort' parameter, see API working group guidelines for syntax and
examples:
https://github.com/openstack/api-wg/blob/master/guidelines/
pagination_filter_sort.rst
Note that the existing 'sort_key' and 'sort_dir' parameters are being
deprecated and they cannot be used with the new 'sort' parameter.
This patch set contains utility functions to:
* Process the input sorting parameters on the request
* Process the sort keys and directions to include the default keys
The main complexity in this change deals with defaulting the sort keys
and directions so that volume order does not change for existing
paths. A new 'process_sort_params' function is created to consistently
process the sort parameters that will be passed from the REST API and
down to the DB API. This utility function will be invoked when the
sort params need to be processed (and defaulted) in the DB sqlalchemy
layer (prior to invoking the common paginate_query function).
These functions will be consumed in the subsequent change set:
https://review.openstack.org/#/c/141915/