Chef Ideas

We believe that the best way to build software is to do it in close collaboration with the people who use it.  We invite you to submit your ideas using the form below.  Please be sure to include the problem for which you are solving and the benefits of implementing the idea.  Thanks for collaborating with us!

Standardize APIs more consistently across services

Currently, if I want to export data from a `cfgmgmt` endpoint via the api using a curl, I can use `-d` to send a requestBody stating what output type I want (json), that looks like this:

curl -sS -H "api-token: ${token}" "https://${automate_url}/api/v0/cfgmgmt/nodes/export" -d '{"output_type":"json","filter":[],"sorting":{"field":"name","order":0}}'


However, if I try to use one of the compliance endpoints, that requestBody is fairly different:

curl -sS -H "api-token: ${token}" "https://${automate_url}/api/v0/compliance/reporting/export" -d '{"type":"json","filters":[{"type":"start_time","values":["2019-11-12T00:00:00Z"]},{"type":"end_time","values":["2019-11-12T23:59:59Z"]}]}'



One can see that the way to specify desired output type is different, This is just a small example that makes using the API difficult to use. Small discrepancies like this might also make it harder to document and patch correct usage of the api.

Another example is `filter` vs. `filters` in the above code blocks.

  • Guest
  • Nov 14 2019
  • Attach files