elasticsearch 8.12.1__py3-none-any.whl → 8.13.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.
- elasticsearch/__init__.py +7 -0
- elasticsearch/_async/client/__init__.py +477 -128
- elasticsearch/_async/client/_base.py +41 -1
- elasticsearch/_async/client/async_search.py +40 -12
- elasticsearch/_async/client/autoscaling.py +37 -11
- elasticsearch/_async/client/cat.py +260 -69
- elasticsearch/_async/client/ccr.py +123 -38
- elasticsearch/_async/client/cluster.py +153 -42
- elasticsearch/_async/client/dangling_indices.py +27 -8
- elasticsearch/_async/client/enrich.py +48 -14
- elasticsearch/_async/client/eql.py +38 -12
- elasticsearch/_async/client/esql.py +10 -2
- elasticsearch/_async/client/features.py +17 -4
- elasticsearch/_async/client/fleet.py +30 -7
- elasticsearch/_async/client/graph.py +11 -3
- elasticsearch/_async/client/ilm.py +101 -29
- elasticsearch/_async/client/indices.py +688 -181
- elasticsearch/_async/client/inference.py +111 -44
- elasticsearch/_async/client/ingest.py +59 -16
- elasticsearch/_async/client/license.py +58 -14
- elasticsearch/_async/client/logstash.py +31 -9
- elasticsearch/_async/client/migration.py +28 -7
- elasticsearch/_async/client/ml.py +781 -214
- elasticsearch/_async/client/monitoring.py +10 -2
- elasticsearch/_async/client/nodes.py +103 -29
- elasticsearch/_async/client/query_ruleset.py +37 -11
- elasticsearch/_async/client/rollup.py +79 -24
- elasticsearch/_async/client/search_application.py +76 -23
- elasticsearch/_async/client/searchable_snapshots.py +49 -12
- elasticsearch/_async/client/security.py +544 -143
- elasticsearch/_async/client/shutdown.py +28 -6
- elasticsearch/_async/client/slm.py +80 -22
- elasticsearch/_async/client/snapshot.py +140 -54
- elasticsearch/_async/client/sql.py +55 -15
- elasticsearch/_async/client/ssl.py +9 -2
- elasticsearch/_async/client/synonyms.py +75 -21
- elasticsearch/_async/client/tasks.py +29 -8
- elasticsearch/_async/client/text_structure.py +74 -2
- elasticsearch/_async/client/transform.py +106 -32
- elasticsearch/_async/client/watcher.py +110 -31
- elasticsearch/_async/client/xpack.py +16 -4
- elasticsearch/_async/helpers.py +1 -1
- elasticsearch/_otel.py +92 -0
- elasticsearch/_sync/client/__init__.py +477 -128
- elasticsearch/_sync/client/_base.py +41 -1
- elasticsearch/_sync/client/async_search.py +40 -12
- elasticsearch/_sync/client/autoscaling.py +37 -11
- elasticsearch/_sync/client/cat.py +260 -69
- elasticsearch/_sync/client/ccr.py +123 -38
- elasticsearch/_sync/client/cluster.py +153 -42
- elasticsearch/_sync/client/dangling_indices.py +27 -8
- elasticsearch/_sync/client/enrich.py +48 -14
- elasticsearch/_sync/client/eql.py +38 -12
- elasticsearch/_sync/client/esql.py +10 -2
- elasticsearch/_sync/client/features.py +17 -4
- elasticsearch/_sync/client/fleet.py +30 -7
- elasticsearch/_sync/client/graph.py +11 -3
- elasticsearch/_sync/client/ilm.py +101 -29
- elasticsearch/_sync/client/indices.py +688 -181
- elasticsearch/_sync/client/inference.py +111 -44
- elasticsearch/_sync/client/ingest.py +59 -16
- elasticsearch/_sync/client/license.py +58 -14
- elasticsearch/_sync/client/logstash.py +31 -9
- elasticsearch/_sync/client/migration.py +28 -7
- elasticsearch/_sync/client/ml.py +781 -214
- elasticsearch/_sync/client/monitoring.py +10 -2
- elasticsearch/_sync/client/nodes.py +103 -29
- elasticsearch/_sync/client/query_ruleset.py +37 -11
- elasticsearch/_sync/client/rollup.py +79 -24
- elasticsearch/_sync/client/search_application.py +76 -23
- elasticsearch/_sync/client/searchable_snapshots.py +49 -12
- elasticsearch/_sync/client/security.py +544 -143
- elasticsearch/_sync/client/shutdown.py +28 -6
- elasticsearch/_sync/client/slm.py +80 -22
- elasticsearch/_sync/client/snapshot.py +140 -54
- elasticsearch/_sync/client/sql.py +55 -15
- elasticsearch/_sync/client/ssl.py +9 -2
- elasticsearch/_sync/client/synonyms.py +75 -21
- elasticsearch/_sync/client/tasks.py +29 -8
- elasticsearch/_sync/client/text_structure.py +74 -2
- elasticsearch/_sync/client/transform.py +106 -32
- elasticsearch/_sync/client/watcher.py +110 -31
- elasticsearch/_sync/client/xpack.py +16 -4
- elasticsearch/_version.py +1 -1
- elasticsearch/helpers/actions.py +1 -1
- elasticsearch/helpers/vectorstore/__init__.py +62 -0
- elasticsearch/helpers/vectorstore/_async/__init__.py +16 -0
- elasticsearch/helpers/vectorstore/_async/_utils.py +39 -0
- elasticsearch/helpers/vectorstore/_async/embedding_service.py +89 -0
- elasticsearch/helpers/vectorstore/_async/strategies.py +466 -0
- elasticsearch/helpers/vectorstore/_async/vectorstore.py +391 -0
- elasticsearch/helpers/vectorstore/_sync/__init__.py +16 -0
- elasticsearch/helpers/vectorstore/_sync/_utils.py +39 -0
- elasticsearch/helpers/vectorstore/_sync/embedding_service.py +89 -0
- elasticsearch/helpers/vectorstore/_sync/strategies.py +466 -0
- elasticsearch/helpers/vectorstore/_sync/vectorstore.py +388 -0
- elasticsearch/helpers/vectorstore/_utils.py +116 -0
- elasticsearch/serializer.py +14 -0
- {elasticsearch-8.12.1.dist-info → elasticsearch-8.13.1.dist-info}/METADATA +28 -8
- elasticsearch-8.13.1.dist-info/RECORD +116 -0
- {elasticsearch-8.12.1.dist-info → elasticsearch-8.13.1.dist-info}/WHEEL +1 -1
- elasticsearch-8.12.1.dist-info/RECORD +0 -103
- {elasticsearch-8.12.1.dist-info → elasticsearch-8.13.1.dist-info}/LICENSE +0 -0
- {elasticsearch-8.12.1.dist-info → elasticsearch-8.13.1.dist-info}/NOTICE +0 -0
- {elasticsearch-8.12.1.dist-info → elasticsearch-8.13.1.dist-info}/top_level.txt +0 -0
|
@@ -39,11 +39,13 @@ from elastic_transport import (
|
|
|
39
39
|
ListApiResponse,
|
|
40
40
|
NodeConfig,
|
|
41
41
|
ObjectApiResponse,
|
|
42
|
+
OpenTelemetrySpan,
|
|
42
43
|
SniffOptions,
|
|
43
44
|
TextApiResponse,
|
|
44
45
|
)
|
|
45
46
|
from elastic_transport.client_utils import DEFAULT, DefaultType
|
|
46
47
|
|
|
48
|
+
from ..._otel import OpenTelemetry
|
|
47
49
|
from ..._version import __versionstr__
|
|
48
50
|
from ...compat import warn_stacklevel
|
|
49
51
|
from ...exceptions import (
|
|
@@ -244,6 +246,7 @@ class BaseClient:
|
|
|
244
246
|
self._retry_on_timeout: Union[DefaultType, bool] = DEFAULT
|
|
245
247
|
self._retry_on_status: Union[DefaultType, Collection[int]] = DEFAULT
|
|
246
248
|
self._verified_elasticsearch = False
|
|
249
|
+
self._otel = OpenTelemetry()
|
|
247
250
|
|
|
248
251
|
@property
|
|
249
252
|
def transport(self) -> AsyncTransport:
|
|
@@ -257,6 +260,34 @@ class BaseClient:
|
|
|
257
260
|
params: Optional[Mapping[str, Any]] = None,
|
|
258
261
|
headers: Optional[Mapping[str, str]] = None,
|
|
259
262
|
body: Optional[Any] = None,
|
|
263
|
+
endpoint_id: Optional[str] = None,
|
|
264
|
+
path_parts: Optional[Mapping[str, Any]] = None,
|
|
265
|
+
) -> ApiResponse[Any]:
|
|
266
|
+
with self._otel.span(
|
|
267
|
+
method,
|
|
268
|
+
endpoint_id=endpoint_id,
|
|
269
|
+
path_parts=path_parts or {},
|
|
270
|
+
) as otel_span:
|
|
271
|
+
response = await self._perform_request(
|
|
272
|
+
method,
|
|
273
|
+
path,
|
|
274
|
+
params=params,
|
|
275
|
+
headers=headers,
|
|
276
|
+
body=body,
|
|
277
|
+
otel_span=otel_span,
|
|
278
|
+
)
|
|
279
|
+
otel_span.set_elastic_cloud_metadata(response.meta.headers)
|
|
280
|
+
return response
|
|
281
|
+
|
|
282
|
+
async def _perform_request(
|
|
283
|
+
self,
|
|
284
|
+
method: str,
|
|
285
|
+
path: str,
|
|
286
|
+
*,
|
|
287
|
+
params: Optional[Mapping[str, Any]] = None,
|
|
288
|
+
headers: Optional[Mapping[str, str]] = None,
|
|
289
|
+
body: Optional[Any] = None,
|
|
290
|
+
otel_span: OpenTelemetrySpan,
|
|
260
291
|
) -> ApiResponse[Any]:
|
|
261
292
|
if headers:
|
|
262
293
|
request_headers = self._headers.copy()
|
|
@@ -292,6 +323,7 @@ class BaseClient:
|
|
|
292
323
|
retry_on_status=self._retry_on_status,
|
|
293
324
|
retry_on_timeout=self._retry_on_timeout,
|
|
294
325
|
client_meta=self._client_meta,
|
|
326
|
+
otel_span=otel_span,
|
|
295
327
|
)
|
|
296
328
|
|
|
297
329
|
# HEAD with a 404 is returned as a normal response
|
|
@@ -383,9 +415,17 @@ class NamespacedClient(BaseClient):
|
|
|
383
415
|
params: Optional[Mapping[str, Any]] = None,
|
|
384
416
|
headers: Optional[Mapping[str, str]] = None,
|
|
385
417
|
body: Optional[Any] = None,
|
|
418
|
+
endpoint_id: Optional[str] = None,
|
|
419
|
+
path_parts: Optional[Mapping[str, Any]] = None,
|
|
386
420
|
) -> ApiResponse[Any]:
|
|
387
421
|
# Use the internal clients .perform_request() implementation
|
|
388
422
|
# so we take advantage of their transport options.
|
|
389
423
|
return await self._client.perform_request(
|
|
390
|
-
method,
|
|
424
|
+
method,
|
|
425
|
+
path,
|
|
426
|
+
params=params,
|
|
427
|
+
headers=headers,
|
|
428
|
+
body=body,
|
|
429
|
+
endpoint_id=endpoint_id,
|
|
430
|
+
path_parts=path_parts,
|
|
391
431
|
)
|
|
@@ -24,6 +24,7 @@ from .utils import SKIP_IN_PATH, _quote, _rewrite_parameters
|
|
|
24
24
|
|
|
25
25
|
|
|
26
26
|
class AsyncSearchClient(NamespacedClient):
|
|
27
|
+
|
|
27
28
|
@_rewrite_parameters()
|
|
28
29
|
async def delete(
|
|
29
30
|
self,
|
|
@@ -38,13 +39,14 @@ class AsyncSearchClient(NamespacedClient):
|
|
|
38
39
|
Deletes an async search by ID. If the search is still running, the search request
|
|
39
40
|
will be cancelled. Otherwise, the saved search results are deleted.
|
|
40
41
|
|
|
41
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
42
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/async-search.html>`_
|
|
42
43
|
|
|
43
44
|
:param id: A unique identifier for the async search.
|
|
44
45
|
"""
|
|
45
46
|
if id in SKIP_IN_PATH:
|
|
46
47
|
raise ValueError("Empty value passed for parameter 'id'")
|
|
47
|
-
|
|
48
|
+
__path_parts: t.Dict[str, str] = {"id": _quote(id)}
|
|
49
|
+
__path = f'/_async_search/{__path_parts["id"]}'
|
|
48
50
|
__query: t.Dict[str, t.Any] = {}
|
|
49
51
|
if error_trace is not None:
|
|
50
52
|
__query["error_trace"] = error_trace
|
|
@@ -56,7 +58,12 @@ class AsyncSearchClient(NamespacedClient):
|
|
|
56
58
|
__query["pretty"] = pretty
|
|
57
59
|
__headers = {"accept": "application/json"}
|
|
58
60
|
return await self.perform_request( # type: ignore[return-value]
|
|
59
|
-
"DELETE",
|
|
61
|
+
"DELETE",
|
|
62
|
+
__path,
|
|
63
|
+
params=__query,
|
|
64
|
+
headers=__headers,
|
|
65
|
+
endpoint_id="async_search.delete",
|
|
66
|
+
path_parts=__path_parts,
|
|
60
67
|
)
|
|
61
68
|
|
|
62
69
|
@_rewrite_parameters()
|
|
@@ -78,7 +85,7 @@ class AsyncSearchClient(NamespacedClient):
|
|
|
78
85
|
Retrieves the results of a previously submitted async search request given its
|
|
79
86
|
ID.
|
|
80
87
|
|
|
81
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
88
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/async-search.html>`_
|
|
82
89
|
|
|
83
90
|
:param id: A unique identifier for the async search.
|
|
84
91
|
:param keep_alive: Specifies how long the async search should be available in
|
|
@@ -98,7 +105,8 @@ class AsyncSearchClient(NamespacedClient):
|
|
|
98
105
|
"""
|
|
99
106
|
if id in SKIP_IN_PATH:
|
|
100
107
|
raise ValueError("Empty value passed for parameter 'id'")
|
|
101
|
-
|
|
108
|
+
__path_parts: t.Dict[str, str] = {"id": _quote(id)}
|
|
109
|
+
__path = f'/_async_search/{__path_parts["id"]}'
|
|
102
110
|
__query: t.Dict[str, t.Any] = {}
|
|
103
111
|
if error_trace is not None:
|
|
104
112
|
__query["error_trace"] = error_trace
|
|
@@ -116,7 +124,12 @@ class AsyncSearchClient(NamespacedClient):
|
|
|
116
124
|
__query["wait_for_completion_timeout"] = wait_for_completion_timeout
|
|
117
125
|
__headers = {"accept": "application/json"}
|
|
118
126
|
return await self.perform_request( # type: ignore[return-value]
|
|
119
|
-
"GET",
|
|
127
|
+
"GET",
|
|
128
|
+
__path,
|
|
129
|
+
params=__query,
|
|
130
|
+
headers=__headers,
|
|
131
|
+
endpoint_id="async_search.get",
|
|
132
|
+
path_parts=__path_parts,
|
|
120
133
|
)
|
|
121
134
|
|
|
122
135
|
@_rewrite_parameters()
|
|
@@ -133,13 +146,14 @@ class AsyncSearchClient(NamespacedClient):
|
|
|
133
146
|
Retrieves the status of a previously submitted async search request given its
|
|
134
147
|
ID.
|
|
135
148
|
|
|
136
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
149
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/async-search.html>`_
|
|
137
150
|
|
|
138
151
|
:param id: A unique identifier for the async search.
|
|
139
152
|
"""
|
|
140
153
|
if id in SKIP_IN_PATH:
|
|
141
154
|
raise ValueError("Empty value passed for parameter 'id'")
|
|
142
|
-
|
|
155
|
+
__path_parts: t.Dict[str, str] = {"id": _quote(id)}
|
|
156
|
+
__path = f'/_async_search/status/{__path_parts["id"]}'
|
|
143
157
|
__query: t.Dict[str, t.Any] = {}
|
|
144
158
|
if error_trace is not None:
|
|
145
159
|
__query["error_trace"] = error_trace
|
|
@@ -151,7 +165,12 @@ class AsyncSearchClient(NamespacedClient):
|
|
|
151
165
|
__query["pretty"] = pretty
|
|
152
166
|
__headers = {"accept": "application/json"}
|
|
153
167
|
return await self.perform_request( # type: ignore[return-value]
|
|
154
|
-
"GET",
|
|
168
|
+
"GET",
|
|
169
|
+
__path,
|
|
170
|
+
params=__query,
|
|
171
|
+
headers=__headers,
|
|
172
|
+
endpoint_id="async_search.status",
|
|
173
|
+
path_parts=__path_parts,
|
|
155
174
|
)
|
|
156
175
|
|
|
157
176
|
@_rewrite_parameters(
|
|
@@ -299,7 +318,7 @@ class AsyncSearchClient(NamespacedClient):
|
|
|
299
318
|
"""
|
|
300
319
|
Executes a search request asynchronously.
|
|
301
320
|
|
|
302
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
321
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/async-search.html>`_
|
|
303
322
|
|
|
304
323
|
:param index: A comma-separated list of index names to search; use `_all` or
|
|
305
324
|
empty string to perform the operation on all indices
|
|
@@ -427,9 +446,12 @@ class AsyncSearchClient(NamespacedClient):
|
|
|
427
446
|
up to a certain timeout. When the async search completes within the timeout,
|
|
428
447
|
the response won’t include the ID as the results are not stored in the cluster.
|
|
429
448
|
"""
|
|
449
|
+
__path_parts: t.Dict[str, str]
|
|
430
450
|
if index not in SKIP_IN_PATH:
|
|
431
|
-
|
|
451
|
+
__path_parts = {"index": _quote(index)}
|
|
452
|
+
__path = f'/{__path_parts["index"]}/_async_search'
|
|
432
453
|
else:
|
|
454
|
+
__path_parts = {}
|
|
433
455
|
__path = "/_async_search"
|
|
434
456
|
__query: t.Dict[str, t.Any] = {}
|
|
435
457
|
__body: t.Dict[str, t.Any] = body if body is not None else {}
|
|
@@ -589,5 +611,11 @@ class AsyncSearchClient(NamespacedClient):
|
|
|
589
611
|
if __body is not None:
|
|
590
612
|
__headers["content-type"] = "application/json"
|
|
591
613
|
return await self.perform_request( # type: ignore[return-value]
|
|
592
|
-
"POST",
|
|
614
|
+
"POST",
|
|
615
|
+
__path,
|
|
616
|
+
params=__query,
|
|
617
|
+
headers=__headers,
|
|
618
|
+
body=__body,
|
|
619
|
+
endpoint_id="async_search.submit",
|
|
620
|
+
path_parts=__path_parts,
|
|
593
621
|
)
|
|
@@ -24,6 +24,7 @@ from .utils import SKIP_IN_PATH, _quote, _rewrite_parameters
|
|
|
24
24
|
|
|
25
25
|
|
|
26
26
|
class AutoscalingClient(NamespacedClient):
|
|
27
|
+
|
|
27
28
|
@_rewrite_parameters()
|
|
28
29
|
async def delete_autoscaling_policy(
|
|
29
30
|
self,
|
|
@@ -38,13 +39,14 @@ class AutoscalingClient(NamespacedClient):
|
|
|
38
39
|
Deletes an autoscaling policy. Designed for indirect use by ECE/ESS and ECK.
|
|
39
40
|
Direct use is not supported.
|
|
40
41
|
|
|
41
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
42
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/autoscaling-delete-autoscaling-policy.html>`_
|
|
42
43
|
|
|
43
44
|
:param name: the name of the autoscaling policy
|
|
44
45
|
"""
|
|
45
46
|
if name in SKIP_IN_PATH:
|
|
46
47
|
raise ValueError("Empty value passed for parameter 'name'")
|
|
47
|
-
|
|
48
|
+
__path_parts: t.Dict[str, str] = {"name": _quote(name)}
|
|
49
|
+
__path = f'/_autoscaling/policy/{__path_parts["name"]}'
|
|
48
50
|
__query: t.Dict[str, t.Any] = {}
|
|
49
51
|
if error_trace is not None:
|
|
50
52
|
__query["error_trace"] = error_trace
|
|
@@ -56,7 +58,12 @@ class AutoscalingClient(NamespacedClient):
|
|
|
56
58
|
__query["pretty"] = pretty
|
|
57
59
|
__headers = {"accept": "application/json"}
|
|
58
60
|
return await self.perform_request( # type: ignore[return-value]
|
|
59
|
-
"DELETE",
|
|
61
|
+
"DELETE",
|
|
62
|
+
__path,
|
|
63
|
+
params=__query,
|
|
64
|
+
headers=__headers,
|
|
65
|
+
endpoint_id="autoscaling.delete_autoscaling_policy",
|
|
66
|
+
path_parts=__path_parts,
|
|
60
67
|
)
|
|
61
68
|
|
|
62
69
|
@_rewrite_parameters()
|
|
@@ -72,8 +79,9 @@ class AutoscalingClient(NamespacedClient):
|
|
|
72
79
|
Gets the current autoscaling capacity based on the configured autoscaling policy.
|
|
73
80
|
Designed for indirect use by ECE/ESS and ECK. Direct use is not supported.
|
|
74
81
|
|
|
75
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
82
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/autoscaling-get-autoscaling-capacity.html>`_
|
|
76
83
|
"""
|
|
84
|
+
__path_parts: t.Dict[str, str] = {}
|
|
77
85
|
__path = "/_autoscaling/capacity"
|
|
78
86
|
__query: t.Dict[str, t.Any] = {}
|
|
79
87
|
if error_trace is not None:
|
|
@@ -86,7 +94,12 @@ class AutoscalingClient(NamespacedClient):
|
|
|
86
94
|
__query["pretty"] = pretty
|
|
87
95
|
__headers = {"accept": "application/json"}
|
|
88
96
|
return await self.perform_request( # type: ignore[return-value]
|
|
89
|
-
"GET",
|
|
97
|
+
"GET",
|
|
98
|
+
__path,
|
|
99
|
+
params=__query,
|
|
100
|
+
headers=__headers,
|
|
101
|
+
endpoint_id="autoscaling.get_autoscaling_capacity",
|
|
102
|
+
path_parts=__path_parts,
|
|
90
103
|
)
|
|
91
104
|
|
|
92
105
|
@_rewrite_parameters()
|
|
@@ -103,13 +116,14 @@ class AutoscalingClient(NamespacedClient):
|
|
|
103
116
|
Retrieves an autoscaling policy. Designed for indirect use by ECE/ESS and ECK.
|
|
104
117
|
Direct use is not supported.
|
|
105
118
|
|
|
106
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
119
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/autoscaling-get-autoscaling-capacity.html>`_
|
|
107
120
|
|
|
108
121
|
:param name: the name of the autoscaling policy
|
|
109
122
|
"""
|
|
110
123
|
if name in SKIP_IN_PATH:
|
|
111
124
|
raise ValueError("Empty value passed for parameter 'name'")
|
|
112
|
-
|
|
125
|
+
__path_parts: t.Dict[str, str] = {"name": _quote(name)}
|
|
126
|
+
__path = f'/_autoscaling/policy/{__path_parts["name"]}'
|
|
113
127
|
__query: t.Dict[str, t.Any] = {}
|
|
114
128
|
if error_trace is not None:
|
|
115
129
|
__query["error_trace"] = error_trace
|
|
@@ -121,7 +135,12 @@ class AutoscalingClient(NamespacedClient):
|
|
|
121
135
|
__query["pretty"] = pretty
|
|
122
136
|
__headers = {"accept": "application/json"}
|
|
123
137
|
return await self.perform_request( # type: ignore[return-value]
|
|
124
|
-
"GET",
|
|
138
|
+
"GET",
|
|
139
|
+
__path,
|
|
140
|
+
params=__query,
|
|
141
|
+
headers=__headers,
|
|
142
|
+
endpoint_id="autoscaling.get_autoscaling_policy",
|
|
143
|
+
path_parts=__path_parts,
|
|
125
144
|
)
|
|
126
145
|
|
|
127
146
|
@_rewrite_parameters(
|
|
@@ -142,7 +161,7 @@ class AutoscalingClient(NamespacedClient):
|
|
|
142
161
|
Creates a new autoscaling policy. Designed for indirect use by ECE/ESS and ECK.
|
|
143
162
|
Direct use is not supported.
|
|
144
163
|
|
|
145
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
164
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/autoscaling-put-autoscaling-policy.html>`_
|
|
146
165
|
|
|
147
166
|
:param name: the name of the autoscaling policy
|
|
148
167
|
:param policy:
|
|
@@ -155,7 +174,8 @@ class AutoscalingClient(NamespacedClient):
|
|
|
155
174
|
)
|
|
156
175
|
elif policy is not None and body is not None:
|
|
157
176
|
raise ValueError("Cannot set both 'policy' and 'body'")
|
|
158
|
-
|
|
177
|
+
__path_parts: t.Dict[str, str] = {"name": _quote(name)}
|
|
178
|
+
__path = f'/_autoscaling/policy/{__path_parts["name"]}'
|
|
159
179
|
__query: t.Dict[str, t.Any] = {}
|
|
160
180
|
if error_trace is not None:
|
|
161
181
|
__query["error_trace"] = error_trace
|
|
@@ -168,5 +188,11 @@ class AutoscalingClient(NamespacedClient):
|
|
|
168
188
|
__body = policy if policy is not None else body
|
|
169
189
|
__headers = {"accept": "application/json", "content-type": "application/json"}
|
|
170
190
|
return await self.perform_request( # type: ignore[return-value]
|
|
171
|
-
"PUT",
|
|
191
|
+
"PUT",
|
|
192
|
+
__path,
|
|
193
|
+
params=__query,
|
|
194
|
+
headers=__headers,
|
|
195
|
+
body=__body,
|
|
196
|
+
endpoint_id="autoscaling.put_autoscaling_policy",
|
|
197
|
+
path_parts=__path_parts,
|
|
172
198
|
)
|