elasticsearch 8.16.0__py3-none-any.whl → 8.17.1__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (90) hide show
  1. elasticsearch/_async/client/__init__.py +234 -96
  2. elasticsearch/_async/client/async_search.py +12 -22
  3. elasticsearch/_async/client/autoscaling.py +39 -4
  4. elasticsearch/_async/client/cat.py +90 -221
  5. elasticsearch/_async/client/ccr.py +85 -35
  6. elasticsearch/_async/client/cluster.py +160 -68
  7. elasticsearch/_async/client/connector.py +362 -25
  8. elasticsearch/_async/client/dangling_indices.py +3 -3
  9. elasticsearch/_async/client/enrich.py +6 -6
  10. elasticsearch/_async/client/eql.py +13 -11
  11. elasticsearch/_async/client/esql.py +3 -2
  12. elasticsearch/_async/client/features.py +27 -5
  13. elasticsearch/_async/client/fleet.py +1 -1
  14. elasticsearch/_async/client/graph.py +9 -3
  15. elasticsearch/_async/client/ilm.py +74 -39
  16. elasticsearch/_async/client/indices.py +633 -152
  17. elasticsearch/_async/client/inference.py +99 -16
  18. elasticsearch/_async/client/ingest.py +201 -23
  19. elasticsearch/_async/client/license.py +38 -22
  20. elasticsearch/_async/client/logstash.py +12 -9
  21. elasticsearch/_async/client/migration.py +17 -8
  22. elasticsearch/_async/client/ml.py +137 -79
  23. elasticsearch/_async/client/monitoring.py +3 -2
  24. elasticsearch/_async/client/nodes.py +37 -23
  25. elasticsearch/_async/client/query_rules.py +47 -25
  26. elasticsearch/_async/client/rollup.py +96 -21
  27. elasticsearch/_async/client/search_application.py +138 -9
  28. elasticsearch/_async/client/searchable_snapshots.py +33 -24
  29. elasticsearch/_async/client/security.py +751 -123
  30. elasticsearch/_async/client/shutdown.py +38 -15
  31. elasticsearch/_async/client/simulate.py +151 -0
  32. elasticsearch/_async/client/slm.py +147 -28
  33. elasticsearch/_async/client/snapshot.py +309 -25
  34. elasticsearch/_async/client/sql.py +79 -58
  35. elasticsearch/_async/client/ssl.py +1 -1
  36. elasticsearch/_async/client/synonyms.py +52 -29
  37. elasticsearch/_async/client/tasks.py +71 -31
  38. elasticsearch/_async/client/text_structure.py +468 -48
  39. elasticsearch/_async/client/transform.py +21 -14
  40. elasticsearch/_async/client/watcher.py +226 -60
  41. elasticsearch/_async/client/xpack.py +13 -8
  42. elasticsearch/_sync/client/__init__.py +234 -96
  43. elasticsearch/_sync/client/async_search.py +12 -22
  44. elasticsearch/_sync/client/autoscaling.py +39 -4
  45. elasticsearch/_sync/client/cat.py +90 -221
  46. elasticsearch/_sync/client/ccr.py +85 -35
  47. elasticsearch/_sync/client/cluster.py +160 -68
  48. elasticsearch/_sync/client/connector.py +362 -25
  49. elasticsearch/_sync/client/dangling_indices.py +3 -3
  50. elasticsearch/_sync/client/enrich.py +6 -6
  51. elasticsearch/_sync/client/eql.py +13 -11
  52. elasticsearch/_sync/client/esql.py +3 -2
  53. elasticsearch/_sync/client/features.py +27 -5
  54. elasticsearch/_sync/client/fleet.py +1 -1
  55. elasticsearch/_sync/client/graph.py +9 -3
  56. elasticsearch/_sync/client/ilm.py +74 -39
  57. elasticsearch/_sync/client/indices.py +633 -152
  58. elasticsearch/_sync/client/inference.py +99 -16
  59. elasticsearch/_sync/client/ingest.py +201 -23
  60. elasticsearch/_sync/client/license.py +38 -22
  61. elasticsearch/_sync/client/logstash.py +12 -9
  62. elasticsearch/_sync/client/migration.py +17 -8
  63. elasticsearch/_sync/client/ml.py +137 -79
  64. elasticsearch/_sync/client/monitoring.py +3 -2
  65. elasticsearch/_sync/client/nodes.py +37 -23
  66. elasticsearch/_sync/client/query_rules.py +47 -25
  67. elasticsearch/_sync/client/rollup.py +96 -21
  68. elasticsearch/_sync/client/search_application.py +138 -9
  69. elasticsearch/_sync/client/searchable_snapshots.py +33 -24
  70. elasticsearch/_sync/client/security.py +751 -123
  71. elasticsearch/_sync/client/shutdown.py +38 -15
  72. elasticsearch/_sync/client/simulate.py +151 -0
  73. elasticsearch/_sync/client/slm.py +147 -28
  74. elasticsearch/_sync/client/snapshot.py +309 -25
  75. elasticsearch/_sync/client/sql.py +79 -58
  76. elasticsearch/_sync/client/ssl.py +1 -1
  77. elasticsearch/_sync/client/synonyms.py +52 -29
  78. elasticsearch/_sync/client/tasks.py +71 -31
  79. elasticsearch/_sync/client/text_structure.py +468 -48
  80. elasticsearch/_sync/client/transform.py +21 -14
  81. elasticsearch/_sync/client/watcher.py +226 -60
  82. elasticsearch/_sync/client/xpack.py +13 -8
  83. elasticsearch/_version.py +1 -1
  84. elasticsearch/client.py +2 -0
  85. {elasticsearch-8.16.0.dist-info → elasticsearch-8.17.1.dist-info}/METADATA +6 -4
  86. elasticsearch-8.17.1.dist-info/RECORD +119 -0
  87. {elasticsearch-8.16.0.dist-info → elasticsearch-8.17.1.dist-info}/WHEEL +1 -1
  88. elasticsearch-8.16.0.dist-info/RECORD +0 -117
  89. {elasticsearch-8.16.0.dist-info → elasticsearch-8.17.1.dist-info}/licenses/LICENSE +0 -0
  90. {elasticsearch-8.16.0.dist-info → elasticsearch-8.17.1.dist-info}/licenses/NOTICE +0 -0
