2018-10-26 11:23:35 -04:00
|
|
|
[role="xpack"]
|
|
|
|
[testenv="platinum"]
|
|
|
|
[[ccr-get-auto-follow-pattern]]
|
2018-12-20 13:23:28 -05:00
|
|
|
=== Get auto-follow pattern API
|
2018-10-26 11:23:35 -04:00
|
|
|
++++
|
2018-12-20 13:23:28 -05:00
|
|
|
<titleabbrev>Get auto-follow pattern</titleabbrev>
|
2018-10-26 11:23:35 -04:00
|
|
|
++++
|
|
|
|
|
|
|
|
Get auto-follow patterns.
|
|
|
|
|
2019-07-04 11:22:17 -04:00
|
|
|
[[ccr-get-auto-follow-pattern-request]]
|
|
|
|
==== {api-request-title}
|
2018-10-26 11:23:35 -04:00
|
|
|
|
|
|
|
//////////////////////////
|
|
|
|
|
2019-09-09 13:38:14 -04:00
|
|
|
[source,console]
|
2018-10-26 11:23:35 -04:00
|
|
|
--------------------------------------------------
|
|
|
|
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
|
|
|
|
|
2019-09-09 13:38:14 -04:00
|
|
|
[source,console]
|
2018-10-26 11:23:35 -04:00
|
|
|
--------------------------------------------------
|
|
|
|
DELETE /_ccr/auto_follow/my_auto_follow_pattern
|
|
|
|
--------------------------------------------------
|
|
|
|
// TEST
|
|
|
|
// TEARDOWN
|
|
|
|
|
|
|
|
//////////////////////////
|
|
|
|
|
2019-09-09 13:38:14 -04:00
|
|
|
[source,console]
|
2018-10-26 11:23:35 -04:00
|
|
|
--------------------------------------------------
|
|
|
|
GET /_ccr/auto_follow/
|
|
|
|
--------------------------------------------------
|
|
|
|
|
2019-09-09 13:38:14 -04:00
|
|
|
[source,console]
|
2018-10-26 11:23:35 -04:00
|
|
|
--------------------------------------------------
|
|
|
|
GET /_ccr/auto_follow/<auto_follow_pattern_name>
|
|
|
|
--------------------------------------------------
|
|
|
|
// TEST[s/<auto_follow_pattern_name>/my_auto_follow_pattern/]
|
|
|
|
|
2019-07-04 11:22:17 -04:00
|
|
|
[[ccr-get-auto-follow-pattern-prereqs]]
|
|
|
|
==== {api-prereq-title}
|
2018-11-21 18:01:59 -05:00
|
|
|
|
2019-07-04 11:22:17 -04:00
|
|
|
* If the {es} {security-features} are enabled, you must have `manage_ccr` cluster
|
2018-11-21 18:01:59 -05:00
|
|
|
privileges on the cluster that contains the follower index. For more information,
|
|
|
|
see {stack-ov}/security-privileges.html[Security privileges].
|
|
|
|
|
2019-07-04 11:22:17 -04:00
|
|
|
[[ccr-get-auto-follow-pattern-desc]]
|
|
|
|
==== {api-description-title}
|
|
|
|
|
|
|
|
This API gets configured {stack-ov}/ccr-auto-follow.html[auto-follow patterns].
|
|
|
|
This API will return the specified auto-follow pattern collection.
|
|
|
|
|
|
|
|
[[ccr-get-auto-follow-pattern-path-parms]]
|
|
|
|
==== {api-path-parms-title}
|
|
|
|
|
2019-07-12 11:26:31 -04:00
|
|
|
`<auto_follow_pattern_name>`::
|
|
|
|
(Optional, string) Specifies the auto-follow pattern collection that you want
|
|
|
|
to retrieve. If you do not specify a name, the API returns information for all
|
2019-07-04 11:22:17 -04:00
|
|
|
collections.
|
|
|
|
|
|
|
|
[[ccr-get-auto-follow-pattern-examples]]
|
|
|
|
==== {api-examples-title}
|
2018-10-26 11:23:35 -04:00
|
|
|
|
|
|
|
This example retrieves information about an auto-follow pattern collection
|
|
|
|
named `my_auto_follow_pattern`:
|
|
|
|
|
2019-09-09 13:38:14 -04:00
|
|
|
[source,console]
|
2018-10-26 11:23:35 -04:00
|
|
|
--------------------------------------------------
|
|
|
|
GET /_ccr/auto_follow/my_auto_follow_pattern
|
|
|
|
--------------------------------------------------
|
|
|
|
// TEST[setup:remote_cluster]
|
|
|
|
|
|
|
|
The API returns the following result:
|
|
|
|
|
2019-09-06 09:22:08 -04:00
|
|
|
[source,console-result]
|
2018-10-26 11:23:35 -04:00
|
|
|
--------------------------------------------------
|
|
|
|
{
|
2018-12-05 02:41:27 -05:00
|
|
|
"patterns": [
|
|
|
|
{
|
|
|
|
"name": "my_auto_follow_pattern",
|
|
|
|
"pattern": {
|
|
|
|
"remote_cluster" : "remote_cluster",
|
|
|
|
"leader_index_patterns" :
|
|
|
|
[
|
|
|
|
"leader_index*"
|
|
|
|
],
|
|
|
|
"follow_index_pattern" : "{{leader_index}}-follower"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
]
|
2018-10-26 11:23:35 -04:00
|
|
|
}
|
|
|
|
--------------------------------------------------
|