Public bug reported: Both the /servers and /servers/details APIs support pagination. When the request includes the "limit" parameters, then a "next" link is included in the reply if the number of servers that match the query is greater than or equal to the limit.
The problem occurs when the caller does not include the limit parameter but the total number of servers is greater than or equal to the default "CONF.osapi_max_limit". When this occurs, the number of servers in the reply is "osapi_max" but there is no "next" link. Therefore, 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. The fix for this is to include the "next" link when the total number of servers is greater than or equal to the default limit, even if the "limit" parameter is not supplied. The documentation also says that the "next" link is required: http://docs.openstack.org/api/openstack-compute/2/content /Paginated_Collections-d1e664.html The fix appears to be in the _get_collection_links function in nova/api/openstack/common.py, when getting the request "limit" value. This needs to be updated from: limit = int(request.params.get("limit", 0)) to: limit = int(request.params.get("limit", CONF.osapi_max_limit)) ** Affects: nova Importance: Undecided Assignee: Steven Kaufer (kaufer) Status: New ** Changed in: nova Assignee: (unassigned) => Steven Kaufer (kaufer) -- You received this bug notification because you are a member of Yahoo! Engineering Team, which is subscribed to OpenStack Compute (nova). https://bugs.launchpad.net/bugs/1288466 Title: Get servers REST reply does not have marker when default limit is reached Status in OpenStack Compute (Nova): New Bug description: Both the /servers and /servers/details APIs support pagination. When the request includes the "limit" parameters, then a "next" link is included in the reply if the number of servers that match the query is greater than or equal to the limit. The problem occurs when the caller does not include the limit parameter but the total number of servers is greater than or equal to the default "CONF.osapi_max_limit". When this occurs, the number of servers in the reply is "osapi_max" but there is no "next" link. Therefore, 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. The fix for this is to include the "next" link when the total number of servers is greater than or equal to the default limit, even if the "limit" parameter is not supplied. The documentation also says that the "next" link is required: http://docs.openstack.org/api/openstack-compute/2/content /Paginated_Collections-d1e664.html The fix appears to be in the _get_collection_links function in nova/api/openstack/common.py, when getting the request "limit" value. This needs to be updated from: limit = int(request.params.get("limit", 0)) to: limit = int(request.params.get("limit", CONF.osapi_max_limit)) To manage notifications about this bug go to: https://bugs.launchpad.net/nova/+bug/1288466/+subscriptions -- Mailing list: https://launchpad.net/~yahoo-eng-team Post to : yahoo-eng-team@lists.launchpad.net Unsubscribe : https://launchpad.net/~yahoo-eng-team More help : https://help.launchpad.net/ListHelp