2018-11-27 20:40:49 -05:00
|
|
|
--
|
|
|
|
:api: get-alias
|
|
|
|
:request: GetAliasesRequest
|
|
|
|
:response: GetAliasesResponse
|
|
|
|
--
|
|
|
|
|
|
|
|
[id="{upid}-{api}"]
|
2018-06-12 04:26:17 -04:00
|
|
|
=== Get Alias API
|
|
|
|
|
2018-11-27 20:40:49 -05:00
|
|
|
[id="{upid}-{api}-request"]
|
2018-06-12 04:26:17 -04:00
|
|
|
==== Get Alias Request
|
|
|
|
|
2018-11-27 20:40:49 -05:00
|
|
|
The Get Alias API uses +{request}+ as its request object.
|
2018-06-12 04:26:17 -04:00
|
|
|
One or more aliases can be optionally provided either at construction
|
|
|
|
time or later on through the relevant setter method.
|
|
|
|
|
|
|
|
["source","java",subs="attributes,callouts,macros"]
|
|
|
|
--------------------------------------------------
|
2018-11-27 20:40:49 -05:00
|
|
|
include-tagged::{doc-tests-file}[{api}-request]
|
2018-06-12 04:26:17 -04:00
|
|
|
--------------------------------------------------
|
|
|
|
|
|
|
|
==== Optional arguments
|
|
|
|
The following arguments can optionally be provided:
|
|
|
|
|
|
|
|
["source","java",subs="attributes,callouts,macros"]
|
|
|
|
--------------------------------------------------
|
2018-11-27 20:40:49 -05:00
|
|
|
include-tagged::{doc-tests-file}[{api}-request-alias]
|
2018-06-12 04:26:17 -04:00
|
|
|
--------------------------------------------------
|
|
|
|
<1> One or more aliases to retrieve
|
|
|
|
|
|
|
|
["source","java",subs="attributes,callouts,macros"]
|
|
|
|
--------------------------------------------------
|
2018-11-27 20:40:49 -05:00
|
|
|
include-tagged::{doc-tests-file}[{api}-request-indices]
|
2018-06-12 04:26:17 -04:00
|
|
|
--------------------------------------------------
|
|
|
|
<1> The index or indices that the alias is associated with
|
|
|
|
|
|
|
|
["source","java",subs="attributes,callouts,macros"]
|
|
|
|
--------------------------------------------------
|
2018-11-27 20:40:49 -05:00
|
|
|
include-tagged::{doc-tests-file}[{api}-request-indicesOptions]
|
2018-06-12 04:26:17 -04:00
|
|
|
--------------------------------------------------
|
|
|
|
<1> Setting `IndicesOptions` controls how unavailable indices are resolved and
|
|
|
|
how wildcard expressions are expanded when looking for aliases that belong to
|
|
|
|
specified indices.
|
|
|
|
|
|
|
|
["source","java",subs="attributes,callouts,macros"]
|
|
|
|
--------------------------------------------------
|
2018-11-27 20:40:49 -05:00
|
|
|
include-tagged::{doc-tests-file}[{api}-request-local]
|
2018-06-12 04:26:17 -04:00
|
|
|
--------------------------------------------------
|
|
|
|
<1> The `local` flag (defaults to `false`) controls whether the aliases need
|
|
|
|
to be looked up in the local cluster state or in the cluster state held by
|
|
|
|
the elected master node
|
|
|
|
|
2018-11-27 20:40:49 -05:00
|
|
|
include::../execution.asciidoc[]
|
2018-06-12 04:26:17 -04:00
|
|
|
|
2018-11-27 20:40:49 -05:00
|
|
|
[id="{upid}-{api}-response"]
|
2018-06-12 04:26:17 -04:00
|
|
|
==== Get Alias Response
|
|
|
|
|
2018-11-27 20:40:49 -05:00
|
|
|
The returned +{response}+ allows to retrieve information about the
|
2018-06-12 04:26:17 -04:00
|
|
|
executed operation as follows:
|
|
|
|
|
|
|
|
["source","java",subs="attributes,callouts,macros"]
|
|
|
|
--------------------------------------------------
|
2018-11-27 20:40:49 -05:00
|
|
|
include-tagged::{doc-tests-file}[{api}-response]
|
2018-06-12 04:26:17 -04:00
|
|
|
--------------------------------------------------
|
2020-02-24 12:22:09 -05:00
|
|
|
<1> Retrieves a map of indices and their aliases
|
|
|
|
|
|
|
|
+{response}+ class contains information about errors if they occurred.
|
|
|
|
This info could be in fields `error` or `exception` depends on a case.
|
|
|
|
|
|
|
|
["source","java",subs="attributes,callouts,macros"]
|
|
|
|
--------------------------------------------------
|
|
|
|
include-tagged::{doc-tests-file}[{api}-response-error]
|
|
|
|
--------------------------------------------------
|
|
|
|
<1> Client sets status to `NOT_FOUND` if at least one item of specified
|
|
|
|
indices or aliases is not found. Otherwise it is `OK`.
|
|
|
|
|
|
|
|
<2> If at least one item of specified indices isn't exist client sets
|
|
|
|
`ElasticsearchException` and returns empty result.
|
|
|
|
|
|
|
|
<3> If at least one item of specified aliases ins't exist client puts
|
|
|
|
error description in `error` field and returns partial result if any
|
|
|
|
of other patterns match.
|
|
|
|
|
|
|
|
If user specified indices or aliases as regular expressions
|
|
|
|
and nothing was found client returns `OK` status and no errors.
|