Skip to content

Commit bc6ee64

Browse files
Auto-generated API code
1 parent 3073f9c commit bc6ee64

File tree

10 files changed

+774
-90
lines changed

10 files changed

+774
-90
lines changed

elasticsearch/_async/client/esql.py

Lines changed: 33 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,15 @@
2626
class EsqlClient(NamespacedClient):
2727

2828
@_rewrite_parameters(
29-
body_fields=("query", "columnar", "filter", "locale", "params"),
29+
body_fields=(
30+
"query",
31+
"columnar",
32+
"filter",
33+
"locale",
34+
"params",
35+
"profile",
36+
"tables",
37+
),
3038
ignore_deprecated_options={"params"},
3139
)
3240
async def query(
@@ -35,14 +43,21 @@ async def query(
3543
query: t.Optional[str] = None,
3644
columnar: t.Optional[bool] = None,
3745
delimiter: t.Optional[str] = None,
46+
drop_null_columns: t.Optional[bool] = None,
3847
error_trace: t.Optional[bool] = None,
3948
filter: t.Optional[t.Mapping[str, t.Any]] = None,
4049
filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
4150
format: t.Optional[str] = None,
4251
human: t.Optional[bool] = None,
4352
locale: t.Optional[str] = None,
44-
params: t.Optional[t.Sequence[t.Union[None, bool, float, int, str]]] = None,
53+
params: t.Optional[
54+
t.Sequence[t.Union[None, bool, float, int, str, t.Any]]
55+
] = None,
4556
pretty: t.Optional[bool] = None,
57+
profile: t.Optional[bool] = None,
58+
tables: t.Optional[
59+
t.Mapping[str, t.Mapping[str, t.Mapping[str, t.Any]]]
60+
] = None,
4661
body: t.Optional[t.Dict[str, t.Any]] = None,
4762
) -> ObjectApiResponse[t.Any]:
4863
"""
@@ -58,13 +73,23 @@ async def query(
5873
row represents all the values of a certain column in the results.
5974
:param delimiter: The character to use between values within a CSV row. Only
6075
valid for the CSV format.
76+
:param drop_null_columns: Should columns that are entirely `null` be removed
77+
from the `columns` and `values` portion of the results? Defaults to `false`.
78+
If `true` then the response will include an extra section under the name
79+
`all_columns` which has the name of all columns.
6180
:param filter: Specify a Query DSL query in the filter parameter to filter the
6281
set of documents that an ES|QL query runs on.
6382
:param format: A short version of the Accept header, e.g. json, yaml.
6483
:param locale:
6584
:param params: To avoid any attempts of hacking or code injection, extract the
6685
values in a separate list of parameters. Use question mark placeholders (?)
6786
in the query string for each of the parameters.
87+
:param profile: If provided and `true` the response will include an extra `profile`
88+
object with information on how the query was executed. This information is
89+
for human debugging and its format can change at any time but it can give
90+
some insight into the performance of each part of the query.
91+
:param tables: Tables to use with the LOOKUP operation. The top level key is
92+
the table name and the next level key is the column name.
6893
"""
6994
if query is None and body is None:
7095
raise ValueError("Empty value passed for parameter 'query'")
@@ -74,6 +99,8 @@ async def query(
7499
__body: t.Dict[str, t.Any] = body if body is not None else {}
75100
if delimiter is not None:
76101
__query["delimiter"] = delimiter
102+
if drop_null_columns is not None:
103+
__query["drop_null_columns"] = drop_null_columns
77104
if error_trace is not None:
78105
__query["error_trace"] = error_trace
79106
if filter_path is not None:
@@ -95,6 +122,10 @@ async def query(
95122
__body["locale"] = locale
96123
if params is not None:
97124
__body["params"] = params
125+
if profile is not None:
126+
__body["profile"] = profile
127+
if tables is not None:
128+
__body["tables"] = tables
98129
__headers = {"accept": "application/json", "content-type": "application/json"}
99130
return await self.perform_request( # type: ignore[return-value]
100131
"POST",

elasticsearch/_async/client/indices.py

Lines changed: 35 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -571,8 +571,8 @@ async def create_data_stream(
571571
pretty: t.Optional[bool] = None,
572572
) -> ObjectApiResponse[t.Any]:
573573
"""
574-
Creates a data stream. You must have a matching index template with data stream
575-
enabled.
574+
Create a data stream. Creates a data stream. You must have a matching index template
575+
with data stream enabled.
576576
577577
`<https://www.elastic.co/guide/en/elasticsearch/reference/master/data-streams.html>`_
578578
@@ -624,7 +624,7 @@ async def data_streams_stats(
624624
pretty: t.Optional[bool] = None,
625625
) -> ObjectApiResponse[t.Any]:
626626
"""
627-
Retrieves statistics for one or more data streams.
627+
Get data stream stats. Retrieves statistics for one or more data streams.
628628
629629
`<https://www.elastic.co/guide/en/elasticsearch/reference/master/data-streams.html>`_
630630
@@ -825,8 +825,8 @@ async def delete_data_lifecycle(
825825
timeout: t.Optional[t.Union["t.Literal[-1]", "t.Literal[0]", str]] = None,
826826
) -> ObjectApiResponse[t.Any]:
827827
"""
828-
Removes the data lifecycle from a data stream rendering it not managed by the
829-
data stream lifecycle
828+
Delete data stream lifecycles. Removes the data stream lifecycle from a data
829+
stream, rendering it not managed by the data stream lifecycle.
830830
831831
`<https://www.elastic.co/guide/en/elasticsearch/reference/master/data-streams-delete-lifecycle.html>`_
832832
@@ -885,7 +885,7 @@ async def delete_data_stream(
885885
pretty: t.Optional[bool] = None,
886886
) -> ObjectApiResponse[t.Any]:
887887
"""
888-
Deletes one or more data streams and their backing indices.
888+
Delete data streams. Deletes one or more data streams and their backing indices.
889889
890890
`<https://www.elastic.co/guide/en/elasticsearch/reference/master/data-streams.html>`_
891891
@@ -934,9 +934,10 @@ async def delete_index_template(
934934
timeout: t.Optional[t.Union["t.Literal[-1]", "t.Literal[0]", str]] = None,
935935
) -> ObjectApiResponse[t.Any]:
936936
"""
937-
The provided <index-template> may contain multiple template names separated by
938-
a comma. If multiple template names are specified then there is no wildcard support
939-
and the provided names should match completely with existing templates.
937+
Delete an index template. The provided <index-template> may contain multiple
938+
template names separated by a comma. If multiple template names are specified
939+
then there is no wildcard support and the provided names should match completely
940+
with existing templates.
940941
941942
`<https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-delete-template.html>`_
942943
@@ -1396,7 +1397,8 @@ async def exists_template(
13961397
pretty: t.Optional[bool] = None,
13971398
) -> HeadApiResponse:
13981399
"""
1399-
Returns information about whether a particular index template exists.
1400+
Check existence of index templates. Returns information about whether a particular
1401+
index template exists.
14001402
14011403
`<https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-template-exists-v1.html>`_
14021404
@@ -1955,7 +1957,8 @@ async def get_data_lifecycle(
19551957
pretty: t.Optional[bool] = None,
19561958
) -> ObjectApiResponse[t.Any]:
19571959
"""
1958-
Retrieves the data stream lifecycle configuration of one or more data streams.
1960+
Get data stream lifecycles. Retrieves the data stream lifecycle configuration
1961+
of one or more data streams.
19591962
19601963
`<https://www.elastic.co/guide/en/elasticsearch/reference/master/data-streams-get-lifecycle.html>`_
19611964
@@ -2014,7 +2017,7 @@ async def get_data_stream(
20142017
pretty: t.Optional[bool] = None,
20152018
) -> ObjectApiResponse[t.Any]:
20162019
"""
2017-
Retrieves information about one or more data streams.
2020+
Get data streams. Retrieves information about one or more data streams.
20182021
20192022
`<https://www.elastic.co/guide/en/elasticsearch/reference/master/data-streams.html>`_
20202023
@@ -2160,7 +2163,7 @@ async def get_index_template(
21602163
pretty: t.Optional[bool] = None,
21612164
) -> ObjectApiResponse[t.Any]:
21622165
"""
2163-
Returns information about one or more index templates.
2166+
Get index templates. Returns information about one or more index templates.
21642167
21652168
`<https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-get-template.html>`_
21662169
@@ -2412,7 +2415,7 @@ async def get_template(
24122415
pretty: t.Optional[bool] = None,
24132416
) -> ObjectApiResponse[t.Any]:
24142417
"""
2415-
Retrieves information about one or more index templates.
2418+
Get index templates. Retrieves information about one or more index templates.
24162419
24172420
`<https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-get-template-v1.html>`_
24182421
@@ -2469,14 +2472,14 @@ async def migrate_to_data_stream(
24692472
pretty: t.Optional[bool] = None,
24702473
) -> ObjectApiResponse[t.Any]:
24712474
"""
2472-
Converts an index alias to a data stream. You must have a matching index template
2473-
that is data stream enabled. The alias must meet the following criteria: The
2474-
alias must have a write index; All indices for the alias must have a `@timestamp`
2475-
field mapping of a `date` or `date_nanos` field type; The alias must not have
2476-
any filters; The alias must not use custom routing. If successful, the request
2477-
removes the alias and creates a data stream with the same name. The indices for
2478-
the alias become hidden backing indices for the stream. The write index for the
2479-
alias becomes the write index for the stream.
2475+
Convert an index alias to a data stream. Converts an index alias to a data stream.
2476+
You must have a matching index template that is data stream enabled. The alias
2477+
must meet the following criteria: The alias must have a write index; All indices
2478+
for the alias must have a `@timestamp` field mapping of a `date` or `date_nanos`
2479+
field type; The alias must not have any filters; The alias must not use custom
2480+
routing. If successful, the request removes the alias and creates a data stream
2481+
with the same name. The indices for the alias become hidden backing indices for
2482+
the stream. The write index for the alias becomes the write index for the stream.
24802483
24812484
`<https://www.elastic.co/guide/en/elasticsearch/reference/master/data-streams.html>`_
24822485
@@ -2519,7 +2522,8 @@ async def modify_data_stream(
25192522
body: t.Optional[t.Dict[str, t.Any]] = None,
25202523
) -> ObjectApiResponse[t.Any]:
25212524
"""
2522-
Performs one or more data stream modification actions in a single atomic operation.
2525+
Update data streams. Performs one or more data stream modification actions in
2526+
a single atomic operation.
25232527
25242528
`<https://www.elastic.co/guide/en/elasticsearch/reference/master/data-streams.html>`_
25252529
@@ -2821,7 +2825,8 @@ async def put_data_lifecycle(
28212825
body: t.Optional[t.Dict[str, t.Any]] = None,
28222826
) -> ObjectApiResponse[t.Any]:
28232827
"""
2824-
Update the data lifecycle of the specified data streams.
2828+
Update data stream lifecycles. Update the data stream lifecycle of the specified
2829+
data streams.
28252830
28262831
`<https://www.elastic.co/guide/en/elasticsearch/reference/master/data-streams-put-lifecycle.html>`_
28272832
@@ -2924,7 +2929,7 @@ async def put_index_template(
29242929
body: t.Optional[t.Dict[str, t.Any]] = None,
29252930
) -> ObjectApiResponse[t.Any]:
29262931
"""
2927-
Creates or updates an index template. Index templates define settings, mappings,
2932+
Create or update an index template. Index templates define settings, mappings,
29282933
and aliases that can be applied automatically to new indices.
29292934
29302935
`<https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-put-template.html>`_
@@ -3326,7 +3331,7 @@ async def put_template(
33263331
body: t.Optional[t.Dict[str, t.Any]] = None,
33273332
) -> ObjectApiResponse[t.Any]:
33283333
"""
3329-
Creates or updates an index template. Index templates define settings, mappings,
3334+
Create or update an index template. Index templates define settings, mappings,
33303335
and aliases that can be applied automatically to new indices.
33313336
33323337
`<https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-templates-v1.html>`_
@@ -4081,7 +4086,8 @@ async def simulate_index_template(
40814086
pretty: t.Optional[bool] = None,
40824087
) -> ObjectApiResponse[t.Any]:
40834088
"""
4084-
4089+
Simulate an index. Returns the index configuration that would be applied to the
4090+
specified index from an existing index template.
40854091
40864092
`<https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-simulate-index.html>`_
40874093
@@ -4160,7 +4166,8 @@ async def simulate_template(
41604166
body: t.Optional[t.Dict[str, t.Any]] = None,
41614167
) -> ObjectApiResponse[t.Any]:
41624168
"""
4163-
Returns the index configuration that would be applied by a particular index template.
4169+
Simulate an index template. Returns the index configuration that would be applied
4170+
by a particular index template.
41644171
41654172
`<https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-simulate-template.html>`_
41664173

elasticsearch/_async/client/ml.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ async def close_job(
8888
body: t.Optional[t.Dict[str, t.Any]] = None,
8989
) -> ObjectApiResponse[t.Any]:
9090
"""
91-
Close anomaly detection jobs A job can be opened and closed multiple times throughout
91+
Close anomaly detection jobs. A job can be opened and closed multiple times throughout
9292
its lifecycle. A closed job cannot receive data or perform analysis operations,
9393
but you can still explore and navigate results. When you close a job, it runs
9494
housekeeping tasks such as pruning the model history, flushing buffers, calculating
@@ -579,7 +579,7 @@ async def delete_job(
579579
wait_for_completion: t.Optional[bool] = None,
580580
) -> ObjectApiResponse[t.Any]:
581581
"""
582-
Deletes an anomaly detection job. All job configuration, model state and results
582+
Delete an anomaly detection job. All job configuration, model state and results
583583
are deleted. It is not currently possible to delete multiple jobs using wildcards
584584
or a comma separated list. If you delete a job that has a datafeed, the request
585585
first tries to delete the datafeed. This behavior is equivalent to calling the
@@ -2739,12 +2739,12 @@ async def open_job(
27392739
body: t.Optional[t.Dict[str, t.Any]] = None,
27402740
) -> ObjectApiResponse[t.Any]:
27412741
"""
2742-
Opens one or more anomaly detection jobs. An anomaly detection job must be opened
2743-
in order for it to be ready to receive and analyze data. It can be opened and
2744-
closed multiple times throughout its lifecycle. When you open a new job, it starts
2745-
with an empty model. When you open an existing job, the most recent model state
2746-
is automatically loaded. The job is ready to resume its analysis from where it
2747-
left off, once new data is received.
2742+
Open anomaly detection jobs. An anomaly detection job must be opened in order
2743+
for it to be ready to receive and analyze data. It can be opened and closed multiple
2744+
times throughout its lifecycle. When you open a new job, it starts with an empty
2745+
model. When you open an existing job, the most recent model state is automatically
2746+
loaded. The job is ready to resume its analysis from where it left off, once
2747+
new data is received.
27482748
27492749
`<https://www.elastic.co/guide/en/elasticsearch/reference/master/ml-open-job.html>`_
27502750
@@ -3612,8 +3612,8 @@ async def put_job(
36123612
body: t.Optional[t.Dict[str, t.Any]] = None,
36133613
) -> ObjectApiResponse[t.Any]:
36143614
"""
3615-
Instantiates an anomaly detection job. If you include a `datafeed_config`, you
3616-
must have read index privileges on the source index.
3615+
Create an anomaly detection job. If you include a `datafeed_config`, you must
3616+
have read index privileges on the source index.
36173617
36183618
`<https://www.elastic.co/guide/en/elasticsearch/reference/master/ml-put-job.html>`_
36193619

elasticsearch/_async/client/query_rules.py

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -250,20 +250,23 @@ async def list_rulesets(
250250
)
251251

252252
@_rewrite_parameters(
253-
body_fields=("actions", "criteria", "type"),
253+
body_fields=("actions", "criteria", "type", "priority"),
254254
)
255255
async def put_rule(
256256
self,
257257
*,
258258
ruleset_id: str,
259259
rule_id: str,
260260
actions: t.Optional[t.Mapping[str, t.Any]] = None,
261-
criteria: t.Optional[t.Sequence[t.Mapping[str, t.Any]]] = None,
261+
criteria: t.Optional[
262+
t.Union[t.Mapping[str, t.Any], t.Sequence[t.Mapping[str, t.Any]]]
263+
] = None,
262264
type: t.Optional[t.Union["t.Literal['pinned']", str]] = None,
263265
error_trace: t.Optional[bool] = None,
264266
filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
265267
human: t.Optional[bool] = None,
266268
pretty: t.Optional[bool] = None,
269+
priority: t.Optional[int] = None,
267270
body: t.Optional[t.Dict[str, t.Any]] = None,
268271
) -> ObjectApiResponse[t.Any]:
269272
"""
@@ -278,6 +281,7 @@ async def put_rule(
278281
:param actions:
279282
:param criteria:
280283
:param type:
284+
:param priority:
281285
"""
282286
if ruleset_id in SKIP_IN_PATH:
283287
raise ValueError("Empty value passed for parameter 'ruleset_id'")
@@ -311,6 +315,8 @@ async def put_rule(
311315
__body["criteria"] = criteria
312316
if type is not None:
313317
__body["type"] = type
318+
if priority is not None:
319+
__body["priority"] = priority
314320
__headers = {"accept": "application/json", "content-type": "application/json"}
315321
return await self.perform_request( # type: ignore[return-value]
316322
"PUT",
@@ -329,7 +335,9 @@ async def put_ruleset(
329335
self,
330336
*,
331337
ruleset_id: str,
332-
rules: t.Optional[t.Sequence[t.Mapping[str, t.Any]]] = None,
338+
rules: t.Optional[
339+
t.Union[t.Mapping[str, t.Any], t.Sequence[t.Mapping[str, t.Any]]]
340+
] = None,
333341
error_trace: t.Optional[bool] = None,
334342
filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
335343
human: t.Optional[bool] = None,

0 commit comments

Comments
 (0)