Skip to content

Commit ffe00d0

Browse files
committed
Generated API
1 parent 4be0f72 commit ffe00d0

24 files changed

+3585
-2523
lines changed

elasticsearch/client/__init__.py

Lines changed: 1234 additions & 1189 deletions
Large diffs are not rendered by default.

elasticsearch/client/cat.py

Lines changed: 335 additions & 278 deletions
Large diffs are not rendered by default.

elasticsearch/client/ccr.py

Lines changed: 66 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ def delete_auto_follow_pattern(self, name, params=None):
1111
"""
1212
if name in SKIP_IN_PATH:
1313
raise ValueError("Empty value passed for a required argument 'name'.")
14+
1415
return self.transport.perform_request(
1516
"DELETE", _make_path("_ccr", "auto_follow", name), params=params
1617
)
@@ -21,29 +22,33 @@ def follow(self, index, body, params=None):
2122
`<https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-put-follow.html>`_
2223
2324
: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
3132
"""
3233
for param in (index, body):
3334
if param in SKIP_IN_PATH:
3435
raise ValueError("Empty value passed for a required argument.")
36+
3537
return self.transport.perform_request(
3638
"PUT", _make_path(index, "_ccr", "follow"), params=params, body=body
3739
)
3840

3941
@query_params()
40-
def follow_info(self, index=None, params=None):
42+
def follow_info(self, index, params=None):
4143
"""
4244
`<https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-get-follow-info.html>`_
4345
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
4648
"""
49+
if index in SKIP_IN_PATH:
50+
raise ValueError("Empty value passed for a required argument 'index'.")
51+
4752
return self.transport.perform_request(
4853
"GET", _make_path(index, "_ccr", "info"), params=params
4954
)
@@ -53,11 +58,12 @@ def follow_stats(self, index, params=None):
5358
"""
5459
`<https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-get-follow-stats.html>`_
5560
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
5863
"""
5964
if index in SKIP_IN_PATH:
6065
raise ValueError("Empty value passed for a required argument 'index'.")
66+
6167
return self.transport.perform_request(
6268
"GET", _make_path(index, "_ccr", "stats"), params=params
6369
)
@@ -67,16 +73,17 @@ def forget_follower(self, index, body, params=None):
6773
"""
6874
`<http://www.elastic.co/guide/en/elasticsearch/reference/current>`_
6975
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
7682
"""
7783
for param in (index, body):
7884
if param in SKIP_IN_PATH:
7985
raise ValueError("Empty value passed for a required argument.")
86+
8087
return self.transport.perform_request(
8188
"POST",
8289
_make_path(index, "_ccr", "forget_follower"),
@@ -100,11 +107,12 @@ def pause_follow(self, index, params=None):
100107
"""
101108
`<https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-post-pause-follow.html>`_
102109
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.
105112
"""
106113
if index in SKIP_IN_PATH:
107114
raise ValueError("Empty value passed for a required argument 'index'.")
115+
108116
return self.transport.perform_request(
109117
"POST", _make_path(index, "_ccr", "pause_follow"), params=params
110118
)
@@ -120,6 +128,7 @@ def put_auto_follow_pattern(self, name, body, params=None):
120128
for param in (name, body):
121129
if param in SKIP_IN_PATH:
122130
raise ValueError("Empty value passed for a required argument.")
131+
123132
return self.transport.perform_request(
124133
"PUT", _make_path("_ccr", "auto_follow", name), params=params, body=body
125134
)
@@ -130,11 +139,12 @@ def resume_follow(self, index, body=None, params=None):
130139
`<https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-post-resume-follow.html>`_
131140
132141
: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
135144
"""
136145
if index in SKIP_IN_PATH:
137146
raise ValueError("Empty value passed for a required argument 'index'.")
147+
138148
return self.transport.perform_request(
139149
"POST", _make_path(index, "_ccr", "resume_follow"), params=params, body=body
140150
)
@@ -143,6 +153,7 @@ def resume_follow(self, index, body=None, params=None):
143153
def stats(self, params=None):
144154
"""
145155
`<https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-get-stats.html>`_
156+
146157
"""
147158
return self.transport.perform_request("GET", "/_ccr/stats", params=params)
148159

@@ -151,11 +162,42 @@ def unfollow(self, index, params=None):
151162
"""
152163
`<http://www.elastic.co/guide/en/elasticsearch/reference/current>`_
153164
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.
156167
"""
157168
if index in SKIP_IN_PATH:
158169
raise ValueError("Empty value passed for a required argument 'index'.")
170+
159171
return self.transport.perform_request(
160172
"POST", _make_path(index, "_ccr", "unfollow"), params=params
161173
)
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

Comments
 (0)