@@ -42,10 +42,15 @@ class ShutdownClient(NamespacedClient):
42
42
  ] = None,
43
43
  ) -> ObjectApiResponse[t.Any]:
44
44
  """
45
- Removes a node from the shutdown list. Designed for indirect use by ECE/ESS and
46
- ECK. Direct use is not supported.
45
+ Cancel node shutdown preparations. Remove a node from the shutdown list so it
46
+ can resume normal operations. You must explicitly clear the shutdown request
47
+ when a node rejoins the cluster or when a node has permanently left the cluster.
48
+ Shutdown requests are never removed automatically by Elasticsearch. NOTE: This
49
+ feature is designed for indirect use by Elastic Cloud, Elastic Cloud Enterprise,
50
+ and Elastic Cloud on Kubernetes. Direct use is not supported. If the operator
51
+ privileges feature is enabled, you must be an operator to use this API.
47
52
 
48
- `<https://www.elastic.co/guide/en/elasticsearch/reference/current>`_
53
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/delete-shutdown.html>`_
49
54
 
50
55
  :param node_id: The node id of node to be removed from the shutdown state
51
56
  :param master_timeout: Period to wait for a connection to the master node. If
@@ -98,10 +103,15 @@ class ShutdownClient(NamespacedClient):
98
103
  ] = None,
99
104
  ) -> ObjectApiResponse[t.Any]:
100
105
  """
101
- Retrieve status of a node or nodes that are currently marked as shutting down.
102
- Designed for indirect use by ECE/ESS and ECK. Direct use is not supported.
106
+ Get the shutdown status. Get information about nodes that are ready to be shut
107
+ down, have shut down preparations still in progress, or have stalled. The API
108
+ returns status information for each part of the shut down process. NOTE: This
109
+ feature is designed for indirect use by Elasticsearch Service, Elastic Cloud
110
+ Enterprise, and Elastic Cloud on Kubernetes. Direct use is not supported. If
111
+ the operator privileges feature is enabled, you must be an operator to use this
112
+ API.
103
113
 
