elasticsearch/docs/reference/indices/indices-exists.asciidoc
Liam Thompson 33a71e3289
[DOCS] Refactor book-scoped variables in docs/reference/index.asciidoc (#107413)
* Remove `es-test-dir` book-scoped variable

* Remove `plugins-examples-dir` book-scoped variable

* Remove `:dependencies-dir:` and `:xes-repo-dir:` book-scoped variables

- In `index.asciidoc`, two variables (`:dependencies-dir:` and `:xes-repo-dir:`) were removed.
- In `sql/index.asciidoc`, the `:sql-tests:` path was updated to fuller path
- In `esql/index.asciidoc`, the `:esql-tests:` path was updated idem

* Replace `es-repo-dir` with `es-ref-dir`

* Move `:include-xpack: true` to few files that use it, remove from index.asciidoc
2024-04-17 14:37:07 +02:00

61 lines
1.4 KiB
Text

[[indices-exists]]
=== Exists API
++++
<titleabbrev>Exists</titleabbrev>
++++
Checks if a data stream, index, or alias exists.
[source,console]
----
HEAD my-data-stream
----
// TEST[setup:my_data_stream]
// TEST[teardown:data_stream_cleanup]
[[indices-exists-api-request]]
==== {api-request-title}
`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.
[[indices-exists-api-path-params]]
==== {api-path-parms-title}
`<target>`::
(Optional, string) Comma-separated list of data streams, indices, and aliases.
Supports wildcards (`*`).
[[indices-exists-api-query-params]]
==== {api-query-parms-title}
include::{es-ref-dir}/rest-api/common-parms.asciidoc[tag=allow-no-indices]
+
Defaults to `true`.
include::{es-ref-dir}/rest-api/common-parms.asciidoc[tag=expand-wildcards]
+
Defaults to `open`.
include::{es-ref-dir}/rest-api/common-parms.asciidoc[tag=flat-settings]
include::{es-ref-dir}/rest-api/common-parms.asciidoc[tag=include-defaults]
include::{es-ref-dir}/rest-api/common-parms.asciidoc[tag=index-ignore-unavailable]
include::{es-ref-dir}/rest-api/common-parms.asciidoc[tag=local]
[[indices-exists-api-response-codes]]
==== {api-response-codes-title}
`200`::
All targets exist.
`404`::
One or more specified targets do not exist.