alias-exists.asciidoc 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. [[indices-alias-exists]]
  2. === Alias exists API
  3. ++++
  4. <titleabbrev>Alias exists</titleabbrev>
  5. ++++
  6. Checks if an <<aliases,alias>> exists.
  7. [source,console]
  8. ----
  9. HEAD _alias/my-alias
  10. ----
  11. // TEST[setup:my_data_stream]
  12. // TEST[s/^/PUT my-data-stream\/_alias\/my-alias\n/]
  13. // TEST[teardown:data_stream_cleanup]
  14. [[alias-exists-api-request]]
  15. ==== {api-request-title}
  16. `HEAD _alias/<alias>`
  17. `HEAD <target>/_alias/<alias>`
  18. [[alias-exists-api-prereqs]]
  19. ==== {api-prereq-title}
  20. * If the {es} {security-features} are enabled, you must have the
  21. `view_index_metadata` or `manage` <<privileges-list-indices,index privilege>>
  22. for the alias. If you specify a target, you must also have the
  23. `view_index_metadata` or `manage` index privilege for the target.
  24. [[alias-exists-api-path-params]]
  25. ==== {api-path-parms-title}
  26. `<alias>`::
  27. (Optional, string) Comma-separated list of aliases to check. Supports wildcards
  28. (`*`).
  29. `<target>`::
  30. (Optional, string) Comma-separated list of data streams or indices used to limit
  31. the request. Supports wildcards (`*`). To target all data streams and indices,
  32. omit this parameter or use `*` or `_all`.
  33. [[alias-exists-api-query-params]]
  34. ==== {api-query-parms-title}
  35. include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=expand-wildcards]
  36. +
  37. Defaults to `all`.
  38. `ignore_unavailable`::
  39. (Optional, Boolean) If `false`, requests that include a missing data stream or
  40. index in the `<target>` return an error. Defaults to `false`.
  41. include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=local]
  42. [[alias-exists-api-response-codes]]
  43. ==== {api-response-codes-title}
  44. `200`::
  45. All specified aliases exist.
  46. `404`::
  47. One or more of the specified aliases don't exist.