@@ -303,7 +303,9 @@ async def create_data_stream(
303
303
error_trace : t .Optional [bool ] = None ,
304
304
filter_path : t .Optional [t .Union [str , t .Sequence [str ]]] = None ,
305
305
human : t .Optional [bool ] = None ,
306
+ master_timeout : t .Optional [t .Union [str , t .Literal [- 1 ], t .Literal [0 ]]] = None ,
306
307
pretty : t .Optional [bool ] = None ,
308
+ timeout : t .Optional [t .Union [str , t .Literal [- 1 ], t .Literal [0 ]]] = None ,
307
309
) -> ObjectApiResponse [t .Any ]:
308
310
"""
309
311
Create a data stream. Creates a data stream. You must have a matching index template
@@ -316,6 +318,11 @@ async def create_data_stream(
316
318
`#`, `:`, or a space character; Cannot start with `-`, `_`, `+`, or `.ds-`;
317
319
Cannot be `.` or `..`; Cannot be longer than 255 bytes. Multi-byte characters
318
320
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.
319
326
"""
320
327
if name in SKIP_IN_PATH :
321
328
raise ValueError ("Empty value passed for parameter 'name'" )
@@ -328,8 +335,12 @@ async def create_data_stream(
328
335
__query ["filter_path" ] = filter_path
329
336
if human is not None :
330
337
__query ["human" ] = human
338
+ if master_timeout is not None :
339
+ __query ["master_timeout" ] = master_timeout
331
340
if pretty is not None :
332
341
__query ["pretty" ] = pretty
342
+ if timeout is not None :
343
+ __query ["timeout" ] = timeout
333
344
__headers = {"accept" : "application/json" }
334
345
return await self .perform_request ( # type: ignore[return-value]
335
346
"PUT" ,
@@ -611,6 +622,7 @@ async def delete_data_stream(
611
622
] = None ,
612
623
filter_path : t .Optional [t .Union [str , t .Sequence [str ]]] = None ,
613
624
human : t .Optional [bool ] = None ,
625
+ master_timeout : t .Optional [t .Union [str , t .Literal [- 1 ], t .Literal [0 ]]] = None ,
614
626
pretty : t .Optional [bool ] = None ,
615
627
) -> ObjectApiResponse [t .Any ]:
616
628
"""
@@ -622,6 +634,9 @@ async def delete_data_stream(
622
634
are supported.
623
635
:param expand_wildcards: Type of data stream that wildcard patterns can match.
624
636
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.
625
640
"""
626
641
if name in SKIP_IN_PATH :
627
642
raise ValueError ("Empty value passed for parameter 'name'" )
@@ -636,6 +651,8 @@ async def delete_data_stream(
636
651
__query ["filter_path" ] = filter_path
637
652
if human is not None :
638
653
__query ["human" ] = human
654
+ if master_timeout is not None :
655
+ __query ["master_timeout" ] = master_timeout
639
656
if pretty is not None :
640
657
__query ["pretty" ] = pretty
641
658
__headers = {"accept" : "application/json" }
@@ -1162,6 +1179,7 @@ async def get_data_lifecycle(
1162
1179
filter_path : t .Optional [t .Union [str , t .Sequence [str ]]] = None ,
1163
1180
human : t .Optional [bool ] = None ,
1164
1181
include_defaults : t .Optional [bool ] = None ,
1182
+ master_timeout : t .Optional [t .Union [str , t .Literal [- 1 ], t .Literal [0 ]]] = None ,
1165
1183
pretty : t .Optional [bool ] = None ,
1166
1184
) -> ObjectApiResponse [t .Any ]:
1167
1185
"""
@@ -1177,6 +1195,9 @@ async def get_data_lifecycle(
1177
1195
Supports comma-separated values, such as `open,hidden`. Valid values are:
1178
1196
`all`, `open`, `closed`, `hidden`, `none`.
1179
1197
: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.
1180
1201
"""
1181
1202
if name in SKIP_IN_PATH :
1182
1203
raise ValueError ("Empty value passed for parameter 'name'" )
@@ -1193,6 +1214,8 @@ async def get_data_lifecycle(
1193
1214
__query ["human" ] = human
1194
1215
if include_defaults is not None :
1195
1216
__query ["include_defaults" ] = include_defaults
1217
+ if master_timeout is not None :
1218
+ __query ["master_timeout" ] = master_timeout
1196
1219
if pretty is not None :
1197
1220
__query ["pretty" ] = pretty
1198
1221
__headers = {"accept" : "application/json" }
@@ -1222,7 +1245,9 @@ async def get_data_stream(
1222
1245
filter_path : t .Optional [t .Union [str , t .Sequence [str ]]] = None ,
1223
1246
human : t .Optional [bool ] = None ,
1224
1247
include_defaults : t .Optional [bool ] = None ,
1248
+ master_timeout : t .Optional [t .Union [str , t .Literal [- 1 ], t .Literal [0 ]]] = None ,
1225
1249
pretty : t .Optional [bool ] = None ,
1250
+ verbose : t .Optional [bool ] = None ,
1226
1251
) -> ObjectApiResponse [t .Any ]:
1227
1252
"""
1228
1253
Get data streams. Retrieves information about one or more data streams.
@@ -1236,6 +1261,11 @@ async def get_data_stream(
1236
1261
Supports comma-separated values, such as `open,hidden`.
1237
1262
:param include_defaults: If true, returns all relevant default configurations
1238
1263
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.
1239
1269
"""
1240
1270
__path_parts : t .Dict [str , str ]
1241
1271
if name not in SKIP_IN_PATH :
@@ -1255,8 +1285,12 @@ async def get_data_stream(
1255
1285
__query ["human" ] = human
1256
1286
if include_defaults is not None :
1257
1287
__query ["include_defaults" ] = include_defaults
1288
+ if master_timeout is not None :
1289
+ __query ["master_timeout" ] = master_timeout
1258
1290
if pretty is not None :
1259
1291
__query ["pretty" ] = pretty
1292
+ if verbose is not None :
1293
+ __query ["verbose" ] = verbose
1260
1294
__headers = {"accept" : "application/json" }
1261
1295
return await self .perform_request ( # type: ignore[return-value]
1262
1296
"GET" ,
@@ -1522,7 +1556,9 @@ async def migrate_to_data_stream(
1522
1556
error_trace : t .Optional [bool ] = None ,
1523
1557
filter_path : t .Optional [t .Union [str , t .Sequence [str ]]] = None ,
1524
1558
human : t .Optional [bool ] = None ,
1559
+ master_timeout : t .Optional [t .Union [str , t .Literal [- 1 ], t .Literal [0 ]]] = None ,
1525
1560
pretty : t .Optional [bool ] = None ,
1561
+ timeout : t .Optional [t .Union [str , t .Literal [- 1 ], t .Literal [0 ]]] = None ,
1526
1562
) -> ObjectApiResponse [t .Any ]:
1527
1563
"""
1528
1564
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(
1537
1573
`<https://www.elastic.co/guide/en/elasticsearch/reference/master/data-streams.html>`_
1538
1574
1539
1575
: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.
1540
1581
"""
1541
1582
if name in SKIP_IN_PATH :
1542
1583
raise ValueError ("Empty value passed for parameter 'name'" )
@@ -1549,8 +1590,12 @@ async def migrate_to_data_stream(
1549
1590
__query ["filter_path" ] = filter_path
1550
1591
if human is not None :
1551
1592
__query ["human" ] = human
1593
+ if master_timeout is not None :
1594
+ __query ["master_timeout" ] = master_timeout
1552
1595
if pretty is not None :
1553
1596
__query ["pretty" ] = pretty
1597
+ if timeout is not None :
1598
+ __query ["timeout" ] = timeout
1554
1599
__headers = {"accept" : "application/json" }
1555
1600
return await self .perform_request ( # type: ignore[return-value]
1556
1601
"POST" ,
@@ -2383,6 +2428,7 @@ async def resolve_index(
2383
2428
self ,
2384
2429
* ,
2385
2430
name : t .Union [str , t .Sequence [str ]],
2431
+ allow_no_indices : t .Optional [bool ] = None ,
2386
2432
error_trace : t .Optional [bool ] = None ,
2387
2433
expand_wildcards : t .Optional [
2388
2434
t .Union [
@@ -2394,6 +2440,7 @@ async def resolve_index(
2394
2440
] = None ,
2395
2441
filter_path : t .Optional [t .Union [str , t .Sequence [str ]]] = None ,
2396
2442
human : t .Optional [bool ] = None ,
2443
+ ignore_unavailable : t .Optional [bool ] = None ,
2397
2444
pretty : t .Optional [bool ] = None ,
2398
2445
) -> ObjectApiResponse [t .Any ]:
2399
2446
"""
@@ -2405,16 +2452,25 @@ async def resolve_index(
2405
2452
:param name: Comma-separated name(s) or index pattern(s) of the indices, aliases,
2406
2453
and data streams to resolve. Resources on remote clusters can be specified
2407
2454
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`.
2408
2460
:param expand_wildcards: Type of index that wildcard patterns can match. If the
2409
2461
request can target data streams, this argument determines whether wildcard
2410
2462
expressions match hidden data streams. Supports comma-separated values, such
2411
2463
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.
2412
2466
"""
2413
2467
if name in SKIP_IN_PATH :
2414
2468
raise ValueError ("Empty value passed for parameter 'name'" )
2415
2469
__path_parts : t .Dict [str , str ] = {"name" : _quote (name )}
2416
2470
__path = f'/_resolve/index/{ __path_parts ["name" ]} '
2417
2471
__query : t .Dict [str , t .Any ] = {}
2472
+ if allow_no_indices is not None :
2473
+ __query ["allow_no_indices" ] = allow_no_indices
2418
2474
if error_trace is not None :
2419
2475
__query ["error_trace" ] = error_trace
2420
2476
if expand_wildcards is not None :
@@ -2423,6 +2479,8 @@ async def resolve_index(
2423
2479
__query ["filter_path" ] = filter_path
2424
2480
if human is not None :
2425
2481
__query ["human" ] = human
2482
+ if ignore_unavailable is not None :
2483
+ __query ["ignore_unavailable" ] = ignore_unavailable
2426
2484
if pretty is not None :
2427
2485
__query ["pretty" ] = pretty
2428
2486
__headers = {"accept" : "application/json" }
0 commit comments