put-auto-follow-pattern.asciidoc 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129
  1. [role="xpack"]
  2. [testenv="platinum"]
  3. [[ccr-put-auto-follow-pattern]]
  4. === Create Auto-Follow Pattern API
  5. ++++
  6. <titleabbrev>Create Auto-Follow Pattern</titleabbrev>
  7. ++++
  8. beta[]
  9. Creates an auto-follow pattern.
  10. ==== Description
  11. This API creates a new named collection of
  12. {stack-ov}/ccr-auto-follow.html[auto-follow patterns] against the remote cluster
  13. specified in the request body. Newly created indices on the remote cluster
  14. matching any of the specified patterns will be automatically configured as follower
  15. indices.
  16. ==== Request
  17. [source,js]
  18. --------------------------------------------------
  19. PUT /_ccr/auto_follow/<auto_follow_pattern_name>
  20. {
  21. "remote_cluster" : "<remote_cluster>",
  22. "leader_index_patterns" :
  23. [
  24. "<leader_index_pattern>"
  25. ],
  26. "follow_index_pattern" : "<follow_index_pattern>"
  27. }
  28. --------------------------------------------------
  29. // CONSOLE
  30. // TEST[setup:remote_cluster]
  31. // TEST[s/<auto_follow_pattern_name>/auto_follow_pattern_name/]
  32. // TEST[s/<remote_cluster>/remote_cluster/]
  33. // TEST[s/<leader_index_patterns>/leader_index*/]
  34. // TEST[s/<follow_index_pattern>/{{leader_index}}-follower/]
  35. //////////////////////////
  36. [source,js]
  37. --------------------------------------------------
  38. DELETE /_ccr/auto_follow/auto_follow_pattern_name
  39. --------------------------------------------------
  40. // CONSOLE
  41. // TEST[continued]
  42. //////////////////////////
  43. ==== Path Parameters
  44. `auto_follow_pattern_name` (required)::
  45. (string) name of the collection of auto-follow patterns
  46. ==== Request Body
  47. `remote_cluster`::
  48. (required string) the <<modules-remote-clusters,remote cluster>> containing the
  49. leader indices to match against
  50. `leader_index_patterns`::
  51. (array) an array of simple index patterns to match against indices in the
  52. remote cluster specified by the `remote_cluster` field
  53. `follow_index_pattern`::
  54. (string) the name of follower index; the template `{{leader_index}}` can be
  55. used to derive the name of the follower index from the name of the leader
  56. index
  57. include::../follow-request-body.asciidoc[]
  58. ==== Authorization
  59. If the {es} {security-features} are enabled, you must have `read` and `monitor`
  60. index privileges for the leader index patterns. You must also have `manage_ccr`
  61. cluster privileges on the cluster that contains the follower index. For more
  62. information, see
  63. {stack-ov}/security-privileges.html[Security privileges].
  64. ==== Example
  65. This example creates an auto-follow pattern named `my_auto_follow_pattern`:
  66. [source,js]
  67. --------------------------------------------------
  68. PUT /_ccr/auto_follow/my_auto_follow_pattern
  69. {
  70. "remote_cluster" : "remote_cluster",
  71. "leader_index_patterns" :
  72. [
  73. "leader_index*"
  74. ],
  75. "follow_index_pattern" : "{{leader_index}}-follower",
  76. "max_read_request_operation_count" : 1024,
  77. "max_outstanding_read_requests" : 16,
  78. "max_read_request_size" : "1024k",
  79. "max_write_request_operation_count" : 32768,
  80. "max_write_request_size" : "16k",
  81. "max_outstanding_write_requests" : 8,
  82. "max_write_buffer_count" : 512,
  83. "max_write_buffer_size" : "512k",
  84. "max_retry_delay" : "10s",
  85. "read_poll_timeout" : "30s"
  86. }
  87. --------------------------------------------------
  88. // CONSOLE
  89. // TEST[setup:remote_cluster]
  90. The API returns the following result:
  91. [source,js]
  92. --------------------------------------------------
  93. {
  94. "acknowledged" : true
  95. }
  96. --------------------------------------------------
  97. // TESTRESPONSE
  98. //////////////////////////
  99. [source,js]
  100. --------------------------------------------------
  101. DELETE /_ccr/auto_follow/my_auto_follow_pattern
  102. --------------------------------------------------
  103. // CONSOLE
  104. // TEST[continued]
  105. //////////////////////////