put-auto-follow-pattern.asciidoc 3.9 KB

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