elasticsearch 8.17.0__py3-none-any.whl → 8.17.2__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.
- elasticsearch/__init__.py +2 -2
- elasticsearch/_async/client/__init__.py +2034 -740
- elasticsearch/_async/client/async_search.py +33 -22
- elasticsearch/_async/client/autoscaling.py +27 -21
- elasticsearch/_async/client/cat.py +280 -336
- elasticsearch/_async/client/ccr.py +96 -70
- elasticsearch/_async/client/cluster.py +152 -144
- elasticsearch/_async/client/connector.py +488 -55
- elasticsearch/_async/client/dangling_indices.py +22 -16
- elasticsearch/_async/client/enrich.py +25 -6
- elasticsearch/_async/client/eql.py +22 -9
- elasticsearch/_async/client/esql.py +295 -3
- elasticsearch/_async/client/features.py +25 -25
- elasticsearch/_async/client/fleet.py +15 -9
- elasticsearch/_async/client/graph.py +9 -8
- elasticsearch/_async/client/ilm.py +91 -61
- elasticsearch/_async/client/indices.py +746 -324
- elasticsearch/_async/client/inference.py +101 -4
- elasticsearch/_async/client/ingest.py +231 -19
- elasticsearch/_async/client/license.py +48 -31
- elasticsearch/_async/client/logstash.py +20 -6
- elasticsearch/_async/client/migration.py +25 -7
- elasticsearch/_async/client/ml.py +532 -278
- elasticsearch/_async/client/monitoring.py +5 -1
- elasticsearch/_async/client/nodes.py +46 -30
- elasticsearch/_async/client/query_rules.py +65 -18
- elasticsearch/_async/client/rollup.py +126 -13
- elasticsearch/_async/client/search_application.py +170 -13
- elasticsearch/_async/client/searchable_snapshots.py +45 -23
- elasticsearch/_async/client/security.py +1299 -340
- elasticsearch/_async/client/shutdown.py +43 -15
- elasticsearch/_async/client/simulate.py +145 -0
- elasticsearch/_async/client/slm.py +163 -19
- elasticsearch/_async/client/snapshot.py +288 -23
- elasticsearch/_async/client/sql.py +94 -53
- elasticsearch/_async/client/ssl.py +16 -17
- elasticsearch/_async/client/synonyms.py +67 -26
- elasticsearch/_async/client/tasks.py +103 -28
- elasticsearch/_async/client/text_structure.py +475 -46
- elasticsearch/_async/client/transform.py +108 -72
- elasticsearch/_async/client/watcher.py +245 -43
- elasticsearch/_async/client/xpack.py +20 -6
- elasticsearch/_async/helpers.py +1 -1
- elasticsearch/_sync/client/__init__.py +2034 -740
- elasticsearch/_sync/client/async_search.py +33 -22
- elasticsearch/_sync/client/autoscaling.py +27 -21
- elasticsearch/_sync/client/cat.py +280 -336
- elasticsearch/_sync/client/ccr.py +96 -70
- elasticsearch/_sync/client/cluster.py +152 -144
- elasticsearch/_sync/client/connector.py +488 -55
- elasticsearch/_sync/client/dangling_indices.py +22 -16
- elasticsearch/_sync/client/enrich.py +25 -6
- elasticsearch/_sync/client/eql.py +22 -9
- elasticsearch/_sync/client/esql.py +295 -3
- elasticsearch/_sync/client/features.py +25 -25
- elasticsearch/_sync/client/fleet.py +15 -9
- elasticsearch/_sync/client/graph.py +9 -8
- elasticsearch/_sync/client/ilm.py +91 -61
- elasticsearch/_sync/client/indices.py +746 -324
- elasticsearch/_sync/client/inference.py +101 -4
- elasticsearch/_sync/client/ingest.py +231 -19
- elasticsearch/_sync/client/license.py +48 -31
- elasticsearch/_sync/client/logstash.py +20 -6
- elasticsearch/_sync/client/migration.py +25 -7
- elasticsearch/_sync/client/ml.py +532 -278
- elasticsearch/_sync/client/monitoring.py +5 -1
- elasticsearch/_sync/client/nodes.py +46 -30
- elasticsearch/_sync/client/query_rules.py +65 -18
- elasticsearch/_sync/client/rollup.py +126 -13
- elasticsearch/_sync/client/search_application.py +170 -13
- elasticsearch/_sync/client/searchable_snapshots.py +45 -23
- elasticsearch/_sync/client/security.py +1299 -340
- elasticsearch/_sync/client/shutdown.py +43 -15
- elasticsearch/_sync/client/simulate.py +145 -0
- elasticsearch/_sync/client/slm.py +163 -19
- elasticsearch/_sync/client/snapshot.py +288 -23
- elasticsearch/_sync/client/sql.py +94 -53
- elasticsearch/_sync/client/ssl.py +16 -17
- elasticsearch/_sync/client/synonyms.py +67 -26
- elasticsearch/_sync/client/tasks.py +103 -28
- elasticsearch/_sync/client/text_structure.py +475 -46
- elasticsearch/_sync/client/transform.py +108 -72
- elasticsearch/_sync/client/utils.py +1 -1
- elasticsearch/_sync/client/watcher.py +245 -43
- elasticsearch/_sync/client/xpack.py +20 -6
- elasticsearch/_version.py +1 -1
- elasticsearch/client.py +4 -0
- elasticsearch/helpers/actions.py +1 -1
- elasticsearch/helpers/vectorstore/_sync/vectorstore.py +4 -1
- {elasticsearch-8.17.0.dist-info → elasticsearch-8.17.2.dist-info}/METADATA +1 -1
- elasticsearch-8.17.2.dist-info/RECORD +119 -0
- elasticsearch-8.17.0.dist-info/RECORD +0 -117
- {elasticsearch-8.17.0.dist-info → elasticsearch-8.17.2.dist-info}/WHEEL +0 -0
- {elasticsearch-8.17.0.dist-info → elasticsearch-8.17.2.dist-info}/licenses/LICENSE +0 -0
- {elasticsearch-8.17.0.dist-info → elasticsearch-8.17.2.dist-info}/licenses/NOTICE +0 -0
|
@@ -42,10 +42,18 @@ class ShutdownClient(NamespacedClient):
|
|
|
42
42
|
] = None,
|
|
43
43
|
) -> ObjectApiResponse[t.Any]:
|
|
44
44
|
"""
|
|
45
|
-
|
|
46
|
-
ECK. Direct use is not supported.
|
|
45
|
+
.. raw:: html
|
|
47
46
|
|
|
48
|
-
|
|
47
|
+
<p>Cancel node shutdown preparations.
|
|
48
|
+
Remove a node from the shutdown list so it can resume normal operations.
|
|
49
|
+
You must explicitly clear the shutdown request when a node rejoins the cluster or when a node has permanently left the cluster.
|
|
50
|
+
Shutdown requests are never removed automatically by Elasticsearch.</p>
|
|
51
|
+
<p>NOTE: This feature is designed for indirect use by Elastic Cloud, Elastic Cloud Enterprise, and Elastic Cloud on Kubernetes.
|
|
52
|
+
Direct use is not supported.</p>
|
|
53
|
+
<p>If the operator privileges feature is enabled, you must be an operator to use this API.</p>
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/delete-shutdown.html>`_
|
|
49
57
|
|
|
50
58
|
:param node_id: The node id of node to be removed from the shutdown state
|
|
51
59
|
:param master_timeout: Period to wait for a connection to the master node. If
|
|
@@ -98,10 +106,16 @@ class ShutdownClient(NamespacedClient):
|
|
|
98
106
|
] = None,
|
|
99
107
|
) -> ObjectApiResponse[t.Any]:
|
|
100
108
|
"""
|
|
101
|
-
|
|
102
|
-
|
|
109
|
+
.. raw:: html
|
|
110
|
+
|
|
111
|
+
<p>Get the shutdown status.</p>
|
|
112
|
+
<p>Get information about nodes that are ready to be shut down, have shut down preparations still in progress, or have stalled.
|
|
113
|
+
The API returns status information for each part of the shut down process.</p>
|
|
114
|
+
<p>NOTE: This feature is designed for indirect use by Elasticsearch Service, Elastic Cloud Enterprise, and Elastic Cloud on Kubernetes. Direct use is not supported.</p>
|
|
115
|
+
<p>If the operator privileges feature is enabled, you must be an operator to use this API.</p>
|
|
103
116
|
|
|
104
|
-
|
|
117
|
+
|
|
118
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/get-shutdown.html>`_
|
|
105
119
|
|
|
106
120
|
:param node_id: Which node for which to retrieve the shutdown status
|
|
107
121
|
:param master_timeout: Period to wait for a connection to the master node. If
|
|
@@ -166,12 +180,26 @@ class ShutdownClient(NamespacedClient):
|
|
|
166
180
|
body: t.Optional[t.Dict[str, t.Any]] = None,
|
|
167
181
|
) -> ObjectApiResponse[t.Any]:
|
|
168
182
|
"""
|
|
169
|
-
|
|
170
|
-
|
|
183
|
+
.. raw:: html
|
|
184
|
+
|
|
185
|
+
<p>Prepare a node to be shut down.</p>
|
|
186
|
+
<p>NOTE: This feature is designed for indirect use by Elastic Cloud, Elastic Cloud Enterprise, and Elastic Cloud on Kubernetes. Direct use is not supported.</p>
|
|
187
|
+
<p>If you specify a node that is offline, it will be prepared for shut down when it rejoins the cluster.</p>
|
|
188
|
+
<p>If the operator privileges feature is enabled, you must be an operator to use this API.</p>
|
|
189
|
+
<p>The API migrates ongoing tasks and index shards to other nodes as needed to prepare a node to be restarted or shut down and removed from the cluster.
|
|
190
|
+
This ensures that Elasticsearch can be stopped safely with minimal disruption to the cluster.</p>
|
|
191
|
+
<p>You must specify the type of shutdown: <code>restart</code>, <code>remove</code>, or <code>replace</code>.
|
|
192
|
+
If a node is already being prepared for shutdown, you can use this API to change the shutdown type.</p>
|
|
193
|
+
<p>IMPORTANT: This API does NOT terminate the Elasticsearch process.
|
|
194
|
+
Monitor the node shutdown status to determine when it is safe to stop Elasticsearch.</p>
|
|
195
|
+
|
|
171
196
|
|
|
172
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/
|
|
197
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/put-shutdown.html>`_
|
|
173
198
|
|
|
174
|
-
:param node_id: The node
|
|
199
|
+
:param node_id: The node identifier. This parameter is not validated against
|
|
200
|
+
the cluster's active nodes. This enables you to register a node for shut
|
|
201
|
+
down while it is offline. No error is thrown if you specify an invalid node
|
|
202
|
+
ID.
|
|
175
203
|
:param reason: A human-readable reason that the node is being shut down. This
|
|
176
204
|
field provides information for other cluster operators; it does not affect
|
|
177
205
|
the shut down process.
|
|
@@ -192,17 +220,17 @@ class ShutdownClient(NamespacedClient):
|
|
|
192
220
|
the index.unassigned.node_left.delayed_timeout setting. If you specify both
|
|
193
221
|
a restart allocation delay and an index-level allocation delay, the longer
|
|
194
222
|
of the two is used.
|
|
195
|
-
:param master_timeout:
|
|
196
|
-
no response is received before the timeout expires, the request fails
|
|
197
|
-
returns an error.
|
|
223
|
+
:param master_timeout: The period to wait for a connection to the master node.
|
|
224
|
+
If no response is received before the timeout expires, the request fails
|
|
225
|
+
and returns an error.
|
|
198
226
|
:param target_node_name: Only valid if type is replace. Specifies the name of
|
|
199
227
|
the node that is replacing the node being shut down. Shards from the shut
|
|
200
228
|
down node are only allowed to be allocated to the target node, and no other
|
|
201
229
|
data will be allocated to the target node. During relocation of data certain
|
|
202
230
|
allocation rules are ignored, such as disk watermarks or user attribute filtering
|
|
203
231
|
rules.
|
|
204
|
-
:param timeout:
|
|
205
|
-
the timeout expires, the request fails and returns an error.
|
|
232
|
+
:param timeout: The period to wait for a response. If no response is received
|
|
233
|
+
before the timeout expires, the request fails and returns an error.
|
|
206
234
|
"""
|
|
207
235
|
if node_id in SKIP_IN_PATH:
|
|
208
236
|
raise ValueError("Empty value passed for parameter 'node_id'")
|
|
@@ -0,0 +1,145 @@
|
|
|
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
|
+
.. raw:: html
|
|
68
|
+
|
|
69
|
+
<p>Simulate data ingestion.
|
|
70
|
+
Run ingest pipelines against a set of provided documents, optionally with substitute pipeline definitions, to simulate ingesting data into an index.</p>
|
|
71
|
+
<p>This API is meant to be used for troubleshooting or pipeline development, as it does not actually index any data into Elasticsearch.</p>
|
|
72
|
+
<p>The API runs the default and final pipeline for that index against a set of documents provided in the body of the request.
|
|
73
|
+
If a pipeline contains a reroute processor, it follows that reroute processor to the new index, running that index's pipelines as well the same way that a non-simulated ingest would.
|
|
74
|
+
No data is indexed into Elasticsearch.
|
|
75
|
+
Instead, the transformed document is returned, along with the list of pipelines that have been run and the name of the index where the document would have been indexed if this were not a simulation.
|
|
76
|
+
The transformed document is validated against the mappings that would apply to this index, and any validation error is reported in the result.</p>
|
|
77
|
+
<p>This API differs from the simulate pipeline API in that you specify a single pipeline for that API, and it runs only that one pipeline.
|
|
78
|
+
The simulate pipeline API is more useful for developing a single pipeline, while the simulate ingest API is more useful for troubleshooting the interaction of the various pipelines that get applied when ingesting into an index.</p>
|
|
79
|
+
<p>By default, the pipeline definitions that are currently in the system are used.
|
|
80
|
+
However, you can supply substitute pipeline definitions in the body of the request.
|
|
81
|
+
These will be used in place of the pipeline definitions that are already in the system. This can be used to replace existing pipeline definitions or to create new ones. The pipeline substitutions are used only within this request.</p>
|
|
82
|
+
|
|
83
|
+
|
|
84
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/simulate-ingest-api.html>`_
|
|
85
|
+
|
|
86
|
+
:param docs: Sample documents to test in the pipeline.
|
|
87
|
+
:param index: The index to simulate ingesting into. This value can be overridden
|
|
88
|
+
by specifying an index on each document. If you specify this parameter in
|
|
89
|
+
the request path, it is used for any documents that do not explicitly specify
|
|
90
|
+
an index argument.
|
|
91
|
+
:param component_template_substitutions: A map of component template names to
|
|
92
|
+
substitute component template definition objects.
|
|
93
|
+
:param index_template_subtitutions: A map of index template names to substitute
|
|
94
|
+
index template definition objects.
|
|
95
|
+
:param mapping_addition:
|
|
96
|
+
:param pipeline: The pipeline to use as the default pipeline. This value can
|
|
97
|
+
be used to override the default pipeline of the index.
|
|
98
|
+
:param pipeline_substitutions: Pipelines to test. If you don’t specify the `pipeline`
|
|
99
|
+
request path parameter, this parameter is required. If you specify both this
|
|
100
|
+
and the request path parameter, the API only uses the request path parameter.
|
|
101
|
+
"""
|
|
102
|
+
if docs is None and body is None:
|
|
103
|
+
raise ValueError("Empty value passed for parameter 'docs'")
|
|
104
|
+
__path_parts: t.Dict[str, str]
|
|
105
|
+
if index not in SKIP_IN_PATH:
|
|
106
|
+
__path_parts = {"index": _quote(index)}
|
|
107
|
+
__path = f'/_ingest/{__path_parts["index"]}/_simulate'
|
|
108
|
+
else:
|
|
109
|
+
__path_parts = {}
|
|
110
|
+
__path = "/_ingest/_simulate"
|
|
111
|
+
__query: t.Dict[str, t.Any] = {}
|
|
112
|
+
__body: t.Dict[str, t.Any] = body if body is not None else {}
|
|
113
|
+
if error_trace is not None:
|
|
114
|
+
__query["error_trace"] = error_trace
|
|
115
|
+
if filter_path is not None:
|
|
116
|
+
__query["filter_path"] = filter_path
|
|
117
|
+
if human is not None:
|
|
118
|
+
__query["human"] = human
|
|
119
|
+
if pipeline is not None:
|
|
120
|
+
__query["pipeline"] = pipeline
|
|
121
|
+
if pretty is not None:
|
|
122
|
+
__query["pretty"] = pretty
|
|
123
|
+
if not __body:
|
|
124
|
+
if docs is not None:
|
|
125
|
+
__body["docs"] = docs
|
|
126
|
+
if component_template_substitutions is not None:
|
|
127
|
+
__body["component_template_substitutions"] = (
|
|
128
|
+
component_template_substitutions
|
|
129
|
+
)
|
|
130
|
+
if index_template_subtitutions is not None:
|
|
131
|
+
__body["index_template_subtitutions"] = index_template_subtitutions
|
|
132
|
+
if mapping_addition is not None:
|
|
133
|
+
__body["mapping_addition"] = mapping_addition
|
|
134
|
+
if pipeline_substitutions is not None:
|
|
135
|
+
__body["pipeline_substitutions"] = pipeline_substitutions
|
|
136
|
+
__headers = {"accept": "application/json", "content-type": "application/json"}
|
|
137
|
+
return await self.perform_request( # type: ignore[return-value]
|
|
138
|
+
"POST",
|
|
139
|
+
__path,
|
|
140
|
+
params=__query,
|
|
141
|
+
headers=__headers,
|
|
142
|
+
body=__body,
|
|
143
|
+
endpoint_id="simulate.ingest",
|
|
144
|
+
path_parts=__path_parts,
|
|
145
|
+
)
|
|
@@ -33,14 +33,26 @@ 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
|
-
|
|
41
|
+
.. raw:: html
|
|
42
|
+
|
|
43
|
+
<p>Delete a policy.
|
|
44
|
+
Delete a snapshot lifecycle policy definition.
|
|
45
|
+
This operation prevents any future snapshots from being taken but does not cancel in-progress snapshots or remove previously-taken snapshots.</p>
|
|
46
|
+
|
|
40
47
|
|
|
41
48
|
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/slm-api-delete-policy.html>`_
|
|
42
49
|
|
|
43
50
|
:param policy_id: The id of the snapshot lifecycle policy to remove
|
|
51
|
+
:param master_timeout: The period to wait for a connection to the master node.
|
|
52
|
+
If no response is received before the timeout expires, the request fails
|
|
53
|
+
and returns an error.
|
|
54
|
+
:param timeout: The period to wait for a response. If no response is received
|
|
55
|
+
before the timeout expires, the request fails and returns an error.
|
|
44
56
|
"""
|
|
45
57
|
if policy_id in SKIP_IN_PATH:
|
|
46
58
|
raise ValueError("Empty value passed for parameter 'policy_id'")
|
|
@@ -53,8 +65,12 @@ class SlmClient(NamespacedClient):
|
|
|
53
65
|
__query["filter_path"] = filter_path
|
|
54
66
|
if human is not None:
|
|
55
67
|
__query["human"] = human
|
|
68
|
+
if master_timeout is not None:
|
|
69
|
+
__query["master_timeout"] = master_timeout
|
|
56
70
|
if pretty is not None:
|
|
57
71
|
__query["pretty"] = pretty
|
|
72
|
+
if timeout is not None:
|
|
73
|
+
__query["timeout"] = timeout
|
|
58
74
|
__headers = {"accept": "application/json"}
|
|
59
75
|
return await self.perform_request( # type: ignore[return-value]
|
|
60
76
|
"DELETE",
|
|
@@ -73,15 +89,26 @@ class SlmClient(NamespacedClient):
|
|
|
73
89
|
error_trace: t.Optional[bool] = None,
|
|
74
90
|
filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
|
|
75
91
|
human: t.Optional[bool] = None,
|
|
92
|
+
master_timeout: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
|
|
76
93
|
pretty: t.Optional[bool] = None,
|
|
94
|
+
timeout: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
|
|
77
95
|
) -> ObjectApiResponse[t.Any]:
|
|
78
96
|
"""
|
|
79
|
-
|
|
80
|
-
|
|
97
|
+
.. raw:: html
|
|
98
|
+
|
|
99
|
+
<p>Run a policy.
|
|
100
|
+
Immediately create a snapshot according to the snapshot lifecycle policy without waiting for the scheduled time.
|
|
101
|
+
The snapshot policy is normally applied according to its schedule, but you might want to manually run a policy before performing an upgrade or other maintenance.</p>
|
|
102
|
+
|
|
81
103
|
|
|
82
104
|
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/slm-api-execute-lifecycle.html>`_
|
|
83
105
|
|
|
84
106
|
:param policy_id: The id of the snapshot lifecycle policy to be executed
|
|
107
|
+
:param master_timeout: The period to wait for a connection to the master node.
|
|
108
|
+
If no response is received before the timeout expires, the request fails
|
|
109
|
+
and returns an error.
|
|
110
|
+
:param timeout: The period to wait for a response. If no response is received
|
|
111
|
+
before the timeout expires, the request fails and returns an error.
|
|
85
112
|
"""
|
|
86
113
|
if policy_id in SKIP_IN_PATH:
|
|
87
114
|
raise ValueError("Empty value passed for parameter 'policy_id'")
|
|
@@ -94,8 +121,12 @@ class SlmClient(NamespacedClient):
|
|
|
94
121
|
__query["filter_path"] = filter_path
|
|
95
122
|
if human is not None:
|
|
96
123
|
__query["human"] = human
|
|
124
|
+
if master_timeout is not None:
|
|
125
|
+
__query["master_timeout"] = master_timeout
|
|
97
126
|
if pretty is not None:
|
|
98
127
|
__query["pretty"] = pretty
|
|
128
|
+
if timeout is not None:
|
|
129
|
+
__query["timeout"] = timeout
|
|
99
130
|
__headers = {"accept": "application/json"}
|
|
100
131
|
return await self.perform_request( # type: ignore[return-value]
|
|
101
132
|
"PUT",
|
|
@@ -113,12 +144,25 @@ class SlmClient(NamespacedClient):
|
|
|
113
144
|
error_trace: t.Optional[bool] = None,
|
|
114
145
|
filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
|
|
115
146
|
human: t.Optional[bool] = None,
|
|
147
|
+
master_timeout: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
|
|
116
148
|
pretty: t.Optional[bool] = None,
|
|
149
|
+
timeout: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
|
|
117
150
|
) -> ObjectApiResponse[t.Any]:
|
|
118
151
|
"""
|
|
119
|
-
|
|
152
|
+
.. raw:: html
|
|
153
|
+
|
|
154
|
+
<p>Run a retention policy.
|
|
155
|
+
Manually apply the retention policy to force immediate removal of snapshots that are expired according to the snapshot lifecycle policy retention rules.
|
|
156
|
+
The retention policy is normally applied according to its schedule.</p>
|
|
157
|
+
|
|
120
158
|
|
|
121
159
|
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/slm-api-execute-retention.html>`_
|
|
160
|
+
|
|
161
|
+
:param master_timeout: The period to wait for a connection to the master node.
|
|
162
|
+
If no response is received before the timeout expires, the request fails
|
|
163
|
+
and returns an error.
|
|
164
|
+
:param timeout: The period to wait for a response. If no response is received
|
|
165
|
+
before the timeout expires, the request fails and returns an error.
|
|
122
166
|
"""
|
|
123
167
|
__path_parts: t.Dict[str, str] = {}
|
|
124
168
|
__path = "/_slm/_execute_retention"
|
|
@@ -129,8 +173,12 @@ class SlmClient(NamespacedClient):
|
|
|
129
173
|
__query["filter_path"] = filter_path
|
|
130
174
|
if human is not None:
|
|
131
175
|
__query["human"] = human
|
|
176
|
+
if master_timeout is not None:
|
|
177
|
+
__query["master_timeout"] = master_timeout
|
|
132
178
|
if pretty is not None:
|
|
133
179
|
__query["pretty"] = pretty
|
|
180
|
+
if timeout is not None:
|
|
181
|
+
__query["timeout"] = timeout
|
|
134
182
|
__headers = {"accept": "application/json"}
|
|
135
183
|
return await self.perform_request( # type: ignore[return-value]
|
|
136
184
|
"POST",
|
|
@@ -149,15 +197,25 @@ class SlmClient(NamespacedClient):
|
|
|
149
197
|
error_trace: t.Optional[bool] = None,
|
|
150
198
|
filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
|
|
151
199
|
human: t.Optional[bool] = None,
|
|
200
|
+
master_timeout: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
|
|
152
201
|
pretty: t.Optional[bool] = None,
|
|
202
|
+
timeout: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
|
|
153
203
|
) -> ObjectApiResponse[t.Any]:
|
|
154
204
|
"""
|
|
155
|
-
|
|
156
|
-
|
|
205
|
+
.. raw:: html
|
|
206
|
+
|
|
207
|
+
<p>Get policy information.
|
|
208
|
+
Get snapshot lifecycle policy definitions and information about the latest snapshot attempts.</p>
|
|
209
|
+
|
|
157
210
|
|
|
158
211
|
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/slm-api-get-policy.html>`_
|
|
159
212
|
|
|
160
213
|
:param policy_id: Comma-separated list of snapshot lifecycle policies to retrieve
|
|
214
|
+
:param master_timeout: The period to wait for a connection to the master node.
|
|
215
|
+
If no response is received before the timeout expires, the request fails
|
|
216
|
+
and returns an error.
|
|
217
|
+
:param timeout: The period to wait for a response. If no response is received
|
|
218
|
+
before the timeout expires, the request fails and returns an error.
|
|
161
219
|
"""
|
|
162
220
|
__path_parts: t.Dict[str, str]
|
|
163
221
|
if policy_id not in SKIP_IN_PATH:
|
|
@@ -173,8 +231,12 @@ class SlmClient(NamespacedClient):
|
|
|
173
231
|
__query["filter_path"] = filter_path
|
|
174
232
|
if human is not None:
|
|
175
233
|
__query["human"] = human
|
|
234
|
+
if master_timeout is not None:
|
|
235
|
+
__query["master_timeout"] = master_timeout
|
|
176
236
|
if pretty is not None:
|
|
177
237
|
__query["pretty"] = pretty
|
|
238
|
+
if timeout is not None:
|
|
239
|
+
__query["timeout"] = timeout
|
|
178
240
|
__headers = {"accept": "application/json"}
|
|
179
241
|
return await self.perform_request( # type: ignore[return-value]
|
|
180
242
|
"GET",
|
|
@@ -192,13 +254,24 @@ class SlmClient(NamespacedClient):
|
|
|
192
254
|
error_trace: t.Optional[bool] = None,
|
|
193
255
|
filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
|
|
194
256
|
human: t.Optional[bool] = None,
|
|
257
|
+
master_timeout: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
|
|
195
258
|
pretty: t.Optional[bool] = None,
|
|
259
|
+
timeout: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
|
|
196
260
|
) -> ObjectApiResponse[t.Any]:
|
|
197
261
|
"""
|
|
198
|
-
|
|
199
|
-
|
|
262
|
+
.. raw:: html
|
|
263
|
+
|
|
264
|
+
<p>Get snapshot lifecycle management statistics.
|
|
265
|
+
Get global and policy-level statistics about actions taken by snapshot lifecycle management.</p>
|
|
266
|
+
|
|
200
267
|
|
|
201
268
|
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/slm-api-get-stats.html>`_
|
|
269
|
+
|
|
270
|
+
:param master_timeout: Period to wait for a connection to the master node. If
|
|
271
|
+
no response is received before the timeout expires, the request fails and
|
|
272
|
+
returns an error.
|
|
273
|
+
:param timeout: Period to wait for a response. If no response is received before
|
|
274
|
+
the timeout expires, the request fails and returns an error.
|
|
202
275
|
"""
|
|
203
276
|
__path_parts: t.Dict[str, str] = {}
|
|
204
277
|
__path = "/_slm/stats"
|
|
@@ -209,8 +282,12 @@ class SlmClient(NamespacedClient):
|
|
|
209
282
|
__query["filter_path"] = filter_path
|
|
210
283
|
if human is not None:
|
|
211
284
|
__query["human"] = human
|
|
285
|
+
if master_timeout is not None:
|
|
286
|
+
__query["master_timeout"] = master_timeout
|
|
212
287
|
if pretty is not None:
|
|
213
288
|
__query["pretty"] = pretty
|
|
289
|
+
if timeout is not None:
|
|
290
|
+
__query["timeout"] = timeout
|
|
214
291
|
__headers = {"accept": "application/json"}
|
|
215
292
|
return await self.perform_request( # type: ignore[return-value]
|
|
216
293
|
"GET",
|
|
@@ -228,12 +305,25 @@ class SlmClient(NamespacedClient):
|
|
|
228
305
|
error_trace: t.Optional[bool] = None,
|
|
229
306
|
filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
|
|
230
307
|
human: t.Optional[bool] = None,
|
|
308
|
+
master_timeout: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
|
|
231
309
|
pretty: t.Optional[bool] = None,
|
|
310
|
+
timeout: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
|
|
232
311
|
) -> ObjectApiResponse[t.Any]:
|
|
233
312
|
"""
|
|
234
|
-
|
|
313
|
+
.. raw:: html
|
|
314
|
+
|
|
315
|
+
<p>Get the snapshot lifecycle management status.</p>
|
|
316
|
+
|
|
235
317
|
|
|
236
318
|
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/slm-api-get-status.html>`_
|
|
319
|
+
|
|
320
|
+
:param master_timeout: The period to wait for a connection to the master node.
|
|
321
|
+
If no response is received before the timeout expires, the request fails
|
|
322
|
+
and returns an error. To indicate that the request should never timeout,
|
|
323
|
+
set it to `-1`.
|
|
324
|
+
:param timeout: The period to wait for a response. If no response is received
|
|
325
|
+
before the timeout expires, the request fails and returns an error. To indicate
|
|
326
|
+
that the request should never timeout, set it to `-1`.
|
|
237
327
|
"""
|
|
238
328
|
__path_parts: t.Dict[str, str] = {}
|
|
239
329
|
__path = "/_slm/status"
|
|
@@ -244,8 +334,12 @@ class SlmClient(NamespacedClient):
|
|
|
244
334
|
__query["filter_path"] = filter_path
|
|
245
335
|
if human is not None:
|
|
246
336
|
__query["human"] = human
|
|
337
|
+
if master_timeout is not None:
|
|
338
|
+
__query["master_timeout"] = master_timeout
|
|
247
339
|
if pretty is not None:
|
|
248
340
|
__query["pretty"] = pretty
|
|
341
|
+
if timeout is not None:
|
|
342
|
+
__query["timeout"] = timeout
|
|
249
343
|
__headers = {"accept": "application/json"}
|
|
250
344
|
return await self.perform_request( # type: ignore[return-value]
|
|
251
345
|
"GET",
|
|
@@ -277,16 +371,23 @@ class SlmClient(NamespacedClient):
|
|
|
277
371
|
body: t.Optional[t.Dict[str, t.Any]] = None,
|
|
278
372
|
) -> ObjectApiResponse[t.Any]:
|
|
279
373
|
"""
|
|
280
|
-
|
|
374
|
+
.. raw:: html
|
|
375
|
+
|
|
376
|
+
<p>Create or update a policy.
|
|
377
|
+
Create or update a snapshot lifecycle policy.
|
|
378
|
+
If the policy already exists, this request increments the policy version.
|
|
379
|
+
Only the latest version of a policy is stored.</p>
|
|
380
|
+
|
|
281
381
|
|
|
282
382
|
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/slm-api-put-policy.html>`_
|
|
283
383
|
|
|
284
|
-
:param policy_id:
|
|
285
|
-
update.
|
|
384
|
+
:param policy_id: The identifier for the snapshot lifecycle policy you want to
|
|
385
|
+
create or update.
|
|
286
386
|
:param config: Configuration for each snapshot created by the policy.
|
|
287
|
-
:param master_timeout:
|
|
288
|
-
no response is received before the timeout expires, the request fails
|
|
289
|
-
returns an error.
|
|
387
|
+
:param master_timeout: The period to wait for a connection to the master node.
|
|
388
|
+
If no response is received before the timeout expires, the request fails
|
|
389
|
+
and returns an error. To indicate that the request should never timeout,
|
|
390
|
+
set it to `-1`.
|
|
290
391
|
:param name: Name automatically assigned to each snapshot created by the policy.
|
|
291
392
|
Date math is supported. To prevent conflicting snapshot names, a UUID is
|
|
292
393
|
automatically appended to each snapshot name.
|
|
@@ -297,8 +398,9 @@ class SlmClient(NamespacedClient):
|
|
|
297
398
|
by the policy.
|
|
298
399
|
:param schedule: Periodic or absolute schedule at which the policy creates snapshots.
|
|
299
400
|
SLM applies schedule changes immediately.
|
|
300
|
-
:param timeout:
|
|
301
|
-
the timeout expires, the request fails and returns an error.
|
|
401
|
+
:param timeout: The period to wait for a response. If no response is received
|
|
402
|
+
before the timeout expires, the request fails and returns an error. To indicate
|
|
403
|
+
that the request should never timeout, set it to `-1`.
|
|
302
404
|
"""
|
|
303
405
|
if policy_id in SKIP_IN_PATH:
|
|
304
406
|
raise ValueError("Empty value passed for parameter 'policy_id'")
|
|
@@ -351,12 +453,27 @@ class SlmClient(NamespacedClient):
|
|
|
351
453
|
error_trace: t.Optional[bool] = None,
|
|
352
454
|
filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
|
|
353
455
|
human: t.Optional[bool] = None,
|
|
456
|
+
master_timeout: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
|
|
354
457
|
pretty: t.Optional[bool] = None,
|
|
458
|
+
timeout: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
|
|
355
459
|
) -> ObjectApiResponse[t.Any]:
|
|
356
460
|
"""
|
|
357
|
-
|
|
461
|
+
.. raw:: html
|
|
462
|
+
|
|
463
|
+
<p>Start snapshot lifecycle management.
|
|
464
|
+
Snapshot lifecycle management (SLM) starts automatically when a cluster is formed.
|
|
465
|
+
Manually starting SLM is necessary only if it has been stopped using the stop SLM API.</p>
|
|
466
|
+
|
|
358
467
|
|
|
359
468
|
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/slm-api-start.html>`_
|
|
469
|
+
|
|
470
|
+
:param master_timeout: The period to wait for a connection to the master node.
|
|
471
|
+
If no response is received before the timeout expires, the request fails
|
|
472
|
+
and returns an error. To indicate that the request should never timeout,
|
|
473
|
+
set it to `-1`.
|
|
474
|
+
:param timeout: The period to wait for a response. If no response is received
|
|
475
|
+
before the timeout expires, the request fails and returns an error. To indicate
|
|
476
|
+
that the request should never timeout, set it to `-1`.
|
|
360
477
|
"""
|
|
361
478
|
__path_parts: t.Dict[str, str] = {}
|
|
362
479
|
__path = "/_slm/start"
|
|
@@ -367,8 +484,12 @@ class SlmClient(NamespacedClient):
|
|
|
367
484
|
__query["filter_path"] = filter_path
|
|
368
485
|
if human is not None:
|
|
369
486
|
__query["human"] = human
|
|
487
|
+
if master_timeout is not None:
|
|
488
|
+
__query["master_timeout"] = master_timeout
|
|
370
489
|
if pretty is not None:
|
|
371
490
|
__query["pretty"] = pretty
|
|
491
|
+
if timeout is not None:
|
|
492
|
+
__query["timeout"] = timeout
|
|
372
493
|
__headers = {"accept": "application/json"}
|
|
373
494
|
return await self.perform_request( # type: ignore[return-value]
|
|
374
495
|
"POST",
|
|
@@ -386,12 +507,31 @@ class SlmClient(NamespacedClient):
|
|
|
386
507
|
error_trace: t.Optional[bool] = None,
|
|
387
508
|
filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
|
|
388
509
|
human: t.Optional[bool] = None,
|
|
510
|
+
master_timeout: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
|
|
389
511
|
pretty: t.Optional[bool] = None,
|
|
512
|
+
timeout: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
|
|
390
513
|
) -> ObjectApiResponse[t.Any]:
|
|
391
514
|
"""
|
|
392
|
-
|
|
515
|
+
.. raw:: html
|
|
516
|
+
|
|
517
|
+
<p>Stop snapshot lifecycle management.
|
|
518
|
+
Stop all snapshot lifecycle management (SLM) operations and the SLM plugin.
|
|
519
|
+
This API is useful when you are performing maintenance on a cluster and need to prevent SLM from performing any actions on your data streams or indices.
|
|
520
|
+
Stopping SLM does not stop any snapshots that are in progress.
|
|
521
|
+
You can manually trigger snapshots with the run snapshot lifecycle policy API even if SLM is stopped.</p>
|
|
522
|
+
<p>The API returns a response as soon as the request is acknowledged, but the plugin might continue to run until in-progress operations complete and it can be safely stopped.
|
|
523
|
+
Use the get snapshot lifecycle management status API to see if SLM is running.</p>
|
|
524
|
+
|
|
393
525
|
|
|
394
526
|
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/slm-api-stop.html>`_
|
|
527
|
+
|
|
528
|
+
:param master_timeout: The period to wait for a connection to the master node.
|
|
529
|
+
If no response is received before the timeout expires, the request fails
|
|
530
|
+
and returns an error. To indicate that the request should never timeout,
|
|
531
|
+
set it to `-1`.
|
|
532
|
+
:param timeout: The period to wait for a response. If no response is received
|
|
533
|
+
before the timeout expires, the request fails and returns an error. To indicate
|
|
534
|
+
that the request should never timeout, set it to `-1`.
|
|
395
535
|
"""
|
|
396
536
|
__path_parts: t.Dict[str, str] = {}
|
|
397
537
|
__path = "/_slm/stop"
|
|
@@ -402,8 +542,12 @@ class SlmClient(NamespacedClient):
|
|
|
402
542
|
__query["filter_path"] = filter_path
|
|
403
543
|
if human is not None:
|
|
404
544
|
__query["human"] = human
|
|
545
|
+
if master_timeout is not None:
|
|
546
|
+
__query["master_timeout"] = master_timeout
|
|
405
547
|
if pretty is not None:
|
|
406
548
|
__query["pretty"] = pretty
|
|
549
|
+
if timeout is not None:
|
|
550
|
+
__query["timeout"] = timeout
|
|
407
551
|
__headers = {"accept": "application/json"}
|
|
408
552
|
return await self.perform_request( # type: ignore[return-value]
|
|
409
553
|
"POST",
|