104
- `<https://www.elastic.co/guide/en/elasticsearch/reference/current>`_
114
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/get-shutdown.html>`_
105
115
 
106
116
  :param node_id: Which node for which to retrieve the shutdown status
107
117
  :param master_timeout: Period to wait for a connection to the master node. If
@@ -166,12 +176,25 @@ class ShutdownClient(NamespacedClient):
166
176
  body: t.Optional[t.Dict[str, t.Any]] = None,
167
177
  ) -> ObjectApiResponse[t.Any]:
168
178
  """
169
- Adds a node to be shut down. Designed for indirect use by ECE/ESS and ECK. Direct
170
- use is not supported.
179
+ Prepare a node to be shut down. NOTE: This feature is designed for indirect use
180
+ by Elastic Cloud, Elastic Cloud Enterprise, and Elastic Cloud on Kubernetes.
181
+ Direct use is not supported. If you specify a node that is offline, it will be
182
+ prepared for shut down when it rejoins the cluster. If the operator privileges
183
+ feature is enabled, you must be an operator to use this API. The API migrates
184
+ ongoing tasks and index shards to other nodes as needed to prepare a node to
185
+ be restarted or shut down and removed from the cluster. This ensures that Elasticsearch
186
+ can be stopped safely with minimal disruption to the cluster. You must specify
187
+ the type of shutdown: `restart`, `remove`, or `replace`. If a node is already
188
+ being prepared for shutdown, you can use this API to change the shutdown type.
189
+ IMPORTANT: This API does NOT terminate the Elasticsearch process. Monitor the
190
+ node shutdown status to determine when it is safe to stop Elasticsearch.
171
191
 
172
- `<https://www.elastic.co/guide/en/elasticsearch/reference/current>`_
192
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/put-shutdown.html>`_
173
193
 
174
- :param node_id: The node id of node to be shut down
194
+ :param node_id: The node identifier. This parameter is not validated against
195
+ the cluster's active nodes. This enables you to register a node for shut
196
+ down while it is offline. No error is thrown if you specify an invalid node
197
+ ID.
175
198
  :param reason: A human-readable reason that the node is being shut down. This
176
199
  field provides information for other cluster operators; it does not affect
177
200
  the shut down process.
@@ -192,17 +215,17 @@ class ShutdownClient(NamespacedClient):
192
215
  the index.unassigned.node_left.delayed_timeout setting. If you specify both
193
216
  a restart allocation delay and an index-level allocation delay, the longer
194
217
  of the two is used.
195
- :param master_timeout: Period to wait for a connection to the master node. If
196
- no response is received before the timeout expires, the request fails and
197
- returns an error.
218
+ :param master_timeout: The period to wait for a connection to the master node.
219
+ If no response is received before the timeout expires, the request fails
220
+ and returns an error.
198
221
  :param target_node_name: Only valid if type is replace. Specifies the name of
199
222
  the node that is replacing the node being shut down. Shards from the shut
200
223
  down node are only allowed to be allocated to the target node, and no other
201
224
  data will be allocated to the target node. During relocation of data certain
202
225
  allocation rules are ignored, such as disk watermarks or user attribute filtering
203
226
  rules.
204
- :param timeout: Period to wait for a response. If no response is received before
205
- the timeout expires, the request fails and returns an error.
227
+ :param timeout: The period to wait for a response. If no response is received
228
+ before the timeout expires, the request fails and returns an error.
206
229
  """
207
230
  if node_id in SKIP_IN_PATH:
208
231
  raise ValueError("Empty value passed for parameter 'node_id'")
@@ -0,0 +1,151 @@
1
+ # Licensed to Elasticsearch B.V. under one or more contributor
2
+ # license agreements. See the NOTICE file distributed with
3
+ # this work for additional information regarding copyright
4
+ # ownership. Elasticsearch B.V. licenses this file to you under
5
+ # the Apache License, Version 2.0 (the "License"); you may
6
+ # not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # http://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing,
12
+ # software distributed under the License is distributed on an
13
+ # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14
+ # KIND, either express or implied. See the License for the
15
+ # specific language governing permissions and limitations
16
+ # under the License.
17
+
18
+ import typing as t
19
+
20
+ from elastic_transport import ObjectApiResponse
21
+
22
+ from ._base import NamespacedClient
23
+ from .utils import (
24
+ SKIP_IN_PATH,
25
+ Stability,
26
+ _quote,
27
+ _rewrite_parameters,
28
+ _stability_warning,
29
+ )
30
+
31
+
32
+ class SimulateClient(NamespacedClient):
33
+
34
+ @_rewrite_parameters(
35
+ body_fields=(
36
+ "docs",
37
+ "component_template_substitutions",
38
+ "index_template_subtitutions",
39
+ "mapping_addition",
40
+ "pipeline_substitutions",
41
+ ),
42
+ )
43
+ @_stability_warning(Stability.EXPERIMENTAL)
44
+ async def ingest(
45
+ self,
46
+ *,
47
+ docs: t.Optional[t.Sequence[t.Mapping[str, t.Any]]] = None,
48
+ index: t.Optional[str] = None,
49
+ component_template_substitutions: t.Optional[
50
+ t.Mapping[str, t.Mapping[str, t.Any]]
51
+ ] = None,
52
+ error_trace: t.Optional[bool] = None,
53
+ filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
54
+ human: t.Optional[bool] = None,
55
+ index_template_subtitutions: t.Optional[
56
+ t.Mapping[str, t.Mapping[str, t.Any]]
57
+ ] = None,
58
+ mapping_addition: t.Optional[t.Mapping[str, t.Any]] = None,
59
+ pipeline: t.Optional[str] = None,
60
+ pipeline_substitutions: t.Optional[
61
+ t.Mapping[str, t.Mapping[str, t.Any]]
62
+ ] = None,
63
+ pretty: t.Optional[bool] = None,
64
+ body: t.Optional[t.Dict[str, t.Any]] = None,
65
+ ) -> ObjectApiResponse[t.Any]:
66
+ """
67
+ Simulate data ingestion. Run ingest pipelines against a set of provided documents,
68
+ optionally with substitute pipeline definitions, to simulate ingesting data into
69
+ an index. This API is meant to be used for troubleshooting or pipeline development,
70
+ as it does not actually index any data into Elasticsearch. The API runs the default
71
+ and final pipeline for that index against a set of documents provided in the
72
+ body of the request. If a pipeline contains a reroute processor, it follows that
73
+ reroute processor to the new index, running that index's pipelines as well the
74
+ same way that a non-simulated ingest would. No data is indexed into Elasticsearch.
75
+ Instead, the transformed document is returned, along with the list of pipelines
76
+ that have been run and the name of the index where the document would have been
77
+ indexed if this were not a simulation. The transformed document is validated
78
+ against the mappings that would apply to this index, and any validation error
79
+ is reported in the result. This API differs from the simulate pipeline API in
80
+ that you specify a single pipeline for that API, and it runs only that one pipeline.
81
+ The simulate pipeline API is more useful for developing a single pipeline, while
82
+ the simulate ingest API is more useful for troubleshooting the interaction of
83
+ the various pipelines that get applied when ingesting into an index. By default,
84
+ the pipeline definitions that are currently in the system are used. However,
85
+ you can supply substitute pipeline definitions in the body of the request. These
86
+ will be used in place of the pipeline definitions that are already in the system.
87
+ This can be used to replace existing pipeline definitions or to create new ones.
88
+ The pipeline substitutions are used only within this request.
89
+
90
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/simulate-ingest-api.html>`_
91
+
92
+ :param docs: Sample documents to test in the pipeline.
93
+ :param index: The index to simulate ingesting into. This value can be overridden
94
+ by specifying an index on each document. If you specify this parameter in
95
+ the request path, it is used for any documents that do not explicitly specify
96
+ an index argument.
97
+ :param component_template_substitutions: A map of component template names to
98
+ substitute component template definition objects.
99
+ :param index_template_subtitutions: A map of index template names to substitute
100
+ index template definition objects.
101
+ :param mapping_addition:
102
+ :param pipeline: The pipeline to use as the default pipeline. This value can
103
+ be used to override the default pipeline of the index.
104
+ :param pipeline_substitutions: Pipelines to test. If you don’t specify the `pipeline`
105
+ request path parameter, this parameter is required. If you specify both this
106
+ and the request path parameter, the API only uses the request path parameter.
107
+ """
108
+ if docs is None and body is None:
109
+ raise ValueError("Empty value passed for parameter 'docs'")
110
+ __path_parts: t.Dict[str, str]
111
+ if index not in SKIP_IN_PATH:
112
+ __path_parts = {"index": _quote(index)}
113
+ __path = f'/_ingest/{__path_parts["index"]}/_simulate'
114
+ else:
115
+ __path_parts = {}
116
+ __path = "/_ingest/_simulate"
117
+ __query: t.Dict[str, t.Any] = {}
118
+ __body: t.Dict[str, t.Any] = body if body is not None else {}
119
+ if error_trace is not None:
120
+ __query["error_trace"] = error_trace
121
+ if filter_path is not None:
122
+ __query["filter_path"] = filter_path
123
+ if human is not None:
124
+ __query["human"] = human
125
+ if pipeline is not None:
126
+ __query["pipeline"] = pipeline
127
+ if pretty is not None:
128
+ __query["pretty"] = pretty
129
+ if not __body:
130
+ if docs is not None:
131
+ __body["docs"] = docs
132
+ if component_template_substitutions is not None:
133
+ __body["component_template_substitutions"] = (
134
+ component_template_substitutions
135
+ )
136
+ if index_template_subtitutions is not None:
137
+ __body["index_template_subtitutions"] = index_template_subtitutions
138
+ if mapping_addition is not None:
139
+ __body["mapping_addition"] = mapping_addition
140
+ if pipeline_substitutions is not None:
141
+ __body["pipeline_substitutions"] = pipeline_substitutions
142
+ __headers = {"accept": "application/json", "content-type": "application/json"}
143
+ return await self.perform_request( # type: ignore[return-value]
144
+ "POST",
145
+ __path,
146
+ params=__query,
147
+ headers=__headers,
148
+ body=__body,
149
+ endpoint_id="simulate.ingest",
150
+ path_parts=__path_parts,
151
+ )
@@ -33,14 +33,23 @@ class SlmClient(NamespacedClient):
33
33
  error_trace: t.Optional[bool] = None,
34
34
  filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
35
35
  human: t.Optional[bool] = None,
36
+ master_timeout: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
36
37
  pretty: t.Optional[bool] = None,
38
+ timeout: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
37
39
  ) -> ObjectApiResponse[t.Any]:
38
40
  """
