2014-01-20 03:23:00 -05:00
|
|
|
[[cat-alias]]
|
2019-08-13 08:35:08 -04:00
|
|
|
=== cat aliases API
|
|
|
|
++++
|
|
|
|
<titleabbrev>cat aliases</titleabbrev>
|
|
|
|
++++
|
2014-01-20 03:23:00 -05:00
|
|
|
|
2019-08-05 08:27:15 -04:00
|
|
|
Returns information about currently configured aliases to indices, including
|
|
|
|
filter and routing information.
|
|
|
|
|
|
|
|
|
|
|
|
[[cat-alias-api-request]]
|
|
|
|
==== {api-request-title}
|
|
|
|
|
2019-10-10 09:48:40 -04:00
|
|
|
`GET /_cat/aliases/<alias>`
|
|
|
|
|
|
|
|
`GET /_cat/aliases`
|
2019-08-05 08:27:15 -04:00
|
|
|
|
|
|
|
[[cat-alias-api-path-params]]
|
|
|
|
==== {api-path-parms-title}
|
|
|
|
|
2019-10-10 09:48:40 -04:00
|
|
|
`<alias>`::
|
|
|
|
(Optional, string)
|
2020-06-01 19:42:53 -04:00
|
|
|
include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=index-alias]
|
2019-08-05 08:27:15 -04:00
|
|
|
|
|
|
|
|
|
|
|
[[cat-alias-api-query-params]]
|
|
|
|
==== {api-query-parms-title}
|
|
|
|
|
2020-06-01 19:42:53 -04:00
|
|
|
include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=http-format]
|
2019-08-05 08:27:15 -04:00
|
|
|
|
2020-06-01 19:42:53 -04:00
|
|
|
include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=cat-h]
|
2019-08-05 08:27:15 -04:00
|
|
|
|
2020-06-01 19:42:53 -04:00
|
|
|
include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=help]
|
2019-08-05 08:27:15 -04:00
|
|
|
|
2020-06-01 19:42:53 -04:00
|
|
|
include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=local]
|
2019-08-05 08:27:15 -04:00
|
|
|
|
2020-06-01 19:42:53 -04:00
|
|
|
include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=cat-s]
|
2019-08-05 08:27:15 -04:00
|
|
|
|
2020-06-01 19:42:53 -04:00
|
|
|
include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=cat-v]
|
2019-08-05 08:27:15 -04:00
|
|
|
|
2020-06-01 19:42:53 -04:00
|
|
|
include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=expand-wildcards]
|
2020-05-29 13:01:53 -04:00
|
|
|
|
2019-08-05 08:27:15 -04:00
|
|
|
|
|
|
|
[[cat-alias-api-example]]
|
|
|
|
==== {api-examples-title}
|
2014-01-20 03:23:00 -05:00
|
|
|
|
2016-10-06 13:31:18 -04:00
|
|
|
////
|
|
|
|
Hidden setup for example:
|
2019-09-09 13:38:14 -04:00
|
|
|
[source,console]
|
2016-10-06 13:31:18 -04:00
|
|
|
--------------------------------------------------
|
2019-01-18 03:34:11 -05:00
|
|
|
PUT test1
|
2016-10-06 13:31:18 -04:00
|
|
|
{
|
|
|
|
"aliases": {
|
|
|
|
"alias1": {},
|
|
|
|
"alias2": {
|
|
|
|
"filter": {
|
|
|
|
"match": {
|
|
|
|
"user": "kimchy"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"alias3": {
|
|
|
|
"routing": "1"
|
|
|
|
},
|
|
|
|
"alias4": {
|
|
|
|
"index_routing": "2",
|
|
|
|
"search_routing": "1,2"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
--------------------------------------------------
|
|
|
|
////
|
|
|
|
|
2019-09-09 13:38:14 -04:00
|
|
|
[source,console]
|
2016-10-06 13:31:18 -04:00
|
|
|
--------------------------------------------------
|
|
|
|
GET /_cat/aliases?v
|
|
|
|
--------------------------------------------------
|
|
|
|
// TEST[continued]
|
|
|
|
|
2019-08-05 08:27:15 -04:00
|
|
|
The API returns the following response:
|
2016-10-06 13:31:18 -04:00
|
|
|
|
2016-10-25 10:56:30 -04:00
|
|
|
[source,txt]
|
2014-01-20 03:23:00 -05:00
|
|
|
--------------------------------------------------
|
2019-08-21 17:15:49 -04:00
|
|
|
alias index filter routing.index routing.search is_write_index
|
|
|
|
alias1 test1 - - - -
|
|
|
|
alias2 test1 * - - -
|
|
|
|
alias3 test1 - 1 1 -
|
|
|
|
alias4 test1 - 2 1,2 -
|
2014-01-20 03:23:00 -05:00
|
|
|
--------------------------------------------------
|
2019-06-10 09:33:32 -04:00
|
|
|
// TESTRESPONSE[s/[*]/[*]/ non_json]
|
2014-01-20 03:23:00 -05:00
|
|
|
|
2019-08-05 08:27:15 -04:00
|
|
|
This response shows that `alias2` has configured a filter, and specific routing
|
2014-05-16 15:43:35 -04:00
|
|
|
configurations in `alias3` and `alias4`.
|
2014-01-20 03:23:00 -05:00
|
|
|
|
2017-04-28 09:21:44 -04:00
|
|
|
If you only want to get information about specific aliases, you can specify
|
|
|
|
the aliases in comma-delimited format as a URL parameter, e.g.,
|
2018-12-31 11:58:49 -05:00
|
|
|
/_cat/aliases/alias1,alias2.
|