Skip to content

Commit 7a548c1

Browse files
Auto-generated API code (#2777)
Co-authored-by: Quentin Pradet <[email protected]>
1 parent 7511689 commit 7a548c1

39 files changed

+2508
-964
lines changed

elasticsearch/_async/client/__init__.py

Lines changed: 782 additions & 232 deletions
Large diffs are not rendered by default.

elasticsearch/_async/client/async_search.py

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -97,8 +97,8 @@ async def get(
9797
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/async-search.html>`_
9898
9999
:param id: A unique identifier for the async search.
100-
:param keep_alive: Specifies how long the async search should be available in
101-
the cluster. When not specified, the `keep_alive` set with the corresponding
100+
:param keep_alive: The length of time that the async search should be available
101+
in the cluster. When not specified, the `keep_alive` set with the corresponding
102102
submit async request will be used. Otherwise, it is possible to override
103103
the value and extend the validity of the request. When this period expires,
104104
the search, if still running, is cancelled. If the search is completed, its
@@ -157,13 +157,17 @@ async def status(
157157
158158
<p>Get the async search status.</p>
159159
<p>Get the status of a previously submitted async search request given its identifier, without retrieving search results.
160-
If the Elasticsearch security features are enabled, use of this API is restricted to the <code>monitoring_user</code> role.</p>
160+
If the Elasticsearch security features are enabled, the access to the status of a specific async search is restricted to:</p>
161+
<ul>
162+
<li>The user or API key that submitted the original async search request.</li>
163+
<li>Users that have the <code>monitor</code> cluster privilege or greater privileges.</li>
164+
</ul>
161165
162166
163167
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/async-search.html>`_
164168
165169
:param id: A unique identifier for the async search.
166-
:param keep_alive: Specifies how long the async search needs to be available.
170+
:param keep_alive: The length of time that the async search needs to be available.
167171
Ongoing async searches and any saved search results are deleted after this
168172
period.
169173
"""
@@ -270,6 +274,7 @@ async def submit(
270274
ignore_throttled: t.Optional[bool] = None,
271275
ignore_unavailable: t.Optional[bool] = None,
272276
indices_boost: t.Optional[t.Sequence[t.Mapping[str, float]]] = None,
277+
keep_alive: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
273278
keep_on_completion: t.Optional[bool] = None,
274279
knn: t.Optional[
275280
t.Union[t.Mapping[str, t.Any], t.Sequence[t.Mapping[str, t.Any]]]
@@ -384,6 +389,9 @@ async def submit(
384389
:param ignore_unavailable: Whether specified concrete indices should be ignored
385390
when unavailable (missing or closed)
386391
:param indices_boost: Boosts the _score of documents from specified indices.
392+
:param keep_alive: Specifies how long the async search needs to be available.
393+
Ongoing async searches and any saved search results are deleted after this
394+
period.
387395
:param keep_on_completion: If `true`, results are stored for later retrieval
388396
when the search completes within the `wait_for_completion_timeout`.
389397
:param knn: Defines the approximate kNN search to run.
@@ -510,6 +518,8 @@ async def submit(
510518
__query["ignore_throttled"] = ignore_throttled
511519
if ignore_unavailable is not None:
512520
__query["ignore_unavailable"] = ignore_unavailable
521+
if keep_alive is not None:
522+
__query["keep_alive"] = keep_alive
513523
if keep_on_completion is not None:
514524
__query["keep_on_completion"] = keep_on_completion
515525
if lenient is not None:

elasticsearch/_async/client/cat.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2494,7 +2494,7 @@ async def tasks(
24942494
IMPORTANT: cat APIs are only intended for human consumption using the command line or Kibana console. They are not intended for use by applications. For application consumption, use the task management API.</p>
24952495
24962496
2497-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/tasks.html>`_
2497+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/cat-tasks.html>`_
24982498
24992499
:param actions: The task action names, which are used to limit the response.
25002500
:param detailed: If `true`, the response includes detailed information about

elasticsearch/_async/client/ccr.py

Lines changed: 67 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -39,14 +39,17 @@ async def delete_auto_follow_pattern(
3939
"""
4040
.. raw:: html
4141
42-
<p>Delete auto-follow patterns.
43-
Delete a collection of cross-cluster replication auto-follow patterns.</p>
42+
<p>Delete auto-follow patterns.</p>
43+
<p>Delete a collection of cross-cluster replication auto-follow patterns.</p>
4444
4545
4646
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/ccr-delete-auto-follow-pattern.html>`_
4747
48-
:param name: The name of the auto follow pattern.
49-
:param master_timeout: Period to wait for a connection to the master node.
48+
:param name: The auto-follow pattern collection to delete.
49+
:param master_timeout: The period to wait for a connection to the master node.
50+
If the master node is not available before the timeout expires, the request
51+
fails and returns an error. It can also be set to `-1` to indicate that the
52+
request should never timeout.
5053
"""
5154
if name in SKIP_IN_PATH:
5255
raise ValueError("Empty value passed for parameter 'name'")
@@ -251,16 +254,18 @@ async def follow_info(
251254
"""
252255
.. raw:: html
253256
254-
<p>Get follower information.
255-
Get information about all cross-cluster replication follower indices.
257+
<p>Get follower information.</p>
258+
<p>Get information about all cross-cluster replication follower indices.
256259
For example, the results include follower index names, leader index names, replication options, and whether the follower indices are active or paused.</p>
257260
258261
259262
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/ccr-get-follow-info.html>`_
260263
261-
:param index: A comma-separated list of index patterns; use `_all` to perform
262-
the operation on all indices
263-
:param master_timeout: Period to wait for a connection to the master node.
264+
:param index: A comma-delimited list of follower index patterns.
265+
:param master_timeout: The period to wait for a connection to the master node.
266+
If the master node is not available before the timeout expires, the request
267+
fails and returns an error. It can also be set to `-1` to indicate that the
268+
request should never timeout.
264269
"""
265270
if index in SKIP_IN_PATH:
266271
raise ValueError("Empty value passed for parameter 'index'")
@@ -301,17 +306,16 @@ async def follow_stats(
301306
"""
302307
.. raw:: html
303308
304-
<p>Get follower stats.
305-
Get cross-cluster replication follower stats.
309+
<p>Get follower stats.</p>
310+
<p>Get cross-cluster replication follower stats.
306311
The API returns shard-level stats about the &quot;following tasks&quot; associated with each shard for the specified indices.</p>
307312
308313
309314
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/ccr-get-follow-stats.html>`_
310315
311-
:param index: A comma-separated list of index patterns; use `_all` to perform
312-
the operation on all indices
313-
:param timeout: Period to wait for a response. If no response is received before
314-
the timeout expires, the request fails and returns an error.
316+
:param index: A comma-delimited list of index patterns.
317+
:param timeout: The period to wait for a response. If no response is received
318+
before the timeout expires, the request fails and returns an error.
315319
"""
316320
if index in SKIP_IN_PATH:
317321
raise ValueError("Empty value passed for parameter 'index'")
@@ -437,15 +441,18 @@ async def get_auto_follow_pattern(
437441
"""
438442
.. raw:: html
439443
440-
<p>Get auto-follow patterns.
441-
Get cross-cluster replication auto-follow patterns.</p>
444+
<p>Get auto-follow patterns.</p>
445+
<p>Get cross-cluster replication auto-follow patterns.</p>
442446
443447
444448
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/ccr-get-auto-follow-pattern.html>`_
445449
446-
:param name: Specifies the auto-follow pattern collection that you want to retrieve.
447-
If you do not specify a name, the API returns information for all collections.
448-
:param master_timeout: Period to wait for a connection to the master node.
450+
:param name: The auto-follow pattern collection that you want to retrieve. If
451+
you do not specify a name, the API returns information for all collections.
452+
:param master_timeout: The period to wait for a connection to the master node.
453+
If the master node is not available before the timeout expires, the request
454+
fails and returns an error. It can also be set to `-1` to indicate that the
455+
request should never timeout.
449456
"""
450457
__path_parts: t.Dict[str, str]
451458
if name not in SKIP_IN_PATH:
@@ -489,8 +496,8 @@ async def pause_auto_follow_pattern(
489496
"""
490497
.. raw:: html
491498
492-
<p>Pause an auto-follow pattern.
493-
Pause a cross-cluster replication auto-follow pattern.
499+
<p>Pause an auto-follow pattern.</p>
500+
<p>Pause a cross-cluster replication auto-follow pattern.
494501
When the API returns, the auto-follow pattern is inactive.
495502
New indices that are created on the remote cluster and match the auto-follow patterns are ignored.</p>
496503
<p>You can resume auto-following with the resume auto-follow pattern API.
@@ -500,9 +507,11 @@ async def pause_auto_follow_pattern(
500507
501508
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/ccr-pause-auto-follow-pattern.html>`_
502509
503-
:param name: The name of the auto follow pattern that should pause discovering
504-
new indices to follow.
505-
:param master_timeout: Period to wait for a connection to the master node.
510+
:param name: The name of the auto-follow pattern to pause.
511+
:param master_timeout: The period to wait for a connection to the master node.
512+
If the master node is not available before the timeout expires, the request
513+
fails and returns an error. It can also be set to `-1` to indicate that the
514+
request should never timeout.
506515
"""
507516
if name in SKIP_IN_PATH:
508517
raise ValueError("Empty value passed for parameter 'name'")
@@ -543,18 +552,20 @@ async def pause_follow(
543552
"""
544553
.. raw:: html
545554
546-
<p>Pause a follower.
547-
Pause a cross-cluster replication follower index.
555+
<p>Pause a follower.</p>
556+
<p>Pause a cross-cluster replication follower index.
548557
The follower index will not fetch any additional operations from the leader index.
549558
You can resume following with the resume follower API.
550559
You can pause and resume a follower index to change the configuration of the following task.</p>
551560
552561
553562
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/ccr-post-pause-follow.html>`_
554563
555-
:param index: The name of the follower index that should pause following its
556-
leader index.
557-
:param master_timeout: Period to wait for a connection to the master node.
564+
:param index: The name of the follower index.
565+
:param master_timeout: The period to wait for a connection to the master node.
566+
If the master node is not available before the timeout expires, the request
567+
fails and returns an error. It can also be set to `-1` to indicate that the
568+
request should never timeout.
558569
"""
559570
if index in SKIP_IN_PATH:
560571
raise ValueError("Empty value passed for parameter 'index'")
@@ -765,17 +776,19 @@ async def resume_auto_follow_pattern(
765776
"""
766777
.. raw:: html
767778
768-
<p>Resume an auto-follow pattern.
769-
Resume a cross-cluster replication auto-follow pattern that was paused.
779+
<p>Resume an auto-follow pattern.</p>
780+
<p>Resume a cross-cluster replication auto-follow pattern that was paused.
770781
The auto-follow pattern will resume configuring following indices for newly created indices that match its patterns on the remote cluster.
771782
Remote indices created while the pattern was paused will also be followed unless they have been deleted or closed in the interim.</p>
772783
773784
774785
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/ccr-resume-auto-follow-pattern.html>`_
775786
776-
:param name: The name of the auto follow pattern to resume discovering new indices
777-
to follow.
778-
:param master_timeout: Period to wait for a connection to the master node.
787+
:param name: The name of the auto-follow pattern to resume.
788+
:param master_timeout: The period to wait for a connection to the master node.
789+
If the master node is not available before the timeout expires, the request
790+
fails and returns an error. It can also be set to `-1` to indicate that the
791+
request should never timeout.
779792
"""
780793
if name in SKIP_IN_PATH:
781794
raise ValueError("Empty value passed for parameter 'name'")
@@ -934,15 +947,18 @@ async def stats(
934947
"""
935948
.. raw:: html
936949
937-
<p>Get cross-cluster replication stats.
938-
This API returns stats about auto-following and the same shard-level stats as the get follower stats API.</p>
950+
<p>Get cross-cluster replication stats.</p>
951+
<p>This API returns stats about auto-following and the same shard-level stats as the get follower stats API.</p>
939952
940953
941954
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/ccr-get-stats.html>`_
942955
943-
:param master_timeout: Period to wait for a connection to the master node.
944-
:param timeout: Period to wait for a response. If no response is received before
945-
the timeout expires, the request fails and returns an error.
956+
:param master_timeout: The period to wait for a connection to the master node.
957+
If the master node is not available before the timeout expires, the request
958+
fails and returns an error. It can also be set to `-1` to indicate that the
959+
request should never timeout.
960+
:param timeout: The period to wait for a response. If no response is received
961+
before the timeout expires, the request fails and returns an error.
946962
"""
947963
__path_parts: t.Dict[str, str] = {}
948964
__path = "/_ccr/stats"
@@ -983,18 +999,23 @@ async def unfollow(
983999
"""
9841000
.. raw:: html
9851001
986-
<p>Unfollow an index.
987-
Convert a cross-cluster replication follower index to a regular index.
1002+
<p>Unfollow an index.</p>
1003+
<p>Convert a cross-cluster replication follower index to a regular index.
9881004
The API stops the following task associated with a follower index and removes index metadata and settings associated with cross-cluster replication.
9891005
The follower index must be paused and closed before you call the unfollow API.</p>
990-
<p>NOTE: Currently cross-cluster replication does not support converting an existing regular index to a follower index. Converting a follower index to a regular index is an irreversible operation.</p>
1006+
<blockquote>
1007+
<p>info
1008+
Currently cross-cluster replication does not support converting an existing regular index to a follower index. Converting a follower index to a regular index is an irreversible operation.</p>
1009+
</blockquote>
9911010
9921011
9931012
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/ccr-post-unfollow.html>`_
9941013
995-
:param index: The name of the follower index that should be turned into a regular
996-
index.
997-
:param master_timeout: Period to wait for a connection to the master node.
1014+
:param index: The name of the follower index.
1015+
:param master_timeout: The period to wait for a connection to the master node.
1016+
If the master node is not available before the timeout expires, the request
1017+
fails and returns an error. It can also be set to `-1` to indicate that the
1018+
request should never timeout.
9981019
"""
9991020
if index in SKIP_IN_PATH:
10001021
raise ValueError("Empty value passed for parameter 'index'")

elasticsearch/_async/client/cluster.py

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -447,8 +447,8 @@ async def health(
447447
"""
448448
.. raw:: html
449449
450-
<p>Get the cluster health status.
451-
You can also use the API to get the health status of only specified data streams and indices.
450+
<p>Get the cluster health status.</p>
451+
<p>You can also use the API to get the health status of only specified data streams and indices.
452452
For data streams, the API retrieves the health status of the stream’s backing indices.</p>
453453
<p>The cluster health status is: green, yellow or red.
454454
On the shard level, a red status indicates that the specific shard is not allocated in the cluster. Yellow means that the primary shard is allocated but replicas are not. Green means that all shards are allocated.
@@ -850,8 +850,8 @@ async def put_settings(
850850
"""
851851
.. raw:: html
852852
853-
<p>Update the cluster settings.
854-
Configure and update dynamic settings on a running cluster.
853+
<p>Update the cluster settings.</p>
854+
<p>Configure and update dynamic settings on a running cluster.
855855
You can also configure dynamic settings locally on an unstarted or shut down node in <code>elasticsearch.yml</code>.</p>
856856
<p>Updates made with this API can be persistent, which apply across cluster restarts, or transient, which reset after a cluster restart.
857857
You can also reset transient or persistent settings by assigning them a null value.</p>
@@ -920,9 +920,16 @@ async def remote_info(
920920
"""
921921
.. raw:: html
922922
923-
<p>Get remote cluster information.
924-
Get all of the configured remote cluster information.
925-
This API returns connection and endpoint information keyed by the configured remote cluster alias.</p>
923+
<p>Get remote cluster information.</p>
924+
<p>Get information about configured remote clusters.
925+
The API returns connection and endpoint information keyed by the configured remote cluster alias.</p>
926+
<blockquote>
927+
<p>info
928+
This API returns information that reflects current state on the local cluster.
929+
The <code>connected</code> field does not necessarily reflect whether a remote cluster is down or unavailable, only whether there is currently an open connection to it.
930+
Elasticsearch does not spontaneously try to reconnect to a disconnected remote cluster.
931+
To trigger a reconnection, attempt a cross-cluster search, ES|QL cross-cluster search, or try the <a href="https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-indices-resolve-cluster">resolve cluster endpoint</a>.</p>
932+
</blockquote>
926933
927934
928935
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/cluster-remote-info.html>`_

0 commit comments

Comments
 (0)