GET details REST API next link missing 'details'

Bug #1299247 reported by Steven Kaufer
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Cinder
Fix Released
High
Steven Kaufer
Icehouse
Fix Released
Undecided
Unassigned
OpenStack Compute (nova)
Fix Released
High
Steven Kaufer

Bug Description

When executing a pagination query a "next" link is included in the API reply when there are more items then the specified limit.

See pagination documentation for more information: http://docs.openstack.org/api/openstack-compute/2/content/Paginated_Collections-d1e664.html

The caller should be able to invoke the "next" link (without having to re-format it) in order to get the next page of data. The documentation states "Subsequent links will honor the initial page size. Thus, a client may follow links to traverse a paginated collection without having to input the marker parameter."

The problem is that the "next" link is always scoped to the non-detailed query. For example, if you execute "/v2/<tenant>/servers/detail?limit=1", the "next" link does not have the URL for a detailed query and is formatted as "/v2/<tenant>/servers?limit=1&marker=<marker>". In this case the "next" link needs to be scoped to "/v2/<tenant>/servers/detail".

This bug is caused because the "next" link is always generated by the _collection_name value in the ViewBuilder -- this name is always "servers".

Steven Kaufer (kaufer)
Changed in nova:
assignee: nobody → Steven Kaufer (kaufer)
Changed in cinder:
assignee: nobody → Steven Kaufer (kaufer)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to cinder (master)

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

Changed in cinder:
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to nova (master)

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

Changed in nova:
status: New → In Progress
Jay Bryant (jsbryant)
Changed in cinder:
importance: Undecided → High
tags: added: icehouse-backport-potential
Revision history for this message
Huang Zhiteng (zhiteng-huang) wrote :

For Cinder, it seems this bug at least also affects detail view of volume transfer and volume backup.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to cinder (master)

Reviewed: https://review.openstack.org/84237
Committed: https://git.openstack.org/cgit/openstack/cinder/commit/?id=2981cdbb03c6f1239a58fedb260796667b8154ab
Submitter: Jenkins
Branch: master

