Bug 1558114
Summary: | [RFE] Support /count API for owner pools | |||
---|---|---|---|---|
Product: | [Community] Candlepin | Reporter: | Jonathon Turel <jturel> | |
Component: | candlepin | Assignee: | Barnaby Court <bcourt> | |
Status: | CLOSED CURRENTRELEASE | QA Contact: | Katello QA List <katello-qa-list> | |
Severity: | unspecified | Docs Contact: | ||
Priority: | unspecified | |||
Version: | 2.2 | CC: | bcourt, redakkan, skallesh | |
Target Milestone: | --- | |||
Target Release: | --- | |||
Hardware: | Unspecified | |||
OS: | Unspecified | |||
Whiteboard: | ||||
Fixed In Version: | candlepin-2.3.5-1 | Doc Type: | If docs needed, set a value | |
Doc Text: | Story Points: | --- | ||
Clone Of: | ||||
: | 1560054 (view as bug list) | Environment: | ||
Last Closed: | 2018-04-06 15:08:33 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: | 1560054 |
Description
Jonathon Turel
2018-03-19 16:27:06 UTC
After discussions with Brad, it would be acceptable to provide the maximum number of records as metadata when the first page of data is returned. Currently we provide a link header that does have some useful information and could be used as a workaround. However, it would be better to include the total # of items as a value. Link: <https://localhost:8443/candlepin/owners/foo/pools?include=id&page=1&per_page=5&include=id&per_page=5&page=2>; rel="next", <https://localhost:8443/candlepin/owners/foo/pools?include=id&page=1&per_page=5&include=id&per_page=5&page=1>; rel="first", <https://localhost:8443/candlepin/owners/foo/pools?include=id&page=1&per_page=5&include=id&per_page=5&page=200>; rel="last" A http header of "X-total-count" with the total number of records would be very helpful if paging is used. I looked into using the link header. My approach was using ?page=1&per_page=1 in my query. In theory the last page should be the total number. It was still slow enough to make paging an unpleasant experience when there are many pools. I had about 3k pool and the response was over 3 seconds, so we won't be going that route as a workaround. In addition to the "x-total-count" header, it will be nice to have an "x-subtotal-count" header which reflects the number of results according to any filtering applied. Barnaby, Per our in-person chat I spoke with Walden regarding handling subtotals. He told me that the x-total-count header reflecting the total after filtering applied is fine - so we can forget about adding the subtotal header I proposed. |