commit 968c01afe7ff43346f5817e2a3adf97fd03106b1
Author: Steven Kaufer <email address hidden>
Date: Thu Mar 6 22:35:48 2014 +0000
Include next link when default limit is reached
The /servers and /servers/detail APIs support pagination and a
"next" link should be included when more data is available, see http://docs.openstack.org/api/openstack-compute/2/content/
Paginated_Collections-d1e664.html. In the documentation it states
that 'collections are required to contain atom "next" links'.
When the default "osapi_max" limit is reached then the "next" link
is not included in the API reply. In this case, the caller cannot
determine if there are any more servers and has no marker value
such that they can retrieve the rest of the servers.
For example, assume that there are 1050 VMs and the osapi_max value
is the default of 1000. The /servers API will return the first 1000
VMs but it will not include the "next" link; the caller has no way
to determine if there are more then 1000 VMs and no way to retrieve
the other 50 VMs.
The fix for this is to include the "next" link when the number of
servers being returned is the maximum limit, even if the "limit"
parameter is not supplied. Note: the caller could workaround this
by specifying the exact "osapi_max" limit value (ie, limit=1000)
on the API call but this requires that the caller knows the
configured limit.
Reviewed: https:/ /review. openstack. org/78800 /git.openstack. org/cgit/ openstack/ nova/commit/ ?id=968c01afe7f f43346f5817e2a3 adf97fd03106b1
Committed: https:/
Submitter: Jenkins
Branch: master
commit 968c01afe7ff433 46f5817e2a3adf9 7fd03106b1
Author: Steven Kaufer <email address hidden>
Date: Thu Mar 6 22:35:48 2014 +0000
Include next link when default limit is reached
The /servers and /servers/detail APIs support pagination and a docs.openstack. org/api/ openstack- compute/ 2/content/ Collections- d1e664. html. In the documentation it states
"next" link should be included when more data is available, see
http://
Paginated_
that 'collections are required to contain atom "next" links'.
When the default "osapi_max" limit is reached then the "next" link
is not included in the API reply. In this case, the caller cannot
determine if there are any more servers and has no marker value
such that they can retrieve the rest of the servers.
For example, assume that there are 1050 VMs and the osapi_max value
is the default of 1000. The /servers API will return the first 1000
VMs but it will not include the "next" link; the caller has no way
to determine if there are more then 1000 VMs and no way to retrieve
the other 50 VMs.
The fix for this is to include the "next" link when the number of
servers being returned is the maximum limit, even if the "limit"
parameter is not supplied. Note: the caller could workaround this
by specifying the exact "osapi_max" limit value (ie, limit=1000)
on the API call but this requires that the caller knows the
configured limit.
Change-Id: I9b3da852b0ab11 dc980524e2317ee 876a3ec28b8
Closes-bug: 1288466