Search

Apart from these endpoints, the Chef server API provides us with an endpoint to query data indexed by the Chef server. This includes data bags, environments, roles, and nodes. The Chef server API provides two endpoints for the purposes of search: /search and /search/INDEX. The search engine used by Chef is based on Apache Solr. You can do a full-text query using a defined query syntax. Chef provides support for search, using different patterns such as exact, wildcard, range, and fuzzy.

/search

The /search endpoint allows you to search for data bags, roles, nodes, and environments. It has support for the GET method.

GET

The GET method returns a JSON with links to each available search index.

For a request, we can use the following code:

GET /search ...

Get Mastering Chef now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.