Search in sources :

Example 1 with EndpointBuilder

use of org.opensearch.client.RequestConverters.EndpointBuilder in project OpenSearch by opensearch-project.

the class TasksRequestConverters method getTask.

static Request getTask(GetTaskRequest getTaskRequest) {
    String endpoint = new EndpointBuilder().addPathPartAsIs("_tasks").addPathPartAsIs(getTaskRequest.getNodeId() + ":" + Long.toString(getTaskRequest.getTaskId())).build();
    Request request = new Request(HttpGet.METHOD_NAME, endpoint);
    RequestConverters.Params params = new RequestConverters.Params();
    params.withTimeout(getTaskRequest.getTimeout()).withWaitForCompletion(getTaskRequest.getWaitForCompletion());
    request.addParameters(params.asMap());
    return request;
}
Also used : CancelTasksRequest(org.opensearch.client.tasks.CancelTasksRequest) GetTaskRequest(org.opensearch.client.tasks.GetTaskRequest) ListTasksRequest(org.opensearch.action.admin.cluster.node.tasks.list.ListTasksRequest) EndpointBuilder(org.opensearch.client.RequestConverters.EndpointBuilder)

Aggregations

ListTasksRequest (org.opensearch.action.admin.cluster.node.tasks.list.ListTasksRequest)1 EndpointBuilder (org.opensearch.client.RequestConverters.EndpointBuilder)1 CancelTasksRequest (org.opensearch.client.tasks.CancelTasksRequest)1 GetTaskRequest (org.opensearch.client.tasks.GetTaskRequest)1