Jump to: navigation, search

Difference between revisions of "API Special Interest Group/Current Design/Sorting"

(Created page with "TODO")
 
Line 1: Line 1:
TODO
+
= Analysis =
 +
 
 +
Sorting is determined through the use of the 'sort_key' and 'sort_dir' query string parameters; the caller can specify these multiple times in order to generate a list of sory keys and directions.
 +
 
 +
The following sort directions values are supported:
 +
 
 +
{| class="wikitable"
 +
|-
 +
! Value !! Description
 +
|-
 +
| asc || Ascending Order
 +
|-
 +
| desc || Descending Order
 +
|}
 +
 
 +
The sort keys and directions are applied in the order in which they are specified as query string parameters.  For example, the following specifies 'key1' to be the first sort key (in ascending order) and 'key2' to be the second sort key (in descending order):
 +
 
 +
<pre><nowiki>
 +
sort_key=key1&sort_dir=asc&sort_key=key2&sort_dir=desc
 +
</nowiki></pre>
 +
 
 +
= Current Design =
 +
 
 +
== Nova ==
 +
 
 +
Nova supports multiple sort keys and multiple sort directions.
 +
 
 +
== Neutron ==
 +
 
 +
Neutron supports multiple sort keys and multiple sort directions.
 +
 
 +
== Cinder ==
 +
 
 +
Cinder supports a single sort key and a single sort direction.
 +
 
 +
Note: [https://blueprints.launchpad.net/cinder/+spec/cinder-pagination This BP] proposes support for multiple sort keys and multiple sort directions
 +
 
 +
== Ironic ==
 +
 
 +
Ironic supports a single sort key and a single sort direction.
 +
 
 +
== Glance ==
 +
 
 +
Glance supports a multiple sort keys and a single sort direction.

Revision as of 20:47, 12 January 2015

Analysis

Sorting is determined through the use of the 'sort_key' and 'sort_dir' query string parameters; the caller can specify these multiple times in order to generate a list of sory keys and directions.

The following sort directions values are supported:

Value Description
asc Ascending Order
desc Descending Order

The sort keys and directions are applied in the order in which they are specified as query string parameters. For example, the following specifies 'key1' to be the first sort key (in ascending order) and 'key2' to be the second sort key (in descending order):

sort_key=key1&sort_dir=asc&sort_key=key2&sort_dir=desc

Current Design

Nova

Nova supports multiple sort keys and multiple sort directions.

Neutron

Neutron supports multiple sort keys and multiple sort directions.

Cinder

Cinder supports a single sort key and a single sort direction.

Note: This BP proposes support for multiple sort keys and multiple sort directions

Ironic

Ironic supports a single sort key and a single sort direction.

Glance

Glance supports a multiple sort keys and a single sort direction.