Package org.opensearch.client
Class TasksClient
- java.lang.Object
-
- org.opensearch.client.TasksClient
-
public final class TasksClient extends java.lang.ObjectA wrapper for theRestHighLevelClientthat provides methods for accessing the Tasks API.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description CancelTasksResponsecancel(CancelTasksRequest cancelTasksRequest, org.opensearch.client.RequestOptions options)Cancel one or more cluster tasks using the Task Management API.org.opensearch.client.CancellablecancelAsync(CancelTasksRequest cancelTasksRequest, org.opensearch.client.RequestOptions options, org.opensearch.action.ActionListener<CancelTasksResponse> listener)Asynchronously cancel one or more cluster tasks using the Task Management API.java.util.Optional<GetTaskResponse>get(GetTaskRequest request, org.opensearch.client.RequestOptions options)Get a task using the Task Management API.org.opensearch.client.CancellablegetAsync(GetTaskRequest request, org.opensearch.client.RequestOptions options, org.opensearch.action.ActionListener<java.util.Optional<GetTaskResponse>> listener)Get a task using the Task Management API.org.opensearch.action.admin.cluster.node.tasks.list.ListTasksResponselist(org.opensearch.action.admin.cluster.node.tasks.list.ListTasksRequest request, org.opensearch.client.RequestOptions options)Get current tasks using the Task Management API.org.opensearch.client.CancellablelistAsync(org.opensearch.action.admin.cluster.node.tasks.list.ListTasksRequest request, org.opensearch.client.RequestOptions options, org.opensearch.action.ActionListener<org.opensearch.action.admin.cluster.node.tasks.list.ListTasksResponse> listener)Asynchronously get current tasks using the Task Management API.
-
-
-
Method Detail
-
list
public org.opensearch.action.admin.cluster.node.tasks.list.ListTasksResponse list(org.opensearch.action.admin.cluster.node.tasks.list.ListTasksRequest request, org.opensearch.client.RequestOptions options) throws java.io.IOExceptionGet current tasks using the Task Management API.- Parameters:
request- the requestoptions- the request options (e.g. headers), useRequestOptions.DEFAULTif nothing needs to be customized- Returns:
- the response
- Throws:
java.io.IOException- in case there is a problem sending the request or parsing back the response
-
listAsync
public org.opensearch.client.Cancellable listAsync(org.opensearch.action.admin.cluster.node.tasks.list.ListTasksRequest request, org.opensearch.client.RequestOptions options, org.opensearch.action.ActionListener<org.opensearch.action.admin.cluster.node.tasks.list.ListTasksResponse> listener)Asynchronously get current tasks using the Task Management API.- Parameters:
request- the requestoptions- the request options (e.g. headers), useRequestOptions.DEFAULTif nothing needs to be customizedlistener- the listener to be notified upon request completion- Returns:
- cancellable that may be used to cancel the request
-
get
public java.util.Optional<GetTaskResponse> get(GetTaskRequest request, org.opensearch.client.RequestOptions options) throws java.io.IOException
Get a task using the Task Management API.- Parameters:
request- the requestoptions- the request options (e.g. headers), useRequestOptions.DEFAULTif nothing needs to be customized- Returns:
- the response
- Throws:
java.io.IOException- in case there is a problem sending the request or parsing back the response
-
getAsync
public org.opensearch.client.Cancellable getAsync(GetTaskRequest request, org.opensearch.client.RequestOptions options, org.opensearch.action.ActionListener<java.util.Optional<GetTaskResponse>> listener)
Get a task using the Task Management API.- Parameters:
request- the requestoptions- the request options (e.g. headers), useRequestOptions.DEFAULTif nothing needs to be customizedlistener- an actionlistener that takes an optional response (404s are returned as an empty Optional)- Returns:
- cancellable that may be used to cancel the request
-
cancel
public CancelTasksResponse cancel(CancelTasksRequest cancelTasksRequest, org.opensearch.client.RequestOptions options) throws java.io.IOException
Cancel one or more cluster tasks using the Task Management API.- Parameters:
cancelTasksRequest- the requestoptions- the request options (e.g. headers), useRequestOptions.DEFAULTif nothing needs to be customized- Returns:
- the response
- Throws:
java.io.IOException- in case there is a problem sending the request or parsing back the response
-
cancelAsync
public org.opensearch.client.Cancellable cancelAsync(CancelTasksRequest cancelTasksRequest, org.opensearch.client.RequestOptions options, org.opensearch.action.ActionListener<CancelTasksResponse> listener)
Asynchronously cancel one or more cluster tasks using the Task Management API.- Parameters:
cancelTasksRequest- the requestoptions- the request options (e.g. headers), useRequestOptions.DEFAULTif nothing needs to be customizedlistener- the listener to be notified upon request completion- Returns:
- cancellable that may be used to cancel the request
-
-