put-auto-follow-pattern.asciidoc 3.2 KB

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