indices-exists.asciidoc 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. [[indices-exists]]
  2. === Exists API
  3. ++++
  4. <titleabbrev>Exists</titleabbrev>
  5. ++++
  6. Checks if a data stream, index, or alias exists.
  7. [source,console]
  8. ----
  9. HEAD my-data-stream
  10. ----
  11. // TEST[setup:my_data_stream]
  12. // TEST[teardown:data_stream_cleanup]
  13. [[indices-exists-api-request]]
  14. ==== {api-request-title}
  15. `HEAD <target>`
  16. [[indices-exists-api-prereqs]]
  17. ==== {api-prereq-title}
  18. * If the {es} {security-features} are enabled, you must have the
  19. `view_index_metadata` or `manage` <<privileges-list-indices,index privilege>>
  20. for the target.
  21. [[indices-exists-api-path-params]]
  22. ==== {api-path-parms-title}
  23. `<target>`::
  24. (Optional, string) Comma-separated list of data streams, indices, and aliases.
  25. Supports wildcards (`*`).
  26. [[indices-exists-api-query-params]]
  27. ==== {api-query-parms-title}
  28. include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=allow-no-indices]
  29. +
  30. Defaults to `true`.
  31. include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=expand-wildcards]
  32. +
  33. Defaults to `open`.
  34. include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=flat-settings]
  35. include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=include-defaults]
  36. include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=index-ignore-unavailable]
  37. include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=local]
  38. [[indices-exists-api-response-codes]]
  39. ==== {api-response-codes-title}
  40. `200`::
  41. All targets exist.
  42. `404`::
  43. One or more specified targets do not exist.