Some of the cinder APIs do weird database joins and double lookups and things, making every field sortable might have some serious database performance impact and open up a DoS attack. Will need more investigation to be sure.
On 2 April 2014 19:42, Steven Kaufer <kau...@us.ibm.com> wrote: > 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. > > Problem description from nova proposal: > > "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. > > 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." > > See nova proposal .rst file (cinder is basically the same) for more > information: https://review.openstack.org/#/c/84451/ > > 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 > https://github.com/openstack/cinder/blob/master/cinder/api/v2/volumes.py#L212-L213 > > Note that the DB layer already accepts multiple sort keys and sort > directions (see > https://github.com/openstack/oslo-incubator/blob/master/openstack/common/db/sqlalchemy/utils.py#L62), > the work I am describing here only exposes the sorting options at the REST > API layer. > > 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? > > Feel free to leave your feedback in the Gerrit review for the nova blueprint > or reply to this thread. > > Thanks, > > Steven Kaufer > > > _______________________________________________ > OpenStack-dev mailing list > OpenStack-dev@lists.openstack.org > http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev > -- Duncan Thomas _______________________________________________ OpenStack-dev mailing list OpenStack-dev@lists.openstack.org http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev