Skip to content

Commit 22377c0

Browse files
authored
Auto-generated code for 8.x (#2719)
1 parent f69cb3d commit 22377c0

32 files changed

+604
-258
lines changed

elasticsearch/_async/client/__init__.py

Lines changed: 28 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -872,7 +872,7 @@ async def count(
872872
body: t.Optional[t.Dict[str, t.Any]] = None,
873873
) -> ObjectApiResponse[t.Any]:
874874
"""
875-
Returns number of documents matching a query.
875+
Count search results. Get the number of documents matching a query.
876876
877877
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.16/search-count.html>`_
878878
@@ -2274,7 +2274,26 @@ async def health_report(
22742274
verbose: t.Optional[bool] = None,
22752275
) -> ObjectApiResponse[t.Any]:
22762276
"""
2277-
Returns the health of the cluster.
2277+
Get the cluster health. Get a report with the health status of an Elasticsearch
2278+
cluster. The report contains a list of indicators that compose Elasticsearch
2279+
functionality. Each indicator has a health status of: green, unknown, yellow
2280+
or red. The indicator will provide an explanation and metadata describing the
2281+
reason for its current health status. The cluster’s status is controlled by the
2282+
worst indicator status. In the event that an indicator’s status is non-green,
2283+
a list of impacts may be present in the indicator result which detail the functionalities
2284+
that are negatively affected by the health issue. Each impact carries with it
2285+
a severity level, an area of the system that is affected, and a simple description
2286+
of the impact on the system. Some health indicators can determine the root cause
2287+
of a health problem and prescribe a set of steps that can be performed in order
2288+
to improve the health of the system. The root cause and remediation steps are
2289+
encapsulated in a diagnosis. A diagnosis contains a cause detailing a root cause
2290+
analysis, an action containing a brief description of the steps to take to fix
2291+
the problem, the list of affected resources (if applicable), and a detailed step-by-step
2292+
troubleshooting guide to fix the diagnosed problem. NOTE: The health indicators
2293+
perform root cause analysis of non-green health statuses. This can be computationally
2294+
expensive when called frequently. When setting up automated polling of the API
2295+
for health status, set verbose to false to disable the more expensive analysis
2296+
logic.
22782297
22792298
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.16/health-api.html>`_
22802299
@@ -3079,6 +3098,7 @@ async def open_point_in_time(
30793098
*,
30803099
index: t.Union[str, t.Sequence[str]],
30813100
keep_alive: t.Union[str, t.Literal[-1], t.Literal[0]],
3101+
allow_partial_search_results: t.Optional[bool] = None,
30823102
error_trace: t.Optional[bool] = None,
30833103
expand_wildcards: t.Optional[
30843104
t.Union[
@@ -3113,6 +3133,10 @@ async def open_point_in_time(
31133133
:param index: A comma-separated list of index names to open point in time; use
31143134
`_all` or empty string to perform the operation on all indices
31153135
:param keep_alive: Extends the time to live of the corresponding point in time.
3136+
:param allow_partial_search_results: If `false`, creating a point in time request
3137+
when a shard is missing or unavailable will throw an exception. If `true`,
3138+
the point in time will contain all the shards that are available at the time
3139+
of the request.
31163140
:param expand_wildcards: Type of index that wildcard patterns can match. If the
31173141
request can target data streams, this argument determines whether wildcard
31183142
expressions match hidden data streams. Supports comma-separated values, such
@@ -3135,6 +3159,8 @@ async def open_point_in_time(
31353159
__body: t.Dict[str, t.Any] = body if body is not None else {}
31363160
if keep_alive is not None:
31373161
__query["keep_alive"] = keep_alive
3162+
if allow_partial_search_results is not None:
3163+
__query["allow_partial_search_results"] = allow_partial_search_results
31383164
if error_trace is not None:
31393165
__query["error_trace"] = error_trace
31403166
if expand_wildcards is not None:

elasticsearch/_async/client/async_search.py

Lines changed: 8 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,7 @@ async def status(
145145
error_trace: t.Optional[bool] = None,
146146
filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
147147
human: t.Optional[bool] = None,
148+
keep_alive: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
148149
pretty: t.Optional[bool] = None,
149150
) -> ObjectApiResponse[t.Any]:
150151
"""
@@ -156,6 +157,9 @@ async def status(
156157
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.16/async-search.html>`_
157158
158159
:param id: A unique identifier for the async search.
160+
:param keep_alive: Specifies how long the async search needs to be available.
161+
Ongoing async searches and any saved search results are deleted after this
162+
period.
159163
"""
160164
if id in SKIP_IN_PATH:
161165
raise ValueError("Empty value passed for parameter 'id'")
@@ -168,6 +172,8 @@ async def status(
168172
__query["filter_path"] = filter_path
169173
if human is not None:
170174
__query["human"] = human
175+
if keep_alive is not None:
176+
__query["keep_alive"] = keep_alive
171177
if pretty is not None:
172178
__query["pretty"] = pretty
173179
__headers = {"accept": "application/json"}
@@ -258,7 +264,6 @@ async def submit(
258264
ignore_throttled: t.Optional[bool] = None,
259265
ignore_unavailable: t.Optional[bool] = None,
260266
indices_boost: t.Optional[t.Sequence[t.Mapping[str, float]]] = None,
261-
keep_alive: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
262267
keep_on_completion: t.Optional[bool] = None,
263268
knn: t.Optional[
264269
t.Union[t.Mapping[str, t.Any], t.Sequence[t.Mapping[str, t.Any]]]
@@ -269,7 +274,6 @@ async def submit(
269274
min_score: t.Optional[float] = None,
270275
pit: t.Optional[t.Mapping[str, t.Any]] = None,
271276
post_filter: t.Optional[t.Mapping[str, t.Any]] = None,
272-
pre_filter_shard_size: t.Optional[int] = None,
273277
preference: t.Optional[str] = None,
274278
pretty: t.Optional[bool] = None,
275279
profile: t.Optional[bool] = None,
@@ -283,7 +287,6 @@ async def submit(
283287
routing: t.Optional[str] = None,
284288
runtime_mappings: t.Optional[t.Mapping[str, t.Mapping[str, t.Any]]] = None,
285289
script_fields: t.Optional[t.Mapping[str, t.Mapping[str, t.Any]]] = None,
286-
scroll: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
287290
search_after: t.Optional[
288291
t.Sequence[t.Union[None, bool, float, int, str, t.Any]]
289292
] = None,
@@ -376,9 +379,6 @@ async def submit(
376379
:param ignore_unavailable: Whether specified concrete indices should be ignored
377380
when unavailable (missing or closed)
378381
:param indices_boost: Boosts the _score of documents from specified indices.
379-
:param keep_alive: Specifies how long the async search needs to be available.
380-
Ongoing async searches and any saved search results are deleted after this
381-
period.
382382
:param keep_on_completion: If `true`, results are stored for later retrieval
383383
when the search completes within the `wait_for_completion_timeout`.
384384
:param knn: Defines the approximate kNN search to run.
@@ -394,10 +394,6 @@ async def submit(
394394
:param pit: Limits the search to a point in time (PIT). If you provide a PIT,
395395
you cannot specify an <index> in the request path.
396396
:param post_filter:
397-
:param pre_filter_shard_size: The default value cannot be changed, which enforces
398-
the execution of a pre-filter roundtrip to retrieve statistics from each
399-
shard so that the ones that surely don’t hold any document matching the query
400-
get skipped.
401397
:param preference: Specify the node or shard the operation should be performed
402398
on (default: random)
403399
:param profile:
@@ -406,13 +402,13 @@ async def submit(
406402
:param request_cache: Specify if request cache should be used for this request
407403
or not, defaults to true
408404
:param rescore:
409-
:param rest_total_hits_as_int:
405+
:param rest_total_hits_as_int: Indicates whether hits.total should be rendered
406+
as an integer or an object in the rest search response
410407
:param routing: A comma-separated list of specific routing values
411408
:param runtime_mappings: Defines one or more runtime fields in the search request.
412409
These fields take precedence over mapped fields with the same name.
413410
:param script_fields: Retrieve a script evaluation (based on different fields)
414411
for each hit.
415-
:param scroll:
416412
:param search_after:
417413
:param search_type: Search operation type
418414
:param seq_no_primary_term: If true, returns sequence number and primary term
@@ -509,8 +505,6 @@ async def submit(
509505
__query["ignore_throttled"] = ignore_throttled
510506
if ignore_unavailable is not None:
511507
__query["ignore_unavailable"] = ignore_unavailable
512-
if keep_alive is not None:
513-
__query["keep_alive"] = keep_alive
514508
if keep_on_completion is not None:
515509
__query["keep_on_completion"] = keep_on_completion
516510
if lenient is not None:
@@ -519,8 +513,6 @@ async def submit(
519513
__query["max_concurrent_shard_requests"] = max_concurrent_shard_requests
520514
if min_compatible_shard_node is not None:
521515
__query["min_compatible_shard_node"] = min_compatible_shard_node
522-
if pre_filter_shard_size is not None:
523-
__query["pre_filter_shard_size"] = pre_filter_shard_size
524516
if preference is not None:
525517
__query["preference"] = preference
526518
if pretty is not None:
@@ -533,8 +525,6 @@ async def submit(
533525
__query["rest_total_hits_as_int"] = rest_total_hits_as_int
534526
if routing is not None:
535527
__query["routing"] = routing
536-
if scroll is not None:
537-
__query["scroll"] = scroll
538528
if search_type is not None:
539529
__query["search_type"] = search_type
540530
if source_excludes is not None:

elasticsearch/_async/client/autoscaling.py

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,9 @@ async def delete_autoscaling_policy(
3333
error_trace: t.Optional[bool] = None,
3434
filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
3535
human: t.Optional[bool] = None,
36+
master_timeout: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
3637
pretty: t.Optional[bool] = None,
38+
timeout: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
3739
) -> ObjectApiResponse[t.Any]:
3840
"""
3941
Delete an autoscaling policy. NOTE: This feature is designed for indirect use
@@ -43,6 +45,11 @@ async def delete_autoscaling_policy(
4345
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.16/autoscaling-delete-autoscaling-policy.html>`_
4446
4547
:param name: the name of the autoscaling policy
48+
:param master_timeout: Period to wait for a connection to the master node. If
49+
no response is received before the timeout expires, the request fails and
50+
returns an error.
51+
:param timeout: Period to wait for a response. If no response is received before
52+
the timeout expires, the request fails and returns an error.
4653
"""
4754
if name in SKIP_IN_PATH:
4855
raise ValueError("Empty value passed for parameter 'name'")
@@ -55,8 +62,12 @@ async def delete_autoscaling_policy(
5562
__query["filter_path"] = filter_path
5663
if human is not None:
5764
__query["human"] = human
65+
if master_timeout is not None:
66+
__query["master_timeout"] = master_timeout
5867
if pretty is not None:
5968
__query["pretty"] = pretty
69+
if timeout is not None:
70+
__query["timeout"] = timeout
6071
__headers = {"accept": "application/json"}
6172
return await self.perform_request( # type: ignore[return-value]
6273
"DELETE",
@@ -74,6 +85,7 @@ async def get_autoscaling_capacity(
7485
error_trace: t.Optional[bool] = None,
7586
filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
7687
human: t.Optional[bool] = None,
88+
master_timeout: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
7789
pretty: t.Optional[bool] = None,
7890
) -> ObjectApiResponse[t.Any]:
7991
"""
@@ -91,6 +103,10 @@ async def get_autoscaling_capacity(
91103
use this information to make autoscaling decisions.
92104
93105
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.16/autoscaling-get-autoscaling-capacity.html>`_
106+
107+
:param master_timeout: Period to wait for a connection to the master node. If
108+
no response is received before the timeout expires, the request fails and
109+
returns an error.
94110
"""
95111
__path_parts: t.Dict[str, str] = {}
96112
__path = "/_autoscaling/capacity"
@@ -101,6 +117,8 @@ async def get_autoscaling_capacity(
101117
__query["filter_path"] = filter_path
102118
if human is not None:
103119
__query["human"] = human
120+
if master_timeout is not None:
121+
__query["master_timeout"] = master_timeout
104122
if pretty is not None:
105123
__query["pretty"] = pretty
106124
__headers = {"accept": "application/json"}
@@ -121,6 +139,7 @@ async def get_autoscaling_policy(
121139
error_trace: t.Optional[bool] = None,
122140
filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
123141
human: t.Optional[bool] = None,
142+
master_timeout: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
124143
pretty: t.Optional[bool] = None,
125144
) -> ObjectApiResponse[t.Any]:
126145
"""
@@ -131,6 +150,9 @@ async def get_autoscaling_policy(
131150
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.16/autoscaling-get-autoscaling-capacity.html>`_
132151
133152
:param name: the name of the autoscaling policy
153+
:param master_timeout: Period to wait for a connection to the master node. If
154+
no response is received before the timeout expires, the request fails and
155+
returns an error.
134156
"""
135157
if name in SKIP_IN_PATH:
136158
raise ValueError("Empty value passed for parameter 'name'")
@@ -143,6 +165,8 @@ async def get_autoscaling_policy(
143165
__query["filter_path"] = filter_path
144166
if human is not None:
145167
__query["human"] = human
168+
if master_timeout is not None:
169+
__query["master_timeout"] = master_timeout
146170
if pretty is not None:
147171
__query["pretty"] = pretty
148172
__headers = {"accept": "application/json"}
@@ -167,7 +191,9 @@ async def put_autoscaling_policy(
167191
error_trace: t.Optional[bool] = None,
168192
filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
169193
human: t.Optional[bool] = None,
194+
master_timeout: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
170195
pretty: t.Optional[bool] = None,
196+
timeout: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
171197
) -> ObjectApiResponse[t.Any]:
172198
"""
173199
Create or update an autoscaling policy. NOTE: This feature is designed for indirect
@@ -178,6 +204,11 @@ async def put_autoscaling_policy(
178204
179205
:param name: the name of the autoscaling policy
180206
:param policy:
207+
:param master_timeout: Period to wait for a connection to the master node. If
208+
no response is received before the timeout expires, the request fails and
209+
returns an error.
210+
:param timeout: Period to wait for a response. If no response is received before
211+
the timeout expires, the request fails and returns an error.
181212
"""
182213
if name in SKIP_IN_PATH:
183214
raise ValueError("Empty value passed for parameter 'name'")
@@ -196,8 +227,12 @@ async def put_autoscaling_policy(
196227
__query["filter_path"] = filter_path
197228
if human is not None:
198229
__query["human"] = human
230+
if master_timeout is not None:
231+
__query["master_timeout"] = master_timeout
199232
if pretty is not None:
200233
__query["pretty"] = pretty
234+
if timeout is not None:
235+
__query["timeout"] = timeout
201236
__body = policy if policy is not None else body
202237
__headers = {"accept": "application/json", "content-type": "application/json"}
203238
return await self.perform_request( # type: ignore[return-value]

0 commit comments

Comments
 (0)