1
0

get-auto-follow-pattern.asciidoc 3.2 KB

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