use of io.cdap.cdap.spi.metadata.SearchResponse in project cdap by caskdata.
the class MetadataHttpHandler method searchNamespace.
@GET
@Path("/namespaces/{namespace-id}/metadata/search")
public void searchNamespace(HttpRequest request, HttpResponder responder, @PathParam("namespace-id") String namespaceId, @Nullable @QueryParam("scope") String scope, @Nullable @QueryParam("query") String searchQuery, @Nullable @QueryParam("target") List<String> targets, @Nullable @QueryParam("sort") String sort, @QueryParam("offset") @DefaultValue("0") int offset, // 2147483647 is Integer.MAX_VALUE
@QueryParam("limit") @DefaultValue("2147483647") int limit, @Nullable @QueryParam("numCursors") Integer numCursors, @QueryParam("cursorRequested") @DefaultValue("false") boolean cursorRequested, @Nullable @QueryParam("cursor") String cursor, @QueryParam("showHidden") @DefaultValue("false") boolean showHidden, @Nullable @QueryParam("entityScope") String entityScope, @Nullable @QueryParam("responseFormat") @DefaultValue("v5") String responseFormat) throws Exception {
SearchRequest searchRequest = getValidatedSearchRequest(scope, ImmutableList.of(namespaceId), searchQuery, targets, sort, offset, limit, numCursors, cursorRequested, cursor, showHidden, entityScope);
SearchResponse response = metadataAdmin.search(searchRequest);
responder.sendJson(HttpResponseStatus.OK, GSON.toJson("v5".equals(responseFormat) ? MetadataCompatibility.toV5Response(response, entityScope) : response));
}
use of io.cdap.cdap.spi.metadata.SearchResponse in project cdap by caskdata.
the class AuditMetadataStorage method search.
@Override
public SearchResponse search(SearchRequest request) throws IOException {
try {
SearchResponse result = storage.search(request);
emitMetrics("search.count");
return result;
} catch (Exception e) {
emitMetrics("search.error");
throw e;
}
}
Aggregations