Skip to content

Commit 7ae3235

Browse files
Auto-generated API code (#2855)
1 parent 5d7db56 commit 7ae3235

File tree

12 files changed

+607
-107
lines changed

12 files changed

+607
-107
lines changed

elasticsearch/_async/client/__init__.py

+35-22
Original file line numberDiff line numberDiff line change
@@ -5884,7 +5884,20 @@ async def terms_enum(
58845884
)
58855885

58865886
@_rewrite_parameters(
5887-
body_fields=("doc", "filter", "per_field_analyzer"),
5887+
body_fields=(
5888+
"doc",
5889+
"field_statistics",
5890+
"fields",
5891+
"filter",
5892+
"offsets",
5893+
"payloads",
5894+
"per_field_analyzer",
5895+
"positions",
5896+
"routing",
5897+
"term_statistics",
5898+
"version",
5899+
"version_type",
5900+
),
58885901
)
58895902
async def termvectors(
58905903
self,
@@ -5961,9 +5974,9 @@ async def termvectors(
59615974
(the sum of document frequencies for all terms in this field). * The sum
59625975
of total term frequencies (the sum of total term frequencies of each term
59635976
in this field).
5964-
:param fields: A comma-separated list or wildcard expressions of fields to include
5965-
in the statistics. It is used as the default list unless a specific field
5966-
list is provided in the `completion_fields` or `fielddata_fields` parameters.
5977+
:param fields: A list of fields to include in the statistics. It is used as the
5978+
default list unless a specific field list is provided in the `completion_fields`
5979+
or `fielddata_fields` parameters.
59675980
:param filter: Filter terms based on their tf-idf scores. This could be useful
59685981
in order find out a good characteristic vector of a document. This feature
59695982
works in a similar manner to the second phase of the More Like This Query.
@@ -6001,41 +6014,41 @@ async def termvectors(
60016014
__body: t.Dict[str, t.Any] = body if body is not None else {}
60026015
if error_trace is not None:
60036016
__query["error_trace"] = error_trace
6004-
if field_statistics is not None:
6005-
__query["field_statistics"] = field_statistics
6006-
if fields is not None:
6007-
__query["fields"] = fields
60086017
if filter_path is not None:
60096018
__query["filter_path"] = filter_path
60106019
if human is not None:
60116020
__query["human"] = human
6012-
if offsets is not None:
6013-
__query["offsets"] = offsets
6014-
if payloads is not None:
6015-
__query["payloads"] = payloads
6016-
if positions is not None:
6017-
__query["positions"] = positions
60186021
if preference is not None:
60196022
__query["preference"] = preference
60206023
if pretty is not None:
60216024
__query["pretty"] = pretty
60226025
if realtime is not None:
60236026
__query["realtime"] = realtime
6024-
if routing is not None:
6025-
__query["routing"] = routing
6026-
if term_statistics is not None:
6027-
__query["term_statistics"] = term_statistics
6028-
if version is not None:
6029-
__query["version"] = version
6030-
if version_type is not None:
6031-
__query["version_type"] = version_type
60326027
if not __body:
60336028
if doc is not None:
60346029
__body["doc"] = doc
6030+
if field_statistics is not None:
6031+
__body["field_statistics"] = field_statistics
6032+
if fields is not None:
6033+
__body["fields"] = fields
60356034
if filter is not None:
60366035
__body["filter"] = filter
6036+
if offsets is not None:
6037+
__body["offsets"] = offsets
6038+
if payloads is not None:
6039+
__body["payloads"] = payloads
60376040
if per_field_analyzer is not None:
60386041
__body["per_field_analyzer"] = per_field_analyzer
6042+
if positions is not None:
6043+
__body["positions"] = positions
6044+
if routing is not None:
6045+
__body["routing"] = routing
6046+
if term_statistics is not None:
6047+
__body["term_statistics"] = term_statistics
6048+
if version is not None:
6049+
__body["version"] = version
6050+
if version_type is not None:
6051+
__body["version_type"] = version_type
60396052
if not __body:
60406053
__body = None # type: ignore[assignment]
60416054
__headers = {"accept": "application/json"}

elasticsearch/_async/client/esql.py

+15-2
Original file line numberDiff line numberDiff line change
@@ -35,13 +35,15 @@ class EsqlClient(NamespacedClient):
3535
"params",
3636
"profile",
3737
"tables",
38+
"wait_for_completion_timeout",
3839
),
3940
ignore_deprecated_options={"params"},
4041
)
4142
async def async_query(
4243
self,
4344
*,
4445
query: t.Optional[str] = None,
46+
allow_partial_results: t.Optional[bool] = None,
4547
columnar: t.Optional[bool] = None,
4648
delimiter: t.Optional[str] = None,
4749
drop_null_columns: t.Optional[bool] = None,
@@ -84,6 +86,9 @@ async def async_query(
8486
8587
:param query: The ES|QL query API accepts an ES|QL query string in the query
8688
parameter, runs it, and returns the results.
89+
:param allow_partial_results: If `true`, partial results will be returned if
90+
there are shard failures, but the query can continue to execute on other
91+
clusters and shards.
8792
:param columnar: By default, ES|QL returns results as rows. For example, FROM
8893
returns each individual document as one row. For the JSON, YAML, CBOR and
8994
smile formats, ES|QL can return the results in a columnar fashion where one
@@ -132,6 +137,8 @@ async def async_query(
132137
__path = "/_query/async"
133138
__query: t.Dict[str, t.Any] = {}
134139
__body: t.Dict[str, t.Any] = body if body is not None else {}
140+
if allow_partial_results is not None:
141+
__query["allow_partial_results"] = allow_partial_results
135142
if delimiter is not None:
136143
__query["delimiter"] = delimiter
137144
if drop_null_columns is not None:
@@ -150,8 +157,6 @@ async def async_query(
150157
__query["keep_on_completion"] = keep_on_completion
151158
if pretty is not None:
152159
__query["pretty"] = pretty
153-
if wait_for_completion_timeout is not None:
154-
__query["wait_for_completion_timeout"] = wait_for_completion_timeout
155160
if not __body:
156161
if query is not None:
157162
__body["query"] = query
@@ -169,6 +174,8 @@ async def async_query(
169174
__body["profile"] = profile
170175
if tables is not None:
171176
__body["tables"] = tables
177+
if wait_for_completion_timeout is not None:
178+
__body["wait_for_completion_timeout"] = wait_for_completion_timeout
172179
__headers = {"accept": "application/json", "content-type": "application/json"}
173180
return await self.perform_request( # type: ignore[return-value]
174181
"POST",
@@ -376,6 +383,7 @@ async def query(
376383
self,
377384
*,
378385
query: t.Optional[str] = None,
386+
allow_partial_results: t.Optional[bool] = None,
379387
columnar: t.Optional[bool] = None,
380388
delimiter: t.Optional[str] = None,
381389
drop_null_columns: t.Optional[bool] = None,
@@ -412,6 +420,9 @@ async def query(
412420
413421
:param query: The ES|QL query API accepts an ES|QL query string in the query
414422
parameter, runs it, and returns the results.
423+
:param allow_partial_results: If `true`, partial results will be returned if
424+
there are shard failures, but the query can continue to execute on other
425+
clusters and shards.
415426
:param columnar: By default, ES|QL returns results as rows. For example, FROM
416427
returns each individual document as one row. For the JSON, YAML, CBOR and
417428
smile formats, ES|QL can return the results in a columnar fashion where one
@@ -446,6 +457,8 @@ async def query(
446457
__path = "/_query"
447458
__query: t.Dict[str, t.Any] = {}
448459
__body: t.Dict[str, t.Any] = body if body is not None else {}
460+
if allow_partial_results is not None:
461+
__query["allow_partial_results"] = allow_partial_results
449462
if delimiter is not None:
450463
__query["delimiter"] = delimiter
451464
if drop_null_columns is not None:

elasticsearch/_async/client/indices.py

+42-9
Original file line numberDiff line numberDiff line change
@@ -1622,7 +1622,9 @@ async def exists_index_template(
16221622
name: str,
16231623
error_trace: t.Optional[bool] = None,
16241624
filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
1625+
flat_settings: t.Optional[bool] = None,
16251626
human: t.Optional[bool] = None,
1627+
local: t.Optional[bool] = None,
16261628
master_timeout: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
16271629
pretty: t.Optional[bool] = None,
16281630
) -> HeadApiResponse:
@@ -1637,6 +1639,10 @@ async def exists_index_template(
16371639
16381640
:param name: Comma-separated list of index template names used to limit the request.
16391641
Wildcard (*) expressions are supported.
1642+
:param flat_settings: If true, returns settings in flat format.
1643+
:param local: If true, the request retrieves information from the local node
1644+
only. Defaults to false, which means information is retrieved from the master
1645+
node.
16401646
:param master_timeout: Period to wait for a connection to the master node. If
16411647
no response is received before the timeout expires, the request fails and
16421648
returns an error.
@@ -1650,8 +1656,12 @@ async def exists_index_template(
16501656
__query["error_trace"] = error_trace
16511657
if filter_path is not None:
16521658
__query["filter_path"] = filter_path
1659+
if flat_settings is not None:
1660+
__query["flat_settings"] = flat_settings
16531661
if human is not None:
16541662
__query["human"] = human
1663+
if local is not None:
1664+
__query["local"] = local
16551665
if master_timeout is not None:
16561666
__query["master_timeout"] = master_timeout
16571667
if pretty is not None:
@@ -1801,9 +1811,6 @@ async def field_usage_stats(
18011811
human: t.Optional[bool] = None,
18021812
ignore_unavailable: t.Optional[bool] = None,
18031813
pretty: t.Optional[bool] = None,
1804-
wait_for_active_shards: t.Optional[
1805-
t.Union[int, t.Union[str, t.Literal["all", "index-setting"]]]
1806-
] = None,
18071814
) -> ObjectApiResponse[t.Any]:
18081815
"""
18091816
.. raw:: html
@@ -1833,9 +1840,6 @@ async def field_usage_stats(
18331840
in the statistics.
18341841
:param ignore_unavailable: If `true`, missing or closed indices are not included
18351842
in the response.
1836-
:param wait_for_active_shards: The number of shard copies that must be active
1837-
before proceeding with the operation. Set to all or any positive integer
1838-
up to the total number of shards in the index (`number_of_replicas+1`).
18391843
"""
18401844
if index in SKIP_IN_PATH:
18411845
raise ValueError("Empty value passed for parameter 'index'")
@@ -1858,8 +1862,6 @@ async def field_usage_stats(
18581862
__query["ignore_unavailable"] = ignore_unavailable
18591863
if pretty is not None:
18601864
__query["pretty"] = pretty
1861-
if wait_for_active_shards is not None:
1862-
__query["wait_for_active_shards"] = wait_for_active_shards
18631865
__headers = {"accept": "application/json"}
18641866
return await self.perform_request( # type: ignore[return-value]
18651867
"GET",
@@ -3835,6 +3837,7 @@ async def put_settings(
38353837
master_timeout: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
38363838
preserve_existing: t.Optional[bool] = None,
38373839
pretty: t.Optional[bool] = None,
3840+
reopen: t.Optional[bool] = None,
38383841
timeout: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
38393842
) -> ObjectApiResponse[t.Any]:
38403843
"""
@@ -3877,6 +3880,9 @@ async def put_settings(
38773880
no response is received before the timeout expires, the request fails and
38783881
returns an error.
38793882
:param preserve_existing: If `true`, existing index settings remain unchanged.
3883+
:param reopen: Whether to close and reopen the index to apply non-dynamic settings.
3884+
If set to `true` the indices to which the settings are being applied will
3885+
be closed temporarily and then reopened in order to apply the changes.
38803886
:param timeout: Period to wait for a response. If no response is received before
38813887
the timeout expires, the request fails and returns an error.
38823888
"""
@@ -3914,6 +3920,8 @@ async def put_settings(
39143920
__query["preserve_existing"] = preserve_existing
39153921
if pretty is not None:
39163922
__query["pretty"] = pretty
3923+
if reopen is not None:
3924+
__query["reopen"] = reopen
39173925
if timeout is not None:
39183926
__query["timeout"] = timeout
39193927
__body = settings if settings is not None else body
@@ -3981,7 +3989,7 @@ async def put_template(
39813989
39823990
:param name: The name of the template
39833991
:param aliases: Aliases for the index.
3984-
:param cause:
3992+
:param cause: User defined reason for creating/updating the index template
39853993
:param create: If true, this request cannot replace or update existing index
39863994
templates.
39873995
:param index_patterns: Array of wildcard expressions used to match the names
@@ -4219,6 +4227,7 @@ async def reload_search_analyzers(
42194227
human: t.Optional[bool] = None,
42204228
ignore_unavailable: t.Optional[bool] = None,
42214229
pretty: t.Optional[bool] = None,
4230+
resource: t.Optional[str] = None,
42224231
) -> ObjectApiResponse[t.Any]:
42234232
"""
42244233
.. raw:: html
@@ -4246,6 +4255,7 @@ async def reload_search_analyzers(
42464255
that are open, closed or both.
42474256
:param ignore_unavailable: Whether specified concrete indices should be ignored
42484257
when unavailable (missing or closed)
4258+
:param resource: Changed resource to reload analyzers from if applicable
42494259
"""
42504260
if index in SKIP_IN_PATH:
42514261
raise ValueError("Empty value passed for parameter 'index'")
@@ -4266,6 +4276,8 @@ async def reload_search_analyzers(
42664276
__query["ignore_unavailable"] = ignore_unavailable
42674277
if pretty is not None:
42684278
__query["pretty"] = pretty
4279+
if resource is not None:
4280+
__query["resource"] = resource
42694281
__headers = {"accept": "application/json"}
42704282
return await self.perform_request( # type: ignore[return-value]
42714283
"POST",
@@ -4502,6 +4514,7 @@ async def rollover(
45024514
error_trace: t.Optional[bool] = None,
45034515
filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
45044516
human: t.Optional[bool] = None,
4517+
lazy: t.Optional[bool] = None,
45054518
mappings: t.Optional[t.Mapping[str, t.Any]] = None,
45064519
master_timeout: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
45074520
pretty: t.Optional[bool] = None,
@@ -4558,6 +4571,9 @@ async def rollover(
45584571
conditions are satisfied.
45594572
:param dry_run: If `true`, checks whether the current index satisfies the specified
45604573
conditions but does not perform a rollover.
4574+
:param lazy: If set to true, the rollover action will only mark a data stream
4575+
to signal that it needs to be rolled over at the next write. Only allowed
4576+
on data streams.
45614577
:param mappings: Mapping for fields in the index. If specified, this mapping
45624578
can include field names, field data types, and mapping paramaters.
45634579
:param master_timeout: Period to wait for a connection to the master node. If
@@ -4592,6 +4608,8 @@ async def rollover(
45924608
__query["filter_path"] = filter_path
45934609
if human is not None:
45944610
__query["human"] = human
4611+
if lazy is not None:
4612+
__query["lazy"] = lazy
45954613
if master_timeout is not None:
45964614
__query["master_timeout"] = master_timeout
45974615
if pretty is not None:
@@ -4908,6 +4926,8 @@ async def simulate_index_template(
49084926
self,
49094927
*,
49104928
name: str,
4929+
cause: t.Optional[str] = None,
4930+
create: t.Optional[bool] = None,
49114931
error_trace: t.Optional[bool] = None,
49124932
filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
49134933
human: t.Optional[bool] = None,
@@ -4925,6 +4945,10 @@ async def simulate_index_template(
49254945
`<https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-indices-simulate-index-template>`_
49264946
49274947
:param name: Name of the index to simulate
4948+
:param cause: User defined reason for dry-run creating the new template for simulation
4949+
purposes
4950+
:param create: Whether the index template we optionally defined in the body should
4951+
only be dry-run added if new or can also replace an existing one
49284952
:param include_defaults: If true, returns all relevant default configurations
49294953
for the index template.
49304954
:param master_timeout: Period to wait for a connection to the master node. If
@@ -4936,6 +4960,10 @@ async def simulate_index_template(
49364960
__path_parts: t.Dict[str, str] = {"name": _quote(name)}
49374961
__path = f'/_index_template/_simulate_index/{__path_parts["name"]}'
49384962
__query: t.Dict[str, t.Any] = {}
4963+
if cause is not None:
4964+
__query["cause"] = cause
4965+
if create is not None:
4966+
__query["create"] = create
49394967
if error_trace is not None:
49404968
__query["error_trace"] = error_trace
49414969
if filter_path is not None:
@@ -4978,6 +5006,7 @@ async def simulate_template(
49785006
*,
49795007
name: t.Optional[str] = None,
49805008
allow_auto_create: t.Optional[bool] = None,
5009+
cause: t.Optional[str] = None,
49815010
composed_of: t.Optional[t.Sequence[str]] = None,
49825011
create: t.Optional[bool] = None,
49835012
data_stream: t.Optional[t.Mapping[str, t.Any]] = None,
@@ -5014,6 +5043,8 @@ async def simulate_template(
50145043
via `actions.auto_create_index`. If set to `false`, then indices or data
50155044
streams matching the template must always be explicitly created, and may
50165045
never be automatically created.
5046+
:param cause: User defined reason for dry-run creating the new template for simulation
5047+
purposes
50175048
:param composed_of: An ordered list of component template names. Component templates
50185049
are merged in the order specified, meaning that the last component template
50195050
specified has the highest precedence.
@@ -5058,6 +5089,8 @@ async def simulate_template(
50585089
__path = "/_index_template/_simulate"
50595090
__query: t.Dict[str, t.Any] = {}
50605091
__body: t.Dict[str, t.Any] = body if body is not None else {}
5092+
if cause is not None:
5093+
__query["cause"] = cause
50615094
if create is not None:
50625095
__query["create"] = create
50635096
if error_trace is not None:

0 commit comments

Comments
 (0)