diff --git a/docs/reference/ccr/apis/auto-follow/pause-auto-follow-pattern.asciidoc b/docs/reference/ccr/apis/auto-follow/pause-auto-follow-pattern.asciidoc new file mode 100644 index 0000000000000..7565135ca840b --- /dev/null +++ b/docs/reference/ccr/apis/auto-follow/pause-auto-follow-pattern.asciidoc @@ -0,0 +1,81 @@ +[role="xpack"] +[testenv="platinum"] +[[ccr-pause-auto-follow-pattern]] +=== Pause auto-follow pattern API +++++ +Pause auto-follow pattern +++++ + +Pauses an auto-follow pattern. + +[[ccr-pause-auto-follow-pattern-request]] +==== {api-request-title} + +`POST /_ccr/auto_follow//pause` + +[[ccr-pause-auto-follow-pattern-prereqs]] +==== {api-prereq-title} + +* If the {es} {security-features} are enabled, you must have `manage_ccr` cluster +privileges on the cluster that contains the follower index. For more information, +see <>. + +[[ccr-pause-auto-follow-pattern-desc]] +==== {api-description-title} + +This API pauses an <>. When this API returns, the auto-follow pattern +is inactive and ignores any new index created on the remote cluster that matches any of +the auto-follow's patterns. Paused auto-follow patterns appear with the `active` field +set to `false` in the <>. + +You can resume auto-following with the <>. +Once resumed, the auto-follow pattern is active again and automatically configure +follower indices for newly created indices on the remote cluster that match its patterns. +Remote indices created while the +pattern was paused will also be followed, unless they have been deleted or closed in the +meantime. + +[[ccr-pause-auto-follow-pattern-path-parms]] +==== {api-path-parms-title} + +``:: + (Required, string) Name of the auto-follow pattern to pause. + + +[[ccr-pause-auto-follow-pattern-examples]] +==== {api-examples-title} + +This example pauses an auto-follow pattern named `my_auto_follow_pattern`: +////////////////////////// + +[source,console] +-------------------------------------------------- +PUT /_ccr/auto_follow/my_auto_follow_pattern +{ + "remote_cluster" : "remote_cluster", + "leader_index_patterns" : + [ + "leader_index" + ], + "follow_index_pattern" : "{{leader_index}}-follower" +} +-------------------------------------------------- +// TEST[setup:remote_cluster] +// TESTSETUP + +////////////////////////// + +[source,console] +-------------------------------------------------- +POST /_ccr/auto_follow/my_auto_follow_pattern/pause +-------------------------------------------------- +// TEST + +The API returns the following result: + +[source,console-result] +-------------------------------------------------- +{ + "acknowledged" : true +} +-------------------------------------------------- diff --git a/docs/reference/ccr/apis/auto-follow/resume-auto-follow-pattern.asciidoc b/docs/reference/ccr/apis/auto-follow/resume-auto-follow-pattern.asciidoc new file mode 100644 index 0000000000000..a96b6eb2f0b40 --- /dev/null +++ b/docs/reference/ccr/apis/auto-follow/resume-auto-follow-pattern.asciidoc @@ -0,0 +1,82 @@ +[role="xpack"] +[testenv="platinum"] +[[ccr-resume-auto-follow-pattern]] +=== Resume auto-follow pattern API +++++ +Resume auto-follow pattern +++++ + +Resumes an auto-follow pattern. + +[[ccr-resume-auto-follow-pattern-request]] +==== {api-request-title} + +`POST /_ccr/auto_follow//resume` + +[[ccr-resume-auto-follow-pattern-prereqs]] +==== {api-prereq-title} + +* If the {es} {security-features} are enabled, you must have `manage_ccr` cluster +privileges on the cluster that contains the follower index. For more information, +see <>. + +[[ccr-resume-auto-follow-pattern-desc]] +==== {api-description-title} + +This API resumes an <> that has been paused with the +<>. When this API +returns, the auto-follow pattern will resume configuring following indices for +newly created indices on the remote cluster that match its patterns. Remote +indices created while the pattern was paused will also be followed, unless they +have been deleted or closed in the meantime. + +[[ccr-resume-auto-follow-pattern-path-parms]] +==== {api-path-parms-title} + +``:: + (Required, string) Specifies the name of the auto-follow pattern to resume. + + +[[ccr-resume-auto-follow-pattern-examples]] +==== {api-examples-title} + +This example resumes the activity of a paused auto-follow pattern +named `my_auto_follow_pattern`: +////////////////////////// + +[source,console] +-------------------------------------------------- +PUT /_ccr/auto_follow/my_auto_follow_pattern +{ + "remote_cluster" : "remote_cluster", + "leader_index_patterns" : + [ + "leader_index" + ], + "follow_index_pattern" : "{{leader_index}}-follower" +} +-------------------------------------------------- +// TEST[setup:remote_cluster] +// TESTSETUP + +[source,console] +-------------------------------------------------- +POST /_ccr/auto_follow/my_auto_follow_pattern/pause +-------------------------------------------------- +// TEST + +////////////////////////// +[source,console] +-------------------------------------------------- +POST /_ccr/auto_follow/my_auto_follow_pattern/resume +-------------------------------------------------- +// TEST + +The API returns the following result: + +[source,console-result] +-------------------------------------------------- +{ + "acknowledged" : true +} +-------------------------------------------------- diff --git a/docs/reference/ccr/apis/ccr-apis.asciidoc b/docs/reference/ccr/apis/ccr-apis.asciidoc index b737167ce3165..7a0fd55a7b44c 100644 --- a/docs/reference/ccr/apis/ccr-apis.asciidoc +++ b/docs/reference/ccr/apis/ccr-apis.asciidoc @@ -30,6 +30,8 @@ You can use the following APIs to perform {ccr} operations. * <> * <> * <> +* <> +* <> // top-level include::get-ccr-stats.asciidoc[] @@ -47,3 +49,5 @@ include::follow/get-follow-info.asciidoc[] include::auto-follow/put-auto-follow-pattern.asciidoc[] include::auto-follow/delete-auto-follow-pattern.asciidoc[] include::auto-follow/get-auto-follow-pattern.asciidoc[] +include::auto-follow/pause-auto-follow-pattern.asciidoc[] +include::auto-follow/resume-auto-follow-pattern.asciidoc[] diff --git a/docs/reference/ccr/auto-follow.asciidoc b/docs/reference/ccr/auto-follow.asciidoc index 580b2b11d7244..d83c2eb0555e3 100644 --- a/docs/reference/ccr/auto-follow.asciidoc +++ b/docs/reference/ccr/auto-follow.asciidoc @@ -21,8 +21,10 @@ a follower index is configured in the local cluster. The follower index uses the new index as its leader index. You can inspect all configured auto-follow pattern collections with the -{ref}/ccr-get-auto-follow-pattern.html[get auto-follow pattern API]. To delete a -configured auto-follow pattern collection, use the +{ref}/ccr-get-auto-follow-pattern.html[get auto-follow pattern API]. Auto-follow patterns +can be paused using the {ref}/ccr-pause-auto-follow-pattern.html[pause auto-follow pattern API] + and can be resumed using the {ref}/ccr-resume-auto-follow-pattern.html[resume auto-follow pattern API]. + To delete a configured auto-follow pattern collection, use the {ref}/ccr-delete-auto-follow-pattern.html[delete auto-follow pattern API]. Since auto-follow functionality is handled automatically in the background on