added node search chefapi

This commit is contained in:
Garrett Eardley 2012-08-30 23:02:32 +01:00
parent 727e749296
commit 6d1b4f0bbf
3 changed files with 27 additions and 0 deletions

View File

@ -555,6 +555,19 @@ public interface ChefApi {
*/
SearchResult<? extends Node> searchNodes();
/**
* search all nodes that match the query parameter.
* <p/>
* 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.
* <p/>

View File

@ -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)
*/

View File

@ -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();