1
0

get-auto-follow-pattern.asciidoc 2.9 KB

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