|
| 1 | +[role="xpack"] |
| 2 | +[testenv="platinum"] |
| 3 | +[[ccr-pause-auto-follow-pattern]] |
| 4 | +=== Pause auto-follow pattern API |
| 5 | +++++ |
| 6 | +<titleabbrev>Pause auto-follow pattern</titleabbrev> |
| 7 | +++++ |
| 8 | + |
| 9 | +Pauses an auto-follow pattern. |
| 10 | + |
| 11 | +[[ccr-pause-auto-follow-pattern-request]] |
| 12 | +==== {api-request-title} |
| 13 | + |
| 14 | +`POST /_ccr/auto_follow/<auto_follow_pattern_name>/pause` |
| 15 | + |
| 16 | +[[ccr-pause-auto-follow-pattern-prereqs]] |
| 17 | +==== {api-prereq-title} |
| 18 | + |
| 19 | +* If the {es} {security-features} are enabled, you must have `manage_ccr` cluster |
| 20 | +privileges on the cluster that contains the follower index. For more information, |
| 21 | +see <<security-privileges>>. |
| 22 | + |
| 23 | +[[ccr-pause-auto-follow-pattern-desc]] |
| 24 | +==== {api-description-title} |
| 25 | + |
| 26 | +This API pauses an <<ccr-auto-follow,auto-follow pattern>>. When this API returns, the auto-follow pattern |
| 27 | +is inactive and ignores any new index created on the remote cluster that matches any of |
| 28 | +the auto-follow's patterns. Paused auto-follow patterns appear with the `active` field |
| 29 | +set to `false` in the <<ccr-get-auto-follow-pattern, GET auto-follow patterns API>>. |
| 30 | + |
| 31 | +You can resume auto-following with the <<ccr-resume-auto-follow-pattern,resume auto-follow pattern API>>. |
| 32 | +Once resumed, the auto-follow pattern is active again and automatically configure |
| 33 | +follower indices for newly created indices on the remote cluster that match its patterns. |
| 34 | +Remote indices created while the |
| 35 | +pattern was paused will also be followed, unless they have been deleted or closed in the |
| 36 | +meantime. |
| 37 | + |
| 38 | +[[ccr-pause-auto-follow-pattern-path-parms]] |
| 39 | +==== {api-path-parms-title} |
| 40 | + |
| 41 | +`<auto_follow_pattern_name>`:: |
| 42 | + (Required, string) Name of the auto-follow pattern to pause. |
| 43 | + |
| 44 | + |
| 45 | +[[ccr-pause-auto-follow-pattern-examples]] |
| 46 | +==== {api-examples-title} |
| 47 | + |
| 48 | +This example pauses an auto-follow pattern named `my_auto_follow_pattern`: |
| 49 | +////////////////////////// |
| 50 | +
|
| 51 | +[source,console] |
| 52 | +-------------------------------------------------- |
| 53 | +PUT /_ccr/auto_follow/my_auto_follow_pattern |
| 54 | +{ |
| 55 | + "remote_cluster" : "remote_cluster", |
| 56 | + "leader_index_patterns" : |
| 57 | + [ |
| 58 | + "leader_index" |
| 59 | + ], |
| 60 | + "follow_index_pattern" : "{{leader_index}}-follower" |
| 61 | +} |
| 62 | +-------------------------------------------------- |
| 63 | +// TEST[setup:remote_cluster] |
| 64 | +// TESTSETUP |
| 65 | +
|
| 66 | +////////////////////////// |
| 67 | + |
| 68 | +[source,console] |
| 69 | +-------------------------------------------------- |
| 70 | +POST /_ccr/auto_follow/my_auto_follow_pattern/pause |
| 71 | +-------------------------------------------------- |
| 72 | +// TEST |
| 73 | + |
| 74 | +The API returns the following result: |
| 75 | + |
| 76 | +[source,console-result] |
| 77 | +-------------------------------------------------- |
| 78 | +{ |
| 79 | + "acknowledged" : true |
| 80 | +} |
| 81 | +-------------------------------------------------- |
0 commit comments