exists_alias.asciidoc 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. [[java-rest-high-exists-alias]]
  2. === Exists Alias API
  3. [[java-rest-high-exists-alias-request]]
  4. ==== Exists Alias Request
  5. The Exists Alias API uses `GetAliasesRequest` as its request object.
  6. One or more aliases can be optionally provided either at construction
  7. time or later on through the relevant setter method.
  8. ["source","java",subs="attributes,callouts,macros"]
  9. --------------------------------------------------
  10. include-tagged::{doc-tests}/IndicesClientDocumentationIT.java[exists-alias-request]
  11. --------------------------------------------------
  12. ==== Optional arguments
  13. The following arguments can optionally be provided:
  14. ["source","java",subs="attributes,callouts,macros"]
  15. --------------------------------------------------
  16. include-tagged::{doc-tests}/IndicesClientDocumentationIT.java[exists-alias-request-alias]
  17. --------------------------------------------------
  18. <1> One or more aliases to look for
  19. ["source","java",subs="attributes,callouts,macros"]
  20. --------------------------------------------------
  21. include-tagged::{doc-tests}/IndicesClientDocumentationIT.java[exists-alias-request-indices]
  22. --------------------------------------------------
  23. <1> The index or indices that the alias is associated with
  24. ["source","java",subs="attributes,callouts,macros"]
  25. --------------------------------------------------
  26. include-tagged::{doc-tests}/IndicesClientDocumentationIT.java[exists-alias-request-indicesOptions]
  27. --------------------------------------------------
  28. <1> Setting `IndicesOptions` controls how unavailable indices are resolved and
  29. how wildcard expressions are expanded
  30. ["source","java",subs="attributes,callouts,macros"]
  31. --------------------------------------------------
  32. include-tagged::{doc-tests}/IndicesClientDocumentationIT.java[exists-alias-request-local]
  33. --------------------------------------------------
  34. <1> The `local` flag (defaults to `false`) controls whether the aliases need
  35. to be looked up in the local cluster state or in the cluster state held by
  36. the elected master node.
  37. [[java-rest-high-exists-alias-sync]]
  38. ==== Synchronous Execution
  39. ["source","java",subs="attributes,callouts,macros"]
  40. --------------------------------------------------
  41. include-tagged::{doc-tests}/IndicesClientDocumentationIT.java[exists-alias-execute]
  42. --------------------------------------------------
  43. [[java-rest-high-exists-alias-async]]
  44. ==== Asynchronous Execution
  45. ["source","java",subs="attributes,callouts,macros"]
  46. --------------------------------------------------
  47. include-tagged::{doc-tests}/IndicesClientDocumentationIT.java[exists-alias-execute-async]
  48. --------------------------------------------------
  49. <1> Called when the execution is successfully completed. The response is
  50. provided as an argument
  51. <2> Called in case of failure. The raised exception is provided as an argument
  52. [[java-rest-high-exists-alias-response]]
  53. ==== Exists Alias Response
  54. The Exists Alias API returns a `boolean` that indicates whether the provided
  55. alias (or aliases) was found or not.