Actions
Bug #31897
openHeadline api feature per_page=all doesn't work for all resources
Status:
New
Priority:
Normal
Assignee:
-
Category:
API
Target version:
-
Description
Wanted to use parameter per_page=all with /api/fact_values but dit not get any results.
❯ http --timeout 600 --json get "$FOREMAN_URL/api/fact_values" search="name = solute_apt_updates::available_updates::count" per_page=all | jq ".total, .per_page, .results|length" 0 0 0 ❯ http --timeout 600 --json get "$FOREMAN_URL/api/fact_values" search="name = solute_apt_updates::available_updates::count" per_page=10000 | jq ".total, .per_page, .results|length" 0 10000 1014
Same with api/hosts thin=true
❯ http --timeout 600 --json get "$FOREMAN_URL/api/hosts" thin=true per_page=all | jq ".total, .per_page, .results|length" 0 0 0 ❯ http --timeout 600 --json get "$FOREMAN_URL/api/hosts" thin=true per_page=3000 | jq ".total, .per_page, .results|length" 1055 3000 1055 ❯ http --timeout 600 --json get "$FOREMAN_URL/api/hosts" thin=true | jq ".total, .per_page, .results|length" 1055 2000 1055
Since this was a headline feature of the 2.2.0 release and we just updated to 2.3.2. i was quite excited to use this.
Works fine without thin=true
❯ http --timeout 600 --json get "$FOREMAN_URL/api/hosts" | jq ".total, .per_page, .results|length" 1055 2000 1055 ❯ http --timeout 600 --json get "$FOREMAN_URL/api/hosts" per_page=all | jq ".total, .per_page, .results|length" 1055 1055 1055 ❯ http --timeout 600 --json get "$FOREMAN_URL/api/hosts" per_page=all search="name ~ dakr" | jq ".total, .per_page, .results|length" 1055 1055 6
fyi http is the tool https://github.com/httpie/httpie
Ticket of feature: https://projects.theforeman.org/issues/29909
Actions