Listing volumes respects osapi_max_limit but does not provide a link to the next element
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenStack Compute (nova) |
Won't Fix
|
Wishlist
|
Unassigned | ||
tempest |
Won't Fix
|
Undecided
|
Unassigned |
Bug Description
When GETting os-volumes, the returned list of volumes respects the osapi_max_limit configuration parameter but does not provide a link to the next element in the list. For example, with two volumes configured and osapi_max_limit set to 1, GETting volumes results in the following:
{
"volumes": [
{
{}
],
"id": "08792e26-
"size": 1,
}
]
}
Unsetting osapi_max_limit results in both volumes being listed:
{
"volumes": [
{
{}
],
"id": "08792e26-
"size": 1,
},
{
{}
],
"id": "5cf46cd2-
"size": 1,
}
]
}
tags: | added: api |
Changed in nova: | |
status: | New → Confirmed |
Changed in nova: | |
assignee: | nobody → Chung Chih, Hung (lyanchih) |
Changed in nova: | |
assignee: | Chung Chih, Hung (lyanchih) → nobody |
status: | In Progress → Confirmed |
Changed in nova: | |
importance: | Undecided → Wishlist |
Changed in nova: | |
status: | New → Won't Fix |
IIUC all the items of the list (=N) can *only* be fetched if:
"osapi_ max_limit" >= N
and if N > "osapi_max_limit" then N - "osapi_max_limit" items get truncated. The code [1] has this section:
def _get_collection _links( self,
request,
items,
collection_ name,
id_key= "uuid") : max_limit, max_limit.
CONF.osapi_ max_limit.
int( request. params. get("limit" , CONF.osapi_ max_limit) ),
CONF. osapi_max_ limit)
"""Retrieve 'next' link, if applicable. This is included if:
1) 'limit' param is specified and equals the number of items.
2) 'limit' param is specified but it exceeds CONF.osapi_
in this case the number of items is CONF.osapi_
3) 'limit' param is NOT specified but the number of items is
"""
links = []
max_items = min(
if max_items and max_items == len(items):
The "==" confuses me, I would expect "<" here.
References: /github. com/openstack/ nova/blob/ c857d791a2f127e 63c20ae8380498f f67e76051b/ nova/api/ openstack/ common. py#L471
[1] https:/