1
0

put-auto-follow-pattern.asciidoc 3.5 KB

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