Search in sources :

Example 6 with GetPipelineRequest

use of org.opensearch.action.ingest.GetPipelineRequest in project OpenSearch by opensearch-project.

the class RestGetPipelineAction method prepareRequest.

@Override
public RestChannelConsumer prepareRequest(RestRequest restRequest, NodeClient client) throws IOException {
    GetPipelineRequest request = new GetPipelineRequest(Strings.splitStringByCommaToArray(restRequest.param("id")));
    request.masterNodeTimeout(restRequest.paramAsTime("master_timeout", request.masterNodeTimeout()));
    return channel -> client.admin().cluster().getPipeline(request, new RestStatusToXContentListener<>(channel));
}
Also used : GetPipelineRequest(org.opensearch.action.ingest.GetPipelineRequest) List(java.util.List) NodeClient(org.opensearch.client.node.NodeClient) Collections.unmodifiableList(java.util.Collections.unmodifiableList) GET(org.opensearch.rest.RestRequest.Method.GET) RestRequest(org.opensearch.rest.RestRequest) RestStatusToXContentListener(org.opensearch.rest.action.RestStatusToXContentListener) Arrays.asList(java.util.Arrays.asList) IOException(java.io.IOException) BaseRestHandler(org.opensearch.rest.BaseRestHandler) Strings(org.opensearch.common.Strings) GetPipelineRequest(org.opensearch.action.ingest.GetPipelineRequest)

Aggregations

GetPipelineRequest (org.opensearch.action.ingest.GetPipelineRequest)6 PutPipelineRequest (org.opensearch.action.ingest.PutPipelineRequest)4 DeletePipelineRequest (org.opensearch.action.ingest.DeletePipelineRequest)3 GetPipelineResponse (org.opensearch.action.ingest.GetPipelineResponse)3 Matchers.containsString (org.hamcrest.Matchers.containsString)2 SimulatePipelineRequest (org.opensearch.action.ingest.SimulatePipelineRequest)2 IOException (java.io.IOException)1 Arrays.asList (java.util.Arrays.asList)1 Collections.unmodifiableList (java.util.Collections.unmodifiableList)1 HashMap (java.util.HashMap)1 List (java.util.List)1 StringJoiner (java.util.StringJoiner)1 AcknowledgedRequest (org.opensearch.action.support.master.AcknowledgedRequest)1 AcknowledgedResponse (org.opensearch.action.support.master.AcknowledgedResponse)1 NodeClient (org.opensearch.client.node.NodeClient)1 Strings (org.opensearch.common.Strings)1 BytesReference (org.opensearch.common.bytes.BytesReference)1 XContentBuilder (org.opensearch.common.xcontent.XContentBuilder)1 PipelineConfiguration (org.opensearch.ingest.PipelineConfiguration)1 BaseRestHandler (org.opensearch.rest.BaseRestHandler)1