Skip to content

Commit c781f3e

Browse files
committed
Update APIs to 7.x-SNAPSHOT
1 parent ae522eb commit c781f3e

File tree

13 files changed

+337
-0
lines changed

13 files changed

+337
-0
lines changed

elasticsearch/_async/client/__init__.py

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2145,3 +2145,33 @@ async def open_point_in_time(self, index=None, params=None, headers=None):
21452145
return await self.transport.perform_request(
21462146
"POST", _make_path(index, "_pit"), params=params, headers=headers
21472147
)
2148+
2149+
@query_params()
2150+
async def terms_enum(self, index, body=None, params=None, headers=None):
2151+
"""
2152+
The terms enum API can be used to discover terms in the index that begin with
2153+
the provided string. It is designed for low-latency look-ups used in auto-
2154+
complete scenarios.
2155+
2156+
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/search-terms-enum.html>`_
2157+
2158+
.. warning::
2159+
2160+
This API is **beta** so may include breaking changes
2161+
or be removed in a future version
2162+
2163+
:arg index: A comma-separated list of index names to search; use
2164+
`_all` or empty string to perform the operation on all indices
2165+
:arg body: field name, string which is the prefix expected in
2166+
matching terms, timeout and size for max number of results
2167+
"""
2168+
if index in SKIP_IN_PATH:
2169+
raise ValueError("Empty value passed for a required argument 'index'.")
2170+
2171+
return await self.transport.perform_request(
2172+
"POST",
2173+
_make_path(index, "_terms_enum"),
2174+
params=params,
2175+
headers=headers,
2176+
body=body,
2177+
)

elasticsearch/_async/client/__init__.pyi

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1150,3 +1150,21 @@ class AsyncElasticsearch(object):
11501150
params: Optional[MutableMapping[str, Any]] = ...,
11511151
headers: Optional[MutableMapping[str, str]] = ...,
11521152
) -> Any: ...
1153+
async def terms_enum(
1154+
self,
1155+
index: Any,
1156+
*,
1157+
body: Optional[Any] = ...,
1158+
pretty: Optional[bool] = ...,
1159+
human: Optional[bool] = ...,
1160+
error_trace: Optional[bool] = ...,
1161+
format: Optional[str] = ...,
1162+
filter_path: Optional[Union[str, Collection[str]]] = ...,
1163+
request_timeout: Optional[Union[int, float]] = ...,
1164+
ignore: Optional[Union[int, Collection[int]]] = ...,
1165+
opaque_id: Optional[str] = ...,
1166+
http_auth: Optional[Union[str, Tuple[str, str]]] = ...,
1167+
api_key: Optional[Union[str, Tuple[str, str]]] = ...,
1168+
params: Optional[MutableMapping[str, Any]] = ...,
1169+
headers: Optional[MutableMapping[str, str]] = ...,
1170+
) -> Any: ...

elasticsearch/_async/client/security.py

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -762,3 +762,23 @@ async def get_service_credentials(
762762
params=params,
763763
headers=headers,
764764
)
765+
766+
@query_params()
767+
async def saml_complete_logout(self, body, params=None, headers=None):
768+
"""
769+
Verifies the logout response sent from the SAML IdP
770+
771+
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/security-api-saml-complete-logout.html>`_
772+
773+
:arg body: The logout response to verify
774+
"""
775+
if body in SKIP_IN_PATH:
776+
raise ValueError("Empty value passed for a required argument 'body'.")
777+
778+
return await self.transport.perform_request(
779+
"POST",
780+
"/_security/saml/complete_logout",
781+
params=params,
782+
headers=headers,
783+
body=body,
784+
)

elasticsearch/_async/client/security.pyi

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -630,3 +630,20 @@ class SecurityClient(NamespacedClient):
630630
params: Optional[MutableMapping[str, Any]] = ...,
631631
headers: Optional[MutableMapping[str, str]] = ...,
632632
) -> Any: ...
633+
async def saml_complete_logout(
634+
self,
635+
*,
636+
body: Any,
637+
pretty: Optional[bool] = ...,
638+
human: Optional[bool] = ...,
639+
error_trace: Optional[bool] = ...,
640+
format: Optional[str] = ...,
641+
filter_path: Optional[Union[str, Collection[str]]] = ...,
642+
request_timeout: Optional[Union[int, float]] = ...,
643+
ignore: Optional[Union[int, Collection[int]]] = ...,
644+
opaque_id: Optional[str] = ...,
645+
http_auth: Optional[Union[str, Tuple[str, str]]] = ...,
646+
api_key: Optional[Union[str, Tuple[str, str]]] = ...,
647+
params: Optional[MutableMapping[str, Any]] = ...,
648+
headers: Optional[MutableMapping[str, str]] = ...,
649+
) -> Any: ...

