@@ -706,6 +706,7 @@ async def bulk(
706706 <li>Perl: Check out <code>Search::Elasticsearch::Client::5_0::Bulk</code> and <code>Search::Elasticsearch::Client::5_0::Scroll</code></li>
707707 <li>Python: Check out <code>elasticsearch.helpers.*</code></li>
708708 <li>JavaScript: Check out <code>client.helpers.*</code></li>
709+ <li>Java: Check out <code>co.elastic.clients.elasticsearch._helpers.bulk.BulkIngester</code></li>
709710 <li>.NET: Check out <code>BulkAllObservable</code></li>
710711 <li>PHP: Check out bulk indexing.</li>
711712 <li>Ruby: Check out <code>Elasticsearch::Helpers::BulkHelper</code></li>
@@ -845,6 +846,73 @@ async def bulk(
845846 path_parts = __path_parts ,
846847 )
847848
849+ @_rewrite_parameters ()
850+ @_stability_warning (Stability .EXPERIMENTAL )
851+ async def capabilities (
852+ self ,
853+ * ,
854+ capabilities : t .Optional [t .Union [str , t .Sequence [str ]]] = None ,
855+ error_trace : t .Optional [bool ] = None ,
856+ filter_path : t .Optional [t .Union [str , t .Sequence [str ]]] = None ,
857+ human : t .Optional [bool ] = None ,
858+ local_only : t .Optional [bool ] = None ,
859+ method : t .Optional [
860+ t .Union [str , t .Literal ["DELETE" , "GET" , "HEAD" , "POST" , "PUT" ]]
861+ ] = None ,
862+ parameters : t .Optional [t .Union [str , t .Sequence [str ]]] = None ,
863+ path : t .Optional [str ] = None ,
864+ pretty : t .Optional [bool ] = None ,
865+ timeout : t .Optional [t .Union [str , t .Literal [- 1 ], t .Literal [0 ]]] = None ,
866+ ) -> ObjectApiResponse [t .Any ]:
867+ """
868+ .. raw:: html
869+
870+ <p>Checks if the specified combination of method, API, parameters, and arbitrary capabilities are supported.</p>
871+
872+
873+ `<https://github.com/elastic/elasticsearch/blob/8.19/rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/README.asciidoc#require-or-skip-api-capabilities>`_
874+
875+ :param capabilities: Comma-separated list of arbitrary API capabilities to check
876+ :param local_only: True if only the node being called should be considered
877+ :param method: REST method to check
878+ :param parameters: Comma-separated list of API parameters to check
879+ :param path: API path to check
880+ :param timeout: Period to wait for a response. If no response is received before
881+ the timeout expires, the request fails and returns an error.
882+ """
883+ __path_parts : t .Dict [str , str ] = {}
884+ __path = "/_capabilities"
885+ __query : t .Dict [str , t .Any ] = {}
886+ if capabilities is not None :
887+ __query ["capabilities" ] = capabilities
888+ if error_trace is not None :
889+ __query ["error_trace" ] = error_trace
890+ if filter_path is not None :
891+ __query ["filter_path" ] = filter_path
892+ if human is not None :
893+ __query ["human" ] = human
894+ if local_only is not None :
895+ __query ["local_only" ] = local_only
896+ if method is not None :
897+ __query ["method" ] = method
898+ if parameters is not None :
899+ __query ["parameters" ] = parameters
900+ if path is not None :
901+ __query ["path" ] = path
902+ if pretty is not None :
903+ __query ["pretty" ] = pretty
904+ if timeout is not None :
905+ __query ["timeout" ] = timeout
906+ __headers = {"accept" : "application/json" }
907+ return await self .perform_request ( # type: ignore[return-value]
908+ "GET" ,
909+ __path ,
910+ params = __query ,
911+ headers = __headers ,
912+ endpoint_id = "capabilities" ,
913+ path_parts = __path_parts ,
914+ )
915+
848916 @_rewrite_parameters (
849917 body_fields = ("scroll_id" ,),
850918 )
@@ -1729,11 +1797,11 @@ async def delete_by_query_rethrottle(
17291797 self ,
17301798 * ,
17311799 task_id : t .Union [int , str ],
1800+ requests_per_second : float ,
17321801 error_trace : t .Optional [bool ] = None ,
17331802 filter_path : t .Optional [t .Union [str , t .Sequence [str ]]] = None ,
17341803 human : t .Optional [bool ] = None ,
17351804 pretty : t .Optional [bool ] = None ,
1736- requests_per_second : t .Optional [float ] = None ,
17371805 ) -> ObjectApiResponse [t .Any ]:
17381806 """
17391807 .. raw:: html
@@ -1751,9 +1819,13 @@ async def delete_by_query_rethrottle(
17511819 """
17521820 if task_id in SKIP_IN_PATH :
17531821 raise ValueError ("Empty value passed for parameter 'task_id'" )
1822+ if requests_per_second is None :
1823+ raise ValueError ("Empty value passed for parameter 'requests_per_second'" )
17541824 __path_parts : t .Dict [str , str ] = {"task_id" : _quote (task_id )}
17551825 __path = f'/_delete_by_query/{ __path_parts ["task_id" ]} /_rethrottle'
17561826 __query : t .Dict [str , t .Any ] = {}
1827+ if requests_per_second is not None :
1828+ __query ["requests_per_second" ] = requests_per_second
17571829 if error_trace is not None :
17581830 __query ["error_trace" ] = error_trace
17591831 if filter_path is not None :
@@ -1762,8 +1834,6 @@ async def delete_by_query_rethrottle(
17621834 __query ["human" ] = human
17631835 if pretty is not None :
17641836 __query ["pretty" ] = pretty
1765- if requests_per_second is not None :
1766- __query ["requests_per_second" ] = requests_per_second
17671837 __headers = {"accept" : "application/json" }
17681838 return await self .perform_request ( # type: ignore[return-value]
17691839 "POST" ,
@@ -4293,11 +4363,11 @@ async def reindex_rethrottle(
42934363 self ,
42944364 * ,
42954365 task_id : str ,
4366+ requests_per_second : float ,
42964367 error_trace : t .Optional [bool ] = None ,
42974368 filter_path : t .Optional [t .Union [str , t .Sequence [str ]]] = None ,
42984369 human : t .Optional [bool ] = None ,
42994370 pretty : t .Optional [bool ] = None ,
4300- requests_per_second : t .Optional [float ] = None ,
43014371 ) -> ObjectApiResponse [t .Any ]:
43024372 """
43034373 .. raw:: html
@@ -4321,9 +4391,13 @@ async def reindex_rethrottle(
43214391 """
43224392 if task_id in SKIP_IN_PATH :
43234393 raise ValueError ("Empty value passed for parameter 'task_id'" )
4394+ if requests_per_second is None :
4395+ raise ValueError ("Empty value passed for parameter 'requests_per_second'" )
43244396 __path_parts : t .Dict [str , str ] = {"task_id" : _quote (task_id )}
43254397 __path = f'/_reindex/{ __path_parts ["task_id" ]} /_rethrottle'
43264398 __query : t .Dict [str , t .Any ] = {}
4399+ if requests_per_second is not None :
4400+ __query ["requests_per_second" ] = requests_per_second
43274401 if error_trace is not None :
43284402 __query ["error_trace" ] = error_trace
43294403 if filter_path is not None :
@@ -4332,8 +4406,6 @@ async def reindex_rethrottle(
43324406 __query ["human" ] = human
43334407 if pretty is not None :
43344408 __query ["pretty" ] = pretty
4335- if requests_per_second is not None :
4336- __query ["requests_per_second" ] = requests_per_second
43374409 __headers = {"accept" : "application/json" }
43384410 return await self .perform_request ( # type: ignore[return-value]
43394411 "POST" ,
@@ -6670,11 +6742,11 @@ async def update_by_query_rethrottle(
66706742 self ,
66716743 * ,
66726744 task_id : str ,
6745+ requests_per_second : float ,
66736746 error_trace : t .Optional [bool ] = None ,
66746747 filter_path : t .Optional [t .Union [str , t .Sequence [str ]]] = None ,
66756748 human : t .Optional [bool ] = None ,
66766749 pretty : t .Optional [bool ] = None ,
6677- requests_per_second : t .Optional [float ] = None ,
66786750 ) -> ObjectApiResponse [t .Any ]:
66796751 """
66806752 .. raw:: html
@@ -6692,9 +6764,13 @@ async def update_by_query_rethrottle(
66926764 """
66936765 if task_id in SKIP_IN_PATH :
66946766 raise ValueError ("Empty value passed for parameter 'task_id'" )
6767+ if requests_per_second is None :
6768+ raise ValueError ("Empty value passed for parameter 'requests_per_second'" )
66956769 __path_parts : t .Dict [str , str ] = {"task_id" : _quote (task_id )}
66966770 __path = f'/_update_by_query/{ __path_parts ["task_id" ]} /_rethrottle'
66976771 __query : t .Dict [str , t .Any ] = {}
6772+ if requests_per_second is not None :
6773+ __query ["requests_per_second" ] = requests_per_second
66986774 if error_trace is not None :
66996775 __query ["error_trace" ] = error_trace
67006776 if filter_path is not None :
@@ -6703,8 +6779,6 @@ async def update_by_query_rethrottle(
67036779 __query ["human" ] = human
67046780 if pretty is not None :
67056781 __query ["pretty" ] = pretty
6706- if requests_per_second is not None :
6707- __query ["requests_per_second" ] = requests_per_second
67086782 __headers = {"accept" : "application/json" }
67096783 return await self .perform_request ( # type: ignore[return-value]
67106784 "POST" ,
0 commit comments