get-auto-follow-pattern.asciidoc 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  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-query-params]]
  61. ==== {api-query-parms-title}
  62. `master_timeout`::
  63. (Optional, <<time-units, time units>>) Specifies the period of time to wait for
  64. a connection to the master node. If no response is received before the timeout
  65. expires, the request fails and returns an error. Defaults to `30s`.
  66. [[ccr-get-auto-follow-pattern-examples]]
  67. ==== {api-examples-title}
  68. This example retrieves information about an auto-follow pattern collection
  69. named `my_auto_follow_pattern`:
  70. [source,console]
  71. --------------------------------------------------
  72. GET /_ccr/auto_follow/my_auto_follow_pattern
  73. --------------------------------------------------
  74. // TEST[setup:remote_cluster]
  75. The API returns the following result:
  76. [source,console-result]
  77. --------------------------------------------------
  78. {
  79. "patterns": [
  80. {
  81. "name": "my_auto_follow_pattern",
  82. "pattern": {
  83. "active": true,
  84. "remote_cluster" : "remote_cluster",
  85. "leader_index_patterns" :
  86. [
  87. "leader_index*"
  88. ],
  89. "leader_index_exclusion_patterns":
  90. [
  91. "leader_index_001"
  92. ],
  93. "follow_index_pattern" : "{{leader_index}}-follower"
  94. }
  95. }
  96. ]
  97. }
  98. --------------------------------------------------