Skip to content

Commit 38e2d13

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

File tree

10 files changed

+696
-54
lines changed

10 files changed

+696
-54
lines changed

elasticsearch/_async/client/esql.py

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

2828
@_rewrite_parameters(
29-
body_fields=("query", "columnar", "filter", "locale", "params"),
29+
body_fields=("query", "columnar", "filter", "locale", "params", "profile"),
3030
ignore_deprecated_options={"params"},
3131
)
3232
async def query(
@@ -35,14 +35,18 @@ async def query(
3535
query: t.Optional[str] = None,
3636
columnar: t.Optional[bool] = None,
3737
delimiter: t.Optional[str] = None,
38+
drop_null_columns: t.Optional[bool] = None,
3839
error_trace: t.Optional[bool] = None,
3940
filter: t.Optional[t.Mapping[str, t.Any]] = None,
4041
filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
4142
format: t.Optional[str] = None,
4243
human: t.Optional[bool] = None,
4344
locale: t.Optional[str] = None,
44-
params: t.Optional[t.Sequence[t.Union[None, bool, float, int, str]]] = None,
45+
params: t.Optional[
46+
t.Sequence[t.Union[None, bool, float, int, str, t.Any]]
47+
] = None,
4548
pretty: t.Optional[bool] = None,
49+
profile: t.Optional[bool] = None,
4650
body: t.Optional[t.Dict[str, t.Any]] = None,
4751
) -> ObjectApiResponse[t.Any]:
4852
"""
@@ -58,13 +62,18 @@ async def query(
5862
row represents all the values of a certain column in the results.
5963
:param delimiter: The character to use between values within a CSV row. Only
6064
valid for the CSV format.
65+
:param drop_null_columns: Should columns that are entirely `null` be removed
66+
from the `columns` and `values` portion of the results? Defaults to `false`.
67+
If `true` then the response will include an extra section under the name
68+
`all_columns` which has the name of all columns.
6169
:param filter: Specify a Query DSL query in the filter parameter to filter the
6270
set of documents that an ES|QL query runs on.
6371
:param format: A short version of the Accept header, e.g. json, yaml.
6472
:param locale:
6573
:param params: To avoid any attempts of hacking or code injection, extract the
6674
values in a separate list of parameters. Use question mark placeholders (?)
6775
in the query string for each of the parameters.
76+
:param profile:
6877
"""
6978
if query is None and body is None:
7079
raise ValueError("Empty value passed for parameter 'query'")
@@ -74,6 +83,8 @@ async def query(
7483
__body: t.Dict[str, t.Any] = body if body is not None else {}
7584
if delimiter is not None:
7685
__query["delimiter"] = delimiter
86+
if drop_null_columns is not None:
87+
__query["drop_null_columns"] = drop_null_columns
7788
if error_trace is not None:
7889
__query["error_trace"] = error_trace
7990
if filter_path is not None:
@@ -95,6 +106,8 @@ async def query(
95106
__body["locale"] = locale
96107
if params is not None:
97108
__body["params"] = params
109+
if profile is not None:
110+
__body["profile"] = profile
98111
__headers = {"accept": "application/json", "content-type": "application/json"}
99112
return await self.perform_request( # type: ignore[return-value]
100113
"POST",

elasticsearch/_async/client/indices.py

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -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
@@ -2160,7 +2162,7 @@ async def get_index_template(
21602162
pretty: t.Optional[bool] = None,
21612163
) -> ObjectApiResponse[t.Any]:
21622164
"""
2163-
Returns information about one or more index templates.
2165+
Get index templates. Returns information about one or more index templates.
21642166
21652167
`<https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-get-template.html>`_
21662168
@@ -2412,7 +2414,7 @@ async def get_template(
24122414
pretty: t.Optional[bool] = None,
24132415
) -> ObjectApiResponse[t.Any]:
24142416
"""
2415-
Retrieves information about one or more index templates.
2417+
Get index templates. Retrieves information about one or more index templates.
24162418
24172419
`<https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-get-template-v1.html>`_
24182420
@@ -2924,7 +2926,7 @@ async def put_index_template(
29242926
body: t.Optional[t.Dict[str, t.Any]] = None,
29252927
) -> ObjectApiResponse[t.Any]:
29262928
"""
2927-
Creates or updates an index template. Index templates define settings, mappings,
2929+
Create or update an index template. Index templates define settings, mappings,
29282930
and aliases that can be applied automatically to new indices.
29292931
29302932
`<https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-put-template.html>`_
@@ -3326,7 +3328,7 @@ async def put_template(
33263328
body: t.Optional[t.Dict[str, t.Any]] = None,
33273329
) -> ObjectApiResponse[t.Any]:
33283330
"""
3329-
Creates or updates an index template. Index templates define settings, mappings,
3331+
Create or update an index template. Index templates define settings, mappings,
33303332
and aliases that can be applied automatically to new indices.
33313333
33323334
`<https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-templates-v1.html>`_
@@ -4081,7 +4083,8 @@ async def simulate_index_template(
40814083
pretty: t.Optional[bool] = None,
40824084
) -> ObjectApiResponse[t.Any]:
40834085
"""
4084-
4086+
Simulate an index. Returns the index configuration that would be applied to the
4087+
specified index from an existing index template.
40854088
40864089
`<https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-simulate-index.html>`_
40874090
@@ -4160,7 +4163,8 @@ async def simulate_template(
41604163
body: t.Optional[t.Dict[str, t.Any]] = None,
41614164
) -> ObjectApiResponse[t.Any]:
41624165
"""
4163-
Returns the index configuration that would be applied by a particular index template.
4166+
Simulate an index template. Returns the index configuration that would be applied
4167+
by a particular index template.
41644168
41654169
`<https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-simulate-template.html>`_
41664170

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)