Skip to content

Commit c33d1b9

Browse files
Auto-generated API code
1 parent b45e7d9 commit c33d1b9

Some content is hidden

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

82 files changed

+1435
-1169
lines changed

elasticsearch/_async/client/__init__.py

Lines changed: 38 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -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>
@@ -773,8 +774,8 @@ async def clear_scroll(
773774
"""
774775
.. raw:: html
775776
776-
<p>Clear a scrolling search.
777-
Clear the search context and results for a scrolling search.</p>
777+
<p>Clear a scrolling search.</p>
778+
<p>Clear the search context and results for a scrolling search.</p>
778779
779780
780781
`<https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-clear-scroll>`_
@@ -827,8 +828,8 @@ async def close_point_in_time(
827828
"""
828829
.. raw:: html
829830
830-
<p>Close a point in time.
831-
A point in time must be opened explicitly before being used in search requests.
831+
<p>Close a point in time.</p>
832+
<p>A point in time must be opened explicitly before being used in search requests.
832833
The <code>keep_alive</code> parameter tells Elasticsearch how long it should persist.
833834
A point in time is automatically closed when the <code>keep_alive</code> period has elapsed.
834835
However, keeping points in time has a cost; close them as soon as they are no longer required for search requests.</p>
@@ -905,8 +906,8 @@ async def count(
905906
"""
906907
.. raw:: html
907908
908-
<p>Count search results.
909-
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>
910911
<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.
911912
The query is optional. When no query is provided, the API uses <code>match_all</code> to count all the documents.</p>
912913
<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 +1649,11 @@ async def delete_by_query_rethrottle(
16481649
self,
16491650
*,
16501651
task_id: str,
1652+
requests_per_second: float,
16511653
error_trace: t.Optional[bool] = None,
16521654
filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
16531655
human: t.Optional[bool] = None,
16541656
pretty: t.Optional[bool] = None,
1655-
requests_per_second: t.Optional[float] = None,
16561657
) -> ObjectApiResponse[t.Any]:
16571658
"""
16581659
.. raw:: html
@@ -1670,9 +1671,13 @@ async def delete_by_query_rethrottle(
16701671
"""
16711672
if task_id in SKIP_IN_PATH:
16721673
raise ValueError("Empty value passed for parameter 'task_id'")
1674+
if requests_per_second is None:
1675+
raise ValueError("Empty value passed for parameter 'requests_per_second'")
16731676
__path_parts: t.Dict[str, str] = {"task_id": _quote(task_id)}
16741677
__path = f'/_delete_by_query/{__path_parts["task_id"]}/_rethrottle'
16751678
__query: t.Dict[str, t.Any] = {}
1679+
if requests_per_second is not None:
1680+
__query["requests_per_second"] = requests_per_second
16761681
if error_trace is not None:
16771682
__query["error_trace"] = error_trace
16781683
if filter_path is not None:
@@ -1681,8 +1686,6 @@ async def delete_by_query_rethrottle(
16811686
__query["human"] = human
16821687
if pretty is not None:
16831688
__query["pretty"] = pretty
1684-
if requests_per_second is not None:
1685-
__query["requests_per_second"] = requests_per_second
16861689
__headers = {"accept": "application/json"}
16871690
return await self.perform_request( # type: ignore[return-value]
16881691
"POST",
@@ -1708,8 +1711,8 @@ async def delete_script(
17081711
"""
17091712
.. raw:: html
17101713
1711-
<p>Delete a script or search template.
1712-
Deletes a stored script or search template.</p>
1714+
<p>Delete a script or search template.</p>
1715+
<p>Deletes a stored script or search template.</p>
17131716
17141717
17151718
`<https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-delete-script>`_
@@ -2020,8 +2023,8 @@ async def explain(
20202023
"""
20212024
.. raw:: html
20222025
2023-
<p>Explain a document match result.
2024-
Get information about why a specific document matches, or doesn't match, a query.
2026+
<p>Explain a document match result.</p>
2027+
<p>Get information about why a specific document matches, or doesn't match, a query.
20252028
It computes a score explanation for a query and a specific document.</p>
20262029
20272030
@@ -2437,8 +2440,8 @@ async def get_script(
24372440
"""
24382441
.. raw:: html
24392442
2440-
<p>Get a script or search template.
2441-
Retrieves a stored script or search template.</p>
2443+
<p>Get a script or search template.</p>
2444+
<p>Retrieves a stored script or search template.</p>
24422445
24432446
24442447
`<https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-get-script>`_
@@ -2674,8 +2677,8 @@ async def health_report(
26742677
"""
26752678
.. raw:: html
26762679
2677-
<p>Get the cluster health.
2678-
Get a report with the health status of an Elasticsearch cluster.
2680+
<p>Get the cluster health.</p>
2681+
<p>Get a report with the health status of an Elasticsearch cluster.
26792682
The report contains a list of indicators that compose Elasticsearch functionality.</p>
26802683
<p>Each indicator has a health status of: green, unknown, yellow or red.
26812684
The indicator will provide an explanation and metadata describing the reason for its current health status.</p>
@@ -2987,8 +2990,8 @@ async def info(
29872990
"""
29882991
.. raw:: html
29892992
2990-
<p>Get cluster info.
2991-
Get basic build, version, and cluster information.
2993+
<p>Get cluster info.</p>
2994+
<p>Get basic build, version, and cluster information.
29922995
::: In Serverless, this API is retained for backward compatibility only. Some response fields, such as the version number, should be ignored.</p>
29932996
29942997
@@ -3704,8 +3707,8 @@ async def put_script(
37043707
"""
37053708
.. raw:: html
37063709
3707-
<p>Create or update a script or search template.
3708-
Creates or updates a stored script or search template.</p>
3710+
<p>Create or update a script or search template.</p>
3711+
<p>Creates or updates a stored script or search template.</p>
37093712
37103713
37113714
`<https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-put-script>`_
@@ -4035,11 +4038,11 @@ async def reindex_rethrottle(
40354038
self,
40364039
*,
40374040
task_id: str,
4041+
requests_per_second: float,
40384042
error_trace: t.Optional[bool] = None,
40394043
filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
40404044
human: t.Optional[bool] = None,
40414045
pretty: t.Optional[bool] = None,
4042-
requests_per_second: t.Optional[float] = None,
40434046
) -> ObjectApiResponse[t.Any]:
40444047
"""
40454048
.. raw:: html
@@ -4063,9 +4066,13 @@ async def reindex_rethrottle(
40634066
"""
40644067
if task_id in SKIP_IN_PATH:
40654068
raise ValueError("Empty value passed for parameter 'task_id'")
4069+
if requests_per_second is None:
4070+
raise ValueError("Empty value passed for parameter 'requests_per_second'")
40664071
__path_parts: t.Dict[str, str] = {"task_id": _quote(task_id)}
40674072
__path = f'/_reindex/{__path_parts["task_id"]}/_rethrottle'
40684073
__query: t.Dict[str, t.Any] = {}
4074+
if requests_per_second is not None:
4075+
__query["requests_per_second"] = requests_per_second
40694076
if error_trace is not None:
40704077
__query["error_trace"] = error_trace
40714078
if filter_path is not None:
@@ -4074,8 +4081,6 @@ async def reindex_rethrottle(
40744081
__query["human"] = human
40754082
if pretty is not None:
40764083
__query["pretty"] = pretty
4077-
if requests_per_second is not None:
4078-
__query["requests_per_second"] = requests_per_second
40794084
__headers = {"accept": "application/json"}
40804085
return await self.perform_request( # type: ignore[return-value]
40814086
"POST",
@@ -6120,8 +6125,8 @@ async def update_by_query(
61206125
"""
61216126
.. raw:: html
61226127
6123-
<p>Update documents.
6124-
Updates documents that match the specified query.
6128+
<p>Update documents.</p>
6129+
<p>Updates documents that match the specified query.
61256130
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>
61266131
<p>If the Elasticsearch security features are enabled, you must have the following index privileges for the target data stream, index, or alias:</p>
61276132
<ul>
@@ -6400,11 +6405,11 @@ async def update_by_query_rethrottle(
64006405
self,
64016406
*,
64026407
task_id: str,
6408+
requests_per_second: float,
64036409
error_trace: t.Optional[bool] = None,
64046410
filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
64056411
human: t.Optional[bool] = None,
64066412
pretty: t.Optional[bool] = None,
6407-
requests_per_second: t.Optional[float] = None,
64086413
) -> ObjectApiResponse[t.Any]:
64096414
"""
64106415
.. raw:: html
@@ -6422,9 +6427,13 @@ async def update_by_query_rethrottle(
64226427
"""
64236428
if task_id in SKIP_IN_PATH:
64246429
raise ValueError("Empty value passed for parameter 'task_id'")
6430+
if requests_per_second is None:
6431+
raise ValueError("Empty value passed for parameter 'requests_per_second'")
64256432
__path_parts: t.Dict[str, str] = {"task_id": _quote(task_id)}
64266433
__path = f'/_update_by_query/{__path_parts["task_id"]}/_rethrottle'
64276434
__query: t.Dict[str, t.Any] = {}
6435+
if requests_per_second is not None:
6436+
__query["requests_per_second"] = requests_per_second
64286437
if error_trace is not None:
64296438
__query["error_trace"] = error_trace
64306439
if filter_path is not None:
@@ -6433,8 +6442,6 @@ async def update_by_query_rethrottle(
64336442
__query["human"] = human
64346443
if pretty is not None:
64356444
__query["pretty"] = pretty
6436-
if requests_per_second is not None:
6437-
__query["requests_per_second"] = requests_per_second
64386445
__headers = {"accept": "application/json"}
64396446
return await self.perform_request( # type: ignore[return-value]
64406447
"POST",

elasticsearch/_async/client/cat.py

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3308,10 +3308,20 @@ async def segments(
33083308
self,
33093309
*,
33103310
index: t.Optional[t.Union[str, t.Sequence[str]]] = None,
3311+
allow_closed: t.Optional[bool] = None,
3312+
allow_no_indices: t.Optional[bool] = None,
33113313
bytes: t.Optional[
33123314
t.Union[str, t.Literal["b", "gb", "kb", "mb", "pb", "tb"]]
33133315
] = None,
33143316
error_trace: t.Optional[bool] = None,
3317+
expand_wildcards: t.Optional[
3318+
t.Union[
3319+
t.Sequence[
3320+
t.Union[str, t.Literal["all", "closed", "hidden", "none", "open"]]
3321+
],
3322+
t.Union[str, t.Literal["all", "closed", "hidden", "none", "open"]],
3323+
]
3324+
] = None,
33153325
filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
33163326
format: t.Optional[str] = None,
33173327
h: t.Optional[
@@ -3362,6 +3372,8 @@ async def segments(
33623372
] = None,
33633373
help: t.Optional[bool] = None,
33643374
human: t.Optional[bool] = None,
3375+
ignore_throttled: t.Optional[bool] = None,
3376+
ignore_unavailable: t.Optional[bool] = None,
33653377
local: t.Optional[bool] = None,
33663378
master_timeout: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
33673379
pretty: t.Optional[bool] = None,
@@ -3385,6 +3397,14 @@ async def segments(
33853397
:param index: A comma-separated list of data streams, indices, and aliases used
33863398
to limit the request. Supports wildcards (`*`). To target all data streams
33873399
and indices, omit this parameter or use `*` or `_all`.
3400+
:param allow_closed: If true, allow closed indices to be returned in the response
3401+
otherwise if false, keep the legacy behaviour of throwing an exception if
3402+
index pattern matches closed indices
3403+
:param allow_no_indices: If false, the request returns an error if any wildcard
3404+
expression, index alias, or _all value targets only missing or closed indices.
3405+
This behavior applies even if the request targets other open indices. For
3406+
example, a request targeting foo*,bar* returns an error if an index starts
3407+
with foo but no index starts with bar.
33883408
:param bytes: Sets the units for columns that contain a byte-size value. Note
33893409
that byte-size value units work in terms of powers of 1024. For instance
33903410
`1kb` means 1024 bytes, not 1000 bytes. If omitted, byte-size values are
@@ -3393,12 +3413,20 @@ async def segments(
33933413
least `1.0`. If given, byte-size values are rendered as an integer with no
33943414
suffix, representing the value of the column in the chosen unit. Values that
33953415
are not an exact multiple of the chosen unit are rounded down.
3416+
:param expand_wildcards: Type of index that wildcard expressions can match. If
3417+
the request can target data streams, this argument determines whether wildcard
3418+
expressions match hidden data streams. Supports comma-separated values, such
3419+
as open,hidden.
33963420
:param format: Specifies the format to return the columnar data in, can be set
33973421
to `text`, `json`, `cbor`, `yaml`, or `smile`.
33983422
:param h: A comma-separated list of columns names to display. It supports simple
33993423
wildcards.
34003424
:param help: When set to `true` will output available columns. This option can't
34013425
be combined with any other query string option.
3426+
:param ignore_throttled: If true, concrete, expanded or aliased indices are ignored
3427+
when frozen.
3428+
:param ignore_unavailable: If true, missing or closed indices are not included
3429+
in the response.
34023430
:param local: If `true`, the request computes the list of selected nodes from
34033431
the local cluster state. If `false` the list of selected nodes are computed
34043432
from the cluster state of the master node. In both cases the coordinating
@@ -3423,10 +3451,16 @@ async def segments(
34233451
__path_parts = {}
34243452
__path = "/_cat/segments"
34253453
__query: t.Dict[str, t.Any] = {}
3454+
if allow_closed is not None:
3455+
__query["allow_closed"] = allow_closed
3456+
if allow_no_indices is not None:
3457+
__query["allow_no_indices"] = allow_no_indices
34263458
if bytes is not None:
34273459
__query["bytes"] = bytes
34283460
if error_trace is not None:
34293461
__query["error_trace"] = error_trace
3462+
if expand_wildcards is not None:
3463+
__query["expand_wildcards"] = expand_wildcards
34303464
if filter_path is not None:
34313465
__query["filter_path"] = filter_path
34323466
if format is not None:
@@ -3437,6 +3471,10 @@ async def segments(
34373471
__query["help"] = help
34383472
if human is not None:
34393473
__query["human"] = human
3474+
if ignore_throttled is not None:
3475+
__query["ignore_throttled"] = ignore_throttled
3476+
if ignore_unavailable is not None:
3477+
__query["ignore_unavailable"] = ignore_unavailable
34403478
if local is not None:
34413479
__query["local"] = local
34423480
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)