Bug 1138262

Summary: API sort hash is not working, but sort_by and sort_order are working but undocumented
Product: Red Hat Satellite Reporter: Peter Vreman <peter.vreman>
Component: API - ContentAssignee: Bryan Kearney <bkearney>
Status: CLOSED WONTFIX QA Contact: Katello QA List <katello-qa-list>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 6.0.3CC: swadeley, tstrachota
Target Milestone: UnspecifiedKeywords: Triaged
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-09-04 17:44:11 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1122832, 1309791    

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.