elasticsearch/_async/client/snapshot.py

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -285,3 +285,57 @@ async def clone(
285285
headers=headers,
286286
body=body,
287287
)
288+
289+
@query_params(
290+
"blob_count",
291+
"concurrency",
292+
"detailed",
293+
"early_read_node_count",
294+
"max_blob_size",
295+
"max_total_data_size",
296+
"rare_action_probability",
297+
"rarely_abort_writes",
298+
"read_node_count",
299+
"seed",
300+
"timeout",
301+
)
302+
async def repository_analyze(self, repository, params=None, headers=None):
303+
"""
304+
Analyzes a repository for correctness and performance
305+
306+
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/modules-snapshots.html>`_
307+
308+
:arg repository: A repository name
309+
:arg blob_count: Number of blobs to create during the test.
310+
Defaults to 100.
311+
:arg concurrency: Number of operations to run concurrently
312+
during the test. Defaults to 10.
313+
:arg detailed: Whether to return detailed results or a summary.
314+
Defaults to 'false' so that only the summary is returned.
315+
:arg early_read_node_count: Number of nodes on which to perform
316+
an early read on a blob, i.e. before writing has completed. Early reads
317+
are rare actions so the 'rare_action_probability' parameter is also
318+
relevant. Defaults to 2.
319+
:arg max_blob_size: Maximum size of a blob to create during the
320+
test, e.g '1gb' or '100mb'. Defaults to '10mb'.
321+
:arg max_total_data_size: Maximum total size of all blobs to
322+
create during the test, e.g '1tb' or '100gb'. Defaults to '1gb'.
323+
:arg rare_action_probability: Probability of taking a rare
324+
action such as an early read or an overwrite. Defaults to 0.02.
325+
:arg rarely_abort_writes: Whether to rarely abort writes before
326+
they complete. Defaults to 'true'.
327+
:arg read_node_count: Number of nodes on which to read a blob
328+
after writing. Defaults to 10.
329+
:arg seed: Seed for the random number generator used to create
330+
the test workload. Defaults to a random value.
331+
:arg timeout: Explicit operation timeout. Defaults to '30s'.
332+
"""
333+
if repository in SKIP_IN_PATH:
334+
raise ValueError("Empty value passed for a required argument 'repository'.")
335+
336+
return await self.transport.perform_request(
337+
"POST",
338+
_make_path("_snapshot", repository, "_analyze"),
339+
params=params,
340+
headers=headers,
341+
)

elasticsearch/_async/client/snapshot.pyi

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -241,3 +241,31 @@ class SnapshotClient(NamespacedClient):
241241
params: Optional[MutableMapping[str, Any]] = ...,
242242
headers: Optional[MutableMapping[str, str]] = ...,
243243
) -> Any: ...
244+
async def repository_analyze(
245+
self,
246+
repository: Any,
247+
*,
248+
blob_count: Optional[Any] = ...,
249+
concurrency: Optional[Any] = ...,
250+
detailed: Optional[Any] = ...,
251+
early_read_node_count: Optional[Any] = ...,
252+
max_blob_size: Optional[Any] = ...,
253+
max_total_data_size: Optional[Any] = ...,
254+
rare_action_probability: Optional[Any] = ...,
255+
rarely_abort_writes: Optional[Any] = ...,
256+
read_node_count: Optional[Any] = ...,
257+
seed: Optional[Any] = ...,
258+
timeout: Optional[Any] = ...,
259+
pretty: Optional[bool] = ...,
260+
human: Optional[bool] = ...,
261+
error_trace: Optional[bool] = ...,
262+
format: Optional[str] = ...,
263+
filter_path: Optional[Union[str, Collection[str]]] = ...,
264+
request_timeout: Optional[Union[int, float]] = ...,
265+
ignore: Optional[Union[int, Collection[int]]] = ...,
266+
opaque_id: Optional[str] = ...,
267+
http_auth: Optional[Union[str, Tuple[str, str]]] = ...,
268+
api_key: Optional[Union[str, Tuple[str, str]]] = ...,
269+
params: Optional[MutableMapping[str, Any]] = ...,
270+
headers: Optional[MutableMapping[str, str]] = ...,
271+
) -> Any: ...

