Book Image

Mastering Chef

By : Mayank Joshi
Book Image

Mastering Chef

By: Mayank Joshi

Overview of this book

Table of Contents (20 chapters)
Mastering Chef
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
2
Knife and Its Associated Plugins
10
Data Bags and Templates
Index

Chapter 11. Chef API and Search

Chef provides a simple and wonderful API to interact with it and get information about different objects that are stored within it. The API provided by Chef is the REST API, and hence it can be used with any programming language that provides support to make HTTP calls. However, one of the more fundamental questions is: why would we even want to learn about API interfaces provided by Chef?

Well, most of the time, we will be writing cookbooks for handling the installation and configuration of different aspects of our infrastructure. At other times, we'll be managing information stored in data bags, or defining environments and roles. However, there will be a time when configuration of a machine or service won't be enough and you'll want to rely on information about the nodes stored in the Chef server for the purpose of configuration. These are times when we'll need to rely on Chef API and the search capabilities provided by Chef. Then, there is another case...