39
- Deletes an existing snapshot lifecycle policy.
41
+ Delete a policy. Delete a snapshot lifecycle policy definition. This operation
42
+ prevents any future snapshots from being taken but does not cancel in-progress
43
+ snapshots or remove previously-taken snapshots.
40
44
 
41
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.16/slm-api-delete-policy.html>`_
45
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/slm-api-delete-policy.html>`_
42
46
 
43
47
  :param policy_id: The id of the snapshot lifecycle policy to remove
48
+ :param master_timeout: The period to wait for a connection to the master node.
49
+ If no response is received before the timeout expires, the request fails
50
+ and returns an error.
51
+ :param timeout: The period to wait for a response. If no response is received
52
+ before the timeout expires, the request fails and returns an error.
44
53
  """
45
54
  if policy_id in SKIP_IN_PATH:
46
55
  raise ValueError("Empty value passed for parameter 'policy_id'")
@@ -53,8 +62,12 @@ class SlmClient(NamespacedClient):
53
62
  __query["filter_path"] = filter_path
54
63
  if human is not None:
55
64
  __query["human"] = human
65
+ if master_timeout is not None:
66
+ __query["master_timeout"] = master_timeout
56
67
  if pretty is not None:
57
68
  __query["pretty"] = pretty
69
+ if timeout is not None:
70
+ __query["timeout"] = timeout
58
71
  __headers = {"accept": "application/json"}
59
72
  return await self.perform_request( # type: ignore[return-value]
60
73
  "DELETE",
@@ -73,15 +86,24 @@ class SlmClient(NamespacedClient):
73
86
  error_trace: t.Optional[bool] = None,
74
87
  filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
75
88
  human: t.Optional[bool] = None,
89
+ master_timeout: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
76
90
  pretty: t.Optional[bool] = None,
91
+ timeout: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
77
92
  ) -> ObjectApiResponse[t.Any]:
78
93
  """