elasticsearch/client/__init__.py

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2133,3 +2133,33 @@ def open_point_in_time(self, index=None, params=None, headers=None):
21332133
return self.transport.perform_request(
21342134
"POST", _make_path(index, "_pit"), params=params, headers=headers
21352135
)
2136+
2137+
@query_params()
2138+
def terms_enum(self, index, body=None, params=None, headers=None):
2139+
"""
2140+
The terms enum API can be used to discover terms in the index that begin with
2141+
the provided string. It is designed for low-latency look-ups used in auto-
2142+
complete scenarios.
2143+
2144+
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/search-terms-enum.html>`_
2145+
2146+
.. warning::
2147+
2148+
This API is **beta** so may include breaking changes
2149+
or be removed in a future version
2150+
2151+
:arg index: A comma-separated list of index names to search; use
2152+
`_all` or empty string to perform the operation on all indices
2153+
:arg body: field name, string which is the prefix expected in
2154+
matching terms, timeout and size for max number of results
2155+
"""
2156+
if index in SKIP_IN_PATH:
2157+
raise ValueError("Empty value passed for a required argument 'index'.")
2158+
2159+
return self.transport.perform_request(
2160+
"POST",
2161+
_make_path(index, "_terms_enum"),
2162+
params=params,
2163+
headers=headers,
2164+
body=body,
2165+
)

elasticsearch/client/__init__.pyi

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1150,3 +1150,21 @@ class Elasticsearch(object):
11501150
params: Optional[MutableMapping[str, Any]] = ...,
11511151
headers: Optional[MutableMapping[str, str]] = ...,
11521152
) -> Any: ...
1153+
def terms_enum(
1154+
self,
1155+
index: Any,
1156+
*,
1157+
body: Optional[Any] = ...,
1158+
pretty: Optional[bool] = ...,
1159+
human: Optional[bool] = ...,
1160+
error_trace: Optional[bool] = ...,
1161+
format: Optional[str] = ...,
1162+
filter_path: Optional[Union[str, Collection[str]]] = ...,
1163+
request_timeout: Optional[Union[int, float]] = ...,
1164+
ignore: Optional[Union[int, Collection[int]]] = ...,
1165+
opaque_id: Optional[str] = ...,
1166+
http_auth: Optional[Union[str, Tuple[str, str]]] = ...,
1167+
api_key: Optional[Union[str, Tuple[str, str]]] = ...,
1168+
params: Optional[MutableMapping[str, Any]] = ...,
1169+
headers: Optional[MutableMapping[str, str]] = ...,
1170+
) -> Any: ...

elasticsearch/client/security.py

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -756,3 +756,23 @@ def get_service_credentials(self, namespace, service, params=None, headers=None)
756756
params=params,
757757
headers=headers,
758758
)
759+
760+
@query_params()
761+
def saml_complete_logout(self, body, params=None, headers=None):
762+
"""
763+
Verifies the logout response sent from the SAML IdP
764+
765+
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/security-api-saml-complete-logout.html>`_
766+
767+
:arg body: The logout response to verify
768+
"""
769+
if body in SKIP_IN_PATH:
770+
raise ValueError("Empty value passed for a required argument 'body'.")
771+
772+
return self.transport.perform_request(
773+
"POST",
774+
"/_security/saml/complete_logout",
775+
params=params,
776+
headers=headers,
777+
body=body,
778+
)

elasticsearch/client/security.pyi

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -630,3 +630,20 @@ class SecurityClient(NamespacedClient):
630630
params: Optional[MutableMapping[str, Any]] = ...,
631631
headers: Optional[MutableMapping[str, str]] = ...,
632632
) -> Any: ...
633+
def saml_complete_logout(
634+
self,
635+
*,
636+
body: Any,
637+
pretty: Optional[bool] = ...,
638+
human: Optional[bool] = ...,
639+
error_trace: Optional[bool] = ...,
640+
format: Optional[str] = ...,
641+
filter_path: Optional[Union[str, Collection[str]]] = ...,
642+
request_timeout: Optional[Union[int, float]] = ...,
643+
ignore: Optional[Union[int, Collection[int]]] = ...,
644+
opaque_id: Optional[str] = ...,
645+
http_auth: Optional[Union[str, Tuple[str, str]]] = ...,
646+
api_key: Optional[Union[str, Tuple[str, str]]] = ...,
647+
params: Optional[MutableMapping[str, Any]] = ...,
648+
headers: Optional[MutableMapping[str, str]] = ...,
649+
) -> Any: ...

