Skip to content

Commit ef15f0a

Browse files
Auto-generated API code
1 parent 37d96c5 commit ef15f0a

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

85 files changed

+2899
-1073
lines changed

elasticsearch/_async/client/__init__.py

Lines changed: 104 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -565,8 +565,8 @@ async def bulk(
565565
"""
566566
.. raw:: html
567567
568-
<p>Bulk index or delete documents.
569-
Perform multiple <code>index</code>, <code>create</code>, <code>delete</code>, and <code>update</code> actions in a single request.
568+
<p>Bulk index or delete documents.</p>
569+
<p>Perform multiple <code>index</code>, <code>create</code>, <code>delete</code>, and <code>update</code> actions in a single request.
570570
This reduces overhead and can greatly increase indexing speed.</p>
571571
<p>If the Elasticsearch security features are enabled, you must have the following index privileges for the target data stream, index, or index alias:</p>
572572
<ul>
@@ -755,6 +755,73 @@ async def bulk(
755755
path_parts=__path_parts,
756756
)
757757

758+
@_rewrite_parameters()
759+
@_stability_warning(Stability.EXPERIMENTAL)
760+
async def capabilities(
761+
self,
762+
*,
763+
capabilities: t.Optional[t.Union[str, t.Sequence[str]]] = None,
764+
error_trace: t.Optional[bool] = None,
765+
filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
766+
human: t.Optional[bool] = None,
767+
local_only: t.Optional[bool] = None,
768+
method: t.Optional[
769+
t.Union[str, t.Literal["DELETE", "GET", "HEAD", "POST", "PUT"]]
770+
] = None,
771+
parameters: t.Optional[t.Union[str, t.Sequence[str]]] = None,
772+
path: t.Optional[str] = None,
773+
pretty: t.Optional[bool] = None,
774+
timeout: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
775+
) -> ObjectApiResponse[t.Any]:
776+
"""
777+
.. raw:: html
778+
779+
<p>Checks if the specified combination of method, API, parameters, and arbitrary capabilities are supported.</p>
780+
781+
782+
`<https://github.com/elastic/elasticsearch/blob/main/rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/README.asciidoc#require-or-skip-api-capabilities>`_
783+
784+
:param capabilities: Comma-separated list of arbitrary API capabilities to check
785+
:param local_only: True if only the node being called should be considered
786+
:param method: REST method to check
787+
:param parameters: Comma-separated list of API parameters to check
788+
:param path: API path to check
789+
:param timeout: Period to wait for a response. If no response is received before
790+
the timeout expires, the request fails and returns an error.
791+
"""
792+
__path_parts: t.Dict[str, str] = {}
793+
__path = "/_capabilities"
794+
__query: t.Dict[str, t.Any] = {}
795+
if capabilities is not None:
796+
__query["capabilities"] = capabilities
797+
if error_trace is not None:
798+
__query["error_trace"] = error_trace
799+
if filter_path is not None:
800+
__query["filter_path"] = filter_path
801+
if human is not None:
802+
__query["human"] = human
803+
if local_only is not None:
804+
__query["local_only"] = local_only
805+
if method is not None:
806+
__query["method"] = method
807+
if parameters is not None:
808+
__query["parameters"] = parameters
809+
if path is not None:
810+
__query["path"] = path
811+
if pretty is not None:
812+
__query["pretty"] = pretty
813+
if timeout is not None:
814+
__query["timeout"] = timeout
815+
__headers = {"accept": "application/json"}
816+
return await self.perform_request( # type: ignore[return-value]
817+
"GET",
818+
__path,
819+
params=__query,
820+
headers=__headers,
821+
endpoint_id="capabilities",
822+
path_parts=__path_parts,
823+
)
824+
758825
@_rewrite_parameters(
759826
body_fields=("scroll_id",),
760827
)
@@ -771,8 +838,8 @@ async def clear_scroll(
771838
"""
772839
.. raw:: html
773840
774-
<p>Clear a scrolling search.
775-
Clear the search context and results for a scrolling search.</p>
841+
<p>Clear a scrolling search.</p>
842+
<p>Clear the search context and results for a scrolling search.</p>
776843
777844
778845
`<https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-clear-scroll>`_
@@ -825,8 +892,8 @@ async def close_point_in_time(
825892
"""
826893
.. raw:: html
827894
828-
<p>Close a point in time.
829-
A point in time must be opened explicitly before being used in search requests.
895+
<p>Close a point in time.</p>
896+
<p>A point in time must be opened explicitly before being used in search requests.
830897
The <code>keep_alive</code> parameter tells Elasticsearch how long it should persist.
831898
A point in time is automatically closed when the <code>keep_alive</code> period has elapsed.
832899
However, keeping points in time has a cost; close them as soon as they are no longer required for search requests.</p>
@@ -906,8 +973,8 @@ async def count(
906973
"""
907974
.. raw:: html
908975
909-
<p>Count search results.
910-
Get the number of documents matching a query.</p>
976+
<p>Count search results.</p>
977+
<p>Get the number of documents matching a query.</p>
911978
<p>The query can be provided either by using a simple query string as a parameter, or by defining Query DSL within the request body.
912979
The query is optional. When no query is provided, the API uses <code>match_all</code> to count all the documents.</p>
913980
<p>The count API supports multi-target syntax. You can run a single count API search across multiple data streams and indices.</p>
@@ -1643,11 +1710,11 @@ async def delete_by_query_rethrottle(
16431710
self,
16441711
*,
16451712
task_id: str,
1713+
requests_per_second: float,
16461714
error_trace: t.Optional[bool] = None,
16471715
filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
16481716
human: t.Optional[bool] = None,
16491717
pretty: t.Optional[bool] = None,
1650-
requests_per_second: t.Optional[float] = None,
16511718
) -> ObjectApiResponse[t.Any]:
16521719
"""
16531720
.. raw:: html
@@ -1665,9 +1732,13 @@ async def delete_by_query_rethrottle(
16651732
"""
16661733
if task_id in SKIP_IN_PATH:
16671734
raise ValueError("Empty value passed for parameter 'task_id'")
1735+
if requests_per_second is None:
1736+
raise ValueError("Empty value passed for parameter 'requests_per_second'")
16681737
__path_parts: t.Dict[str, str] = {"task_id": _quote(task_id)}
16691738
__path = f'/_delete_by_query/{__path_parts["task_id"]}/_rethrottle'
16701739
__query: t.Dict[str, t.Any] = {}
1740+
if requests_per_second is not None:
1741+
__query["requests_per_second"] = requests_per_second
16711742
if error_trace is not None:
16721743
__query["error_trace"] = error_trace
16731744
if filter_path is not None:
@@ -1676,8 +1747,6 @@ async def delete_by_query_rethrottle(
16761747
__query["human"] = human
16771748
if pretty is not None:
16781749
__query["pretty"] = pretty
1679-
if requests_per_second is not None:
1680-
__query["requests_per_second"] = requests_per_second
16811750
__headers = {"accept": "application/json"}
16821751
return await self.perform_request( # type: ignore[return-value]
16831752
"POST",
@@ -1703,8 +1772,8 @@ async def delete_script(
17031772
"""
17041773
.. raw:: html
17051774
1706-
<p>Delete a script or search template.
1707-
Deletes a stored script or search template.</p>
1775+
<p>Delete a script or search template.</p>
1776+
<p>Deletes a stored script or search template.</p>
17081777
17091778
17101779
`<https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-delete-script>`_
@@ -2015,8 +2084,8 @@ async def explain(
20152084
"""
20162085
.. raw:: html
20172086
2018-
<p>Explain a document match result.
2019-
Get information about why a specific document matches, or doesn't match, a query.
2087+
<p>Explain a document match result.</p>
2088+
<p>Get information about why a specific document matches, or doesn't match, a query.
20202089
It computes a score explanation for a query and a specific document.</p>
20212090
20222091
@@ -2419,8 +2488,8 @@ async def get_script(
24192488
"""
24202489
.. raw:: html
24212490
2422-
<p>Get a script or search template.
2423-
Retrieves a stored script or search template.</p>
2491+
<p>Get a script or search template.</p>
2492+
<p>Retrieves a stored script or search template.</p>
24242493
24252494
24262495
`<https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-get-script>`_
@@ -2656,8 +2725,8 @@ async def health_report(
26562725
"""
26572726
.. raw:: html
26582727
2659-
<p>Get the cluster health.
2660-
Get a report with the health status of an Elasticsearch cluster.
2728+
<p>Get the cluster health.</p>
2729+
<p>Get a report with the health status of an Elasticsearch cluster.
26612730
The report contains a list of indicators that compose Elasticsearch functionality.</p>
26622731
<p>Each indicator has a health status of: green, unknown, yellow or red.
26632732
The indicator will provide an explanation and metadata describing the reason for its current health status.</p>
@@ -2969,8 +3038,8 @@ async def info(
29693038
"""
29703039
.. raw:: html
29713040
2972-
<p>Get cluster info.
2973-
Get basic build, version, and cluster information.
3041+
<p>Get cluster info.</p>
3042+
<p>Get basic build, version, and cluster information.
29743043
::: In Serverless, this API is retained for backward compatibility only. Some response fields, such as the version number, should be ignored.</p>
29753044
29763045
@@ -3664,8 +3733,8 @@ async def put_script(
36643733
"""
36653734
.. raw:: html
36663735
3667-
<p>Create or update a script or search template.
3668-
Creates or updates a stored script or search template.</p>
3736+
<p>Create or update a script or search template.</p>
3737+
<p>Creates or updates a stored script or search template.</p>
36693738
36703739
36713740
`<https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-put-script>`_
@@ -3999,11 +4068,11 @@ async def reindex_rethrottle(
39994068
self,
40004069
*,
40014070
task_id: str,
4071+
requests_per_second: float,
40024072
error_trace: t.Optional[bool] = None,
40034073
filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
40044074
human: t.Optional[bool] = None,
40054075
pretty: t.Optional[bool] = None,
4006-
requests_per_second: t.Optional[float] = None,
40074076
) -> ObjectApiResponse[t.Any]:
40084077
"""
40094078
.. raw:: html
@@ -4027,9 +4096,13 @@ async def reindex_rethrottle(
40274096
"""
40284097
if task_id in SKIP_IN_PATH:
40294098
raise ValueError("Empty value passed for parameter 'task_id'")
4099+
if requests_per_second is None:
4100+
raise ValueError("Empty value passed for parameter 'requests_per_second'")
40304101
__path_parts: t.Dict[str, str] = {"task_id": _quote(task_id)}
40314102
__path = f'/_reindex/{__path_parts["task_id"]}/_rethrottle'
40324103
__query: t.Dict[str, t.Any] = {}
4104+
if requests_per_second is not None:
4105+
__query["requests_per_second"] = requests_per_second
40334106
if error_trace is not None:
40344107
__query["error_trace"] = error_trace
40354108
if filter_path is not None:
@@ -4038,8 +4111,6 @@ async def reindex_rethrottle(
40384111
__query["human"] = human
40394112
if pretty is not None:
40404113
__query["pretty"] = pretty
4041-
if requests_per_second is not None:
4042-
__query["requests_per_second"] = requests_per_second
40434114
__headers = {"accept": "application/json"}
40444115
return await self.perform_request( # type: ignore[return-value]
40454116
"POST",
@@ -6070,8 +6141,8 @@ async def update_by_query(
60706141
"""
60716142
.. raw:: html
60726143
6073-
<p>Update documents.
6074-
Updates documents that match the specified query.
6144+
<p>Update documents.</p>
6145+
<p>Updates documents that match the specified query.
60756146
If no query is specified, performs an update on every document in the data stream or index without modifying the source, which is useful for picking up mapping changes.</p>
60766147
<p>If the Elasticsearch security features are enabled, you must have the following index privileges for the target data stream, index, or alias:</p>
60776148
<ul>
@@ -6350,11 +6421,11 @@ async def update_by_query_rethrottle(
63506421
self,
63516422
*,
63526423
task_id: str,
6424+
requests_per_second: float,
63536425
error_trace: t.Optional[bool] = None,
63546426
filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
63556427
human: t.Optional[bool] = None,
63566428
pretty: t.Optional[bool] = None,
6357-
requests_per_second: t.Optional[float] = None,
63586429
) -> ObjectApiResponse[t.Any]:
63596430
"""
63606431
.. raw:: html
@@ -6372,9 +6443,13 @@ async def update_by_query_rethrottle(
63726443
"""
63736444
if task_id in SKIP_IN_PATH:
63746445
raise ValueError("Empty value passed for parameter 'task_id'")
6446+
if requests_per_second is None:
6447+
raise ValueError("Empty value passed for parameter 'requests_per_second'")
63756448
__path_parts: t.Dict[str, str] = {"task_id": _quote(task_id)}
63766449
__path = f'/_update_by_query/{__path_parts["task_id"]}/_rethrottle'
63776450
__query: t.Dict[str, t.Any] = {}
6451+
if requests_per_second is not None:
6452+
__query["requests_per_second"] = requests_per_second
63786453
if error_trace is not None:
63796454
__query["error_trace"] = error_trace
63806455
if filter_path is not None:
@@ -6383,8 +6458,6 @@ async def update_by_query_rethrottle(
63836458
__query["human"] = human
63846459
if pretty is not None:
63856460
__query["pretty"] = pretty
6386-
if requests_per_second is not None:
6387-
__query["requests_per_second"] = requests_per_second
63886461
__headers = {"accept": "application/json"}
63896462
return await self.perform_request( # type: ignore[return-value]
63906463
"POST",

0 commit comments

Comments
 (0)