Skip to content

Commit cdbcad2

Browse files
Auto-generated API code
1 parent c0b34de commit cdbcad2

Some content is hidden

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

81 files changed

+1119
-1073
lines changed

elasticsearch/_async/client/__init__.py

Lines changed: 37 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>
@@ -771,8 +771,8 @@ async def clear_scroll(
771771
"""
772772
.. raw:: html
773773
774-
<p>Clear a scrolling search.
775-
Clear the search context and results for a scrolling search.</p>
774+
<p>Clear a scrolling search.</p>
775+
<p>Clear the search context and results for a scrolling search.</p>
776776
777777
778778
`<https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-clear-scroll>`_
@@ -825,8 +825,8 @@ async def close_point_in_time(
825825
"""
826826
.. raw:: html
827827
828-
<p>Close a point in time.
829-
A point in time must be opened explicitly before being used in search requests.
828+
<p>Close a point in time.</p>
829+
<p>A point in time must be opened explicitly before being used in search requests.
830830
The <code>keep_alive</code> parameter tells Elasticsearch how long it should persist.
831831
A point in time is automatically closed when the <code>keep_alive</code> period has elapsed.
832832
However, keeping points in time has a cost; close them as soon as they are no longer required for search requests.</p>
@@ -906,8 +906,8 @@ async def count(
906906
"""
907907
.. raw:: html
908908
909-
<p>Count search results.
910-
Get the number of documents matching a query.</p>
909+
<p>Count search results.</p>
910+
<p>Get the number of documents matching a query.</p>
911911
<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.
912912
The query is optional. When no query is provided, the API uses <code>match_all</code> to count all the documents.</p>
913913
<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 +1643,11 @@ async def delete_by_query_rethrottle(
16431643
self,
16441644
*,
16451645
task_id: str,
1646+
requests_per_second: float,
16461647
error_trace: t.Optional[bool] = None,
16471648
filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
16481649
human: t.Optional[bool] = None,
16491650
pretty: t.Optional[bool] = None,
1650-
requests_per_second: t.Optional[float] = None,
16511651
) -> ObjectApiResponse[t.Any]:
16521652
"""
16531653
.. raw:: html
@@ -1665,9 +1665,13 @@ async def delete_by_query_rethrottle(
16651665
"""
16661666
if task_id in SKIP_IN_PATH:
16671667
raise ValueError("Empty value passed for parameter 'task_id'")
1668+
if requests_per_second is None:
1669+
raise ValueError("Empty value passed for parameter 'requests_per_second'")
16681670
__path_parts: t.Dict[str, str] = {"task_id": _quote(task_id)}
16691671
__path = f'/_delete_by_query/{__path_parts["task_id"]}/_rethrottle'
16701672
__query: t.Dict[str, t.Any] = {}
1673+
if requests_per_second is not None:
1674+
__query["requests_per_second"] = requests_per_second
16711675
if error_trace is not None:
16721676
__query["error_trace"] = error_trace
16731677
if filter_path is not None:
@@ -1676,8 +1680,6 @@ async def delete_by_query_rethrottle(
16761680
__query["human"] = human
16771681
if pretty is not None:
16781682
__query["pretty"] = pretty
1679-
if requests_per_second is not None:
1680-
__query["requests_per_second"] = requests_per_second
16811683
__headers = {"accept": "application/json"}
16821684
return await self.perform_request( # type: ignore[return-value]
16831685
"POST",
@@ -1703,8 +1705,8 @@ async def delete_script(
17031705
"""
17041706
.. raw:: html
17051707
1706-
<p>Delete a script or search template.
1707-
Deletes a stored script or search template.</p>
1708+
<p>Delete a script or search template.</p>
1709+
<p>Deletes a stored script or search template.</p>
17081710
17091711
17101712
`<https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-delete-script>`_
@@ -2015,8 +2017,8 @@ async def explain(
20152017
"""
20162018
.. raw:: html
20172019
2018-
<p>Explain a document match result.
2019-
Get information about why a specific document matches, or doesn't match, a query.
2020+
<p>Explain a document match result.</p>
2021+
<p>Get information about why a specific document matches, or doesn't match, a query.
20202022
It computes a score explanation for a query and a specific document.</p>
20212023
20222024
@@ -2419,8 +2421,8 @@ async def get_script(
24192421
"""
24202422
.. raw:: html
24212423
2422-
<p>Get a script or search template.
2423-
Retrieves a stored script or search template.</p>
2424+
<p>Get a script or search template.</p>
2425+
<p>Retrieves a stored script or search template.</p>
24242426
24252427
24262428
`<https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-get-script>`_
@@ -2656,8 +2658,8 @@ async def health_report(
26562658
"""
26572659
.. raw:: html
26582660
2659-
<p>Get the cluster health.
2660-
Get a report with the health status of an Elasticsearch cluster.
2661+
<p>Get the cluster health.</p>
2662+
<p>Get a report with the health status of an Elasticsearch cluster.
26612663
The report contains a list of indicators that compose Elasticsearch functionality.</p>
26622664
<p>Each indicator has a health status of: green, unknown, yellow or red.
26632665
The indicator will provide an explanation and metadata describing the reason for its current health status.</p>
@@ -2969,8 +2971,8 @@ async def info(
29692971
"""
29702972
.. raw:: html
29712973
2972-
<p>Get cluster info.
2973-
Get basic build, version, and cluster information.
2974+
<p>Get cluster info.</p>
2975+
<p>Get basic build, version, and cluster information.
29742976
::: In Serverless, this API is retained for backward compatibility only. Some response fields, such as the version number, should be ignored.</p>
29752977
29762978
@@ -3664,8 +3666,8 @@ async def put_script(
36643666
"""
36653667
.. raw:: html
36663668
3667-
<p>Create or update a script or search template.
3668-
Creates or updates a stored script or search template.</p>
3669+
<p>Create or update a script or search template.</p>
3670+
<p>Creates or updates a stored script or search template.</p>
36693671
36703672
36713673
`<https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-put-script>`_
@@ -3999,11 +4001,11 @@ async def reindex_rethrottle(
39994001
self,
40004002
*,
40014003
task_id: str,
4004+
requests_per_second: float,
40024005
error_trace: t.Optional[bool] = None,
40034006
filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
40044007
human: t.Optional[bool] = None,
40054008
pretty: t.Optional[bool] = None,
4006-
requests_per_second: t.Optional[float] = None,
40074009
) -> ObjectApiResponse[t.Any]:
40084010
"""
40094011
.. raw:: html
@@ -4027,9 +4029,13 @@ async def reindex_rethrottle(
40274029
"""
40284030
if task_id in SKIP_IN_PATH:
40294031
raise ValueError("Empty value passed for parameter 'task_id'")
4032+
if requests_per_second is None:
4033+
raise ValueError("Empty value passed for parameter 'requests_per_second'")
40304034
__path_parts: t.Dict[str, str] = {"task_id": _quote(task_id)}
40314035
__path = f'/_reindex/{__path_parts["task_id"]}/_rethrottle'
40324036
__query: t.Dict[str, t.Any] = {}
4037+
if requests_per_second is not None:
4038+
__query["requests_per_second"] = requests_per_second
40334039
if error_trace is not None:
40344040
__query["error_trace"] = error_trace
40354041
if filter_path is not None:
@@ -4038,8 +4044,6 @@ async def reindex_rethrottle(
40384044
__query["human"] = human
40394045
if pretty is not None:
40404046
__query["pretty"] = pretty
4041-
if requests_per_second is not None:
4042-
__query["requests_per_second"] = requests_per_second
40434047
__headers = {"accept": "application/json"}
40444048
return await self.perform_request( # type: ignore[return-value]
40454049
"POST",
@@ -6070,8 +6074,8 @@ async def update_by_query(
60706074
"""
60716075
.. raw:: html
60726076
6073-
<p>Update documents.
6074-
Updates documents that match the specified query.
6077+
<p>Update documents.</p>
6078+
<p>Updates documents that match the specified query.
60756079
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>
60766080
<p>If the Elasticsearch security features are enabled, you must have the following index privileges for the target data stream, index, or alias:</p>
60776081
<ul>
@@ -6350,11 +6354,11 @@ async def update_by_query_rethrottle(
63506354
self,
63516355
*,
63526356
task_id: str,
6357+
requests_per_second: float,
63536358
error_trace: t.Optional[bool] = None,
63546359
filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
63556360
human: t.Optional[bool] = None,
63566361
pretty: t.Optional[bool] = None,
6357-
requests_per_second: t.Optional[float] = None,
63586362
) -> ObjectApiResponse[t.Any]:
63596363
"""
63606364
.. raw:: html
@@ -6372,9 +6376,13 @@ async def update_by_query_rethrottle(
63726376
"""
63736377
if task_id in SKIP_IN_PATH:
63746378
raise ValueError("Empty value passed for parameter 'task_id'")
6379+
if requests_per_second is None:
6380+
raise ValueError("Empty value passed for parameter 'requests_per_second'")
63756381
__path_parts: t.Dict[str, str] = {"task_id": _quote(task_id)}
63766382
__path = f'/_update_by_query/{__path_parts["task_id"]}/_rethrottle'
63776383
__query: t.Dict[str, t.Any] = {}
6384+
if requests_per_second is not None:
6385+
__query["requests_per_second"] = requests_per_second
63786386
if error_trace is not None:
63796387
__query["error_trace"] = error_trace
63806388
if filter_path is not None:
@@ -6383,8 +6391,6 @@ async def update_by_query_rethrottle(
63836391
__query["human"] = human
63846392
if pretty is not None:
63856393
__query["pretty"] = pretty
6386-
if requests_per_second is not None:
6387-
__query["requests_per_second"] = requests_per_second
63886394
__headers = {"accept": "application/json"}
63896395
return await self.perform_request( # type: ignore[return-value]
63906396
"POST",

elasticsearch/_async/client/cat.py

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3301,10 +3301,20 @@ async def segments(
33013301
self,
33023302
*,
33033303
index: t.Optional[t.Union[str, t.Sequence[str]]] = None,
3304+
allow_closed: t.Optional[bool] = None,
3305+
allow_no_indices: t.Optional[bool] = None,
33043306
bytes: t.Optional[
33053307
t.Union[str, t.Literal["b", "gb", "kb", "mb", "pb", "tb"]]
33063308
] = None,
33073309
error_trace: t.Optional[bool] = None,
3310+
expand_wildcards: t.Optional[
3311+
t.Union[
3312+
t.Sequence[
3313+
t.Union[str, t.Literal["all", "closed", "hidden", "none", "open"]]
3314+
],
3315+
t.Union[str, t.Literal["all", "closed", "hidden", "none", "open"]],
3316+
]
3317+
] = None,
33083318
filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
33093319
format: t.Optional[str] = None,
33103320
h: t.Optional[
@@ -3355,6 +3365,8 @@ async def segments(
33553365
] = None,
33563366
help: t.Optional[bool] = None,
33573367
human: t.Optional[bool] = None,
3368+
ignore_throttled: t.Optional[bool] = None,
3369+
ignore_unavailable: t.Optional[bool] = None,
33583370
local: t.Optional[bool] = None,
33593371
master_timeout: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
33603372
pretty: t.Optional[bool] = None,
@@ -3378,6 +3390,14 @@ async def segments(
33783390
:param index: A comma-separated list of data streams, indices, and aliases used
33793391
to limit the request. Supports wildcards (`*`). To target all data streams
33803392
and indices, omit this parameter or use `*` or `_all`.
3393+
:param allow_closed: If true, allow closed indices to be returned in the response
3394+
otherwise if false, keep the legacy behaviour of throwing an exception if
3395+
index pattern matches closed indices
3396+
:param allow_no_indices: If false, the request returns an error if any wildcard
3397+
expression, index alias, or _all value targets only missing or closed indices.
3398+
This behavior applies even if the request targets other open indices. For
3399+
example, a request targeting foo*,bar* returns an error if an index starts
3400+
with foo but no index starts with bar.
33813401
:param bytes: Sets the units for columns that contain a byte-size value. Note
33823402
that byte-size value units work in terms of powers of 1024. For instance
33833403
`1kb` means 1024 bytes, not 1000 bytes. If omitted, byte-size values are
@@ -3386,12 +3406,20 @@ async def segments(
33863406
least `1.0`. If given, byte-size values are rendered as an integer with no
33873407
suffix, representing the value of the column in the chosen unit. Values that
33883408
are not an exact multiple of the chosen unit are rounded down.
3409+
:param expand_wildcards: Type of index that wildcard expressions can match. If
3410+
the request can target data streams, this argument determines whether wildcard
3411+
expressions match hidden data streams. Supports comma-separated values, such
3412+
as open,hidden.
33893413
:param format: Specifies the format to return the columnar data in, can be set
33903414
to `text`, `json`, `cbor`, `yaml`, or `smile`.
33913415
:param h: A comma-separated list of columns names to display. It supports simple
33923416
wildcards.
33933417
:param help: When set to `true` will output available columns. This option can't
33943418
be combined with any other query string option.
3419+
:param ignore_throttled: If true, concrete, expanded or aliased indices are ignored
3420+
when frozen.
3421+
:param ignore_unavailable: If true, missing or closed indices are not included
3422+
in the response.
33953423
:param local: If `true`, the request computes the list of selected nodes from
33963424
the local cluster state. If `false` the list of selected nodes are computed
33973425
from the cluster state of the master node. In both cases the coordinating
@@ -3416,10 +3444,16 @@ async def segments(
34163444
__path_parts = {}
34173445
__path = "/_cat/segments"
34183446
__query: t.Dict[str, t.Any] = {}
3447+
if allow_closed is not None:
3448+
__query["allow_closed"] = allow_closed
3449+
if allow_no_indices is not None:
3450+
__query["allow_no_indices"] = allow_no_indices
34193451
if bytes is not None:
34203452
__query["bytes"] = bytes
34213453
if error_trace is not None:
34223454
__query["error_trace"] = error_trace
3455+
if expand_wildcards is not None:
3456+
__query["expand_wildcards"] = expand_wildcards
34233457
if filter_path is not None:
34243458
__query["filter_path"] = filter_path
34253459
if format is not None:
@@ -3430,6 +3464,10 @@ async def segments(
34303464
__query["help"] = help
34313465
if human is not None:
34323466
__query["human"] = human
3467+
if ignore_throttled is not None:
3468+
__query["ignore_throttled"] = ignore_throttled
3469+
if ignore_unavailable is not None:
3470+
__query["ignore_unavailable"] = ignore_unavailable
34333471
if local is not None:
34343472
__query["local"] = local
34353473
if master_timeout is not None:

elasticsearch/_async/client/ccr.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -125,8 +125,8 @@ async def follow(
125125
"""
126126
.. raw:: html
127127
128-
<p>Create a follower.
129-
Create a cross-cluster replication follower index that follows a specific leader index.
128+
<p>Create a follower.</p>
129+
<p>Create a cross-cluster replication follower index that follows a specific leader index.
130130
When the API returns, the follower index exists and cross-cluster replication starts replicating operations from the leader index to the follower index.</p>
131131
132132
@@ -368,8 +368,8 @@ async def forget_follower(
368368
"""
369369
.. raw:: html
370370
371-
<p>Forget a follower.
372-
Remove the cross-cluster replication follower retention leases from the leader.</p>
371+
<p>Forget a follower.</p>
372+
<p>Remove the cross-cluster replication follower retention leases from the leader.</p>
373373
<p>A following index takes out retention leases on its leader index.
374374
These leases are used to increase the likelihood that the shards of the leader index retain the history of operations that the shards of the following index need to run replication.
375375
When a follower index is converted to a regular index by the unfollow API (either by directly calling the API or by index lifecycle management tasks), these leases are removed.
@@ -640,8 +640,8 @@ async def put_auto_follow_pattern(
640640
"""
641641
.. raw:: html
642642
643-
<p>Create or update auto-follow patterns.
644-
Create a collection of cross-cluster replication auto-follow patterns for a remote cluster.
643+
<p>Create or update auto-follow patterns.</p>
644+
<p>Create a collection of cross-cluster replication auto-follow patterns for a remote cluster.
645645
Newly created indices on the remote cluster that match any of the patterns are automatically configured as follower indices.
646646
Indices on the remote cluster that were created before the auto-follow pattern was created will not be auto-followed even if they match the pattern.</p>
647647
<p>This API can also be used to update auto-follow patterns.
@@ -853,8 +853,8 @@ async def resume_follow(
853853
"""
854854
.. raw:: html
855855
856-
<p>Resume a follower.
857-
Resume a cross-cluster replication follower index that was paused.
856+
<p>Resume a follower.</p>
857+
<p>Resume a cross-cluster replication follower index that was paused.
858858
The follower index could have been paused with the pause follower API.
859859
Alternatively it could be paused due to replication that cannot be retried due to failures during following tasks.
860860
When this API returns, the follower index will resume fetching operations from the leader index.</p>

0 commit comments

Comments
 (0)