@@ -567,8 +567,8 @@ async def bulk(
567567 """
568568 .. raw:: html
569569
570- <p>Bulk index or delete documents.
571- Perform multiple <code>index</code>, <code>create</code>, <code>delete</code>, and <code>update</code> actions in a single request.
570+ <p>Bulk index or delete documents.</p>
571+ <p> Perform multiple <code>index</code>, <code>create</code>, <code>delete</code>, and <code>update</code> actions in a single request.
572572 This reduces overhead and can greatly increase indexing speed.</p>
573573 <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>
574574 <ul>
@@ -616,6 +616,7 @@ async def bulk(
616616 <li>Perl: Check out <code>Search::Elasticsearch::Client::5_0::Bulk</code> and <code>Search::Elasticsearch::Client::5_0::Scroll</code></li>
617617 <li>Python: Check out <code>elasticsearch.helpers.*</code></li>
618618 <li>JavaScript: Check out <code>client.helpers.*</code></li>
619+ <li>Java: Check out <code>co.elastic.clients.elasticsearch._helpers.bulk.BulkIngester</code></li>
619620 <li>.NET: Check out <code>BulkAllObservable</code></li>
620621 <li>PHP: Check out bulk indexing.</li>
621622 <li>Ruby: Check out <code>Elasticsearch::Helpers::BulkHelper</code></li>
@@ -757,6 +758,73 @@ async def bulk(
757758 path_parts = __path_parts ,
758759 )
759760
761+ @_rewrite_parameters ()
762+ @_stability_warning (Stability .EXPERIMENTAL )
763+ async def capabilities (
764+ self ,
765+ * ,
766+ capabilities : t .Optional [t .Union [str , t .Sequence [str ]]] = None ,
767+ error_trace : t .Optional [bool ] = None ,
768+ filter_path : t .Optional [t .Union [str , t .Sequence [str ]]] = None ,
769+ human : t .Optional [bool ] = None ,
770+ local_only : t .Optional [bool ] = None ,
771+ method : t .Optional [
772+ t .Union [str , t .Literal ["DELETE" , "GET" , "HEAD" , "POST" , "PUT" ]]
773+ ] = None ,
774+ parameters : t .Optional [t .Union [str , t .Sequence [str ]]] = None ,
775+ path : t .Optional [str ] = None ,
776+ pretty : t .Optional [bool ] = None ,
777+ timeout : t .Optional [t .Union [str , t .Literal [- 1 ], t .Literal [0 ]]] = None ,
778+ ) -> ObjectApiResponse [t .Any ]:
779+ """
780+ .. raw:: html
781+
782+ <p>Checks if the specified combination of method, API, parameters, and arbitrary capabilities are supported.</p>
783+
784+
785+ `<https://github.com/elastic/elasticsearch/blob/main/rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/README.asciidoc#require-or-skip-api-capabilities>`_
786+
787+ :param capabilities: Comma-separated list of arbitrary API capabilities to check
788+ :param local_only: True if only the node being called should be considered
789+ :param method: REST method to check
790+ :param parameters: Comma-separated list of API parameters to check
791+ :param path: API path to check
792+ :param timeout: Period to wait for a response. If no response is received before
793+ the timeout expires, the request fails and returns an error.
794+ """
795+ __path_parts : t .Dict [str , str ] = {}
796+ __path = "/_capabilities"
797+ __query : t .Dict [str , t .Any ] = {}
798+ if capabilities is not None :
799+ __query ["capabilities" ] = capabilities
800+ if error_trace is not None :
801+ __query ["error_trace" ] = error_trace
802+ if filter_path is not None :
803+ __query ["filter_path" ] = filter_path
804+ if human is not None :
805+ __query ["human" ] = human
806+ if local_only is not None :
807+ __query ["local_only" ] = local_only
808+ if method is not None :
809+ __query ["method" ] = method
810+ if parameters is not None :
811+ __query ["parameters" ] = parameters
812+ if path is not None :
813+ __query ["path" ] = path
814+ if pretty is not None :
815+ __query ["pretty" ] = pretty
816+ if timeout is not None :
817+ __query ["timeout" ] = timeout
818+ __headers = {"accept" : "application/json" }
819+ return await self .perform_request ( # type: ignore[return-value]
820+ "GET" ,
821+ __path ,
822+ params = __query ,
823+ headers = __headers ,
824+ endpoint_id = "capabilities" ,
825+ path_parts = __path_parts ,
826+ )
827+
760828 @_rewrite_parameters (
761829 body_fields = ("scroll_id" ,),
762830 )
@@ -773,8 +841,8 @@ async def clear_scroll(
773841 """
774842 .. raw:: html
775843
776- <p>Clear a scrolling search.
777- Clear the search context and results for a scrolling search.</p>
844+ <p>Clear a scrolling search.</p>
845+ <p> Clear the search context and results for a scrolling search.</p>
778846
779847
780848 `<https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-clear-scroll>`_
@@ -827,8 +895,8 @@ async def close_point_in_time(
827895 """
828896 .. raw:: html
829897
830- <p>Close a point in time.
831- A point in time must be opened explicitly before being used in search requests.
898+ <p>Close a point in time.</p>
899+ <p> A point in time must be opened explicitly before being used in search requests.
832900 The <code>keep_alive</code> parameter tells Elasticsearch how long it should persist.
833901 A point in time is automatically closed when the <code>keep_alive</code> period has elapsed.
834902 However, keeping points in time has a cost; close them as soon as they are no longer required for search requests.</p>
@@ -905,8 +973,8 @@ async def count(
905973 """
906974 .. raw:: html
907975
908- <p>Count search results.
909- 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>
910978 <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.
911979 The query is optional. When no query is provided, the API uses <code>match_all</code> to count all the documents.</p>
912980 <p>The count API supports multi-target syntax. You can run a single count API search across multiple data streams and indices.</p>
@@ -1648,11 +1716,11 @@ async def delete_by_query_rethrottle(
16481716 self ,
16491717 * ,
16501718 task_id : str ,
1719+ requests_per_second : float ,
16511720 error_trace : t .Optional [bool ] = None ,
16521721 filter_path : t .Optional [t .Union [str , t .Sequence [str ]]] = None ,
16531722 human : t .Optional [bool ] = None ,
16541723 pretty : t .Optional [bool ] = None ,
1655- requests_per_second : t .Optional [float ] = None ,
16561724 ) -> ObjectApiResponse [t .Any ]:
16571725 """
16581726 .. raw:: html
@@ -1670,9 +1738,13 @@ async def delete_by_query_rethrottle(
16701738 """
16711739 if task_id in SKIP_IN_PATH :
16721740 raise ValueError ("Empty value passed for parameter 'task_id'" )
1741+ if requests_per_second is None :
1742+ raise ValueError ("Empty value passed for parameter 'requests_per_second'" )
16731743 __path_parts : t .Dict [str , str ] = {"task_id" : _quote (task_id )}
16741744 __path = f'/_delete_by_query/{ __path_parts ["task_id" ]} /_rethrottle'
16751745 __query : t .Dict [str , t .Any ] = {}
1746+ if requests_per_second is not None :
1747+ __query ["requests_per_second" ] = requests_per_second
16761748 if error_trace is not None :
16771749 __query ["error_trace" ] = error_trace
16781750 if filter_path is not None :
@@ -1681,8 +1753,6 @@ async def delete_by_query_rethrottle(
16811753 __query ["human" ] = human
16821754 if pretty is not None :
16831755 __query ["pretty" ] = pretty
1684- if requests_per_second is not None :
1685- __query ["requests_per_second" ] = requests_per_second
16861756 __headers = {"accept" : "application/json" }
16871757 return await self .perform_request ( # type: ignore[return-value]
16881758 "POST" ,
@@ -1708,8 +1778,8 @@ async def delete_script(
17081778 """
17091779 .. raw:: html
17101780
1711- <p>Delete a script or search template.
1712- Deletes a stored script or search template.</p>
1781+ <p>Delete a script or search template.</p>
1782+ <p> Deletes a stored script or search template.</p>
17131783
17141784
17151785 `<https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-delete-script>`_
@@ -2020,8 +2090,8 @@ async def explain(
20202090 """
20212091 .. raw:: html
20222092
2023- <p>Explain a document match result.
2024- Get information about why a specific document matches, or doesn't match, a query.
2093+ <p>Explain a document match result.</p>
2094+ <p> Get information about why a specific document matches, or doesn't match, a query.
20252095 It computes a score explanation for a query and a specific document.</p>
20262096
20272097
@@ -2437,8 +2507,8 @@ async def get_script(
24372507 """
24382508 .. raw:: html
24392509
2440- <p>Get a script or search template.
2441- Retrieves a stored script or search template.</p>
2510+ <p>Get a script or search template.</p>
2511+ <p> Retrieves a stored script or search template.</p>
24422512
24432513
24442514 `<https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-get-script>`_
@@ -2674,8 +2744,8 @@ async def health_report(
26742744 """
26752745 .. raw:: html
26762746
2677- <p>Get the cluster health.
2678- Get a report with the health status of an Elasticsearch cluster.
2747+ <p>Get the cluster health.</p>
2748+ <p> Get a report with the health status of an Elasticsearch cluster.
26792749 The report contains a list of indicators that compose Elasticsearch functionality.</p>
26802750 <p>Each indicator has a health status of: green, unknown, yellow or red.
26812751 The indicator will provide an explanation and metadata describing the reason for its current health status.</p>
@@ -2987,8 +3057,8 @@ async def info(
29873057 """
29883058 .. raw:: html
29893059
2990- <p>Get cluster info.
2991- Get basic build, version, and cluster information.
3060+ <p>Get cluster info.</p>
3061+ <p> Get basic build, version, and cluster information.
29923062 ::: In Serverless, this API is retained for backward compatibility only. Some response fields, such as the version number, should be ignored.</p>
29933063
29943064
@@ -3704,8 +3774,8 @@ async def put_script(
37043774 """
37053775 .. raw:: html
37063776
3707- <p>Create or update a script or search template.
3708- Creates or updates a stored script or search template.</p>
3777+ <p>Create or update a script or search template.</p>
3778+ <p> Creates or updates a stored script or search template.</p>
37093779
37103780
37113781 `<https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-put-script>`_
@@ -4035,11 +4105,11 @@ async def reindex_rethrottle(
40354105 self ,
40364106 * ,
40374107 task_id : str ,
4108+ requests_per_second : float ,
40384109 error_trace : t .Optional [bool ] = None ,
40394110 filter_path : t .Optional [t .Union [str , t .Sequence [str ]]] = None ,
40404111 human : t .Optional [bool ] = None ,
40414112 pretty : t .Optional [bool ] = None ,
4042- requests_per_second : t .Optional [float ] = None ,
40434113 ) -> ObjectApiResponse [t .Any ]:
40444114 """
40454115 .. raw:: html
@@ -4063,9 +4133,13 @@ async def reindex_rethrottle(
40634133 """
40644134 if task_id in SKIP_IN_PATH :
40654135 raise ValueError ("Empty value passed for parameter 'task_id'" )
4136+ if requests_per_second is None :
4137+ raise ValueError ("Empty value passed for parameter 'requests_per_second'" )
40664138 __path_parts : t .Dict [str , str ] = {"task_id" : _quote (task_id )}
40674139 __path = f'/_reindex/{ __path_parts ["task_id" ]} /_rethrottle'
40684140 __query : t .Dict [str , t .Any ] = {}
4141+ if requests_per_second is not None :
4142+ __query ["requests_per_second" ] = requests_per_second
40694143 if error_trace is not None :
40704144 __query ["error_trace" ] = error_trace
40714145 if filter_path is not None :
@@ -4074,8 +4148,6 @@ async def reindex_rethrottle(
40744148 __query ["human" ] = human
40754149 if pretty is not None :
40764150 __query ["pretty" ] = pretty
4077- if requests_per_second is not None :
4078- __query ["requests_per_second" ] = requests_per_second
40794151 __headers = {"accept" : "application/json" }
40804152 return await self .perform_request ( # type: ignore[return-value]
40814153 "POST" ,
@@ -6120,8 +6192,8 @@ async def update_by_query(
61206192 """
61216193 .. raw:: html
61226194
6123- <p>Update documents.
6124- Updates documents that match the specified query.
6195+ <p>Update documents.</p>
6196+ <p> Updates documents that match the specified query.
61256197 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>
61266198 <p>If the Elasticsearch security features are enabled, you must have the following index privileges for the target data stream, index, or alias:</p>
61276199 <ul>
@@ -6400,11 +6472,11 @@ async def update_by_query_rethrottle(
64006472 self ,
64016473 * ,
64026474 task_id : str ,
6475+ requests_per_second : float ,
64036476 error_trace : t .Optional [bool ] = None ,
64046477 filter_path : t .Optional [t .Union [str , t .Sequence [str ]]] = None ,
64056478 human : t .Optional [bool ] = None ,
64066479 pretty : t .Optional [bool ] = None ,
6407- requests_per_second : t .Optional [float ] = None ,
64086480 ) -> ObjectApiResponse [t .Any ]:
64096481 """
64106482 .. raw:: html
@@ -6422,9 +6494,13 @@ async def update_by_query_rethrottle(
64226494 """
64236495 if task_id in SKIP_IN_PATH :
64246496 raise ValueError ("Empty value passed for parameter 'task_id'" )
6497+ if requests_per_second is None :
6498+ raise ValueError ("Empty value passed for parameter 'requests_per_second'" )
64256499 __path_parts : t .Dict [str , str ] = {"task_id" : _quote (task_id )}
64266500 __path = f'/_update_by_query/{ __path_parts ["task_id" ]} /_rethrottle'
64276501 __query : t .Dict [str , t .Any ] = {}
6502+ if requests_per_second is not None :
6503+ __query ["requests_per_second" ] = requests_per_second
64286504 if error_trace is not None :
64296505 __query ["error_trace" ] = error_trace
64306506 if filter_path is not None :
@@ -6433,8 +6509,6 @@ async def update_by_query_rethrottle(
64336509 __query ["human" ] = human
64346510 if pretty is not None :
64356511 __query ["pretty" ] = pretty
6436- if requests_per_second is not None :
6437- __query ["requests_per_second" ] = requests_per_second
64386512 __headers = {"accept" : "application/json" }
64396513 return await self .perform_request ( # type: ignore[return-value]
64406514 "POST" ,
0 commit comments