Skip to content

Commit 9097e78

Browse files
Auto-generated API code
1 parent 41f4ef7 commit 9097e78

File tree

16 files changed

+494
-260
lines changed

16 files changed

+494
-260
lines changed

elasticsearch_serverless/_async/client/__init__.py

Lines changed: 41 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2271,6 +2271,7 @@ async def msearch(
22712271
human: t.Optional[bool] = None,
22722272
ignore_throttled: t.Optional[bool] = None,
22732273
ignore_unavailable: t.Optional[bool] = None,
2274+
include_named_queries_score: t.Optional[bool] = None,
22742275
max_concurrent_searches: t.Optional[int] = None,
22752276
max_concurrent_shard_requests: t.Optional[int] = None,
22762277
pre_filter_shard_size: t.Optional[int] = None,
@@ -2304,6 +2305,13 @@ async def msearch(
23042305
when frozen.
23052306
:param ignore_unavailable: If true, missing or closed indices are not included
23062307
in the response.
2308+
:param include_named_queries_score: Indicates whether hit.matched_queries should
2309+
be rendered as a map that includes the name of the matched query associated
2310+
with its score (true) or as an array containing the name of the matched queries
2311+
(false) This functionality reruns each named query on every hit in a search
2312+
response. Typically, this adds a small overhead to a request. However, using
2313+
computationally expensive named queries on a large number of hits may add
2314+
significant overhead.
23072315
:param max_concurrent_searches: Maximum number of concurrent searches the multi
23082316
search API can execute.
23092317
:param max_concurrent_shard_requests: Maximum number of concurrent shard requests
@@ -2353,6 +2361,8 @@ async def msearch(
23532361
__query["ignore_throttled"] = ignore_throttled
23542362
if ignore_unavailable is not None:
23552363
__query["ignore_unavailable"] = ignore_unavailable
2364+
if include_named_queries_score is not None:
2365+
__query["include_named_queries_score"] = include_named_queries_score
23562366
if max_concurrent_searches is not None:
23572367
__query["max_concurrent_searches"] = max_concurrent_searches
23582368
if max_concurrent_shard_requests is not None:
@@ -2585,7 +2595,9 @@ async def mtermvectors(
25852595
path_parts=__path_parts,
25862596
)
25872597

2588-
@_rewrite_parameters()
2598+
@_rewrite_parameters(
2599+
body_fields=("index_filter",),
2600+
)
25892601
async def open_point_in_time(
25902602
self,
25912603
*,
@@ -2603,9 +2615,11 @@ async def open_point_in_time(
26032615
filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
26042616
human: t.Optional[bool] = None,
26052617
ignore_unavailable: t.Optional[bool] = None,
2618+
index_filter: t.Optional[t.Mapping[str, t.Any]] = None,
26062619
preference: t.Optional[str] = None,
26072620
pretty: t.Optional[bool] = None,
26082621
routing: t.Optional[str] = None,
2622+
body: t.Optional[t.Dict[str, t.Any]] = None,
26092623
) -> ObjectApiResponse[t.Any]:
26102624
"""
26112625
A search request by default executes against the most recent visible data of
@@ -2627,17 +2641,20 @@ async def open_point_in_time(
26272641
as `open,hidden`. Valid values are: `all`, `open`, `closed`, `hidden`, `none`.
26282642
:param ignore_unavailable: If `false`, the request returns an error if it targets
26292643
a missing or closed index.
2644+
:param index_filter: Allows to filter indices if the provided query rewrites
2645+
to `match_none` on every shard.
26302646
:param preference: Specifies the node or shard the operation should be performed
26312647
on. Random by default.
26322648
:param routing: Custom value used to route operations to a specific shard.
26332649
"""
26342650
if index in SKIP_IN_PATH:
26352651
raise ValueError("Empty value passed for parameter 'index'")
2636-
if keep_alive is None:
2652+
if keep_alive is None and body is None:
26372653
raise ValueError("Empty value passed for parameter 'keep_alive'")
26382654
__path_parts: t.Dict[str, str] = {"index": _quote(index)}
26392655
__path = f'/{__path_parts["index"]}/_pit'
26402656
__query: t.Dict[str, t.Any] = {}
2657+
__body: t.Dict[str, t.Any] = body if body is not None else {}
26412658
if keep_alive is not None:
26422659
__query["keep_alive"] = keep_alive
26432660
if error_trace is not None:
@@ -2656,12 +2673,20 @@ async def open_point_in_time(
26562673
__query["pretty"] = pretty
26572674
if routing is not None:
26582675
__query["routing"] = routing
2676+
if not __body:
2677+
if index_filter is not None:
2678+
__body["index_filter"] = index_filter
2679+
if not __body:
2680+
__body = None # type: ignore[assignment]
26592681
__headers = {"accept": "application/json"}
2682+
if __body is not None:
2683+
__headers["content-type"] = "application/json"
26602684
return await self.perform_request( # type: ignore[return-value]
26612685
"POST",
26622686
__path,
26632687
params=__query,
26642688
headers=__headers,
2689+
body=__body,
26652690
endpoint_id="open_point_in_time",
26662691
path_parts=__path_parts,
26672692
)
@@ -3221,6 +3246,7 @@ async def search(
32213246
human: t.Optional[bool] = None,
32223247
ignore_throttled: t.Optional[bool] = None,
32233248
ignore_unavailable: t.Optional[bool] = None,
3249+
include_named_queries_score: t.Optional[bool] = None,
32243250
indices_boost: t.Optional[t.Sequence[t.Mapping[str, float]]] = None,
32253251
knn: t.Optional[
32263252
t.Union[t.Mapping[str, t.Any], t.Sequence[t.Mapping[str, t.Any]]]
@@ -3348,6 +3374,13 @@ async def search(
33483374
be ignored when frozen.
33493375
:param ignore_unavailable: If `false`, the request returns an error if it targets
33503376
a missing or closed index.
3377+
:param include_named_queries_score: Indicates whether hit.matched_queries should
3378+
be rendered as a map that includes the name of the matched query associated
3379+
with its score (true) or as an array containing the name of the matched queries
3380+
(false) This functionality reruns each named query on every hit in a search
3381+
response. Typically, this adds a small overhead to a request. However, using
3382+
computationally expensive named queries on a large number of hits may add
3383+
significant overhead.
33513384
:param indices_boost: Boosts the _score of documents from specified indices.
33523385
:param knn: Defines the approximate kNN search to run.
33533386
:param lenient: If `true`, format-based query failures (such as providing text
@@ -3529,6 +3562,8 @@ async def search(
35293562
__query["ignore_throttled"] = ignore_throttled
35303563
if ignore_unavailable is not None:
35313564
__query["ignore_unavailable"] = ignore_unavailable
3565+
if include_named_queries_score is not None:
3566+
__query["include_named_queries_score"] = include_named_queries_score
35323567
if lenient is not None:
35333568
__query["lenient"] = lenient
35343569
if max_concurrent_shard_requests is not None:
@@ -4389,6 +4424,7 @@ async def update_by_query(
43894424
pipeline: t.Optional[str] = None,
43904425
preference: t.Optional[str] = None,
43914426
pretty: t.Optional[bool] = None,
4427+
q: t.Optional[str] = None,
43924428
query: t.Optional[t.Mapping[str, t.Any]] = None,
43934429
refresh: t.Optional[bool] = None,
43944430
request_cache: t.Optional[bool] = None,
@@ -4455,6 +4491,7 @@ async def update_by_query(
44554491
parameter.
44564492
:param preference: Specifies the node or shard the operation should be performed
44574493
on. Random by default.
4494+
:param q: Query in the Lucene query string syntax.
44584495
:param query: Specifies the documents to update using the Query DSL.
44594496
:param refresh: If `true`, Elasticsearch refreshes affected shards to make the
44604497
operation visible to search.
@@ -4539,6 +4576,8 @@ async def update_by_query(
45394576
__query["preference"] = preference
45404577
if pretty is not None:
45414578
__query["pretty"] = pretty
4579+
if q is not None:
4580+
__query["q"] = q
45424581
if refresh is not None:
45434582
__query["refresh"] = refresh
45444583
if request_cache is not None:

elasticsearch_serverless/_async/client/cat.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ async def count(
223223
) -> t.Union[ObjectApiResponse[t.Any], TextApiResponse]:
224224
"""
225225
Get a document count. Provides quick access to a document count for a data stream,
226-
an index, or an entire cluster.n/ The document count only includes live documents,
226+
an index, or an entire cluster. The document count only includes live documents,
227227
not deleted documents which have not yet been removed by the merge process. CAT
228228
APIs are only intended for human consumption using the command line or Kibana
229229
console. They are not intended for use by applications. For application consumption,

elasticsearch_serverless/_async/client/cluster.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -284,7 +284,7 @@ async def put_component_template(
284284
`<https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-component-template.html>`_
285285
286286
:param name: Name of the component template to create. Elasticsearch includes
287-
the following built-in component templates: `logs-mappings`; 'logs-settings`;
287+
the following built-in component templates: `logs-mappings`; `logs-settings`;
288288
`metrics-mappings`; `metrics-settings`;`synthetics-mapping`; `synthetics-settings`.
289289
Elastic Agent uses these templates to configure backing indices for its data
290290
streams. If you use Elastic Agent and want to overwrite one of these templates,

elasticsearch_serverless/_async/client/indices.py

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -303,7 +303,9 @@ async def create_data_stream(
303303
error_trace: t.Optional[bool] = None,
304304
filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
305305
human: t.Optional[bool] = None,
306+
master_timeout: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
306307
pretty: t.Optional[bool] = None,
308+
timeout: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
307309
) -> ObjectApiResponse[t.Any]:
308310
"""
309311
Create a data stream. Creates a data stream. You must have a matching index template
@@ -316,6 +318,11 @@ async def create_data_stream(
316318
`#`, `:`, or a space character; Cannot start with `-`, `_`, `+`, or `.ds-`;
317319
Cannot be `.` or `..`; Cannot be longer than 255 bytes. Multi-byte characters
318320
count towards this limit faster.
321+
:param master_timeout: Period to wait for a connection to the master node. If
322+
no response is received before the timeout expires, the request fails and
323+
returns an error.
324+
:param timeout: Period to wait for a response. If no response is received before
325+
the timeout expires, the request fails and returns an error.
319326
"""
320327
if name in SKIP_IN_PATH:
321328
raise ValueError("Empty value passed for parameter 'name'")
@@ -328,8 +335,12 @@ async def create_data_stream(
328335
__query["filter_path"] = filter_path
329336
if human is not None:
330337
__query["human"] = human
338+
if master_timeout is not None:
339+
__query["master_timeout"] = master_timeout
331340
if pretty is not None:
332341
__query["pretty"] = pretty
342+
if timeout is not None:
343+
__query["timeout"] = timeout
333344
__headers = {"accept": "application/json"}
334345
return await self.perform_request( # type: ignore[return-value]
335346
"PUT",
@@ -611,6 +622,7 @@ async def delete_data_stream(
611622
] = None,
612623
filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
613624
human: t.Optional[bool] = None,
625+
master_timeout: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
614626
pretty: t.Optional[bool] = None,
615627
) -> ObjectApiResponse[t.Any]:
616628
"""
@@ -622,6 +634,9 @@ async def delete_data_stream(
622634
are supported.
623635
:param expand_wildcards: Type of data stream that wildcard patterns can match.
624636
Supports comma-separated values,such as `open,hidden`.
637+
:param master_timeout: Period to wait for a connection to the master node. If
638+
no response is received before the timeout expires, the request fails and
639+
returns an error.
625640
"""
626641
if name in SKIP_IN_PATH:
627642
raise ValueError("Empty value passed for parameter 'name'")
@@ -636,6 +651,8 @@ async def delete_data_stream(
636651
__query["filter_path"] = filter_path
637652
if human is not None:
638653
__query["human"] = human
654+
if master_timeout is not None:
655+
__query["master_timeout"] = master_timeout
639656
if pretty is not None:
640657
__query["pretty"] = pretty
641658
__headers = {"accept": "application/json"}
@@ -1162,6 +1179,7 @@ async def get_data_lifecycle(
11621179
filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
11631180
human: t.Optional[bool] = None,
11641181
include_defaults: t.Optional[bool] = None,
1182+
master_timeout: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
11651183
pretty: t.Optional[bool] = None,
11661184
) -> ObjectApiResponse[t.Any]:
11671185
"""
@@ -1177,6 +1195,9 @@ async def get_data_lifecycle(
11771195
Supports comma-separated values, such as `open,hidden`. Valid values are:
11781196
`all`, `open`, `closed`, `hidden`, `none`.
11791197
:param include_defaults: If `true`, return all default settings in the response.
1198+
:param master_timeout: Period to wait for a connection to the master node. If
1199+
no response is received before the timeout expires, the request fails and
1200+
returns an error.
11801201
"""
11811202
if name in SKIP_IN_PATH:
11821203
raise ValueError("Empty value passed for parameter 'name'")
@@ -1193,6 +1214,8 @@ async def get_data_lifecycle(
11931214
__query["human"] = human
11941215
if include_defaults is not None:
11951216
__query["include_defaults"] = include_defaults
1217+
if master_timeout is not None:
1218+
__query["master_timeout"] = master_timeout
11961219
if pretty is not None:
11971220
__query["pretty"] = pretty
11981221
__headers = {"accept": "application/json"}
@@ -1222,7 +1245,9 @@ async def get_data_stream(
12221245
filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
12231246
human: t.Optional[bool] = None,
12241247
include_defaults: t.Optional[bool] = None,
1248+
master_timeout: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
12251249
pretty: t.Optional[bool] = None,
1250+
verbose: t.Optional[bool] = None,
12261251
) -> ObjectApiResponse[t.Any]:
12271252
"""
12281253
Get data streams. Retrieves information about one or more data streams.
@@ -1236,6 +1261,11 @@ async def get_data_stream(
12361261
Supports comma-separated values, such as `open,hidden`.
12371262
:param include_defaults: If true, returns all relevant default configurations
12381263
for the index template.
1264+
:param master_timeout: Period to wait for a connection to the master node. If
1265+
no response is received before the timeout expires, the request fails and
1266+
returns an error.
1267+
:param verbose: Whether the maximum timestamp for each data stream should be
1268+
calculated and returned.
12391269
"""
12401270
__path_parts: t.Dict[str, str]
12411271
if name not in SKIP_IN_PATH:
@@ -1255,8 +1285,12 @@ async def get_data_stream(
12551285
__query["human"] = human
12561286
if include_defaults is not None:
12571287
__query["include_defaults"] = include_defaults
1288+
if master_timeout is not None:
1289+
__query["master_timeout"] = master_timeout
12581290
if pretty is not None:
12591291
__query["pretty"] = pretty
1292+
if verbose is not None:
1293+
__query["verbose"] = verbose
12601294
__headers = {"accept": "application/json"}
12611295
return await self.perform_request( # type: ignore[return-value]
12621296
"GET",
@@ -1522,7 +1556,9 @@ async def migrate_to_data_stream(
15221556
error_trace: t.Optional[bool] = None,
15231557
filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
15241558
human: t.Optional[bool] = None,
1559+
master_timeout: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
15251560
pretty: t.Optional[bool] = None,
1561+
timeout: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
15261562
) -> ObjectApiResponse[t.Any]:
15271563
"""
15281564
Convert an index alias to a data stream. Converts an index alias to a data stream.
@@ -1537,6 +1573,11 @@ async def migrate_to_data_stream(
15371573
`<https://www.elastic.co/guide/en/elasticsearch/reference/master/data-streams.html>`_
15381574
15391575
:param name: Name of the index alias to convert to a data stream.
1576+
:param master_timeout: Period to wait for a connection to the master node. If
1577+
no response is received before the timeout expires, the request fails and
1578+
returns an error.
1579+
:param timeout: Period to wait for a response. If no response is received before
1580+
the timeout expires, the request fails and returns an error.
15401581
"""
15411582
if name in SKIP_IN_PATH:
15421583
raise ValueError("Empty value passed for parameter 'name'")
@@ -1549,8 +1590,12 @@ async def migrate_to_data_stream(
15491590
__query["filter_path"] = filter_path
15501591
if human is not None:
15511592
__query["human"] = human
1593+
if master_timeout is not None:
1594+
__query["master_timeout"] = master_timeout
15521595
if pretty is not None:
15531596
__query["pretty"] = pretty
1597+
if timeout is not None:
1598+
__query["timeout"] = timeout
15541599
__headers = {"accept": "application/json"}
15551600
return await self.perform_request( # type: ignore[return-value]
15561601
"POST",
@@ -2383,6 +2428,7 @@ async def resolve_index(
23832428
self,
23842429
*,
23852430
name: t.Union[str, t.Sequence[str]],
2431+
allow_no_indices: t.Optional[bool] = None,
23862432
error_trace: t.Optional[bool] = None,
23872433
expand_wildcards: t.Optional[
23882434
t.Union[
@@ -2394,6 +2440,7 @@ async def resolve_index(
23942440
] = None,
23952441
filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
23962442
human: t.Optional[bool] = None,
2443+
ignore_unavailable: t.Optional[bool] = None,
23972444
pretty: t.Optional[bool] = None,
23982445
) -> ObjectApiResponse[t.Any]:
23992446
"""
@@ -2405,16 +2452,25 @@ async def resolve_index(
24052452
:param name: Comma-separated name(s) or index pattern(s) of the indices, aliases,
24062453
and data streams to resolve. Resources on remote clusters can be specified
24072454
using the `<cluster>`:`<name>` syntax.
2455+
:param allow_no_indices: If `false`, the request returns an error if any wildcard
2456+
expression, index alias, or `_all` value targets only missing or closed indices.
2457+
This behavior applies even if the request targets other open indices. For
2458+
example, a request targeting `foo*,bar*` returns an error if an index starts
2459+
with `foo` but no index starts with `bar`.
24082460
:param expand_wildcards: Type of index that wildcard patterns can match. If the
24092461
request can target data streams, this argument determines whether wildcard
24102462
expressions match hidden data streams. Supports comma-separated values, such
24112463
as `open,hidden`. Valid values are: `all`, `open`, `closed`, `hidden`, `none`.
2464+
:param ignore_unavailable: If `false`, the request returns an error if it targets
2465+
a missing or closed index.
24122466
"""
24132467
if name in SKIP_IN_PATH:
24142468
raise ValueError("Empty value passed for parameter 'name'")
24152469
__path_parts: t.Dict[str, str] = {"name": _quote(name)}
24162470
__path = f'/_resolve/index/{__path_parts["name"]}'
24172471
__query: t.Dict[str, t.Any] = {}
2472+
if allow_no_indices is not None:
2473+
__query["allow_no_indices"] = allow_no_indices
24182474
if error_trace is not None:
24192475
__query["error_trace"] = error_trace
24202476
if expand_wildcards is not None:
@@ -2423,6 +2479,8 @@ async def resolve_index(
24232479
__query["filter_path"] = filter_path
24242480
if human is not None:
24252481
__query["human"] = human
2482+
if ignore_unavailable is not None:
2483+
__query["ignore_unavailable"] = ignore_unavailable
24262484
if pretty is not None:
24272485
__query["pretty"] = pretty
24282486
__headers = {"accept": "application/json"}

0 commit comments

Comments
 (0)