Red Hat Satellite engineering is moving the tracking of its product development work on Satellite to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "Satellite project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs will be migrated starting at the end of May. If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "Satellite project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/SAT-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1138262 - API sort hash is not working, but sort_by and sort_order are working but undocumented
Summary: API sort hash is not working, but sort_by and sort_order are working but undo...
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: API - Content
Version: 6.0.3
Hardware: Unspecified
OS: Unspecified
unspecified
medium
Target Milestone: Unspecified
Assignee: Bryan Kearney
QA Contact: Katello QA List
URL:
Whiteboard:
Depends On:
Blocks: 1122832 1309791
TreeView+ depends on / blocked
 
Reported: 2014-09-04 11:53 UTC by Peter Vreman
Modified: 2018-09-04 17:44 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2018-09-04 17:44:11 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Foreman Issue Tracker 18341 0 None None None 2017-02-01 12:53:59 UTC
Red Hat Bugzilla 1417726 0 medium CLOSED Hammer params for ordering are inconsistent 2021-02-22 00:41:40 UTC

Internal Links: 1417726

Description Peter Vreman 2014-09-04 11:53:28 UTC
Description of problem:
In the API the order option is working. The documented sort hash is not working. There are the undocumented sort_by and sort_order that are working instead.

Working order:

# curl -K /opt/hoici/etc/curl-admin.conf -H 'Content-Type: application/json' -d '{"per_page":"9999","sort":{"by":"name","order":"desc"}}' -XGET https://localhost/katello/api/v2/organizations/4/products | jq . | tail -n10
  "sort": {
    "order": null,
    "by": null
  },
  "search": null,
  "per_page": "9999",
  "page": 1,
  "subtotal": 19,
  "total": 19
}

Not working sort hash:

# curl -K /opt/hoici/etc/curl-admin.conf -H 'Content-Type: application/json' -d '{"per_page":"9999","order":"name desc"}' -XGET https://localhost/katello/api/v2/organizations/4/products | jq . | tail -n10
  "sort": {
    "order": "desc",
    "by": "name"
  },
  "search": null,
  "per_page": "9999",
  "page": 1,
  "subtotal": 19,
  "total": 19
}

Working sort_by and sort_order:

# curl -K /opt/hoici/etc/curl-admin.conf -H 'Content-Type: application/json' -d '{"per_page":"9999","sort_by":"name","sort_order":"desc"}' -XGET https://localhost/katello/api/v2/organizations/4/products | jq . | tail -n 10
  "sort": {
    "order": "desc",
    "by": "name"
  },
  "search": null,
  "per_page": "9999",
  "page": 1,
  "subtotal": 19,
  "total": 19
}


Version-Release number of selected component (if applicable):


How reproducible:


Steps to Reproduce:
1.
2.
3.

Actual results:


Expected results:
Consistent API functionality and documentation for sorting the results


Additional info:

Comment 1 RHEL Program Management 2014-09-04 12:03:00 UTC
Since this issue was entered in Red Hat Bugzilla, the release flag has been
set to ? to ensure that it is properly evaluated for this release.

Comment 3 Bryan Kearney 2016-07-08 20:28:07 UTC
Per 6.3 planning, moving out non acked bugs to the backlog

Comment 5 Tomas Strachota 2017-02-01 12:53:57 UTC
Created redmine issue http://projects.theforeman.org/issues/18341 from this bug

Comment 6 Bryan Kearney 2018-09-04 17:44:11 UTC
Thank you for your interest in Satellite 6. We have evaluated this request, and we do not expect this to be implemented in the product in the foreseeable future. We are therefore closing this out as WONTFIX. If you have any concerns about this, please feel free to contact Rich Jerrido or Bryan Kearney. Thank you.


Note You need to log in before you can comment on or make changes to this bug.