Skip to content

Commit c8c7a34

Browse files
authored
Auto-generated API code (#38)
* Auto-generated API code * Try older qaf image * Revert "Try older qaf image" This reverts commit 30fdabe.
1 parent 2b8e964 commit c8c7a34

File tree

8 files changed

+170
-80
lines changed

8 files changed

+170
-80
lines changed

elasticsearch_serverless/_async/client/cluster.py

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -225,16 +225,17 @@ async def info(
225225
)
226226

227227
@_rewrite_parameters(
228-
body_fields=("template", "allow_auto_create", "meta", "version"),
228+
body_fields=("template", "deprecated", "meta", "version"),
229229
parameter_aliases={"_meta": "meta"},
230230
)
231231
async def put_component_template(
232232
self,
233233
*,
234234
name: str,
235235
template: t.Optional[t.Mapping[str, t.Any]] = None,
236-
allow_auto_create: t.Optional[bool] = None,
236+
cause: t.Optional[str] = None,
237237
create: t.Optional[bool] = None,
238+
deprecated: t.Optional[bool] = None,
238239
error_trace: t.Optional[bool] = None,
239240
filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
240241
human: t.Optional[bool] = None,
@@ -262,13 +263,12 @@ async def put_component_template(
262263
update settings API.
263264
:param template: The template to be applied which includes mappings, settings,
264265
or aliases configuration.
265-
:param allow_auto_create: This setting overrides the value of the `action.auto_create_index`
266-
cluster setting. If set to `true` in a template, then indices can be automatically
267-
created using that template even if auto-creation of indices is disabled
268-
via `actions.auto_create_index`. If set to `false` then data streams matching
269-
the template must always be explicitly created.
266+
:param cause:
270267
:param create: If `true`, this request cannot replace or update existing component
271268
templates.
269+
:param deprecated: Marks this index template as deprecated. When creating or
270+
updating a non-deprecated index template that uses deprecated components,
271+
Elasticsearch will emit a deprecation warning.
272272
:param master_timeout: Period to wait for a connection to the master node. If
273273
no response is received before the timeout expires, the request fails and
274274
returns an error.
@@ -287,6 +287,8 @@ async def put_component_template(
287287
__path = f"/_component_template/{_quote(name)}"
288288
__query: t.Dict[str, t.Any] = {}
289289
__body: t.Dict[str, t.Any] = body if body is not None else {}
290+
if cause is not None:
291+
__query["cause"] = cause
290292
if create is not None:
291293
__query["create"] = create
292294
if error_trace is not None:
@@ -302,8 +304,8 @@ async def put_component_template(
302304
if not __body:
303305
if template is not None:
304306
__body["template"] = template
305-
if allow_auto_create is not None:
306-
__body["allow_auto_create"] = allow_auto_create
307+
if deprecated is not None:
308+
__body["deprecated"] = deprecated
307309
if meta is not None:
308310
__body["_meta"] = meta
309311
if version is not None:

elasticsearch_serverless/_async/client/indices.py

Lines changed: 49 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1638,8 +1638,11 @@ async def put_data_lifecycle(
16381638

16391639
@_rewrite_parameters(
16401640
body_fields=(
1641+
"allow_auto_create",
16411642
"composed_of",
16421643
"data_stream",
1644+
"deprecated",
1645+
"ignore_missing_component_templates",
16431646
"index_patterns",
16441647
"meta",
16451648
"priority",
@@ -1652,13 +1655,20 @@ async def put_index_template(
16521655
self,
16531656
*,
16541657
name: str,
1658+
allow_auto_create: t.Optional[bool] = None,
1659+
cause: t.Optional[str] = None,
16551660
composed_of: t.Optional[t.Sequence[str]] = None,
16561661
create: t.Optional[bool] = None,
16571662
data_stream: t.Optional[t.Mapping[str, t.Any]] = None,
1663+
deprecated: t.Optional[bool] = None,
16581664
error_trace: t.Optional[bool] = None,
16591665
filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
16601666
human: t.Optional[bool] = None,
1667+
ignore_missing_component_templates: t.Optional[t.Sequence[str]] = None,
16611668
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,
16621672
meta: t.Optional[t.Mapping[str, t.Any]] = None,
16631673
pretty: t.Optional[bool] = None,
16641674
priority: t.Optional[int] = None,
@@ -1672,6 +1682,13 @@ async def put_index_template(
16721682
`<https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-put-template.html>`_
16731683
16741684
: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
16751692
:param composed_of: An ordered list of component template names. Component templates
16761693
are merged in the order specified, meaning that the last component template
16771694
specified has the highest precedence.
@@ -1680,7 +1697,16 @@ async def put_index_template(
16801697
:param data_stream: If this object is included, the template is used to create
16811698
data streams and their backing indices. Supports an empty object. Data streams
16821699
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
16831706
: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.
16841710
:param meta: Optional user metadata about the index template. May have any contents.
16851711
This map is not automatically generated by Elasticsearch.
16861712
:param priority: Priority to determine index template precedence when a new data
@@ -1698,6 +1724,8 @@ async def put_index_template(
16981724
__path = f"/_index_template/{_quote(name)}"
16991725
__query: t.Dict[str, t.Any] = {}
17001726
__body: t.Dict[str, t.Any] = body if body is not None else {}
1727+
if cause is not None:
1728+
__query["cause"] = cause
17011729
if create is not None:
17021730
__query["create"] = create
17031731
if error_trace is not None:
@@ -1706,13 +1734,23 @@ async def put_index_template(
17061734
__query["filter_path"] = filter_path
17071735
if human is not None:
17081736
__query["human"] = human
1737+
if master_timeout is not None:
1738+
__query["master_timeout"] = master_timeout
17091739
if pretty is not None:
17101740
__query["pretty"] = pretty
17111741
if not __body:
1742+
if allow_auto_create is not None:
1743+
__body["allow_auto_create"] = allow_auto_create
17121744
if composed_of is not None:
17131745
__body["composed_of"] = composed_of
17141746
if data_stream is not None:
17151747
__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+
)
17161754
if index_patterns is not None:
17171755
__body["index_patterns"] = index_patterns
17181756
if meta is not None:
@@ -1997,10 +2035,10 @@ async def put_template(
19972035
*,
19982036
name: str,
19992037
aliases: t.Optional[t.Mapping[str, t.Mapping[str, t.Any]]] = None,
2038+
cause: t.Optional[str] = None,
20002039
create: t.Optional[bool] = None,
20012040
error_trace: t.Optional[bool] = None,
20022041
filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
2003-
flat_settings: t.Optional[bool] = None,
20042042
human: t.Optional[bool] = None,
20052043
index_patterns: t.Optional[t.Union[str, t.Sequence[str]]] = None,
20062044
mappings: t.Optional[t.Mapping[str, t.Any]] = None,
@@ -2010,7 +2048,6 @@ async def put_template(
20102048
order: t.Optional[int] = None,
20112049
pretty: t.Optional[bool] = None,
20122050
settings: t.Optional[t.Mapping[str, t.Any]] = None,
2013-
timeout: t.Optional[t.Union["t.Literal[-1]", "t.Literal[0]", str]] = None,
20142051
version: t.Optional[int] = None,
20152052
body: t.Optional[t.Dict[str, t.Any]] = None,
20162053
) -> ObjectApiResponse[t.Any]:
@@ -2021,9 +2058,9 @@ async def put_template(
20212058
20222059
:param name: The name of the template
20232060
:param aliases: Aliases for the index.
2061+
:param cause:
20242062
:param create: If true, this request cannot replace or update existing index
20252063
templates.
2026-
:param flat_settings: If `true`, returns settings in flat format.
20272064
:param index_patterns: Array of wildcard expressions used to match the names
20282065
of indices during creation.
20292066
:param mappings: Mapping for fields in the index.
@@ -2035,8 +2072,6 @@ async def put_template(
20352072
Templates with higher 'order' values are merged later, overriding templates
20362073
with lower values.
20372074
: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.
20402075
:param version: Version number used to manage index templates externally. This
20412076
number is not automatically generated by Elasticsearch.
20422077
"""
@@ -2045,22 +2080,20 @@ async def put_template(
20452080
__path = f"/_template/{_quote(name)}"
20462081
__query: t.Dict[str, t.Any] = {}
20472082
__body: t.Dict[str, t.Any] = body if body is not None else {}
2083+
if cause is not None:
2084+
__query["cause"] = cause
20482085
if create is not None:
20492086
__query["create"] = create
20502087
if error_trace is not None:
20512088
__query["error_trace"] = error_trace
20522089
if filter_path is not None:
20532090
__query["filter_path"] = filter_path
2054-
if flat_settings is not None:
2055-
__query["flat_settings"] = flat_settings
20562091
if human is not None:
20572092
__query["human"] = human
20582093
if master_timeout is not None:
20592094
__query["master_timeout"] = master_timeout
20602095
if pretty is not None:
20612096
__query["pretty"] = pretty
2062-
if timeout is not None:
2063-
__query["timeout"] = timeout
20642097
if not __body:
20652098
if aliases is not None:
20662099
__body["aliases"] = aliases
@@ -2345,6 +2378,7 @@ async def simulate_index_template(
23452378
"allow_auto_create",
23462379
"composed_of",
23472380
"data_stream",
2381+
"deprecated",
23482382
"ignore_missing_component_templates",
23492383
"index_patterns",
23502384
"meta",
@@ -2362,6 +2396,7 @@ async def simulate_template(
23622396
composed_of: t.Optional[t.Sequence[str]] = None,
23632397
create: t.Optional[bool] = None,
23642398
data_stream: t.Optional[t.Mapping[str, t.Any]] = None,
2399+
deprecated: t.Optional[bool] = None,
23652400
error_trace: t.Optional[bool] = None,
23662401
filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
23672402
human: t.Optional[bool] = None,
@@ -2402,6 +2437,9 @@ async def simulate_template(
24022437
:param data_stream: If this object is included, the template is used to create
24032438
data streams and their backing indices. Supports an empty object. Data streams
24042439
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.
24052443
:param ignore_missing_component_templates: The configuration option ignore_missing_component_templates
24062444
can be used when an index template references a component template that might
24072445
not exist
@@ -2451,6 +2489,8 @@ async def simulate_template(
24512489
__body["composed_of"] = composed_of
24522490
if data_stream is not None:
24532491
__body["data_stream"] = data_stream
2492+
if deprecated is not None:
2493+
__body["deprecated"] = deprecated
24542494
if ignore_missing_component_templates is not None:
24552495
__body["ignore_missing_component_templates"] = (
24562496
ignore_missing_component_templates

0 commit comments

Comments
 (0)