OpenSearch/docs/reference/cat/alias.asciidoc

96 lines
2.2 KiB
Plaintext

[[cat-alias]]
=== cat aliases API
++++
<titleabbrev>cat aliases</titleabbrev>
++++
Returns information about currently configured aliases to indices, including
filter and routing information.
[[cat-alias-api-request]]
==== {api-request-title}
`GET /_cat/aliases/<alias>`
`GET /_cat/aliases`
[[cat-alias-api-path-params]]
==== {api-path-parms-title}
`<alias>`::
(Optional, string)
include::{docdir}/rest-api/common-parms.asciidoc[tag=index-alias]
[[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=cat-s]
include::{docdir}/rest-api/common-parms.asciidoc[tag=cat-v]
[[cat-alias-api-example]]
==== {api-examples-title}
////
Hidden setup for example:
[source,console]
--------------------------------------------------
PUT test1
{
"aliases": {
"alias1": {},
"alias2": {
"filter": {
"match": {
"user": "kimchy"
}
}
},
"alias3": {
"routing": "1"
},
"alias4": {
"index_routing": "2",
"search_routing": "1,2"
}
}
}
--------------------------------------------------
////
[source,console]
--------------------------------------------------
GET /_cat/aliases?v
--------------------------------------------------
// TEST[continued]
The API returns the following response:
[source,txt]
--------------------------------------------------
alias index filter routing.index routing.search is_write_index
alias1 test1 - - - -
alias2 test1 * - - -
alias3 test1 - 1 1 -
alias4 test1 - 2 1,2 -
--------------------------------------------------
// TESTRESPONSE[s/[*]/[*]/ non_json]
This response shows that `alias2` has configured a filter, and specific routing
configurations in `alias3` and `alias4`.
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.,
/_cat/aliases/alias1,alias2.