v3 - pagination in GET services does not work

Bug #1451402 reported by Jamie Hannaford
22
This bug affects 2 people
Affects Status Importance Assigned to Milestone
OpenStack Identity (keystone)
Fix Released
Undecided
Unassigned
openstack-api-site
Fix Released
High
Diane Fleming

Bug Description

When I execute

GET http://xxx.xxx.xxx.xxx:35357/v3/services?page=2&per_page=5

I expect to see a paginated collection returned (5 resources in total), however this is not the case. Instead I get back the full collection - so it seems like the query params are being ignored.

The next and prev links don't reference the next page in the collection either.

Do I need to configure the conf file or something? If so, I couldn't find it documented anywhere.

Revision history for this message
Dolph Mathews (dolph) wrote :

Where are page and per_page parameters documented with respect to v3? The next and previous links are intended to give the backend driver control over pagination. There's no guaranteed support for API users to make arbitrary pagination queries that are not provided by the backend due to the difference in pagination strategies required for different backends (SQL vs LDAP, for example).

Changed in keystone:
status: New → Incomplete
Revision history for this message
Jamie Hannaford (jamie-hannaford) wrote :

Here: http://developer.openstack.org/api-ref-identity-v3.html

For most GET operations which return a collection (list services, etc.) - there a bunch of query parameters, including `page` and `per_page`.

If we do not make pagination available over the API to end-users, we should remove all references to these parameters and make it very clear that v3 does not support pagination.

Revision history for this message
Launchpad Janitor (janitor) wrote :

[Expired for Keystone because there has been no activity for 60 days.]

Changed in keystone:
status: Incomplete → Expired
Revision history for this message
Dolph Mathews (dolph) wrote :

As mentioned in comment #2, the page and per_page parameters should be removed from http://developer.openstack.org/api-ref-identity-v3.html as they are not, and have never been, supported by keystone.

Revision history for this message
Dolph Mathews (dolph) wrote :

I left additional info in a duplicate of this bug: https://bugs.launchpad.net/keystone/+bug/1480787/comments/1

Anne Gentle (annegentle)
Changed in openstack-api-site:
status: New → Confirmed
importance: Undecided → Medium
Atsushi SAKAI (sakaia)
Changed in openstack-api-site:
assignee: nobody → Atsushi SAKAI (sakaia)
Atsushi SAKAI (sakaia)
tags: added: keystone
Revision history for this message
Atsushi SAKAI (sakaia) wrote :

For your case, It seems solved by using marker/limit.
Is your problem solved? or you still have a problem?

OpenStack Identity API v2.0 Paginated collections
http://specs.openstack.org/openstack/keystone-specs/api/v2.0/identity-api-v2.0-paginated_collections.html

Revision history for this message
Jamie Hannaford (jamie-hannaford) wrote :

I'm not sure what you mean. This is a bug with v3 documentation. You've posted a link to the v2 API.

Ladislav Smola (lsmola)
Changed in keystone:
status: Expired → Confirmed
Revision history for this message
Ladislav Smola (lsmola) wrote :

Yeah the v3 pagination doesn't work at all. I've set list_limit to 2 for testing

crudini --set /etc/keystone/keystone.conf DEFAULT list_limit 2

and now I can't access my data :-)

here is the response, it doesn't contain links to previous and next either, only truncate=true is correct

{"links"=>{"self"=>"http://10.8.99.222:35357/v3/projects", "previous"=>nil, "next"=>nil}, "projects"=>[{"description"=>"Heat stack user project", "links"=>{"self"=>"http://10.8.99.222:35357/v3/projects/1e08f3807b9348078a31b23b2938d38b"}, "enabled"=>true, "id"=>"1e08f3807b9348078a31b23b2938d38b", "parent_id"=>nil, "domain_id"=>"daff4aab54244fa1aaeac4d436ec97b6", "name"=>"6923ecb4505e44a9b614912ce6c7cd5b-a3dd363c-de55-4984-9f30-eec3c5a"}, {"description"=>"Heat stack user project", "links"=>{"self"=>"http://10.8.99.222:35357/v3/projects/2982d2698be14c359e780c6ca975e5e9"}, "enabled"=>true, "id"=>"2982d2698be14c359e780c6ca975e5e9", "parent_id"=>nil, "domain_id"=>"daff4aab54244fa1aaeac4d436ec97b6", "name"=>"6923ecb4505e44a9b614912ce6c7cd5b-fe618d76-8006-44aa-9469-934e370"}], "truncated"=>true}

Revision history for this message
Ladislav Smola (lsmola) wrote :

Could anybody set this to High? I guess not working pagination is pretty essential. :-)

Changed in openstack-api-site:
assignee: Atsushi SAKAI (sakaia) → Diane Fleming (diane-fleming)
milestone: none → liberty
importance: Medium → High
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to api-site (master)

Fix proposed to branch: master
Review: https://review.openstack.org/230081

Changed in openstack-api-site:
status: Confirmed → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to api-site (master)

Reviewed: https://review.openstack.org/230081
Committed: https://git.openstack.org/cgit/openstack/api-site/commit/?id=a0972f56cc9460dda502cfe3775064e7a847fab3
Submitter: Jenkins
Branch: master

commit a0972f56cc9460dda502cfe3775064e7a847fab3
Author: Diane Fleming <email address hidden>
Date: Thu Oct 1 14:01:30 2015 -0500

    Remove page and per_page query parameters from Identity v3

    Change-Id: I32488c41d36816d1bc337b3ad194c0b8a3743c05
    Closes-Bug: #1451402

Changed in openstack-api-site:
status: In Progress → Fix Released
Revision history for this message
Kent Wang (k.wang) wrote :

Looks like this should be set to Won't Fix if no v3 support

tags: removed: keystone
Revision history for this message
Steve Martinelli (stevemar) wrote :

AFAICT, setting the global list_limit option on the mitaka version works -- just tested it with user list, project list and service list.
i'm marking this as incomplete for now since i don't know what else to test

Changed in keystone:
status: Confirmed → Incomplete
Revision history for this message
Steve Martinelli (stevemar) wrote :

marking this as fix-released since it should be working in mitaka

Changed in keystone:
status: Incomplete → Fix Released
Revision history for this message
Henry Nash (henry-nash) wrote :

Marking this as fixed seems confusing (at least with the existing title) - since AFAIK we are not support v3 pagination at all. Limits, yes, pagination, no.

Revision history for this message
Ladislav Smola (lsmola) wrote :

I must say, I am pretty confused whether pagination of Keystone v3 works now or not. If not, can you please not mark it as fix released?

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.