diff --git a/apis/chef/src/main/java/org/jclouds/chef/ChefApi.java b/apis/chef/src/main/java/org/jclouds/chef/ChefApi.java index c3328957c2..eccebf6c76 100644 --- a/apis/chef/src/main/java/org/jclouds/chef/ChefApi.java +++ b/apis/chef/src/main/java/org/jclouds/chef/ChefApi.java @@ -555,6 +555,19 @@ public interface ChefApi { */ SearchResult extends Node> searchNodes(); + + /** + * search all nodes that match the query parameter. + *
+ * Note that without any request parameters this will return all of the data + * within the index. + * + * @return The response contains the total number of rows that matched your + * request, the position this result set returns (useful for paging) + * and the rows themselves. + */ + SearchResult extends Node> searchNodes(String qeury); + /** * search all items in a databag. * diff --git a/apis/chef/src/main/java/org/jclouds/chef/ChefAsyncApi.java b/apis/chef/src/main/java/org/jclouds/chef/ChefAsyncApi.java index 6458e724e1..e62e0fb367 100644 --- a/apis/chef/src/main/java/org/jclouds/chef/ChefAsyncApi.java +++ b/apis/chef/src/main/java/org/jclouds/chef/ChefAsyncApi.java @@ -29,6 +29,7 @@ import javax.ws.rs.GET; import javax.ws.rs.HEAD; import javax.ws.rs.POST; import javax.ws.rs.PUT; +import javax.ws.rs.QueryParam; import javax.ws.rs.Path; import javax.ws.rs.PathParam; import javax.ws.rs.Produces; @@ -432,6 +433,14 @@ public interface ChefAsyncApi { @ResponseParser(ParseSearchNodesFromJson.class) ListenableFuture extends SearchResult extends Node>> searchNodes(); + /** + * @see ChefApi#searchNodes(String) + */ + @GET + @Path("/search/node") + @ResponseParser(ParseSearchNodesFromJson.class) + ListenableFuture extends SearchResult extends Node>> searchNodes(@QueryParam("q") String query); + /** * @see ChefApi#searchDatabag(String) */ diff --git a/apis/chef/src/main/java/org/jclouds/chef/test/TransientChefAsyncApi.java b/apis/chef/src/main/java/org/jclouds/chef/test/TransientChefAsyncApi.java index ab93825424..e5aaaecc72 100644 --- a/apis/chef/src/main/java/org/jclouds/chef/test/TransientChefAsyncApi.java +++ b/apis/chef/src/main/java/org/jclouds/chef/test/TransientChefAsyncApi.java @@ -297,6 +297,11 @@ public class TransientChefAsyncApi implements ChefAsyncApi { throw new UnsupportedOperationException(); } + @Override + public ListenableFuture extends SearchResult extends Node>> searchNodes(String query) { + throw new UnsupportedOperationException(); + } + @Override public ListenableFuture extends SearchResult extends Role>> searchRoles() { throw new UnsupportedOperationException();