2020-07-01 10:41:15 -04:00
|
|
|
[[indices-resolve-index-api]]
|
|
|
|
=== Resolve index API
|
|
|
|
++++
|
|
|
|
<titleabbrev>Resolve index</titleabbrev>
|
|
|
|
++++
|
|
|
|
|
2020-08-12 15:14:03 -04:00
|
|
|
Resolves the specified name(s) and/or index patterns for indices, index
|
|
|
|
aliases, and data streams. Multiple patterns and remote clusters are
|
2020-07-01 10:41:15 -04:00
|
|
|
supported.
|
|
|
|
|
2020-07-02 09:27:14 -04:00
|
|
|
////
|
|
|
|
[source,console]
|
|
|
|
----
|
|
|
|
PUT /foo_closed
|
|
|
|
|
|
|
|
POST /foo_closed/_close
|
|
|
|
|
|
|
|
PUT /remotecluster-bar-01
|
|
|
|
|
|
|
|
PUT /freeze-index
|
|
|
|
|
|
|
|
POST /freeze-index/_freeze
|
|
|
|
|
2020-07-27 15:58:26 -04:00
|
|
|
PUT /my-index-000001
|
2020-07-02 09:27:14 -04:00
|
|
|
|
|
|
|
PUT /freeze-index/_alias/f-alias
|
|
|
|
|
2020-07-27 15:58:26 -04:00
|
|
|
PUT /my-index-000001/_alias/f-alias
|
2020-07-02 09:27:14 -04:00
|
|
|
|
|
|
|
PUT /_index_template/foo_data_stream
|
|
|
|
{
|
|
|
|
"index_patterns": [ "foo" ],
|
2020-07-14 17:28:43 -04:00
|
|
|
"data_stream": { }
|
2020-07-02 09:27:14 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
PUT /_data_stream/foo
|
|
|
|
----
|
|
|
|
// TESTSETUP
|
|
|
|
|
|
|
|
[source,console]
|
|
|
|
----
|
|
|
|
DELETE /_data_stream/*
|
|
|
|
|
|
|
|
DELETE /_index_template/foo_data_stream
|
|
|
|
----
|
|
|
|
// TEARDOWN
|
|
|
|
////
|
2020-07-01 10:41:15 -04:00
|
|
|
|
|
|
|
[source,console]
|
|
|
|
----
|
2020-07-31 09:51:47 -04:00
|
|
|
GET /_resolve/index/my-index-*
|
2020-07-01 10:41:15 -04:00
|
|
|
----
|
|
|
|
|
|
|
|
[[resolve-index-api-request]]
|
|
|
|
==== {api-request-title}
|
|
|
|
|
|
|
|
`GET /_resolve/index/<name>`
|
|
|
|
|
|
|
|
|
|
|
|
[[resolve-index-api-path-params]]
|
|
|
|
==== {api-path-parms-title}
|
|
|
|
|
|
|
|
`<name>`::
|
|
|
|
+
|
|
|
|
--
|
2020-08-12 15:14:03 -04:00
|
|
|
(Required, string) Comma-separated name(s) or index pattern(s) of the
|
2020-07-01 10:41:15 -04:00
|
|
|
indices, index aliases, and data streams to resolve. Resources on
|
|
|
|
<<modules-remote-clusters,remote clusters>> can be specified using the
|
|
|
|
`<cluster>:<name>` syntax.
|
|
|
|
--
|
|
|
|
|
|
|
|
[[resolve-index-api-query-params]]
|
|
|
|
==== {api-query-parms-title}
|
|
|
|
|
|
|
|
include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=expand-wildcards]
|
|
|
|
+
|
|
|
|
Defaults to `open`.
|
|
|
|
|
|
|
|
[[resolve-index-api-example]]
|
|
|
|
==== {api-examples-title}
|
|
|
|
|
|
|
|
[source,console]
|
2020-07-02 09:27:14 -04:00
|
|
|
----
|
|
|
|
GET /_resolve/index/f*,remoteCluster1:bar*?expand_wildcards=all
|
|
|
|
----
|
|
|
|
// TEST[continued]
|
|
|
|
// TEST[s/remoteCluster1:/remotecluster-/]
|
2020-07-01 10:41:15 -04:00
|
|
|
|
|
|
|
The API returns the following response:
|
|
|
|
|
|
|
|
[source,console-result]
|
2020-07-02 09:27:14 -04:00
|
|
|
----
|
2020-07-01 10:41:15 -04:00
|
|
|
{
|
2020-07-02 09:27:14 -04:00
|
|
|
"indices": [ <1>
|
2020-07-01 10:41:15 -04:00
|
|
|
{
|
2020-07-02 09:27:14 -04:00
|
|
|
"name": "foo_closed",
|
|
|
|
"attributes": [
|
2020-07-01 10:41:15 -04:00
|
|
|
"closed"
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
2020-07-02 09:27:14 -04:00
|
|
|
"name": "freeze-index",
|
|
|
|
"aliases": [
|
|
|
|
"f-alias"
|
|
|
|
],
|
|
|
|
"attributes": [
|
|
|
|
"frozen",
|
2020-07-01 10:41:15 -04:00
|
|
|
"open"
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
2020-07-02 09:27:14 -04:00
|
|
|
"name": "remoteCluster1:bar-01",
|
|
|
|
"attributes": [
|
|
|
|
"open"
|
2020-07-01 10:41:15 -04:00
|
|
|
]
|
|
|
|
}
|
|
|
|
],
|
2020-07-02 09:27:14 -04:00
|
|
|
"aliases": [ <2>
|
2020-07-01 10:41:15 -04:00
|
|
|
{
|
2020-07-02 09:27:14 -04:00
|
|
|
"name": "f-alias",
|
|
|
|
"indices": [
|
2020-07-01 10:41:15 -04:00
|
|
|
"freeze-index",
|
2020-07-27 15:58:26 -04:00
|
|
|
"my-index-000001"
|
2020-07-01 10:41:15 -04:00
|
|
|
]
|
|
|
|
}
|
|
|
|
],
|
2020-07-02 09:27:14 -04:00
|
|
|
"data_streams": [ <3>
|
2020-07-01 10:41:15 -04:00
|
|
|
{
|
2020-07-02 09:27:14 -04:00
|
|
|
"name": "foo",
|
|
|
|
"backing_indices": [
|
2020-07-01 10:41:15 -04:00
|
|
|
".ds-foo-000001"
|
|
|
|
],
|
2020-07-02 09:27:14 -04:00
|
|
|
"timestamp_field": "@timestamp"
|
2020-07-01 10:41:15 -04:00
|
|
|
}
|
|
|
|
]
|
|
|
|
}
|
2020-07-02 09:27:14 -04:00
|
|
|
----
|
|
|
|
// TESTRESPONSE[s/remoteCluster1:/remotecluster-/]
|
2020-07-01 10:41:15 -04:00
|
|
|
<1> All indices matching the supplied names or expressions
|
|
|
|
<2> All aliases matching the supplied names or expressions
|
|
|
|
<3> All data streams matching the supplied names or expressions
|