@@ -1241,7 +1241,8 @@ async def delete_data_stream(self, name, params=None, headers=None):
12411241 Deletes a data stream.
12421242 `<https://www.elastic.co/guide/en/elasticsearch/reference/master/data-streams.html>`_
12431243
1244- :arg name: The name of the data stream
1244+ :arg name: A comma-separated list of data streams to delete; use
1245+ `*` to delete all data streams
12451246 """
12461247 if name in SKIP_IN_PATH :
12471248 raise ValueError ("Empty value passed for a required argument 'name'." )
@@ -1370,8 +1371,8 @@ async def get_data_stream(self, name=None, params=None, headers=None):
13701371 Returns data streams.
13711372 `<https://www.elastic.co/guide/en/elasticsearch/reference/master/data-streams.html>`_
13721373
1373- :arg name: The name or wildcard expression of the requested data
1374- streams
1374+ :arg name: A comma-separated list of data streams to get; use
1375+ `*` to get all data streams
13751376 """
13761377 return await self .transport .perform_request (
13771378 "GET" , _make_path ("_data_stream" , name ), params = params , headers = headers
@@ -1419,3 +1420,37 @@ async def resolve_index(self, name, params=None, headers=None):
14191420 return await self .transport .perform_request (
14201421 "GET" , _make_path ("_resolve" , "index" , name ), params = params , headers = headers
14211422 )
1423+
1424+ @query_params (
1425+ "allow_no_indices" ,
1426+ "expand_wildcards" ,
1427+ "ignore_unavailable" ,
1428+ "master_timeout" ,
1429+ "timeout" ,
1430+ )
1431+ async def add_block (self , index , block , params = None , headers = None ):
1432+ """
1433+ Adds a block to an index.
1434+ `<https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-blocks.html>`_
1435+
1436+ :arg index: A comma separated list of indices to add a block to
1437+ :arg block: The block to add (one of read, write, read_only or
1438+ metadata)
1439+ :arg allow_no_indices: Whether to ignore if a wildcard indices
1440+ expression resolves into no concrete indices. (This includes `_all`
1441+ string or when no indices have been specified)
1442+ :arg expand_wildcards: Whether to expand wildcard expression to
1443+ concrete indices that are open, closed or both. Valid choices: open,
1444+ closed, hidden, none, all Default: open
1445+ :arg ignore_unavailable: Whether specified concrete indices
1446+ should be ignored when unavailable (missing or closed)
1447+ :arg master_timeout: Specify timeout for connection to master
1448+ :arg timeout: Explicit operation timeout
1449+ """
1450+ for param in (index , block ):
1451+ if param in SKIP_IN_PATH :
1452+ raise ValueError ("Empty value passed for a required argument." )
1453+
1454+ return await self .transport .perform_request (
1455+ "PUT" , _make_path (index , "_block" , block ), params = params , headers = headers
1456+ )
0 commit comments