79
- Immediately creates a snapshot according to the lifecycle policy, without waiting
80
- for the scheduled time.
94
+ Run a policy. Immediately create a snapshot according to the snapshot lifecycle
95
+ policy without waiting for the scheduled time. The snapshot policy is normally
96
+ applied according to its schedule, but you might want to manually run a policy
97
+ before performing an upgrade or other maintenance.
81
98
 
82
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.16/slm-api-execute-lifecycle.html>`_
99
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/slm-api-execute-lifecycle.html>`_
83
100
 
84
101
  :param policy_id: The id of the snapshot lifecycle policy to be executed
102
+ :param master_timeout: The period to wait for a connection to the master node.
103
+ If no response is received before the timeout expires, the request fails
104
+ and returns an error.
105
+ :param timeout: The period to wait for a response. If no response is received
106
+ before the timeout expires, the request fails and returns an error.
85
107
  """
86
108
  if policy_id in SKIP_IN_PATH:
87
109
  raise ValueError("Empty value passed for parameter 'policy_id'")
@@ -94,8 +116,12 @@ class SlmClient(NamespacedClient):
94
116
  __query["filter_path"] = filter_path
95
117
  if human is not None:
96
118
  __query["human"] = human
119
+ if master_timeout is not None:
120
+ __query["master_timeout"] = master_timeout
97
121
  if pretty is not None:
98
122
  __query["pretty"] = pretty
123
+ if timeout is not None:
124
+ __query["timeout"] = timeout
99
125
  __headers = {"accept": "application/json"}
100
126
  return await self.perform_request( # type: ignore[return-value]
101
127
  "PUT",
@@ -113,12 +139,22 @@ class SlmClient(NamespacedClient):
113
139
  error_trace: t.Optional[bool] = None,
114
140
  filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
115
141
  human: t.Optional[bool] = None,
142
+ master_timeout: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
116
143
  pretty: t.Optional[bool] = None,
144
+ timeout: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
117
145
  ) -> ObjectApiResponse[t.Any]:
118
146
  """
