Get Alias API
editGet Alias API
editGet Alias Request
editThe Get Alias API uses GetAliasesRequest
as its request object.
One or more aliases can be optionally provided either at construction
time or later on through the relevant setter method.
GetAliasesRequest request = new GetAliasesRequest(); GetAliasesRequest requestWithAlias = new GetAliasesRequest("alias1"); GetAliasesRequest requestWithAliases = new GetAliasesRequest(new String[]{"alias1", "alias2"});
Optional arguments
editThe following arguments can optionally be provided:
Setting |
Synchronous Execution
editGetAliasesResponse response = client.indices().getAlias(request, RequestOptions.DEFAULT);
Asynchronous Execution
editThe asynchronous execution of a get alias request requires both a GetAliasesRequest
instance and an ActionListener
instance to be passed to the asynchronous
method:
The asynchronous method does not block and returns immediately. Once it is
completed the ActionListener
is called back using the onResponse
method
if the execution successfully completed or using the onFailure
method if
it failed.
A typical listener for the Boolean
response looks like:
Get Alias Response
editThe returned GetAliasesResponse
allows to retrieve information about the
executed operation as follows: