Bug #4643
Web service API should be designed and documented
| Status: | Accepted | Start date: | 08/27/2010 | |
|---|---|---|---|---|
| Priority: | Normal | Due date: | ||
| Assignee: | - | % Done: | 0% | |
| Category: | - | |||
| Target version: | - | |||
| Keywords: | Affected URL: | |||
| Branch: | Affected Dashboard version: | |||
Description
Currently the application provides an incomplete and undocumented API. Unfortunately, various people are beginning to use these. Worse still, the report aggregator and node classifier use these undocumented APIs in incompatible ways across different Puppet releases.
Desired behavior:
- All actions, parameters and output formats should be documented and examples provided.
- All actions that emit data should be able to produce JSON, the preferred format for those working with web services.
- All actions that return lists of records should be paginated, e.g. fetching “/reports.json” should return a paginated subset of the reports data, rather than all reports. All paginated actions should emit a consistent field describing the number of pages and records matched. All actions doing pagination should accept a consistent set of parameters to retrieve records for a particular page.
Optional behavior: * Authenticity token cookie, as used by Rails, may be used to guard all non-GET actions as long as it’s easy to retrieve. * Site-specific token may be used to guard all non-GET actions.
History
#1
Updated by James Turnbull almost 3 years ago
Awesome! +1.
#2
Updated by James Turnbull over 1 year ago
- Target version changed from 1.2.0 to 140
#3
Updated by Daniel Pittman about 1 year ago
- Target version deleted (
140)