|
@@ -1,40 +1,36 @@
|
|
|
[[indices-exists]]
|
|
|
-=== Index exists API
|
|
|
+=== Exists API
|
|
|
++++
|
|
|
-<titleabbrev>Index exists</titleabbrev>
|
|
|
+<titleabbrev>Exists</titleabbrev>
|
|
|
++++
|
|
|
|
|
|
-Checks if an index exists.
|
|
|
-The returned HTTP status code indicates if the index exists or not.
|
|
|
-A `404` means it does not exist, and `200` means it does.
|
|
|
+Checks if a data stream, index, or alias exists.
|
|
|
|
|
|
[source,console]
|
|
|
---------------------------------------------------
|
|
|
-HEAD /my-index-000001
|
|
|
---------------------------------------------------
|
|
|
-// TEST[setup:my_index]
|
|
|
-
|
|
|
+----
|
|
|
+HEAD my-data-stream
|
|
|
+----
|
|
|
+// TEST[setup:my_data_stream]
|
|
|
+// TEST[teardown:data_stream_cleanup]
|
|
|
|
|
|
[[indices-exists-api-request]]
|
|
|
==== {api-request-title}
|
|
|
|
|
|
-`HEAD /<target>`
|
|
|
+`HEAD <target>`
|
|
|
|
|
|
[[indices-exists-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>>
|
|
|
-for the target data stream, index, or index alias.
|
|
|
+for the target.
|
|
|
|
|
|
[[indices-exists-api-path-params]]
|
|
|
==== {api-path-parms-title}
|
|
|
|
|
|
`<target>`::
|
|
|
-(Optional, string)
|
|
|
-Comma-separated list of data streams, indices, and index aliases used to limit
|
|
|
-the request. Wildcard expressions (`*`) are supported.
|
|
|
-
|
|
|
+(Optional, string) Comma-separated list of data streams, indices, and aliases.
|
|
|
+Supports wildcards (`*`).
|
|
|
|
|
|
[[indices-exists-api-query-params]]
|
|
|
==== {api-query-parms-title}
|
|
@@ -55,12 +51,11 @@ include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=index-ignore-unavailab
|
|
|
|
|
|
include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=local]
|
|
|
|
|
|
-
|
|
|
[[indices-exists-api-response-codes]]
|
|
|
==== {api-response-codes-title}
|
|
|
|
|
|
`200`::
|
|
|
-Indicates all specified indices or index aliases exist.
|
|
|
+All targets exist.
|
|
|
|
|
|
- `404`::
|
|
|
-Indicates one or more specified indices or index aliases **do not** exist.
|
|
|
+`404`::
|
|
|
+One or more specified targets do not exist.
|