Listing resources with 'fields' and 'limit' doesn't return a 'next' link correctly

Bug #1715541 reported by Hironori Shiina
18
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Ironic
Fix Released
Medium
Unassigned

Bug Description

If API to list resources is requested with the 'fields' parameter and the 'limit' parameter, the 'next' parameter doesn't give an appropriate URL. The 'fields' parameter is not added in the URL. If 'uuid' field is not specified in 'fields' request parameter, the 'maker' request parameter in the 'next' URL is set to 'Unset'.

When the following request is posted:
  GET /v1/volume/connectors/?limit=1&fields=type,connector_id
It got a response with the following 'next' parameter:
  "next": "http://127.0.0.1:6385/v1/volume/connectors?sort_key=id&sort_dir=asc&limit=1&marker=Unset"

Revision history for this message
Vasyl Saienko (vsaienko) wrote :

can't reproduce. my output is http://paste.openstack.org/show/621638/

Revision history for this message
Vasyl Saienko (vsaienko) wrote :

the fields indeed missing in the next link

Changed in ironic:
status: New → Confirmed
Ruby Loo (rloo)
Changed in ironic:
assignee: nobody → Ruby Loo (rloo)
importance: Undecided → Medium
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to ironic (master)

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

Changed in ironic:
status: Confirmed → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

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

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix merged to ironic (master)

Reviewed: https://review.openstack.org/505837
Committed: https://git.openstack.org/cgit/openstack/ironic/commit/?id=f8a42d366c0d20918fee579406feffe83c1f7b9a
Submitter: Jenkins
Branch: master

commit f8a42d366c0d20918fee579406feffe83c1f7b9a
Author: Ruby Loo <email address hidden>
Date: Wed Sep 20 18:19:17 2017 -0400

    ListType preserves the order of the input

    The ListType class returns a list of items in a string.
    The list was not guaranteed to be the same order as in the string;
    this patch changes it so that the order is preserved.

    Related-Bug: #1715541
    Change-Id: Iefab751d34e97f460b6d63316eb38085e4eb1154

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on ironic (master)

Change abandoned by "Dmitry Tantsur <email address hidden>" on branch: master
Review: https://review.opendev.org/c/openstack/ironic/+/506280
Reason: Abandoning because of inactivity. Will need to be significantly reworked to match the new API architecture.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

Change abandoned by "Dmitry Tantsur <email address hidden>" on branch: master
Review: https://review.opendev.org/c/openstack/ironic/+/508368
Reason: Abandoning because of inactivity. Will need to be significantly reworked to match the new API architecture.

Ruby Loo (rloo)
Changed in ironic:
assignee: Ruby Loo (rloo) → nobody
Revision history for this message
Iury Gregory Melo Ferreira (iurygregory) wrote :

Marking as Invalid since the change was abandoned. Feel free to re-open if necessary.

Changed in ironic:
status: In Progress → Invalid
status: Invalid → Incomplete
Revision history for this message
Iury Gregory Melo Ferreira (iurygregory) wrote :

Moving to Incomplete, I don't have a setup at the moment to reproduce, but I will try to test if we can still reproduce this issue.

Revision history for this message
Dmitry Tantsur (divius) wrote :

Tested on Bifrost, I cannot confirm this bug any more:

$ curl -sH "x-openstack-ironic-api-version: 1.80" -u "..." "http://192.168.122.1:6385/v1/nodes?fields=name&limit=1" | jq .
{
  "nodes": [
    {
      "name": "testvm1",
      "links": [
        {
          "href": "http://192.168.122.1:6385/v1/nodes/4e41df61-84b1-5856-bfb6-6b5f2cd3dd11",
          "rel": "self"
        },
        {
          "href": "http://192.168.122.1:6385/nodes/4e41df61-84b1-5856-bfb6-6b5f2cd3dd11",
          "rel": "bookmark"
        }
      ]
    }
  ],
  "next": "http://192.168.122.1:6385/v1/nodes?sort_key=id&sort_dir=asc&fields=name&limit=1&marker=4e41df61-84b1-5856-bfb6-6b5f2cd3dd11"
}

All links look correct to me.

Changed in ironic:
status: Incomplete → 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.