0

I am working on a project where in I have to build a rest api and will be using chef at the backend. How can the integration between chef and a rest api be done? For eg: I will be having chef recipes on the chef server. So how can these recipes be invoked from the rest api? Also what is the best language that can be used for developing a rest api?

Krish Gambhir
  • 47
  • 2
  • 8

1 Answers1

1

There really isn't much information in your question to go on, but it seems like you may be conflating a few different concepts.

The Chef server is the central location to store your cookbooks and other config data. You do not "invoke cookbooks" on it. Though cookbooks can be uploaded to the Chef server, nodes running the Chef client are the ones that would "invoke" a cookbook. You can read more about the Chef server on the Chef website.

As far as integration between the Chef server and a RESTful API. No such "integration" needs to be done, the server already provides with one. You can see its documentation on the Chef website. You may be specifically interested in the /cookbooks endpoint:

The /cookbooks endpoint has the following methods: GET. The GET method is used to return a hash of all cookbooks and cookbook versions.

Finally, what the "best" language for a RESTful API is an matter of opinion and depends on your needs. A similar question has been asked and closed for that reason previously.

If you're just getting started, you may also find this question about what RESTful programming is helpful.

Community
  • 1
  • 1
Thai Wood
  • 485
  • 4
  • 13