@Override public RestStatus status() { return isFound() ? RestStatus.OK : RestStatus.NOT_FOUND; }
@Override public GetPipelineResponse newResponse() { return new GetPipelineResponse(); } }
/** * Check if a pipeline exists * @param pipelineName pipeline name * @return true if the pipeline exists, false otherwise * @throws IOException In case of error */ public boolean isExistingPipeline(String pipelineName) throws IOException { logger.debug("is existing pipeline [{}]", pipelineName); try { return client.ingest().getPipeline(new GetPipelineRequest(pipelineName), RequestOptions.DEFAULT).isFound(); } catch (ElasticsearchStatusException e) { if (e.status().getStatus() == 404) { return false; } throw new IOException(e); } }
@Override protected GetPipelineResponse newResponse() { return new GetPipelineResponse(); }
/** * Check if a pipeline exists * @param pipelineName pipeline name * @return true if the pipeline exists, false otherwise * @throws IOException In case of error */ public boolean isExistingPipeline(String pipelineName) throws IOException { logger.debug("is existing pipeline [{}]", pipelineName); try { return client.ingest().getPipeline(new GetPipelineRequest(pipelineName), RequestOptions.DEFAULT).isFound(); } catch (ElasticsearchStatusException e) { if (e.status().getStatus() == 404) { return false; } throw new IOException(e); } }
@Override protected void masterOperation(GetPipelineRequest request, ClusterState state, ActionListener<GetPipelineResponse> listener) throws Exception { listener.onResponse(new GetPipelineResponse(IngestService.getPipelines(state, request.getIds()))); }
@Override public RestStatus status() { return isFound() ? RestStatus.OK : RestStatus.NOT_FOUND; }
@Override public GetPipelineResponse newResponse() { return new GetPipelineResponse(); } }
@Override public RestStatus status() { return isFound() ? RestStatus.OK : RestStatus.NOT_FOUND; }
@Override public GetPipelineResponse newResponse() { return new GetPipelineResponse(); } }
@Override public RestStatus status() { return isFound() ? RestStatus.OK : RestStatus.NOT_FOUND; }
@Override protected GetPipelineResponse newResponse() { return new GetPipelineResponse(); }
@Override public GetPipelineResponse newResponse() { return new GetPipelineResponse(); } }
@Override protected GetPipelineResponse newResponse() { return new GetPipelineResponse(); }
@Override protected GetPipelineResponse newResponse() { return new GetPipelineResponse(); }
/** * * @param parser the parser for the XContent that contains the serialized GetPipelineResponse. * @return an instance of GetPipelineResponse read from the parser * @throws IOException If the parsing fails */ public static GetPipelineResponse fromXContent(XContentParser parser) throws IOException { ensureExpectedToken(XContentParser.Token.START_OBJECT, parser.nextToken(), parser::getTokenLocation); List<PipelineConfiguration> pipelines = new ArrayList<>(); while(parser.nextToken().equals(Token.FIELD_NAME)) { String pipelineId = parser.currentName(); parser.nextToken(); XContentBuilder contentBuilder = XContentBuilder.builder(parser.contentType().xContent()); contentBuilder.generator().copyCurrentStructure(parser); PipelineConfiguration pipeline = new PipelineConfiguration( pipelineId, BytesReference.bytes(contentBuilder), contentBuilder.contentType() ); pipelines.add(pipeline); } ensureExpectedToken(XContentParser.Token.END_OBJECT, parser.currentToken(), parser::getTokenLocation); return new GetPipelineResponse(pipelines); }
@Override protected void masterOperation(GetPipelineRequest request, ClusterState state, ActionListener<GetPipelineResponse> listener) throws Exception { listener.onResponse(new GetPipelineResponse(pipelineStore.getPipelines(state, request.getIds()))); }
@Override protected void masterOperation(GetPipelineRequest request, ClusterState state, ActionListener<GetPipelineResponse> listener) throws Exception { listener.onResponse(new GetPipelineResponse(IngestService.getPipelines(state, request.getIds()))); }
@Override protected void masterOperation(GetPipelineRequest request, ClusterState state, ActionListener<GetPipelineResponse> listener) throws Exception { listener.onResponse(new GetPipelineResponse(pipelineStore.getPipelines(state, request.getIds()))); }
/** * * @param parser the parser for the XContent that contains the serialized GetPipelineResponse. * @return an instance of GetPipelineResponse read from the parser * @throws IOException If the parsing fails */ public static GetPipelineResponse fromXContent(XContentParser parser) throws IOException { ensureExpectedToken(XContentParser.Token.START_OBJECT, parser.nextToken(), parser::getTokenLocation); List<PipelineConfiguration> pipelines = new ArrayList<>(); while(parser.nextToken().equals(Token.FIELD_NAME)) { String pipelineId = parser.currentName(); parser.nextToken(); XContentBuilder contentBuilder = XContentBuilder.builder(parser.contentType().xContent()); contentBuilder.generator().copyCurrentStructure(parser); PipelineConfiguration pipeline = new PipelineConfiguration( pipelineId, BytesReference.bytes(contentBuilder), contentBuilder.contentType() ); pipelines.add(pipeline); } ensureExpectedToken(XContentParser.Token.END_OBJECT, parser.currentToken(), parser::getTokenLocation); return new GetPipelineResponse(pipelines); }