elasticsearch/client/snapshot.py

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -285,3 +285,57 @@ def clone(
285285
headers=headers,
286286
body=body,
287287
)
288+
289+
@query_params(
290+
"blob_count",
291+
"concurrency",
292+
"detailed",
293+
"early_read_node_count",
294+
"max_blob_size",
295+
"max_total_data_size",
296+
"rare_action_probability",
297+
"rarely_abort_writes",
298+
"read_node_count",
299+
"seed",
300+
"timeout",
301+
)
302+
def repository_analyze(self, repository, params=None, headers=None):
303+
"""
304+
Analyzes a repository for correctness and performance
305+
306+
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/modules-snapshots.html>`_
307+
308+
:arg repository: A repository name
309+
:arg blob_count: Number of blobs to create during the test.
310+
Defaults to 100.
311+
:arg concurrency: Number of operations to run concurrently
312+
during the test. Defaults to 10.
313+
:arg detailed: Whether to return detailed results or a summary.
314+
Defaults to 'false' so that only the summary is returned.
315+
:arg early_read_node_count: Number of nodes on which to perform
316+
an early read on a blob, i.e. before writing has completed. Early reads
317+
are rare actions so the 'rare_action_probability' parameter is also
318+
relevant. Defaults to 2.
319+
:arg max_blob_size: Maximum size of a blob to create during the
320+
test, e.g '1gb' or '100mb'. Defaults to '10mb'.
321+
:arg max_total_data_size: Maximum total size of all blobs to
322+
create during the test, e.g '1tb' or '100gb'. Defaults to '1gb'.
323+
:arg rare_action_probability: Probability of taking a rare
324+
action such as an early read or an overwrite. Defaults to 0.02.
325+
:arg rarely_abort_writes: Whether to rarely abort writes before
326+
they complete. Defaults to 'true'.
327+
:arg read_node_count: Number of nodes on which to read a blob
328+
after writing. Defaults to 10.
329+
:arg seed: Seed for the random number generator used to create
330+
the test workload. Defaults to a random value.
331+
:arg timeout: Explicit operation timeout. Defaults to '30s'.
332+
"""
333+
if repository in SKIP_IN_PATH:
334+
raise ValueError("Empty value passed for a required argument 'repository'.")
335+
336+
return self.transport.perform_request(
337+
"POST",
338+
_make_path("_snapshot", repository, "_analyze"),
339+
params=params,
340+
headers=headers,
341+
)

elasticsearch/client/snapshot.pyi

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -241,3 +241,31 @@ class SnapshotClient(NamespacedClient):
241241
params: Optional[MutableMapping[str, Any]] = ...,
242242
headers: Optional[MutableMapping[str, str]] = ...,
243243
) -> Any: ...
244+
def repository_analyze(
245+
self,
246+
repository: Any,
247+
*,
248+
blob_count: Optional[Any] = ...,
249+
concurrency: Optional[Any] = ...,
250+
detailed: Optional[Any] = ...,
251+
early_read_node_count: Optional[Any] = ...,
252+
max_blob_size: Optional[Any] = ...,
253+
max_total_data_size: Optional[Any] = ...,
254+
rare_action_probability: Optional[Any] = ...,
255+
rarely_abort_writes: Optional[Any] = ...,
256+
read_node_count: Optional[Any] = ...,
257+
seed: Optional[Any] = ...,
258+
timeout: Optional[Any] = ...,
259+
pretty: Optional[bool] = ...,
260+
human: Optional[bool] = ...,
261+
error_trace: Optional[bool] = ...,
262+
format: Optional[str] = ...,
263+
filter_path: Optional[Union[str, Collection[str]]] = ...,
264+
request_timeout: Optional[Union[int, float]] = ...,
265+
ignore: Optional[Union[int, Collection[int]]] = ...,
266+
opaque_id: Optional[str] = ...,
267+
http_auth: Optional[Union[str, Tuple[str, str]]] = ...,
268+
api_key: Optional[Union[str, Tuple[str, str]]] = ...,
269+
params: Optional[MutableMapping[str, Any]] = ...,
270+
headers: Optional[MutableMapping[str, str]] = ...,
271+
) -> Any: ...

test_elasticsearch/test_server/test_rest_api_spec.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,8 @@
6060

6161
# broken YAML tests on some releases
6262
SKIP_TESTS = {
63+
"ml/job_cat_apis[0]",
64+
"ml/post_data[0]",
6365
"ml/post_data[1]",
6466
"ml/post_data[2]",
6567
"ml/post_data[3]",
@@ -69,6 +71,7 @@
6971
"ml/get_trained_model_stats[1]",
7072
"ml/get_trained_model_stats[2]",
7173
"ml/get_trained_model_stats[3]",
74+
"ml/set_upgrade_mode[0]",
7275
"ml/set_upgrade_mode[1]",
7376
"ml/set_upgrade_mode[2]",
7477
"ml/set_upgrade_mode[3]",

0 commit comments

Comments
 (0)