@@ -11,6 +11,7 @@ def delete_auto_follow_pattern(self, name, params=None):
11
11
"""
12
12
if name in SKIP_IN_PATH :
13
13
raise ValueError ("Empty value passed for a required argument 'name'." )
14
+
14
15
return self .transport .perform_request (
15
16
"DELETE" , _make_path ("_ccr" , "auto_follow" , name ), params = params
16
17
)
@@ -21,29 +22,33 @@ def follow(self, index, body, params=None):
21
22
`<https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-put-follow.html>`_
22
23
23
24
:arg index: The name of the follower index
24
- :arg body: The name of the leader index and other optional ccr related
25
- parameters
26
- :arg wait_for_active_shards: Sets the number of shard copies that must
27
- be active before returning. Defaults to 0. Set to `all` for all
28
- shard copies, otherwise set to any non-negative value less than or
29
- equal to the total number of copies for the shard (number of
30
- replicas + 1), default '0'
25
+ :arg body: The name of the leader index and other optional ccr
26
+ related parameters
27
+ :arg wait_for_active_shards: Sets the number of shard copies
28
+ that must be active before returning. Defaults to 0. Set to `all` for
29
+ all shard copies, otherwise set to any non-negative value less than or
30
+ equal to the total number of copies for the shard (number of replicas +
31
+ 1) Default: 0
31
32
"""
32
33
for param in (index , body ):
33
34
if param in SKIP_IN_PATH :
34
35
raise ValueError ("Empty value passed for a required argument." )
36
+
35
37
return self .transport .perform_request (
36
38
"PUT" , _make_path (index , "_ccr" , "follow" ), params = params , body = body
37
39
)
38
40
39
41
@query_params ()
40
- def follow_info (self , index = None , params = None ):
42
+ def follow_info (self , index , params = None ):
41
43
"""
42
44
`<https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-get-follow-info.html>`_
43
45
44
- :arg index: A comma-separated list of index patterns; use `_all` to
45
- perform the operation on all indices
46
+ :arg index: A comma-separated list of index patterns; use `_all`
47
+ to perform the operation on all indices
46
48
"""
49
+ if index in SKIP_IN_PATH :
50
+ raise ValueError ("Empty value passed for a required argument 'index'." )
51
+
47
52
return self .transport .perform_request (
48
53
"GET" , _make_path (index , "_ccr" , "info" ), params = params
49
54
)
@@ -53,11 +58,12 @@ def follow_stats(self, index, params=None):
53
58
"""
54
59
`<https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-get-follow-stats.html>`_
55
60
56
- :arg index: A comma-separated list of index patterns; use `_all` to
57
- perform the operation on all indices
61
+ :arg index: A comma-separated list of index patterns; use `_all`
62
+ to perform the operation on all indices
58
63
"""
59
64
if index in SKIP_IN_PATH :
60
65
raise ValueError ("Empty value passed for a required argument 'index'." )
66
+
61
67
return self .transport .perform_request (
62
68
"GET" , _make_path (index , "_ccr" , "stats" ), params = params
63
69
)
@@ -67,16 +73,17 @@ def forget_follower(self, index, body, params=None):
67
73
"""
68
74
`<http://www.elastic.co/guide/en/elasticsearch/reference/current>`_
69
75
70
- :arg index: the name of the leader index for which specified follower
71
- retention leases should be removed
72
- :arg body: the name and UUID of the follower index, the name of the
73
- cluster containing the follower index, and the alias from the
74
- perspective of that cluster for the remote cluster containing the
75
- leader index
76
+ :arg index: the name of the leader index for which specified
77
+ follower retention leases should be removed
78
+ :arg body: the name and UUID of the follower index, the name of
79
+ the cluster containing the follower index, and the alias from the
80
+ perspective of that cluster for the remote cluster containing the leader
81
+ index
76
82
"""
77
83
for param in (index , body ):
78
84
if param in SKIP_IN_PATH :
79
85
raise ValueError ("Empty value passed for a required argument." )
86
+
80
87
return self .transport .perform_request (
81
88
"POST" ,
82
89
_make_path (index , "_ccr" , "forget_follower" ),
@@ -100,11 +107,12 @@ def pause_follow(self, index, params=None):
100
107
"""
101
108
`<https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-post-pause-follow.html>`_
102
109
103
- :arg index: The name of the follower index that should pause following
104
- its leader index.
110
+ :arg index: The name of the follower index that should pause
111
+ following its leader index.
105
112
"""
106
113
if index in SKIP_IN_PATH :
107
114
raise ValueError ("Empty value passed for a required argument 'index'." )
115
+
108
116
return self .transport .perform_request (
109
117
"POST" , _make_path (index , "_ccr" , "pause_follow" ), params = params
110
118
)
@@ -120,6 +128,7 @@ def put_auto_follow_pattern(self, name, body, params=None):
120
128
for param in (name , body ):
121
129
if param in SKIP_IN_PATH :
122
130
raise ValueError ("Empty value passed for a required argument." )
131
+
123
132
return self .transport .perform_request (
124
133
"PUT" , _make_path ("_ccr" , "auto_follow" , name ), params = params , body = body
125
134
)
@@ -130,11 +139,12 @@ def resume_follow(self, index, body=None, params=None):
130
139
`<https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-post-resume-follow.html>`_
131
140
132
141
:arg index: The name of the follow index to resume following.
133
- :arg body: The name of the leader index and other optional ccr related
134
- parameters
142
+ :arg body: The name of the leader index and other optional ccr
143
+ related parameters
135
144
"""
136
145
if index in SKIP_IN_PATH :
137
146
raise ValueError ("Empty value passed for a required argument 'index'." )
147
+
138
148
return self .transport .perform_request (
139
149
"POST" , _make_path (index , "_ccr" , "resume_follow" ), params = params , body = body
140
150
)
@@ -143,6 +153,7 @@ def resume_follow(self, index, body=None, params=None):
143
153
def stats (self , params = None ):
144
154
"""
145
155
`<https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-get-stats.html>`_
156
+
146
157
"""
147
158
return self .transport .perform_request ("GET" , "/_ccr/stats" , params = params )
148
159
@@ -151,11 +162,42 @@ def unfollow(self, index, params=None):
151
162
"""
152
163
`<http://www.elastic.co/guide/en/elasticsearch/reference/current>`_
153
164
154
- :arg index: The name of the follower index that should be turned into a
155
- regular index.
165
+ :arg index: The name of the follower index that should be turned
166
+ into a regular index.
156
167
"""
157
168
if index in SKIP_IN_PATH :
158
169
raise ValueError ("Empty value passed for a required argument 'index'." )
170
+
159
171
return self .transport .perform_request (
160
172
"POST" , _make_path (index , "_ccr" , "unfollow" ), params = params
161
173
)
174
+
175
+ @query_params ()
176
+ def pause_auto_follow_pattern (self , name , params = None ):
177
+ """
178
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-pause-auto-follow-pattern.html>`_
179
+
180
+ :arg name: The name of the auto follow pattern that should pause
181
+ discovering new indices to follow.
182
+ """
183
+ if name in SKIP_IN_PATH :
184
+ raise ValueError ("Empty value passed for a required argument 'name'." )
185
+
186
+ return self .transport .perform_request (
187
+ "POST" , _make_path ("_ccr" , "auto_follow" , name , "pause" ), params = params
188
+ )
189
+
190
+ @query_params ()
191
+ def resume_auto_follow_pattern (self , name , params = None ):
192
+ """
193
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-resume-auto-follow-pattern.html>`_
194
+
195
+ :arg name: The name of the auto follow pattern to resume
196
+ discovering new indices to follow.
197
+ """
198
+ if name in SKIP_IN_PATH :
199
+ raise ValueError ("Empty value passed for a required argument 'name'." )
200
+
201
+ return self .transport .perform_request (
202
+ "POST" , _make_path ("_ccr" , "auto_follow" , name , "resume" ), params = params
203
+ )
0 commit comments