commit 2981cdbb03c6f1239a58fedb260796667b8154ab
Author: Steven Kaufer <email address hidden>
Date: Mon Mar 31 20:32:39 2014 +0000

    GET details REST API next link missing 'details'

    When executing a pagination query a "next" link is included in the
    API reply when there are more items then the specified limit.

    See pagination documentation for more information:
    http://docs.openstack.org/api/openstack-compute/2/content/
    Paginated_Collections-d1e664.html

    The caller should be able to invoke the "next" link (without
    having to re-format it) in order to get the next page of data.
    The documentation states "Subsequent links will honor the
    initial page size. Thus, a client may follow links to traverse
    a paginated collection without having to input the marker parameter."

    The problem is that the "next" link is always scoped to the non-
    detailed query.

    For example, if you execute "/v2/<tenant>/volumes/detail?limit=1",
    the "next" link does not have the URL for a detailed query and is
    formatted as "/v2/<tenant>/volumes?limit=1&marker=<marker>". In this
    case the "next" link needs to be scoped to "/v2/<tenant>/volumes/detail".

    The user could work around this issue my manually inserting '/details'
    into the "next" link URL.

    Test code is included to verify that the '/details' URL is correctly added
    when the "next" link is included in a detailed pagination query. Also,
    existing tests were changed to ensure that the correct controller function
    (ie, 'index' vs. 'detail) are invoked for the appropriate query
    (ie, non-detailed or detailed) -- 'index' was previously alwayed invoked
    for detailed URL requests.

    Change-Id: Ib00d6deb25255fac1db0f7bf4ecd3c8d30e1c39d
    Closes-bug: 1299247

Changed in cinder:
status: In Progress → Fix Committed
Changed in nova:
importance: Undecided → High
Revision history for this message
Openstack Gerrit (openstack-gerrit) wrote : Fix merged to nova (master)

Reviewed: https://review.openstack.org/84308
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=65a2221a813ee5e295fbd0345361cf53d0914514
Submitter: Jenkins
Branch: master

commit 65a2221a813ee5e295fbd0345361cf53d0914514
Author: Steven Kaufer <email address hidden>
Date: Tue Apr 1 01:34:27 2014 +0000

    GET details REST API next link missing 'details'

    When executing a pagination query a "next" link is included in the
    API reply when there are more items then the specified limit.

    See pagination documentation for more information:
    http://docs.openstack.org/api/openstack-compute/2/content/
    Paginated_Collections-d1e664.html

    The caller should be able to invoke the "next" link (without
    having to re-format it) in order to get the next page of data.
    The documentation states "Subsequent links will honor the
    initial page size. Thus, a client may follow links to traverse
    a paginated collection without having to input the marker parameter."

    The problem is that the "next" link is always scoped to the
    non-detailed query.

    For example, if you execute "/v2/<tenant>/servers/detail?limit=1",
    the "next" link does not have the URL for a detailed query and is
    formatted as "/v2/<tenant>/servers?limit=1&marker=<marker>". In this
    case the "next" link needs to be scoped to "/v2/<tenant>/servers/detail".
    Common code is used for both the v2 and v3 APIs.

    Existing test cases will be updated to verify that the next link is
    correctly scoped for both the v2 and v3 APIs.

    The user could work around this issue my manually inserting '/details'
    into the "next" link URL.

    Change-Id: Ib06a6cc6e2dd5e2c8c16986ee256a58752626eb9
    Closes-bug: 1299247

Changed in nova:
status: In Progress → Fix Committed
Revision history for this message
Openstack Gerrit (openstack-gerrit) wrote : Fix proposed to cinder (stable/icehouse)

Fix proposed to branch: stable/icehouse
Review: https://review.openstack.org/90646

Mike Perez (thingee)
Changed in cinder:
milestone: none → juno-1
Thierry Carrez (ttx)
Changed in nova:
milestone: none → juno-1
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in cinder:
status: Fix Committed → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to cinder (stable/icehouse)

Reviewed: https://review.openstack.org/90646
Committed: https://git.openstack.org/cgit/openstack/cinder/commit/?id=00d456ba0c3c62db68dce778fa50837f5d7ebacb
Submitter: Jenkins
Branch: stable/icehouse

commit 00d456ba0c3c62db68dce778fa50837f5d7ebacb
Author: Steven Kaufer <email address hidden>
Date: Mon Mar 31 20:32:39 2014 +0000

    GET details REST API next link missing 'details'

    When executing a pagination query a "next" link is included in the
    API reply when there are more items then the specified limit.

    See pagination documentation for more information:
    http://docs.openstack.org/api/openstack-compute/2/content/
    Paginated_Collections-d1e664.html

    The caller should be able to invoke the "next" link (without
    having to re-format it) in order to get the next page of data.
    The documentation states "Subsequent links will honor the
    initial page size. Thus, a client may follow links to traverse
    a paginated collection without having to input the marker parameter."

    The problem is that the "next" link is always scoped to the non-
    detailed query.

    For example, if you execute "/v2/<tenant>/volumes/detail?limit=1",
    the "next" link does not have the URL for a detailed query and is
    formatted as "/v2/<tenant>/volumes?limit=1&marker=<marker>". In this
    case the "next" link needs to be scoped to "/v2/<tenant>/volumes/detail".

    The user could work around this issue my manually inserting '/details'
    into the "next" link URL.

    Test code is included to verify that the '/details' URL is correctly added
    when the "next" link is included in a detailed pagination query. Also,
    existing tests were changed to ensure that the correct controller function
    (ie, 'index' vs. 'detail) are invoked for the appropriate query
    (ie, non-detailed or detailed) -- 'index' was previously alwayed invoked
    for detailed URL requests.

    Change-Id: Ib00d6deb25255fac1db0f7bf4ecd3c8d30e1c39d
    Closes-bug: 1299247
    (cherry picked from commit 2981cdbb03c6f1239a58fedb260796667b8154ab)

tags: added: in-stable-icehouse
Chuck Short (zulcss)
tags: removed: icehouse-backport-potential
Thierry Carrez (ttx)
Changed in nova:
milestone: juno-1 → 2014.2
Thierry Carrez (ttx)
Changed in cinder:
milestone: juno-1 → 2014.2
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

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