Package org.elasticsearch.ingest
Class IngestPipelineTestUtils
java.lang.Object
org.elasticsearch.ingest.IngestPipelineTestUtils
Utils for creating/retrieving/deleting ingest pipelines in a test cluster.
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
deletePipelinesIgnoringExceptions
(ElasticsearchClient client, Iterable<String> ids) Attempt to delete the ingest pipeline with the givenid
, using the givenElasticsearchClient
, and logging (but otherwise ignoring) the result.static SimulatePipelineRequest
jsonSimulatePipelineRequest
(String jsonString) Construct a newSimulatePipelineRequest
whose content is the given JSON document, represented as aString
.static SimulatePipelineRequest
jsonSimulatePipelineRequest
(BytesReference jsonBytes) Construct a newSimulatePipelineRequest
whose content is the given JSON document, represented as aBytesReference
.static void
putJsonPipeline
(ElasticsearchClient client, String id, String jsonString) Create an ingest pipeline with the given ID and body, using the givenElasticsearchClient
.static void
putJsonPipeline
(ElasticsearchClient client, String id, BytesReference source) Create an ingest pipeline with the given ID and body, using the givenElasticsearchClient
.static void
putJsonPipeline
(ElasticsearchClient client, String id, org.elasticsearch.xcontent.ToXContentFragment toXContent) Create an ingest pipeline with the given ID and body, using the givenElasticsearchClient
.static PutPipelineRequest
putJsonPipelineRequest
(String id, String jsonString) static PutPipelineRequest
putJsonPipelineRequest
(String id, BytesReference source)
-
Method Details
-
putJsonPipelineRequest
- Parameters:
id
- The pipeline id.source
- The body of thePutPipelineRequest
as a JSON-formattedBytesReference
.- Returns:
- a new
PutPipelineRequest
with the givenid
and body.
-
putJsonPipelineRequest
- Parameters:
id
- The pipeline id.jsonString
- The body of thePutPipelineRequest
as a JSON-formattedString
.- Returns:
- a new
PutPipelineRequest
with the givenid
and body.
-
putJsonPipeline
Create an ingest pipeline with the given ID and body, using the givenElasticsearchClient
.- Parameters:
client
- The client to use to execute thePutPipelineTransportAction
.id
- The pipeline id.source
- The body of thePutPipelineRequest
as a JSON-formattedBytesReference
.
-
putJsonPipeline
Create an ingest pipeline with the given ID and body, using the givenElasticsearchClient
.- Parameters:
client
- The client to use to execute thePutPipelineTransportAction
.id
- The pipeline id.jsonString
- The body of thePutPipelineRequest
as a JSON-formattedString
.
-
putJsonPipeline
public static void putJsonPipeline(ElasticsearchClient client, String id, org.elasticsearch.xcontent.ToXContentFragment toXContent) throws IOException Create an ingest pipeline with the given ID and body, using the givenElasticsearchClient
.- Parameters:
client
- The client to use to execute thePutPipelineTransportAction
.id
- The pipeline id.toXContent
- The body of thePutPipelineRequest
as aToXContentFragment
.- Throws:
IOException
-
deletePipelinesIgnoringExceptions
public static void deletePipelinesIgnoringExceptions(ElasticsearchClient client, Iterable<String> ids) Attempt to delete the ingest pipeline with the givenid
, using the givenElasticsearchClient
, and logging (but otherwise ignoring) the result. -
jsonSimulatePipelineRequest
Construct a newSimulatePipelineRequest
whose content is the given JSON document, represented as aString
. -
jsonSimulatePipelineRequest
Construct a newSimulatePipelineRequest
whose content is the given JSON document, represented as aBytesReference
.
-