119
- Deletes any snapshots that are expired according to the policy's retention rules.
147
+ Run a retention policy. Manually apply the retention policy to force immediate
148
+ removal of snapshots that are expired according to the snapshot lifecycle policy
149
+ retention rules. The retention policy is normally applied according to its schedule.
120
150
 
121
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.16/slm-api-execute-retention.html>`_
151
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/slm-api-execute-retention.html>`_
152
+
153
+ :param master_timeout: The period to wait for a connection to the master node.
154
+ If no response is received before the timeout expires, the request fails
155
+ and returns an error.
156
+ :param timeout: The period to wait for a response. If no response is received
157
+ before the timeout expires, the request fails and returns an error.
122
158
  """
123
159
  __path_parts: t.Dict[str, str] = {}
124
160
  __path = "/_slm/_execute_retention"
@@ -129,8 +165,12 @@ class SlmClient(NamespacedClient):
129
165
  __query["filter_path"] = filter_path
130
166
  if human is not None:
131
167
  __query["human"] = human
168
+ if master_timeout is not None:
169
+ __query["master_timeout"] = master_timeout
132
170
  if pretty is not None:
133
171
  __query["pretty"] = pretty
172
+ if timeout is not None:
173
+ __query["timeout"] = timeout
134
174
  __headers = {"accept": "application/json"}
135
175
  return await self.perform_request( # type: ignore[return-value]
136
176
  "POST",
@@ -149,15 +189,22 @@ class SlmClient(NamespacedClient):
149
189
  error_trace: t.Optional[bool] = None,
150
190
  filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
151
191
  human: t.Optional[bool] = None,
192
+ master_timeout: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
152
193
  pretty: t.Optional[bool] = None,
194
+ timeout: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
153
195
  ) -> ObjectApiResponse[t.Any]:
154
196
  """
155
- Retrieves one or more snapshot lifecycle policy definitions and information about
156
- the latest snapshot attempts.
197
+ Get policy information. Get snapshot lifecycle policy definitions and information
198
+ about the latest snapshot attempts.
157
199
 
158
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.16/slm-api-get-policy.html>`_
200
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/slm-api-get-policy.html>`_
159
201
 
160
202
  :param policy_id: Comma-separated list of snapshot lifecycle policies to retrieve
203
+ :param master_timeout: The period to wait for a connection to the master node.
204
+ If no response is received before the timeout expires, the request fails
205
+ and returns an error.
206
+ :param timeout: The period to wait for a response. If no response is received
207
+ before the timeout expires, the request fails and returns an error.
161
208
  """
162
209
  __path_parts: t.Dict[str, str]
163
210
  if policy_id not in SKIP_IN_PATH:
@@ -173,8 +220,12 @@ class SlmClient(NamespacedClient):
173
220
  __query["filter_path"] = filter_path
174
221
  if human is not None:
175
222
  __query["human"] = human
223
+ if master_timeout is not None:
224
+ __query["master_timeout"] = master_timeout
176
225
  if pretty is not None:
177
226
  __query["pretty"] = pretty
227
+ if timeout is not None:
228
+ __query["timeout"] = timeout
178
229
  __headers = {"accept": "application/json"}
179
230
  return await self.perform_request( # type: ignore[return-value]
180
231
  "GET",
@@ -192,13 +243,21 @@ class SlmClient(NamespacedClient):
192
243
  error_trace: t.Optional[bool] = None,
193
244
  filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
194
245
  human: t.Optional[bool] = None,
246
+ master_timeout: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
195
247
  pretty: t.Optional[bool] = None,
248
+ timeout: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
196
249
  ) -> ObjectApiResponse[t.Any]:
197
250
  """
