2019-08-29 21:44:58 +08:00
|
|
|
[[indices-get-alias]]
|
2021-05-25 23:52:16 +08:00
|
|
|
=== Get alias API
|
2019-08-29 21:44:58 +08:00
|
|
|
++++
|
2021-05-25 23:52:16 +08:00
|
|
|
<titleabbrev>Get alias</titleabbrev>
|
2019-08-29 21:44:58 +08:00
|
|
|
++++
|
|
|
|
|
2021-05-25 23:52:16 +08:00
|
|
|
Retrieves information for one or more <<alias,aliases>>.
|
2019-08-29 21:44:58 +08:00
|
|
|
|
2019-09-06 22:55:16 +08:00
|
|
|
[source,console]
|
2019-08-29 21:44:58 +08:00
|
|
|
----
|
2021-06-01 20:45:22 +08:00
|
|
|
GET my-data-stream/_alias/my-alias
|
2019-08-29 21:44:58 +08:00
|
|
|
----
|
2021-06-01 20:45:22 +08:00
|
|
|
// TEST[setup:my_data_stream]
|
|
|
|
// TEST[s/^/PUT my-data-stream\/_alias\/my-alias\n/]
|
|
|
|
// TEST[teardown:data_stream_cleanup]
|
2019-08-29 21:44:58 +08:00
|
|
|
|
|
|
|
[[get-alias-api-request]]
|
|
|
|
==== {api-request-title}
|
|
|
|
|
2021-06-01 20:45:22 +08:00
|
|
|
`GET _alias/<alias>`
|
2019-08-29 21:44:58 +08:00
|
|
|
|
2021-06-01 20:45:22 +08:00
|
|
|
`GET _alias`
|
2019-08-29 21:44:58 +08:00
|
|
|
|
2021-06-01 20:45:22 +08:00
|
|
|
`GET <target>/_alias/<alias>`
|
2019-08-29 21:44:58 +08:00
|
|
|
|
2021-01-28 21:53:10 +08:00
|
|
|
[[get-alias-api-api-prereqs]]
|
|
|
|
==== {api-prereq-title}
|
|
|
|
|
|
|
|
* If the {es} {security-features} are enabled, you must have the
|
|
|
|
`view_index_metadata` or `manage` <<privileges-list-indices,index privilege>>
|
2021-06-01 20:45:22 +08:00
|
|
|
for the alias. If you specify a target, you must also have `view_index_metadata`
|
|
|
|
or `manage` index privilege for the target.
|
2019-08-29 21:44:58 +08:00
|
|
|
|
|
|
|
[[get-alias-api-path-params]]
|
|
|
|
==== {api-path-parms-title}
|
|
|
|
|
|
|
|
`<alias>`::
|
2021-06-01 20:45:22 +08:00
|
|
|
(Optional, string) Comma-separated list of aliases to retrieve. Supports
|
|
|
|
wildcards (`*`). To retrieve all aliases, omit this parameter or use `*` or
|
|
|
|
`_all`.
|
2019-08-29 21:44:58 +08:00
|
|
|
|
2021-06-01 20:45:22 +08:00
|
|
|
`<target>`::
|
|
|
|
(Optional, string) Comma-separated list of data streams or indices used to limit
|
|
|
|
the request. Supports wildcards (`*`). To target all data streams and indices,
|
|
|
|
omit this parameter or use `*` or `_all`.
|
2019-08-29 21:44:58 +08:00
|
|
|
|
|
|
|
[[get-alias-api-query-params]]
|
|
|
|
==== {api-query-parms-title}
|
|
|
|
|
2020-06-02 06:55:05 +08:00
|
|
|
include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=allow-no-indices]
|
2020-02-24 18:37:29 +08:00
|
|
|
+
|
|
|
|
Defaults to `true`.
|
2019-08-29 21:44:58 +08:00
|
|
|
|
2020-06-02 06:55:05 +08:00
|
|
|
include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=expand-wildcards]
|
2019-08-29 21:44:58 +08:00
|
|
|
+
|
|
|
|
Defaults to `all`.
|
|
|
|
|
2020-10-23 03:10:37 +08:00
|
|
|
`ignore_unavailable`::
|
2021-06-01 20:45:22 +08:00
|
|
|
(Optional, Boolean) If `false`, requests that include a missing data stream or
|
|
|
|
index in the `<target>` return an error. Defaults to `false`.
|
2019-08-29 21:44:58 +08:00
|
|
|
|
2020-06-02 06:55:05 +08:00
|
|
|
include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=local]
|