Project

General

Profile

Actions

Bug #2773

closed

API Inconsistency - /puppetclasses and /api/puppetclasses

Added by Tal Kammer almost 11 years ago. Updated almost 11 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
API
Target version:
-
Difficulty:
Triaged:
Fixed in Releases:
Found in Releases:

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

Actions #1

Updated by Joseph Magen almost 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?

Actions #2

Updated by Dominic Cleal almost 11 years ago

  • Status changed from Assigned to Feedback
Actions #3

Updated by Joseph Magen almost 11 years ago

  • Status changed from Feedback to Closed

answered of foreman-users mailing list

Actions

Also available in: Atom PDF