@@ -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,6 +1245,7 @@ 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 ,
1226
1250
) -> ObjectApiResponse [t .Any ]:
1227
1251
"""
@@ -1236,6 +1260,9 @@ async def get_data_stream(
1236
1260
Supports comma-separated values, such as `open,hidden`.
1237
1261
:param include_defaults: If true, returns all relevant default configurations
1238
1262
for the index template.
1263
+ :param master_timeout: Period to wait for a connection to the master node. If
1264
+ no response is received before the timeout expires, the request fails and
1265
+ returns an error.
1239
1266
"""
1240
1267
__path_parts : t .Dict [str , str ]
1241
1268
if name not in SKIP_IN_PATH :
@@ -1255,6 +1282,8 @@ async def get_data_stream(
1255
1282
__query ["human" ] = human
1256
1283
if include_defaults is not None :
1257
1284
__query ["include_defaults" ] = include_defaults
1285
+ if master_timeout is not None :
1286
+ __query ["master_timeout" ] = master_timeout
1258
1287
if pretty is not None :
1259
1288
__query ["pretty" ] = pretty
1260
1289
__headers = {"accept" : "application/json" }
@@ -1522,7 +1551,9 @@ async def migrate_to_data_stream(
1522
1551
error_trace : t .Optional [bool ] = None ,
1523
1552
filter_path : t .Optional [t .Union [str , t .Sequence [str ]]] = None ,
1524
1553
human : t .Optional [bool ] = None ,
1554
+ master_timeout : t .Optional [t .Union [str , t .Literal [- 1 ], t .Literal [0 ]]] = None ,
1525
1555
pretty : t .Optional [bool ] = None ,
1556
+ timeout : t .Optional [t .Union [str , t .Literal [- 1 ], t .Literal [0 ]]] = None ,
1526
1557
) -> ObjectApiResponse [t .Any ]:
1527
1558
"""
1528
1559
Convert an index alias to a data stream. Converts an index alias to a data stream.
@@ -1537,6 +1568,11 @@ async def migrate_to_data_stream(
1537
1568
`<https://www.elastic.co/guide/en/elasticsearch/reference/master/data-streams.html>`_
1538
1569
1539
1570
:param name: Name of the index alias to convert to a data stream.
1571
+ :param master_timeout: Period to wait for a connection to the master node. If
1572
+ no response is received before the timeout expires, the request fails and
1573
+ returns an error.
1574
+ :param timeout: Period to wait for a response. If no response is received before
1575
+ the timeout expires, the request fails and returns an error.
1540
1576
"""
1541
1577
if name in SKIP_IN_PATH :
1542
1578
raise ValueError ("Empty value passed for parameter 'name'" )
@@ -1549,8 +1585,12 @@ async def migrate_to_data_stream(
1549
1585
__query ["filter_path" ] = filter_path
1550
1586
if human is not None :
1551
1587
__query ["human" ] = human
1588
+ if master_timeout is not None :
1589
+ __query ["master_timeout" ] = master_timeout
1552
1590
if pretty is not None :
1553
1591
__query ["pretty" ] = pretty
1592
+ if timeout is not None :
1593
+ __query ["timeout" ] = timeout
1554
1594
__headers = {"accept" : "application/json" }
1555
1595
return await self .perform_request ( # type: ignore[return-value]
1556
1596
"POST" ,
0 commit comments