198
- Returns global and policy-level statistics about actions taken by snapshot lifecycle
199
- management.
251
+ Get snapshot lifecycle management statistics. Get global and policy-level statistics
252
+ about actions taken by snapshot lifecycle management.
253
+
254
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/slm-api-get-stats.html>`_
200
255
 
201
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.16/slm-api-get-stats.html>`_
256
+ :param master_timeout: Period to wait for a connection to the master node. If
257
+ no response is received before the timeout expires, the request fails and
258
+ returns an error.
259
+ :param timeout: Period to wait for a response. If no response is received before
260
+ the timeout expires, the request fails and returns an error.
202
261
  """
203
262
  __path_parts: t.Dict[str, str] = {}
204
263
  __path = "/_slm/stats"
@@ -209,8 +268,12 @@ class SlmClient(NamespacedClient):
209
268
  __query["filter_path"] = filter_path
210
269
  if human is not None:
211
270
  __query["human"] = human
271
+ if master_timeout is not None:
272
+ __query["master_timeout"] = master_timeout
212
273
  if pretty is not None:
213
274
  __query["pretty"] = pretty
275
+ if timeout is not None:
276
+ __query["timeout"] = timeout
214
277
  __headers = {"accept": "application/json"}
215
278
  return await self.perform_request( # type: ignore[return-value]
216
279
  "GET",
@@ -228,12 +291,22 @@ class SlmClient(NamespacedClient):
228
291
  error_trace: t.Optional[bool] = None,
229
292
  filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
230
293
  human: t.Optional[bool] = None,
294
+ master_timeout: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
231
295
  pretty: t.Optional[bool] = None,
296
+ timeout: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
232
297
  ) -> ObjectApiResponse[t.Any]:
233
298
  """
234
- Retrieves the status of snapshot lifecycle management (SLM).
299
+ Get the snapshot lifecycle management status.
300
+
301
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/slm-api-get-status.html>`_
235
302
 
236
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.16/slm-api-get-status.html>`_
303
+ :param master_timeout: The period to wait for a connection to the master node.
304
+ If no response is received before the timeout expires, the request fails
305
+ and returns an error. To indicate that the request should never timeout,
306
+ set it to `-1`.
307
+ :param timeout: The period to wait for a response. If no response is received
308
+ before the timeout expires, the request fails and returns an error. To indicate
309
+ that the request should never timeout, set it to `-1`.
237
310
  """
238
311
  __path_parts: t.Dict[str, str] = {}
239
312
  __path = "/_slm/status"
@@ -244,8 +317,12 @@ class SlmClient(NamespacedClient):
244
317
  __query["filter_path"] = filter_path
245
318
  if human is not None:
246
319
  __query["human"] = human
320
+ if master_timeout is not None:
321
+ __query["master_timeout"] = master_timeout
247
322
  if pretty is not None:
248
323
  __query["pretty"] = pretty
324
+ if timeout is not None:
325
+ __query["timeout"] = timeout
249
326
  __headers = {"accept": "application/json"}
250
327
  return await self.perform_request( # type: ignore[return-value]
251
328
  "GET",
@@ -277,16 +354,19 @@ class SlmClient(NamespacedClient):
277
354
  body: t.Optional[t.Dict[str, t.Any]] = None,
278
355
  ) -> ObjectApiResponse[t.Any]:
279
356
  """
280
- Creates or updates a snapshot lifecycle policy.
357
+ Create or update a policy. Create or update a snapshot lifecycle policy. If the
358
+ policy already exists, this request increments the policy version. Only the latest
359
+ version of a policy is stored.
281
360
 
282
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.16/slm-api-put-policy.html>`_
361
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/slm-api-put-policy.html>`_
283
362
 
284
- :param policy_id: ID for the snapshot lifecycle policy you want to create or
285
- update.
363
+ :param policy_id: The identifier for the snapshot lifecycle policy you want to
364
+ create or update.
286
365
  :param config: Configuration for each snapshot created by the policy.
287
- :param master_timeout: Period to wait for a connection to the master node. If
288
- no response is received before the timeout expires, the request fails and
289
- returns an error.
366
+ :param master_timeout: The period to wait for a connection to the master node.
367
+ If no response is received before the timeout expires, the request fails
368
+ and returns an error. To indicate that the request should never timeout,
369
+ set it to `-1`.
290
370
  :param name: Name automatically assigned to each snapshot created by the policy.
291
371
  Date math is supported. To prevent conflicting snapshot names, a UUID is
292
372
  automatically appended to each snapshot name.
@@ -297,8 +377,9 @@ class SlmClient(NamespacedClient):
297
377
  by the policy.
298
378
  :param schedule: Periodic or absolute schedule at which the policy creates snapshots.
299
379
  SLM applies schedule changes immediately.
