@@ -1638,8 +1638,11 @@ async def put_data_lifecycle(
1638
1638
1639
1639
@_rewrite_parameters (
1640
1640
body_fields = (
1641
+ "allow_auto_create" ,
1641
1642
"composed_of" ,
1642
1643
"data_stream" ,
1644
+ "deprecated" ,
1645
+ "ignore_missing_component_templates" ,
1643
1646
"index_patterns" ,
1644
1647
"meta" ,
1645
1648
"priority" ,
@@ -1652,13 +1655,20 @@ async def put_index_template(
1652
1655
self ,
1653
1656
* ,
1654
1657
name : str ,
1658
+ allow_auto_create : t .Optional [bool ] = None ,
1659
+ cause : t .Optional [str ] = None ,
1655
1660
composed_of : t .Optional [t .Sequence [str ]] = None ,
1656
1661
create : t .Optional [bool ] = None ,
1657
1662
data_stream : t .Optional [t .Mapping [str , t .Any ]] = None ,
1663
+ deprecated : t .Optional [bool ] = None ,
1658
1664
error_trace : t .Optional [bool ] = None ,
1659
1665
filter_path : t .Optional [t .Union [str , t .Sequence [str ]]] = None ,
1660
1666
human : t .Optional [bool ] = None ,
1667
+ ignore_missing_component_templates : t .Optional [t .Sequence [str ]] = None ,
1661
1668
index_patterns : t .Optional [t .Union [str , t .Sequence [str ]]] = None ,
1669
+ master_timeout : t .Optional [
1670
+ t .Union ["t.Literal[-1]" , "t.Literal[0]" , str ]
1671
+ ] = None ,
1662
1672
meta : t .Optional [t .Mapping [str , t .Any ]] = None ,
1663
1673
pretty : t .Optional [bool ] = None ,
1664
1674
priority : t .Optional [int ] = None ,
@@ -1672,6 +1682,13 @@ async def put_index_template(
1672
1682
`<https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-put-template.html>`_
1673
1683
1674
1684
:param name: Index or template name
1685
+ :param allow_auto_create: This setting overrides the value of the `action.auto_create_index`
1686
+ cluster setting. If set to `true` in a template, then indices can be automatically
1687
+ created using that template even if auto-creation of indices is disabled
1688
+ via `actions.auto_create_index`. If set to `false`, then indices or data
1689
+ streams matching the template must always be explicitly created, and may
1690
+ never be automatically created.
1691
+ :param cause: User defined reason for creating/updating the index template
1675
1692
:param composed_of: An ordered list of component template names. Component templates
1676
1693
are merged in the order specified, meaning that the last component template
1677
1694
specified has the highest precedence.
@@ -1680,7 +1697,16 @@ async def put_index_template(
1680
1697
:param data_stream: If this object is included, the template is used to create
1681
1698
data streams and their backing indices. Supports an empty object. Data streams
1682
1699
require a matching index template with a `data_stream` object.
1700
+ :param deprecated: Marks this index template as deprecated. When creating or
1701
+ updating a non-deprecated index template that uses deprecated components,
1702
+ Elasticsearch will emit a deprecation warning.
1703
+ :param ignore_missing_component_templates: The configuration option ignore_missing_component_templates
1704
+ can be used when an index template references a component template that might
1705
+ not exist
1683
1706
:param index_patterns: Name of the index template to create.
1707
+ :param master_timeout: Period to wait for a connection to the master node. If
1708
+ no response is received before the timeout expires, the request fails and
1709
+ returns an error.
1684
1710
:param meta: Optional user metadata about the index template. May have any contents.
1685
1711
This map is not automatically generated by Elasticsearch.
1686
1712
:param priority: Priority to determine index template precedence when a new data
@@ -1698,6 +1724,8 @@ async def put_index_template(
1698
1724
__path = f"/_index_template/{ _quote (name )} "
1699
1725
__query : t .Dict [str , t .Any ] = {}
1700
1726
__body : t .Dict [str , t .Any ] = body if body is not None else {}
1727
+ if cause is not None :
1728
+ __query ["cause" ] = cause
1701
1729
if create is not None :
1702
1730
__query ["create" ] = create
1703
1731
if error_trace is not None :
@@ -1706,13 +1734,23 @@ async def put_index_template(
1706
1734
__query ["filter_path" ] = filter_path
1707
1735
if human is not None :
1708
1736
__query ["human" ] = human
1737
+ if master_timeout is not None :
1738
+ __query ["master_timeout" ] = master_timeout
1709
1739
if pretty is not None :
1710
1740
__query ["pretty" ] = pretty
1711
1741
if not __body :
1742
+ if allow_auto_create is not None :
1743
+ __body ["allow_auto_create" ] = allow_auto_create
1712
1744
if composed_of is not None :
1713
1745
__body ["composed_of" ] = composed_of
1714
1746
if data_stream is not None :
1715
1747
__body ["data_stream" ] = data_stream
1748
+ if deprecated is not None :
1749
+ __body ["deprecated" ] = deprecated
1750
+ if ignore_missing_component_templates is not None :
1751
+ __body ["ignore_missing_component_templates" ] = (
1752
+ ignore_missing_component_templates
1753
+ )
1716
1754
if index_patterns is not None :
1717
1755
__body ["index_patterns" ] = index_patterns
1718
1756
if meta is not None :
@@ -1997,10 +2035,10 @@ async def put_template(
1997
2035
* ,
1998
2036
name : str ,
1999
2037
aliases : t .Optional [t .Mapping [str , t .Mapping [str , t .Any ]]] = None ,
2038
+ cause : t .Optional [str ] = None ,
2000
2039
create : t .Optional [bool ] = None ,
2001
2040
error_trace : t .Optional [bool ] = None ,
2002
2041
filter_path : t .Optional [t .Union [str , t .Sequence [str ]]] = None ,
2003
- flat_settings : t .Optional [bool ] = None ,
2004
2042
human : t .Optional [bool ] = None ,
2005
2043
index_patterns : t .Optional [t .Union [str , t .Sequence [str ]]] = None ,
2006
2044
mappings : t .Optional [t .Mapping [str , t .Any ]] = None ,
@@ -2010,7 +2048,6 @@ async def put_template(
2010
2048
order : t .Optional [int ] = None ,
2011
2049
pretty : t .Optional [bool ] = None ,
2012
2050
settings : t .Optional [t .Mapping [str , t .Any ]] = None ,
2013
- timeout : t .Optional [t .Union ["t.Literal[-1]" , "t.Literal[0]" , str ]] = None ,
2014
2051
version : t .Optional [int ] = None ,
2015
2052
body : t .Optional [t .Dict [str , t .Any ]] = None ,
2016
2053
) -> ObjectApiResponse [t .Any ]:
@@ -2021,9 +2058,9 @@ async def put_template(
2021
2058
2022
2059
:param name: The name of the template
2023
2060
:param aliases: Aliases for the index.
2061
+ :param cause:
2024
2062
:param create: If true, this request cannot replace or update existing index
2025
2063
templates.
2026
- :param flat_settings: If `true`, returns settings in flat format.
2027
2064
:param index_patterns: Array of wildcard expressions used to match the names
2028
2065
of indices during creation.
2029
2066
:param mappings: Mapping for fields in the index.
@@ -2035,8 +2072,6 @@ async def put_template(
2035
2072
Templates with higher 'order' values are merged later, overriding templates
2036
2073
with lower values.
2037
2074
:param settings: Configuration options for the index.
2038
- :param timeout: Period to wait for a response. If no response is received before
2039
- the timeout expires, the request fails and returns an error.
2040
2075
:param version: Version number used to manage index templates externally. This
2041
2076
number is not automatically generated by Elasticsearch.
2042
2077
"""
@@ -2045,22 +2080,20 @@ async def put_template(
2045
2080
__path = f"/_template/{ _quote (name )} "
2046
2081
__query : t .Dict [str , t .Any ] = {}
2047
2082
__body : t .Dict [str , t .Any ] = body if body is not None else {}
2083
+ if cause is not None :
2084
+ __query ["cause" ] = cause
2048
2085
if create is not None :
2049
2086
__query ["create" ] = create
2050
2087
if error_trace is not None :
2051
2088
__query ["error_trace" ] = error_trace
2052
2089
if filter_path is not None :
2053
2090
__query ["filter_path" ] = filter_path
2054
- if flat_settings is not None :
2055
- __query ["flat_settings" ] = flat_settings
2056
2091
if human is not None :
2057
2092
__query ["human" ] = human
2058
2093
if master_timeout is not None :
2059
2094
__query ["master_timeout" ] = master_timeout
2060
2095
if pretty is not None :
2061
2096
__query ["pretty" ] = pretty
2062
- if timeout is not None :
2063
- __query ["timeout" ] = timeout
2064
2097
if not __body :
2065
2098
if aliases is not None :
2066
2099
__body ["aliases" ] = aliases
@@ -2345,6 +2378,7 @@ async def simulate_index_template(
2345
2378
"allow_auto_create" ,
2346
2379
"composed_of" ,
2347
2380
"data_stream" ,
2381
+ "deprecated" ,
2348
2382
"ignore_missing_component_templates" ,
2349
2383
"index_patterns" ,
2350
2384
"meta" ,
@@ -2362,6 +2396,7 @@ async def simulate_template(
2362
2396
composed_of : t .Optional [t .Sequence [str ]] = None ,
2363
2397
create : t .Optional [bool ] = None ,
2364
2398
data_stream : t .Optional [t .Mapping [str , t .Any ]] = None ,
2399
+ deprecated : t .Optional [bool ] = None ,
2365
2400
error_trace : t .Optional [bool ] = None ,
2366
2401
filter_path : t .Optional [t .Union [str , t .Sequence [str ]]] = None ,
2367
2402
human : t .Optional [bool ] = None ,
@@ -2402,6 +2437,9 @@ async def simulate_template(
2402
2437
:param data_stream: If this object is included, the template is used to create
2403
2438
data streams and their backing indices. Supports an empty object. Data streams
2404
2439
require a matching index template with a `data_stream` object.
2440
+ :param deprecated: Marks this index template as deprecated. When creating or
2441
+ updating a non-deprecated index template that uses deprecated components,
2442
+ Elasticsearch will emit a deprecation warning.
2405
2443
:param ignore_missing_component_templates: The configuration option ignore_missing_component_templates
2406
2444
can be used when an index template references a component template that might
2407
2445
not exist
@@ -2451,6 +2489,8 @@ async def simulate_template(
2451
2489
__body ["composed_of" ] = composed_of
2452
2490
if data_stream is not None :
2453
2491
__body ["data_stream" ] = data_stream
2492
+ if deprecated is not None :
2493
+ __body ["deprecated" ] = deprecated
2454
2494
if ignore_missing_component_templates is not None :
2455
2495
__body ["ignore_missing_component_templates" ] = (
2456
2496
ignore_missing_component_templates
0 commit comments