Allow limiting the number of objects returned via GET
by providing "limit"
Example: api/notifications?limit=5
Allow offseting (skipping N first records) via "offset"
Example: api/notifications?offset=100
Allow ordering of objects by providing "order_by"
Example: api/notifications?order_by=-id
Add helper functions/classes to:
- get HTTP parameters (limit, offset, order_by)
- get scoped collection query by applying 4 operations
filter, order, offset, limit
- set Conent-Range header if scope limits are present
Make default NailgunCollection's GET utilize scoped query
This makes default (parent) GET of child handlers support paging
and ordering (overriden GET methods will not get this functionality
automatically)
NailgunCollection.GET is also an example of how to implement
this new functionality.
Helper functions/classes can be utilized in child handler methods
to implement filters / ordering / paging
Related-Bug: 1657348
Change-Id: I7760465f70b3f69791e7a0c558a26e8ba55c934a
(cherry picked from commit 03aaca2deeb062e962a81d16c2a75fb5fccfc265)
Reviewed: https:/ /review. openstack. org/436718 /git.openstack. org/cgit/ openstack/ fuel-web/ commit/ ?id=c89a8569db3 f6bc4e244a8890f 150f0b5c70eaea
Committed: https:/
Submitter: Jenkins
Branch: stable/newton
commit c89a8569db3f6bc 4e244a8890f150f 0b5c70eaea
Author: Dmitry Sutyagin <email address hidden>
Date: Mon Jan 23 15:48:31 2017 -0800
Add limit, offset, order in collection GET
Allow limiting the number of objects returned via GET ns?limit= 5
by providing "limit"
Example: api/notificatio
Allow offseting (skipping N first records) via "offset" ns?offset= 100
Example: api/notificatio
Allow ordering of objects by providing "order_by" ns?order_ by=-id
Example: api/notificatio
Add helper functions/classes to:
- get HTTP parameters (limit, offset, order_by)
- get scoped collection query by applying 4 operations
filter, order, offset, limit
- set Conent-Range header if scope limits are present
Make default NailgunCollection's GET utilize scoped query ection. GET is also an example of how to implement
This makes default (parent) GET of child handlers support paging
and ordering (overriden GET methods will not get this functionality
automatically)
NailgunColl
this new functionality.
Helper functions/classes can be utilized in child handler methods
to implement filters / ordering / paging
Related-Bug: 1657348 9791e7a0c558a26 e8ba55c934a 962a81d16c2a75f b5fccfc265)
Change-Id: I7760465f70b3f6
(cherry picked from commit 03aaca2deeb062e