300
- :param timeout: Period to wait for a response. If no response is received before
301
- the timeout expires, the request fails and returns an error.
380
+ :param timeout: The period to wait for a response. If no response is received
381
+ before the timeout expires, the request fails and returns an error. To indicate
382
+ that the request should never timeout, set it to `-1`.
302
383
  """
303
384
  if policy_id in SKIP_IN_PATH:
304
385
  raise ValueError("Empty value passed for parameter 'policy_id'")
@@ -351,12 +432,24 @@ class SlmClient(NamespacedClient):
351
432
  error_trace: t.Optional[bool] = None,
352
433
  filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
353
434
  human: t.Optional[bool] = None,
435
+ master_timeout: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
354
436
  pretty: t.Optional[bool] = None,
437
+ timeout: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
355
438
  ) -> ObjectApiResponse[t.Any]:
356
439
  """
357
- Turns on snapshot lifecycle management (SLM).
440
+ Start snapshot lifecycle management. Snapshot lifecycle management (SLM) starts
441
+ automatically when a cluster is formed. Manually starting SLM is necessary only
442
+ if it has been stopped using the stop SLM API.
443
+
444
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/slm-api-start.html>`_
358
445
 
359
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.16/slm-api-start.html>`_
446
+ :param master_timeout: The period to wait for a connection to the master node.
447
+ If no response is received before the timeout expires, the request fails
448
+ and returns an error. To indicate that the request should never timeout,
449
+ set it to `-1`.
450
+ :param timeout: The period to wait for a response. If no response is received
451
+ before the timeout expires, the request fails and returns an error. To indicate
452
+ that the request should never timeout, set it to `-1`.
360
453
  """
361
454
  __path_parts: t.Dict[str, str] = {}
362
455
  __path = "/_slm/start"
@@ -367,8 +460,12 @@ class SlmClient(NamespacedClient):
367
460
  __query["filter_path"] = filter_path
368
461
  if human is not None:
369
462
  __query["human"] = human
463
+ if master_timeout is not None:
464
+ __query["master_timeout"] = master_timeout
370
465
  if pretty is not None:
371
466
  __query["pretty"] = pretty
467
+ if timeout is not None:
468
+ __query["timeout"] = timeout
372
469
  __headers = {"accept": "application/json"}
373
470
  return await self.perform_request( # type: ignore[return-value]
374
471
  "POST",
@@ -386,12 +483,30 @@ class SlmClient(NamespacedClient):
386
483
  error_trace: t.Optional[bool] = None,
387
484
  filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
388
485
  human: t.Optional[bool] = None,
486
+ master_timeout: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
389
487
  pretty: t.Optional[bool] = None,
488
+ timeout: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
390
489
  ) -> ObjectApiResponse[t.Any]:
391
490
  """
392
- Turns off snapshot lifecycle management (SLM).
491
+ Stop snapshot lifecycle management. Stop all snapshot lifecycle management (SLM)
492
+ operations and the SLM plugin. This API is useful when you are performing maintenance
493
+ on a cluster and need to prevent SLM from performing any actions on your data
494
+ streams or indices. Stopping SLM does not stop any snapshots that are in progress.
495
+ You can manually trigger snapshots with the run snapshot lifecycle policy API
496
+ even if SLM is stopped. The API returns a response as soon as the request is
497
+ acknowledged, but the plugin might continue to run until in-progress operations
498
+ complete and it can be safely stopped. Use the get snapshot lifecycle management
499
+ status API to see if SLM is running.
393
500
 
394
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.16/slm-api-stop.html>`_
501
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/slm-api-stop.html>`_
502
+
503
+ :param master_timeout: The period to wait for a connection to the master node.
504
+ If no response is received before the timeout expires, the request fails
505
+ and returns an error. To indicate that the request should never timeout,
506
+ set it to `-1`.
507
+ :param timeout: The period to wait for a response. If no response is received
508
+ before the timeout expires, the request fails and returns an error. To indicate
509
+ that the request should never timeout, set it to `-1`.
395
510
  """
396
511
  __path_parts: t.Dict[str, str] = {}
397
512
  __path = "/_slm/stop"
@@ -402,8 +517,12 @@ class SlmClient(NamespacedClient):
402
517
  __query["filter_path"] = filter_path
403
518
  if human is not None:
404
519
  __query["human"] = human
520
+ if master_timeout is not None:
521
+ __query["master_timeout"] = master_timeout
405
522
  if pretty is not None:
406
523
  __query["pretty"] = pretty
524
+ if timeout is not None:
525
+ __query["timeout"] = timeout
407
526
  __headers = {"accept": "application/json"}
408
527
  return await self.perform_request( # type: ignore[return-value]
409
528
  "POST",