Bug #2773
closed
API Inconsistency - /puppetclasses and /api/puppetclasses
Added by Tal Kammer almost 12 years ago.
Updated over 11 years ago.
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
- 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?
- Status changed from Assigned to Feedback
- Status changed from Feedback to Closed
answered of foreman-users mailing list
Also available in: Atom
PDF