Skip to content

Commit 94573cf

Browse files
Auto-generated code for main (#2671)
Co-authored-by: Quentin Pradet <[email protected]>
1 parent 596e7ca commit 94573cf

24 files changed

+1288
-512
lines changed

Diff for: elasticsearch/_async/client/__init__.py

+98-39
Large diffs are not rendered by default.

Diff for: elasticsearch/_async/client/async_search.py

+21-21
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,11 @@ async def delete(
3636
pretty: t.Optional[bool] = None,
3737
) -> ObjectApiResponse[t.Any]:
3838
"""
39-
Deletes an async search by identifier. If the search is still running, the search
40-
request will be cancelled. Otherwise, the saved search results are deleted. If
41-
the Elasticsearch security features are enabled, the deletion of a specific async
42-
search is restricted to: the authenticated user that submitted the original search
43-
request; users that have the `cancel_task` cluster privilege.
39+
Delete an async search. If the asynchronous search is still running, it is cancelled.
40+
Otherwise, the saved search results are deleted. If the Elasticsearch security
41+
features are enabled, the deletion of a specific async search is restricted to:
42+
the authenticated user that submitted the original search request; users that
43+
have the `cancel_task` cluster privilege.
4444
4545
`<https://www.elastic.co/guide/en/elasticsearch/reference/master/async-search.html>`_
4646
@@ -85,9 +85,9 @@ async def get(
8585
] = None,
8686
) -> ObjectApiResponse[t.Any]:
8787
"""
88-
Retrieves the results of a previously submitted async search request given its
89-
identifier. If the Elasticsearch security features are enabled, access to the
90-
results of a specific async search is restricted to the user or API key that
88+
Get async search results. Retrieve the results of a previously submitted asynchronous
89+
search request. If the Elasticsearch security features are enabled, access to
90+
the results of a specific async search is restricted to the user or API key that
9191
submitted it.
9292
9393
`<https://www.elastic.co/guide/en/elasticsearch/reference/master/async-search.html>`_
@@ -148,10 +148,10 @@ async def status(
148148
pretty: t.Optional[bool] = None,
149149
) -> ObjectApiResponse[t.Any]:
150150
"""
151-
Get async search status Retrieves the status of a previously submitted async
152-
search request given its identifier, without retrieving search results. If the
153-
Elasticsearch security features are enabled, use of this API is restricted to
154-
the `monitoring_user` role.
151+
Get the async search status. Get the status of a previously submitted async search
152+
request given its identifier, without retrieving search results. If the Elasticsearch
153+
security features are enabled, use of this API is restricted to the `monitoring_user`
154+
role.
155155
156156
`<https://www.elastic.co/guide/en/elasticsearch/reference/master/async-search.html>`_
157157
@@ -323,15 +323,15 @@ async def submit(
323323
body: t.Optional[t.Dict[str, t.Any]] = None,
324324
) -> ObjectApiResponse[t.Any]:
325325
"""
326-
Runs a search request asynchronously. When the primary sort of the results is
327-
an indexed field, shards get sorted based on minimum and maximum value that they
328-
hold for that field, hence partial results become available following the sort
329-
criteria that was requested. Warning: Async search does not support scroll nor
330-
search requests that only include the suggest section. By default, Elasticsearch
331-
doesn’t allow you to store an async search response larger than 10Mb and an attempt
332-
to do this results in an error. The maximum allowed size for a stored async search
333-
response can be set by changing the `search.max_async_search_response_size` cluster
334-
level setting.
326+
Run an async search. When the primary sort of the results is an indexed field,
327+
shards get sorted based on minimum and maximum value that they hold for that
328+
field. Partial results become available following the sort criteria that was
329+
requested. Warning: Asynchronous search does not support scroll or search requests
330+
that include only the suggest section. By default, Elasticsearch does not allow
331+
you to store an async search response larger than 10Mb and an attempt to do this
332+
results in an error. The maximum allowed size for a stored async search response
333+
can be set by changing the `search.max_async_search_response_size` cluster level
334+
setting.
335335
336336
`<https://www.elastic.co/guide/en/elasticsearch/reference/master/async-search.html>`_
337337

Diff for: elasticsearch/_async/client/autoscaling.py

+19-6
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,8 @@ async def delete_autoscaling_policy(
3636
pretty: t.Optional[bool] = None,
3737
) -> ObjectApiResponse[t.Any]:
3838
"""
39-
Deletes an autoscaling policy. Designed for indirect use by ECE/ESS and ECK.
39+
Delete an autoscaling policy. NOTE: This feature is designed for indirect use
40+
by Elasticsearch Service, Elastic Cloud Enterprise, and Elastic Cloud on Kubernetes.
4041
Direct use is not supported.
4142
4243
`<https://www.elastic.co/guide/en/elasticsearch/reference/master/autoscaling-delete-autoscaling-policy.html>`_
@@ -76,8 +77,18 @@ async def get_autoscaling_capacity(
7677
pretty: t.Optional[bool] = None,
7778
) -> ObjectApiResponse[t.Any]:
7879
"""
79-
Gets the current autoscaling capacity based on the configured autoscaling policy.
80-
Designed for indirect use by ECE/ESS and ECK. Direct use is not supported.
80+
Get the autoscaling capacity. NOTE: This feature is designed for indirect use
81+
by Elasticsearch Service, Elastic Cloud Enterprise, and Elastic Cloud on Kubernetes.
82+
Direct use is not supported. This API gets the current autoscaling capacity based
83+
on the configured autoscaling policy. It will return information to size the
84+
cluster appropriately to the current workload. The `required_capacity` is calculated
85+
as the maximum of the `required_capacity` result of all individual deciders that
86+
are enabled for the policy. The operator should verify that the `current_nodes`
87+
match the operator’s knowledge of the cluster to avoid making autoscaling decisions
88+
based on stale or incomplete information. The response contains decider-specific
89+
information you can use to diagnose how and why autoscaling determined a certain
90+
capacity was required. This information is provided for diagnosis only. Do not
91+
use this information to make autoscaling decisions.
8192
8293
`<https://www.elastic.co/guide/en/elasticsearch/reference/master/autoscaling-get-autoscaling-capacity.html>`_
8394
"""
@@ -113,7 +124,8 @@ async def get_autoscaling_policy(
113124
pretty: t.Optional[bool] = None,
114125
) -> ObjectApiResponse[t.Any]:
115126
"""
116-
Retrieves an autoscaling policy. Designed for indirect use by ECE/ESS and ECK.
127+
Get an autoscaling policy. NOTE: This feature is designed for indirect use by
128+
Elasticsearch Service, Elastic Cloud Enterprise, and Elastic Cloud on Kubernetes.
117129
Direct use is not supported.
118130
119131
`<https://www.elastic.co/guide/en/elasticsearch/reference/master/autoscaling-get-autoscaling-capacity.html>`_
@@ -158,8 +170,9 @@ async def put_autoscaling_policy(
158170
pretty: t.Optional[bool] = None,
159171
) -> ObjectApiResponse[t.Any]:
160172
"""
161-
Creates a new autoscaling policy. Designed for indirect use by ECE/ESS and ECK.
162-
Direct use is not supported.
173+
Create or update an autoscaling policy. NOTE: This feature is designed for indirect
174+
use by Elasticsearch Service, Elastic Cloud Enterprise, and Elastic Cloud on
175+
Kubernetes. Direct use is not supported.
163176
164177
`<https://www.elastic.co/guide/en/elasticsearch/reference/master/autoscaling-put-autoscaling-policy.html>`_
165178

Diff for: elasticsearch/_async/client/ccr.py

+58-25
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,8 @@ async def delete_auto_follow_pattern(
6868
@_rewrite_parameters(
6969
body_fields=(
7070
"leader_index",
71+
"remote_cluster",
72+
"data_stream_name",
7173
"max_outstanding_read_requests",
7274
"max_outstanding_write_requests",
7375
"max_read_request_operation_count",
@@ -78,29 +80,31 @@ async def delete_auto_follow_pattern(
7880
"max_write_request_operation_count",
7981
"max_write_request_size",
8082
"read_poll_timeout",
81-
"remote_cluster",
83+
"settings",
8284
),
8385
)
8486
async def follow(
8587
self,
8688
*,
8789
index: str,
90+
leader_index: t.Optional[str] = None,
91+
remote_cluster: t.Optional[str] = None,
92+
data_stream_name: t.Optional[str] = None,
8893
error_trace: t.Optional[bool] = None,
8994
filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
9095
human: t.Optional[bool] = None,
91-
leader_index: t.Optional[str] = None,
9296
max_outstanding_read_requests: t.Optional[int] = None,
9397
max_outstanding_write_requests: t.Optional[int] = None,
9498
max_read_request_operation_count: t.Optional[int] = None,
95-
max_read_request_size: t.Optional[str] = None,
99+
max_read_request_size: t.Optional[t.Union[int, str]] = None,
96100
max_retry_delay: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
97101
max_write_buffer_count: t.Optional[int] = None,
98-
max_write_buffer_size: t.Optional[str] = None,
102+
max_write_buffer_size: t.Optional[t.Union[int, str]] = None,
99103
max_write_request_operation_count: t.Optional[int] = None,
100-
max_write_request_size: t.Optional[str] = None,
104+
max_write_request_size: t.Optional[t.Union[int, str]] = None,
101105
pretty: t.Optional[bool] = None,
102106
read_poll_timeout: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
103-
remote_cluster: t.Optional[str] = None,
107+
settings: t.Optional[t.Mapping[str, t.Any]] = None,
104108
wait_for_active_shards: t.Optional[
105109
t.Union[int, t.Union[str, t.Literal["all", "index-setting"]]]
106110
] = None,
@@ -111,26 +115,51 @@ async def follow(
111115
112116
`<https://www.elastic.co/guide/en/elasticsearch/reference/master/ccr-put-follow.html>`_
113117
114-
:param index: The name of the follower index
115-
:param leader_index:
116-
:param max_outstanding_read_requests:
117-
:param max_outstanding_write_requests:
118-
:param max_read_request_operation_count:
119-
:param max_read_request_size:
120-
:param max_retry_delay:
121-
:param max_write_buffer_count:
122-
:param max_write_buffer_size:
123-
:param max_write_request_operation_count:
124-
:param max_write_request_size:
125-
:param read_poll_timeout:
126-
:param remote_cluster:
127-
:param wait_for_active_shards: Sets the number of shard copies that must be active
128-
before returning. Defaults to 0. Set to `all` for all shard copies, otherwise
129-
set to any non-negative value less than or equal to the total number of copies
130-
for the shard (number of replicas + 1)
118+
:param index: The name of the follower index.
119+
:param leader_index: The name of the index in the leader cluster to follow.
120+
:param remote_cluster: The remote cluster containing the leader index.
121+
:param data_stream_name: If the leader index is part of a data stream, the name
122+
to which the local data stream for the followed index should be renamed.
123+
:param max_outstanding_read_requests: The maximum number of outstanding reads
124+
requests from the remote cluster.
125+
:param max_outstanding_write_requests: The maximum number of outstanding write
126+
requests on the follower.
127+
:param max_read_request_operation_count: The maximum number of operations to
128+
pull per read from the remote cluster.
129+
:param max_read_request_size: The maximum size in bytes of per read of a batch
130+
of operations pulled from the remote cluster.
131+
:param max_retry_delay: The maximum time to wait before retrying an operation
132+
that failed exceptionally. An exponential backoff strategy is employed when
133+
retrying.
134+
:param max_write_buffer_count: The maximum number of operations that can be queued
135+
for writing. When this limit is reached, reads from the remote cluster will
136+
be deferred until the number of queued operations goes below the limit.
137+
:param max_write_buffer_size: The maximum total bytes of operations that can
138+
be queued for writing. When this limit is reached, reads from the remote
139+
cluster will be deferred until the total bytes of queued operations goes
140+
below the limit.
141+
:param max_write_request_operation_count: The maximum number of operations per
142+
bulk write request executed on the follower.
143+
:param max_write_request_size: The maximum total bytes of operations per bulk
144+
write request executed on the follower.
145+
:param read_poll_timeout: The maximum time to wait for new operations on the
146+
remote cluster when the follower index is synchronized with the leader index.
147+
When the timeout has elapsed, the poll for operations will return to the
148+
follower so that it can update some statistics. Then the follower will immediately
149+
attempt to read from the leader again.
150+
:param settings: Settings to override from the leader index.
151+
:param wait_for_active_shards: Specifies the number of shards to wait on being
152+
active before responding. This defaults to waiting on none of the shards
153+
to be active. A shard must be restored from the leader index before being
154+
active. Restoring a follower shard requires transferring all the remote Lucene
155+
segment files to the follower index.
131156
"""
132157
if index in SKIP_IN_PATH:
133158
raise ValueError("Empty value passed for parameter 'index'")
159+
if leader_index is None and body is None:
160+
raise ValueError("Empty value passed for parameter 'leader_index'")
161+
if remote_cluster is None and body is None:
162+
raise ValueError("Empty value passed for parameter 'remote_cluster'")
134163
__path_parts: t.Dict[str, str] = {"index": _quote(index)}
135164
__path = f'/{__path_parts["index"]}/_ccr/follow'
136165
__query: t.Dict[str, t.Any] = {}
@@ -148,6 +177,10 @@ async def follow(
148177
if not __body:
149178
if leader_index is not None:
150179
__body["leader_index"] = leader_index
180+
if remote_cluster is not None:
181+
__body["remote_cluster"] = remote_cluster
182+
if data_stream_name is not None:
183+
__body["data_stream_name"] = data_stream_name
151184
if max_outstanding_read_requests is not None:
152185
__body["max_outstanding_read_requests"] = max_outstanding_read_requests
153186
if max_outstanding_write_requests is not None:
@@ -174,8 +207,8 @@ async def follow(
174207
__body["max_write_request_size"] = max_write_request_size
175208
if read_poll_timeout is not None:
176209
__body["read_poll_timeout"] = read_poll_timeout
177-
if remote_cluster is not None:
178-
__body["remote_cluster"] = remote_cluster
210+
if settings is not None:
211+
__body["settings"] = settings
179212
__headers = {"accept": "application/json", "content-type": "application/json"}
180213
return await self.perform_request( # type: ignore[return-value]
181214
"PUT",

0 commit comments

Comments
 (0)