get-auto-follow-pattern.asciidoc 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  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,console]
  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. // TEST[setup:remote_cluster]
  25. // TESTSETUP
  26. [source,console]
  27. --------------------------------------------------
  28. DELETE /_ccr/auto_follow/my_auto_follow_pattern
  29. --------------------------------------------------
  30. // TEST
  31. // TEARDOWN
  32. //////////////////////////
  33. [source,console]
  34. --------------------------------------------------
  35. GET /_ccr/auto_follow/
  36. --------------------------------------------------
  37. [source,console]
  38. --------------------------------------------------
  39. GET /_ccr/auto_follow/<auto_follow_pattern_name>
  40. --------------------------------------------------
  41. // TEST[s/<auto_follow_pattern_name>/my_auto_follow_pattern/]
  42. [[ccr-get-auto-follow-pattern-prereqs]]
  43. ==== {api-prereq-title}
  44. * If the {es} {security-features} are enabled, you must have `manage_ccr` cluster
  45. privileges on the cluster that contains the follower index. For more information,
  46. see <<security-privileges>>.
  47. [[ccr-get-auto-follow-pattern-desc]]
  48. ==== {api-description-title}
  49. This API gets configured <<ccr-auto-follow,auto-follow patterns>>.
  50. This API will return the specified auto-follow pattern collection.
  51. [[ccr-get-auto-follow-pattern-path-parms]]
  52. ==== {api-path-parms-title}
  53. `<auto_follow_pattern_name>`::
  54. (Optional, string) Specifies the auto-follow pattern collection that you want
  55. to retrieve. If you do not specify a name, the API returns information for all
  56. collections.
  57. [[ccr-get-auto-follow-pattern-examples]]
  58. ==== {api-examples-title}
  59. This example retrieves information about an auto-follow pattern collection
  60. named `my_auto_follow_pattern`:
  61. [source,console]
  62. --------------------------------------------------
  63. GET /_ccr/auto_follow/my_auto_follow_pattern
  64. --------------------------------------------------
  65. // TEST[setup:remote_cluster]
  66. The API returns the following result:
  67. [source,console-result]
  68. --------------------------------------------------
  69. {
  70. "patterns": [
  71. {
  72. "name": "my_auto_follow_pattern",
  73. "pattern": {
  74. "remote_cluster" : "remote_cluster",
  75. "leader_index_patterns" :
  76. [
  77. "leader_index*"
  78. ],
  79. "follow_index_pattern" : "{{leader_index}}-follower"
  80. }
  81. }
  82. ]
  83. }
  84. --------------------------------------------------