-
Notifications
You must be signed in to change notification settings - Fork 25.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Introduce cross-cluster replication API docs #34726
Changes from 1 commit
ce8c28d
d8fd650
a43ee46
5b1fcbf
f7bbdd1
bcfcb88
c3c86a4
6fbe1cd
843ae8f
caf996e
6337e6e
dd51c2c
738c0fe
ba825ca
7df57e6
822c850
baf1e60
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
This commit is our first introduction to cross-cluster replication docs. In this commit, we introduce the cross-cluster replication API docs. We also add skelton docs for additional content that will be added in a series of follow-up commits.
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
@@ -0,0 +1,67 @@ | ||||||||||||||||
[role="xpack"] | ||||||||||||||||
[testenv="platinum"] | ||||||||||||||||
[[ccr-delete-auto-follow-pattern]] | ||||||||||||||||
=== Delete Auto-Follow Pattern API | ||||||||||||||||
++++ | ||||||||||||||||
<titleabbrev>Delete Auto-Follow Pattern</titleabbrev> | ||||||||||||||||
++++ | ||||||||||||||||
|
||||||||||||||||
Delete auto-follow patterns. | ||||||||||||||||
|
||||||||||||||||
==== Description | ||||||||||||||||
|
||||||||||||||||
This API deletes configured auto-follow patterns. | ||||||||||||||||
|
||||||||||||||||
==== Request | ||||||||||||||||
|
||||||||||||||||
////////////////////////// | ||||||||||||||||
|
||||||||||||||||
[source,js] | ||||||||||||||||
-------------------------------------------------- | ||||||||||||||||
PUT /_ccr/auto_follow/leader_cluster | ||||||||||||||||
{ | ||||||||||||||||
"leader_cluster" : "leader_cluster", | ||||||||||||||||
"leader_index_patterns" : | ||||||||||||||||
[ | ||||||||||||||||
"leader_index" | ||||||||||||||||
], | ||||||||||||||||
"follow_index_pattern" : "{{leader_index}}-follower" | ||||||||||||||||
} | ||||||||||||||||
-------------------------------------------------- | ||||||||||||||||
// CONSOLE | ||||||||||||||||
// TEST[setup:leader_cluster] | ||||||||||||||||
// TESTSETUP | ||||||||||||||||
|
||||||||||||||||
////////////////////////// | ||||||||||||||||
|
||||||||||||||||
[source,js] | ||||||||||||||||
-------------------------------------------------- | ||||||||||||||||
DELETE /_ccr/auto_follow/<leader_cluster> | ||||||||||||||||
-------------------------------------------------- | ||||||||||||||||
// CONSOLE | ||||||||||||||||
// TEST[s/<leader_cluster>/leader_cluster/] | ||||||||||||||||
|
||||||||||||||||
Here, the auto-follow patterns associated with the | ||||||||||||||||
<<modules-remote-clusters,remote cluster>> specified by `<leader_cluster>` | ||||||||||||||||
will be deleted. | ||||||||||||||||
|
||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||||||||
==== Example | ||||||||||||||||
|
||||||||||||||||
The following is an example of using the delete auto-follow pattern API. | ||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||||||||
|
||||||||||||||||
[source,js] | ||||||||||||||||
-------------------------------------------------- | ||||||||||||||||
DELETE /_ccr/auto_follow/leader_cluster | ||||||||||||||||
-------------------------------------------------- | ||||||||||||||||
// CONSOLE | ||||||||||||||||
// TEST[setup:leader_cluster] | ||||||||||||||||
|
||||||||||||||||
The API returns the following result: | ||||||||||||||||
|
||||||||||||||||
[source,js] | ||||||||||||||||
-------------------------------------------------- | ||||||||||||||||
{ | ||||||||||||||||
"acknowledged" : true | ||||||||||||||||
} | ||||||||||||||||
-------------------------------------------------- | ||||||||||||||||
// TESTRESPONSE |
Original file line number | Diff line number | Diff line change | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
@@ -0,0 +1,91 @@ | ||||||||||||||||
[role="xpack"] | ||||||||||||||||
[testenv="platinum"] | ||||||||||||||||
[[ccr-get-auto-follow-pattern]] | ||||||||||||||||
=== Get Auto-Follow Pattern API | ||||||||||||||||
++++ | ||||||||||||||||
<titleabbrev>Get Auto-Follow Pattern</titleabbrev> | ||||||||||||||||
++++ | ||||||||||||||||
|
||||||||||||||||
Get auto-follow patterns. | ||||||||||||||||
|
||||||||||||||||
==== Description | ||||||||||||||||
|
||||||||||||||||
This API gets configured auto-follow patterns. This API will return the | ||||||||||||||||
configured auto-follow patterns on a per-cluster basis. | ||||||||||||||||
|
||||||||||||||||
==== Request | ||||||||||||||||
|
||||||||||||||||
////////////////////////// | ||||||||||||||||
|
||||||||||||||||
[source,js] | ||||||||||||||||
-------------------------------------------------- | ||||||||||||||||
PUT /_ccr/auto_follow/leader_cluster | ||||||||||||||||
{ | ||||||||||||||||
"leader_cluster" : "leader_cluster", | ||||||||||||||||
"leader_index_patterns" : | ||||||||||||||||
[ | ||||||||||||||||
"leader_index*" | ||||||||||||||||
], | ||||||||||||||||
"follow_index_pattern" : "{{leader_index}}-follower" | ||||||||||||||||
} | ||||||||||||||||
-------------------------------------------------- | ||||||||||||||||
// CONSOLE | ||||||||||||||||
// TEST[setup:leader_cluster] | ||||||||||||||||
// TESTSETUP | ||||||||||||||||
|
||||||||||||||||
[source,js] | ||||||||||||||||
-------------------------------------------------- | ||||||||||||||||
DELETE /_ccr/auto_follow/leader_cluster | ||||||||||||||||
-------------------------------------------------- | ||||||||||||||||
// CONSOLE | ||||||||||||||||
// TEST | ||||||||||||||||
// TEARDOWN | ||||||||||||||||
|
||||||||||||||||
////////////////////////// | ||||||||||||||||
|
||||||||||||||||
[source,js] | ||||||||||||||||
-------------------------------------------------- | ||||||||||||||||
GET /_ccr/auto_follow/ | ||||||||||||||||
-------------------------------------------------- | ||||||||||||||||
// CONSOLE | ||||||||||||||||
|
||||||||||||||||
Here, all auto-follow patterns will be returned. | ||||||||||||||||
|
||||||||||||||||
[source,js] | ||||||||||||||||
-------------------------------------------------- | ||||||||||||||||
GET /_ccr/auto_follow/<leader_cluster> | ||||||||||||||||
-------------------------------------------------- | ||||||||||||||||
// CONSOLE | ||||||||||||||||
// TEST[s/<leader_cluster>/leader_cluster/] | ||||||||||||||||
|
||||||||||||||||
Here, all auto-follow patterns configured for the | ||||||||||||||||
<<modules-remote-clusters,remote cluster>> specified by `<leader_cluster>` | ||||||||||||||||
will be returned. | ||||||||||||||||
|
||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||||||||
==== Example | ||||||||||||||||
|
||||||||||||||||
The following is an example of using the get auto-follow pattern API. | ||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||||||||
|
||||||||||||||||
[source,js] | ||||||||||||||||
-------------------------------------------------- | ||||||||||||||||
GET /_ccr/auto_follow/leader_cluster | ||||||||||||||||
-------------------------------------------------- | ||||||||||||||||
// CONSOLE | ||||||||||||||||
// TEST[setup:leader_cluster] | ||||||||||||||||
|
||||||||||||||||
The API returns the following result: | ||||||||||||||||
|
||||||||||||||||
[source,js] | ||||||||||||||||
-------------------------------------------------- | ||||||||||||||||
{ | ||||||||||||||||
"leader_cluster" : | ||||||||||||||||
{ | ||||||||||||||||
"leader_index_patterns" : | ||||||||||||||||
[ | ||||||||||||||||
"leader_index*" | ||||||||||||||||
], | ||||||||||||||||
"follow_index_pattern" : "{{leader_index}}-follower" | ||||||||||||||||
} | ||||||||||||||||
} | ||||||||||||||||
-------------------------------------------------- | ||||||||||||||||
// TESTRESPONSE |
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
@@ -0,0 +1,48 @@ | ||||||
[role="xpack"] | ||||||
[testenv="platinum"] | ||||||
[[ccr-get-auto-follow-stats]] | ||||||
=== Get Auto-Follow Stats API | ||||||
++++ | ||||||
<titleabbrev>Get Auto-Follow Stats</titleabbrev> | ||||||
++++ | ||||||
|
||||||
Get auto-follow stats. | ||||||
|
||||||
==== Description | ||||||
|
||||||
This API gets stats about auto-follow patterns. | ||||||
|
||||||
==== Request | ||||||
|
||||||
[source,js] | ||||||
-------------------------------------------------- | ||||||
GET /_ccr/auto_follow/stats | ||||||
-------------------------------------------------- | ||||||
// CONSOLE | ||||||
// TEST | ||||||
|
||||||
Here, stats about auto-follow patterns will be returned. | ||||||
|
||||||
==== Example | ||||||
|
||||||
The following is an example of using the get auto-follow stats API. | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
|
||||||
[source,js] | ||||||
-------------------------------------------------- | ||||||
GET /_ccr/auto_follow/stats | ||||||
-------------------------------------------------- | ||||||
// CONSOLE | ||||||
// TEST | ||||||
|
||||||
The API returns the following result: | ||||||
|
||||||
[source,js] | ||||||
-------------------------------------------------- | ||||||
{ | ||||||
"number_of_successful_follow_indices" : 16, | ||||||
"number_of_failed_follow_indices" : 0, | ||||||
"number_of_failed_remote_cluster_state_requests" : 0, | ||||||
"recent_auto_follow_errors" : [ ] | ||||||
} | ||||||
-------------------------------------------------- | ||||||
// TESTRESPONSE[s/"number_of_successful_follow_indices" : 16/"number_of_successful_follow_indices" : $body.number_of_successful_follow_indices/] |
Original file line number | Diff line number | Diff line change | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
@@ -0,0 +1,98 @@ | ||||||||||||||||
[role="xpack"] | ||||||||||||||||
[testenv="platinum"] | ||||||||||||||||
[[ccr-put-auto-follow-pattern]] | ||||||||||||||||
=== Create Auto-Follow Pattern API | ||||||||||||||||
++++ | ||||||||||||||||
<titleabbrev>Create Auto-Follow Pattern</titleabbrev> | ||||||||||||||||
++++ | ||||||||||||||||
|
||||||||||||||||
Creates an auto-follow pattern. | ||||||||||||||||
|
||||||||||||||||
==== Description | ||||||||||||||||
|
||||||||||||||||
This API creates a new collection of auto-follow patterns against the specified | ||||||||||||||||
remote cluster. Newly created indices on the remote cluster matching any of the specified | ||||||||||||||||
patterns will be automatically configured as follower indices. | ||||||||||||||||
|
||||||||||||||||
==== Request | ||||||||||||||||
|
||||||||||||||||
[source,js] | ||||||||||||||||
-------------------------------------------------- | ||||||||||||||||
PUT /_ccr/auto_follow/<leader_cluster> | ||||||||||||||||
{ | ||||||||||||||||
"leader_cluster" : "<leader_cluster>", | ||||||||||||||||
"leader_index_patterns" : | ||||||||||||||||
[ | ||||||||||||||||
"<leader_index_pattern>" | ||||||||||||||||
], | ||||||||||||||||
"follow_index_pattern" : "<follow_index_pattern>" | ||||||||||||||||
} | ||||||||||||||||
-------------------------------------------------- | ||||||||||||||||
// CONSOLE | ||||||||||||||||
// TEST[setup:leader_cluster] | ||||||||||||||||
// TEST[s/<leader_cluster>/leader_cluster/] | ||||||||||||||||
// TEST[s/<leader_index_patterns>/leader_index*/] | ||||||||||||||||
// TEST[s/<follow_index_pattern>/{{leader_index}}-follower/] | ||||||||||||||||
|
||||||||||||||||
Here, `<leader_cluster>` is the <<modules-remote-clusters,remote cluster>> | ||||||||||||||||
containing the leader indices to match against, `<leader_index_pattern>` is a | ||||||||||||||||
simple index pattern to match against indices in the remote cluster, and | ||||||||||||||||
`<follow_index_pattern>` is the pattern to use to name the resulting follower | ||||||||||||||||
indices. The `<follow_index_pattern>` can use the template `{{leader_index}}` to | ||||||||||||||||
refer to the name of the leader index being followed. | ||||||||||||||||
|
||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||||||||
==== Request Body | ||||||||||||||||
`leader_cluster`:: | ||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||||||||
(required string) the <<modules-remote-clusters,remote cluster>> containing the | ||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||||||||
leader indices to match against | ||||||||||||||||
|
||||||||||||||||
`leader_index_patterns`:: | ||||||||||||||||
(array) an array of simple index patterns to match against indices in the | ||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||||||||
remote cluster specified by the `leader_cluster` field | ||||||||||||||||
|
||||||||||||||||
`follow_index_pattern`:: | ||||||||||||||||
(string) the name of follower index; the template `{{leader_index}}` can be | ||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||||||||
used to derive the name of the follower index from the name of the leader | ||||||||||||||||
index | ||||||||||||||||
|
||||||||||||||||
include::../follow-request-body.asciidoc[] | ||||||||||||||||
|
||||||||||||||||
==== Example | ||||||||||||||||
|
||||||||||||||||
The following is an example of using the create auto-follow pattern API. | ||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||||||||
|
||||||||||||||||
[source,js] | ||||||||||||||||
-------------------------------------------------- | ||||||||||||||||
PUT /_ccr/auto_follow/leader_cluster | ||||||||||||||||
{ | ||||||||||||||||
"leader_cluster" : "leader_cluster", | ||||||||||||||||
"leader_index_patterns" : | ||||||||||||||||
[ | ||||||||||||||||
"leader_index*" | ||||||||||||||||
], | ||||||||||||||||
"follow_index_pattern" : "{{leader_index}}-follower" | ||||||||||||||||
} | ||||||||||||||||
-------------------------------------------------- | ||||||||||||||||
// CONSOLE | ||||||||||||||||
// TEST[setup:leader_cluster] | ||||||||||||||||
|
||||||||||||||||
The API returns the following result: | ||||||||||||||||
|
||||||||||||||||
[source,js] | ||||||||||||||||
-------------------------------------------------- | ||||||||||||||||
{ | ||||||||||||||||
"acknowledged" : true | ||||||||||||||||
} | ||||||||||||||||
-------------------------------------------------- | ||||||||||||||||
// TESTRESPONSE | ||||||||||||||||
|
||||||||||||||||
////////////////////////// | ||||||||||||||||
|
||||||||||||||||
[source,js] | ||||||||||||||||
-------------------------------------------------- | ||||||||||||||||
DELETE /_ccr/auto_follow/leader_cluster | ||||||||||||||||
-------------------------------------------------- | ||||||||||||||||
// CONSOLE | ||||||||||||||||
// TEST[continued] | ||||||||||||||||
|
||||||||||||||||
////////////////////////// |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
[role="xpack"] | ||
[testenv="platinum"] | ||
[[ccr-apis]] | ||
== Cross-cluster replication APIs | ||
|
||
You can use the following APIs to perform {ccr} operations. | ||
|
||
[float] | ||
[[ccr-api-follow]] | ||
=== Follow | ||
|
||
* <<ccr-put-follow,Create follower index>> | ||
* <<ccr-post-pause-follow,Pause follower>> | ||
* <<ccr-post-resume-follow,Resume follower>> | ||
* <<ccr-post-unfollow,Convert follower index to a regular index>> | ||
* <<ccr-get-follow-stats,Get stats about follower indices>> | ||
|
||
[float] | ||
[[ccr-api-auto-follow]] | ||
=== Auto-follow | ||
|
||
* <<ccr-put-auto-follow-pattern,Create auto-follow pattern>> | ||
* <<ccr-delete-auto-follow-pattern,Delete auto-follow pattern>> | ||
* <<ccr-get-auto-follow-pattern,Get auto-follow patterns>> | ||
* <<ccr-get-auto-follow-stats,Get stats about auto-follow patterns>> | ||
|
||
// follow | ||
include::follow/put-follow.asciidoc[] | ||
include::follow/post-pause-follow.asciidoc[] | ||
include::follow/post-resume-follow.asciidoc[] | ||
include::follow/post-unfollow.asciidoc[] | ||
include::follow/get-follow-stats.asciidoc[] | ||
|
||
// auto-follow | ||
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/get-auto-follow-stats.asciidoc[] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is removed because it is now used in the setup section of some of the docs tests, and
setup
sections do not supportis_true
sections. While we could add support foris_true
sections tosetup
section, this assertion is adding little value to begin with.