get-auto-follow-pattern.asciidoc 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. [role="xpack"]
  2. [testenv="platinum"]
  3. [[ccr-get-auto-follow-pattern]]
  4. === Get auto-follow pattern API
  5. ++++
  6. <titleabbrev>Get auto-follow pattern</titleabbrev>
  7. ++++
  8. Get auto-follow patterns.
  9. [[ccr-get-auto-follow-pattern-request]]
  10. ==== {api-request-title}
  11. //////////////////////////
  12. [source,js]
  13. --------------------------------------------------
  14. PUT /_ccr/auto_follow/my_auto_follow_pattern
  15. {
  16. "remote_cluster" : "remote_cluster",
  17. "leader_index_patterns" :
  18. [
  19. "leader_index*"
  20. ],
  21. "follow_index_pattern" : "{{leader_index}}-follower"
  22. }
  23. --------------------------------------------------
  24. // CONSOLE
  25. // TEST[setup:remote_cluster]
  26. // TESTSETUP
  27. [source,js]
  28. --------------------------------------------------
  29. DELETE /_ccr/auto_follow/my_auto_follow_pattern
  30. --------------------------------------------------
  31. // CONSOLE
  32. // TEST
  33. // TEARDOWN
  34. //////////////////////////
  35. [source,js]
  36. --------------------------------------------------
  37. GET /_ccr/auto_follow/
  38. --------------------------------------------------
  39. // CONSOLE
  40. [source,js]
  41. --------------------------------------------------
  42. GET /_ccr/auto_follow/<auto_follow_pattern_name>
  43. --------------------------------------------------
  44. // CONSOLE
  45. // TEST[s/<auto_follow_pattern_name>/my_auto_follow_pattern/]
  46. [[ccr-get-auto-follow-pattern-prereqs]]
  47. ==== {api-prereq-title}
  48. * If the {es} {security-features} are enabled, you must have `manage_ccr` cluster
  49. privileges on the cluster that contains the follower index. For more information,
  50. see {stack-ov}/security-privileges.html[Security privileges].
  51. [[ccr-get-auto-follow-pattern-desc]]
  52. ==== {api-description-title}
  53. This API gets configured {stack-ov}/ccr-auto-follow.html[auto-follow patterns].
  54. This API will return the specified auto-follow pattern collection.
  55. [[ccr-get-auto-follow-pattern-path-parms]]
  56. ==== {api-path-parms-title}
  57. `<auto_follow_pattern_name>`::
  58. (Optional, string) Specifies the auto-follow pattern collection that you want
  59. to retrieve. If you do not specify a name, the API returns information for all
  60. collections.
  61. [[ccr-get-auto-follow-pattern-examples]]
  62. ==== {api-examples-title}
  63. This example retrieves information about an auto-follow pattern collection
  64. named `my_auto_follow_pattern`:
  65. [source,js]
  66. --------------------------------------------------
  67. GET /_ccr/auto_follow/my_auto_follow_pattern
  68. --------------------------------------------------
  69. // CONSOLE
  70. // TEST[setup:remote_cluster]
  71. The API returns the following result:
  72. [source,console-result]
  73. --------------------------------------------------
  74. {
  75. "patterns": [
  76. {
  77. "name": "my_auto_follow_pattern",
  78. "pattern": {
  79. "remote_cluster" : "remote_cluster",
  80. "leader_index_patterns" :
  81. [
  82. "leader_index*"
  83. ],
  84. "follow_index_pattern" : "{{leader_index}}-follower"
  85. }
  86. }
  87. ]
  88. }
  89. --------------------------------------------------