<html><body>
<p><font size="2" face="sans-serif">I have proposed blueprints in both nova and cinder for supporting multiple sort keys and sort directions for the GET APIs (servers and volumes).  I am trying to get feedback from other projects in order to have a more uniform API across services.</font><br>
<br>
<font size="2" face="sans-serif">Problem description from nova proposal:</font><br>
<br>
<font size="2" face="sans-serif">"There is no support for retrieving server data in a specific order, it is defaulted to descending sort order by the "created date" and "id" keys. In order to retrieve data in any sort order and direction, the REST APIs need to accept multiple sort keys and directions.</font><br>
<br>
<font size="2" face="sans-serif">Use Case: A UI that displays a table with only the page of data that it has retrieved from the server. The items in this table need to be sorted by status first and by display name second. In order to retrieve data in this order, the APIs must accept multiple sort keys/directions."</font><br>
<br>
<font size="2" face="sans-serif">See nova proposal .rst file (cinder is basically the same) for more information:  <a href="https://review.openstack.org/#/c/84451/">https://review.openstack.org/#/c/84451/</a></font><br>
<br>
<font size="2" face="sans-serif">Most projects have similar GET requests and I am trying to get some consensus on this approach across the various projects; the goal is to have this type of functionality common across projects (not just nova and cinder).  Note that some projects (ie, cinder) already support a single sort key and sort direction, see <a href="https://github.com/openstack/cinder/blob/master/cinder/api/v2/volumes.py#L212-L213">https://github.com/openstack/cinder/blob/master/cinder/api/v2/volumes.py#L212-L213</a></font><br>
<br>
<font size="2" face="sans-serif">Note that the DB layer already accepts multiple sort keys and sort directions (see <a href="https://github.com/openstack/oslo-incubator/blob/master/openstack/common/db/sqlalchemy/utils.py#L62">https://github.com/openstack/oslo-incubator/blob/master/openstack/common/db/sqlalchemy/utils.py#L62</a>), the work I am describing here only exposes the sorting options at the REST API layer.</font><br>
<br>
<font size="2" face="sans-serif">Please provide feedback on this direction.  Specifically, do you see any issues (and, if so, why) with allowing the caller to specify sort orders and directions on the GET APIs?</font><br>
<br>
<font size="2" face="sans-serif">Feel free to leave your feedback in the Gerrit review for the nova blueprint or reply to this thread.</font><br>
<br>
<font size="2" face="sans-serif">Thanks, </font><br>
<br>
<font size="2" face="sans-serif">Steven Kaufer</font></body></html>