Bug #2773
closedAPI Inconsistency - /puppetclasses and /api/puppetclasses
Description
I was trying to list all the puppet classes in our server and when running:
curl -s -H "Accept:application/json" -k -u $USER:$PASS --get https://$HOST/puppetclasses
I got one set of results.
and when running:
curl -s -H "Accept:application/json" -k -u $USER:$PASS --get https://$HOST/api/puppetclasses
I got a different set of results.
Can someone please verify this.
Thanks,
Tal
Updated by Joseph Magen over 11 years ago
- Category set to API
- Status changed from New to Assigned
- Assignee set to Joseph Magen
The JSON response for /puppetclasses (without /api) does not paginate the results. It retursn on the puppetclasses in Foreman.
The JSON response for /api/puppetclasses paginates the results according the the parameters :page and :per_page. If you want all the results, pass :per_page in the URL like this below.
/api/puppetclasses?per_page=100000
If there is no parameter passed, it takes the default in Settings, which is why the response was different.
By the way, the JSON responses in the UI controllers (without /api/) are going to be deprecated soon, so there is no reason to paginate the response. Can I close this issue?
Updated by Dominic Cleal over 11 years ago
- Status changed from Assigned to Feedback
Updated by Joseph Magen over 11 years ago
- Status changed from Feedback to Closed
answered of foreman-users mailing list