Curl only retrieves first page of hosts

Problem:
When I do a curl command to retrieve my host list, I’m only getting back my first 100 results of 677.

curl --insecure -u myusername -H “Accept:application/json” https://myforemandomain/api/v2/hosts ?per_page=1000 | jq ‘.results .name’

Foreman and Proxy versions:

Foreman and Proxy plugin versions:
Foreman version 1.23.2 and API v2

Is there a way to retrieve all of the results from my hosts page?

Is the above a formatting issue? I see a space between “hosts” and ?per_page

Run it without the JQ portion. The raw json should have the result/pagination info at the top of the return before the results

FWIW I think this is some kind of easy fix. I use per_page all day frequently and it totally works…

3 Likes