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}
|
|
|
|
|
|
|
|
`GET /_cat/aliases/{name}`
|
|
|
|
|
|
|
|
[[cat-alias-api-path-params]]
|
|
|
|
==== {api-path-parms-title}
|
|
|
|
|
|
|
|
include::{docdir}/rest-api/common-parms.asciidoc[tag=name]
|
|
|
|
|
|
|
|
|
|
|
|
[[cat-alias-api-query-params]]
|
|
|
|
==== {api-query-parms-title}
|
|
|
|
|
|
|
|
include::{docdir}/rest-api/common-parms.asciidoc[tag=http-format]
|
|
|
|
|
|
|
|
include::{docdir}/rest-api/common-parms.asciidoc[tag=cat-h]
|
|
|
|
|
|
|
|
include::{docdir}/rest-api/common-parms.asciidoc[tag=help]
|
|
|
|
|
|
|
|
include::{docdir}/rest-api/common-parms.asciidoc[tag=local]
|
|
|
|
|
|
|
|
include::{docdir}/rest-api/common-parms.asciidoc[tag=master-timeout]
|
|
|
|
|
|
|
|
include::{docdir}/rest-api/common-parms.asciidoc[tag=cat-s]
|
|
|
|
|
|
|
|
include::{docdir}/rest-api/common-parms.asciidoc[tag=cat-v]
|
|
|
|
|
|
|
|
|
|
|
|
[[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:
|
|
|
|
[source,js]
|
|
|
|
--------------------------------------------------
|
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"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
--------------------------------------------------
|
|
|
|
// CONSOLE
|
|
|
|
////
|
|
|
|
|
|
|
|
[source,js]
|
|
|
|
--------------------------------------------------
|
|
|
|
GET /_cat/aliases?v
|
|
|
|
--------------------------------------------------
|
|
|
|
// CONSOLE
|
|
|
|
// 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
|
|
|
--------------------------------------------------
|
2015-10-15 15:55:06 -04:00
|
|
|
alias index filter routing.index routing.search
|
2014-01-20 03:23:00 -05:00
|
|
|
alias1 test1 - - -
|
2016-10-06 13:31:18 -04:00
|
|
|
alias2 test1 * - -
|
2014-01-20 03:23:00 -05:00
|
|
|
alias3 test1 - 1 1
|
2016-10-06 13:31:18 -04:00
|
|
|
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.
|