elasticsearch9 9.0.0__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 (160) hide show
  1. elasticsearch9/__init__.py +98 -0
  2. elasticsearch9/_async/__init__.py +16 -0
  3. elasticsearch9/_async/client/__init__.py +6531 -0
  4. elasticsearch9/_async/client/_base.py +430 -0
  5. elasticsearch9/_async/client/async_search.py +637 -0
  6. elasticsearch9/_async/client/autoscaling.py +252 -0
  7. elasticsearch9/_async/client/cat.py +2995 -0
  8. elasticsearch9/_async/client/ccr.py +1043 -0
  9. elasticsearch9/_async/client/cluster.py +1223 -0
  10. elasticsearch9/_async/client/connector.py +1978 -0
  11. elasticsearch9/_async/client/dangling_indices.py +192 -0
  12. elasticsearch9/_async/client/enrich.py +291 -0
  13. elasticsearch9/_async/client/eql.py +359 -0
  14. elasticsearch9/_async/client/esql.py +490 -0
  15. elasticsearch9/_async/client/features.py +130 -0
  16. elasticsearch9/_async/client/fleet.py +658 -0
  17. elasticsearch9/_async/client/graph.py +113 -0
  18. elasticsearch9/_async/client/ilm.py +668 -0
  19. elasticsearch9/_async/client/indices.py +5582 -0
  20. elasticsearch9/_async/client/inference.py +2247 -0
  21. elasticsearch9/_async/client/ingest.py +766 -0
  22. elasticsearch9/_async/client/license.py +400 -0
  23. elasticsearch9/_async/client/logstash.py +176 -0
  24. elasticsearch9/_async/client/migration.py +160 -0
  25. elasticsearch9/_async/client/ml.py +5835 -0
  26. elasticsearch9/_async/client/monitoring.py +100 -0
  27. elasticsearch9/_async/client/nodes.py +543 -0
  28. elasticsearch9/_async/client/query_rules.py +485 -0
  29. elasticsearch9/_async/client/rollup.py +616 -0
  30. elasticsearch9/_async/client/search_application.py +574 -0
  31. elasticsearch9/_async/client/searchable_snapshots.py +313 -0
  32. elasticsearch9/_async/client/security.py +4688 -0
  33. elasticsearch9/_async/client/shutdown.py +268 -0
  34. elasticsearch9/_async/client/simulate.py +145 -0
  35. elasticsearch9/_async/client/slm.py +559 -0
  36. elasticsearch9/_async/client/snapshot.py +1338 -0
  37. elasticsearch9/_async/client/sql.py +469 -0
  38. elasticsearch9/_async/client/ssl.py +76 -0
  39. elasticsearch9/_async/client/synonyms.py +413 -0
  40. elasticsearch9/_async/client/tasks.py +295 -0
  41. elasticsearch9/_async/client/text_structure.py +664 -0
  42. elasticsearch9/_async/client/transform.py +922 -0
  43. elasticsearch9/_async/client/utils.py +48 -0
  44. elasticsearch9/_async/client/watcher.py +894 -0
  45. elasticsearch9/_async/client/xpack.py +134 -0
  46. elasticsearch9/_async/helpers.py +596 -0
  47. elasticsearch9/_otel.py +110 -0
  48. elasticsearch9/_sync/__init__.py +16 -0
  49. elasticsearch9/_sync/client/__init__.py +6529 -0
  50. elasticsearch9/_sync/client/_base.py +430 -0
  51. elasticsearch9/_sync/client/async_search.py +637 -0
  52. elasticsearch9/_sync/client/autoscaling.py +252 -0
  53. elasticsearch9/_sync/client/cat.py +2995 -0
  54. elasticsearch9/_sync/client/ccr.py +1043 -0
  55. elasticsearch9/_sync/client/cluster.py +1223 -0
  56. elasticsearch9/_sync/client/connector.py +1978 -0
  57. elasticsearch9/_sync/client/dangling_indices.py +192 -0
  58. elasticsearch9/_sync/client/enrich.py +291 -0
  59. elasticsearch9/_sync/client/eql.py +359 -0
  60. elasticsearch9/_sync/client/esql.py +490 -0
  61. elasticsearch9/_sync/client/features.py +130 -0
  62. elasticsearch9/_sync/client/fleet.py +658 -0
  63. elasticsearch9/_sync/client/graph.py +113 -0
  64. elasticsearch9/_sync/client/ilm.py +668 -0
  65. elasticsearch9/_sync/client/indices.py +5582 -0
  66. elasticsearch9/_sync/client/inference.py +2247 -0
  67. elasticsearch9/_sync/client/ingest.py +766 -0
  68. elasticsearch9/_sync/client/license.py +400 -0
  69. elasticsearch9/_sync/client/logstash.py +176 -0
  70. elasticsearch9/_sync/client/migration.py +160 -0
  71. elasticsearch9/_sync/client/ml.py +5835 -0
  72. elasticsearch9/_sync/client/monitoring.py +100 -0
  73. elasticsearch9/_sync/client/nodes.py +543 -0
  74. elasticsearch9/_sync/client/query_rules.py +485 -0
  75. elasticsearch9/_sync/client/rollup.py +616 -0
  76. elasticsearch9/_sync/client/search_application.py +574 -0
  77. elasticsearch9/_sync/client/searchable_snapshots.py +313 -0
  78. elasticsearch9/_sync/client/security.py +4688 -0
  79. elasticsearch9/_sync/client/shutdown.py +268 -0
  80. elasticsearch9/_sync/client/simulate.py +145 -0
  81. elasticsearch9/_sync/client/slm.py +559 -0
  82. elasticsearch9/_sync/client/snapshot.py +1338 -0
  83. elasticsearch9/_sync/client/sql.py +469 -0
  84. elasticsearch9/_sync/client/ssl.py +76 -0
  85. elasticsearch9/_sync/client/synonyms.py +413 -0
  86. elasticsearch9/_sync/client/tasks.py +295 -0
  87. elasticsearch9/_sync/client/text_structure.py +664 -0
  88. elasticsearch9/_sync/client/transform.py +922 -0
  89. elasticsearch9/_sync/client/utils.py +475 -0
  90. elasticsearch9/_sync/client/watcher.py +894 -0
  91. elasticsearch9/_sync/client/xpack.py +134 -0
  92. elasticsearch9/_utils.py +34 -0
  93. elasticsearch9/_version.py +18 -0
  94. elasticsearch9/client.py +126 -0
  95. elasticsearch9/compat.py +79 -0
  96. elasticsearch9/dsl/__init__.py +203 -0
  97. elasticsearch9/dsl/_async/__init__.py +16 -0
  98. elasticsearch9/dsl/_async/document.py +522 -0
  99. elasticsearch9/dsl/_async/faceted_search.py +50 -0
  100. elasticsearch9/dsl/_async/index.py +639 -0
  101. elasticsearch9/dsl/_async/mapping.py +49 -0
  102. elasticsearch9/dsl/_async/search.py +237 -0
  103. elasticsearch9/dsl/_async/update_by_query.py +47 -0
  104. elasticsearch9/dsl/_sync/__init__.py +16 -0
  105. elasticsearch9/dsl/_sync/document.py +514 -0
  106. elasticsearch9/dsl/_sync/faceted_search.py +50 -0
  107. elasticsearch9/dsl/_sync/index.py +597 -0
  108. elasticsearch9/dsl/_sync/mapping.py +49 -0
  109. elasticsearch9/dsl/_sync/search.py +230 -0
  110. elasticsearch9/dsl/_sync/update_by_query.py +45 -0
  111. elasticsearch9/dsl/aggs.py +3734 -0
  112. elasticsearch9/dsl/analysis.py +341 -0
  113. elasticsearch9/dsl/async_connections.py +37 -0
  114. elasticsearch9/dsl/connections.py +142 -0
  115. elasticsearch9/dsl/document.py +20 -0
  116. elasticsearch9/dsl/document_base.py +444 -0
  117. elasticsearch9/dsl/exceptions.py +32 -0
  118. elasticsearch9/dsl/faceted_search.py +28 -0
  119. elasticsearch9/dsl/faceted_search_base.py +489 -0
  120. elasticsearch9/dsl/field.py +4392 -0
  121. elasticsearch9/dsl/function.py +180 -0
  122. elasticsearch9/dsl/index.py +23 -0
  123. elasticsearch9/dsl/index_base.py +178 -0
  124. elasticsearch9/dsl/mapping.py +19 -0
  125. elasticsearch9/dsl/mapping_base.py +219 -0
  126. elasticsearch9/dsl/query.py +2822 -0
  127. elasticsearch9/dsl/response/__init__.py +388 -0
  128. elasticsearch9/dsl/response/aggs.py +100 -0
  129. elasticsearch9/dsl/response/hit.py +53 -0
  130. elasticsearch9/dsl/search.py +20 -0
  131. elasticsearch9/dsl/search_base.py +1053 -0
  132. elasticsearch9/dsl/serializer.py +34 -0
  133. elasticsearch9/dsl/types.py +6453 -0
  134. elasticsearch9/dsl/update_by_query.py +19 -0
  135. elasticsearch9/dsl/update_by_query_base.py +149 -0
  136. elasticsearch9/dsl/utils.py +687 -0
  137. elasticsearch9/dsl/wrappers.py +144 -0
  138. elasticsearch9/exceptions.py +133 -0
  139. elasticsearch9/helpers/__init__.py +41 -0
  140. elasticsearch9/helpers/actions.py +875 -0
  141. elasticsearch9/helpers/errors.py +40 -0
  142. elasticsearch9/helpers/vectorstore/__init__.py +62 -0
  143. elasticsearch9/helpers/vectorstore/_async/__init__.py +16 -0
  144. elasticsearch9/helpers/vectorstore/_async/_utils.py +39 -0
  145. elasticsearch9/helpers/vectorstore/_async/embedding_service.py +89 -0
  146. elasticsearch9/helpers/vectorstore/_async/strategies.py +487 -0
  147. elasticsearch9/helpers/vectorstore/_async/vectorstore.py +421 -0
  148. elasticsearch9/helpers/vectorstore/_sync/__init__.py +16 -0
  149. elasticsearch9/helpers/vectorstore/_sync/_utils.py +39 -0
  150. elasticsearch9/helpers/vectorstore/_sync/embedding_service.py +89 -0
  151. elasticsearch9/helpers/vectorstore/_sync/strategies.py +487 -0
  152. elasticsearch9/helpers/vectorstore/_sync/vectorstore.py +421 -0
  153. elasticsearch9/helpers/vectorstore/_utils.py +116 -0
  154. elasticsearch9/py.typed +0 -0
  155. elasticsearch9/serializer.py +250 -0
  156. elasticsearch9-9.0.0.dist-info/METADATA +175 -0
  157. elasticsearch9-9.0.0.dist-info/RECORD +160 -0
  158. elasticsearch9-9.0.0.dist-info/WHEEL +4 -0
  159. elasticsearch9-9.0.0.dist-info/licenses/LICENSE +176 -0
  160. elasticsearch9-9.0.0.dist-info/licenses/NOTICE +2 -0
@@ -0,0 +1,100 @@
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 _rewrite_parameters
24
+
25
+
26
+ class MonitoringClient(NamespacedClient):
27
+
28
+ @_rewrite_parameters(
29
+ body_name="operations",
30
+ )
31
+ async def bulk(
32
+ self,
33
+ *,
34
+ interval: t.Union[str, t.Literal[-1], t.Literal[0]],
35
+ operations: t.Optional[t.Sequence[t.Mapping[str, t.Any]]] = None,
36
+ body: t.Optional[t.Sequence[t.Mapping[str, t.Any]]] = None,
37
+ system_api_version: str,
38
+ system_id: str,
39
+ error_trace: t.Optional[bool] = None,
40
+ filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
41
+ human: t.Optional[bool] = None,
42
+ pretty: t.Optional[bool] = None,
43
+ ) -> ObjectApiResponse[t.Any]:
44
+ """
45
+ .. raw:: html
46
+
47
+ <p>Send monitoring data.
48
+ This API is used by the monitoring features to send monitoring data.</p>
49
+
50
+
51
+ `<https://www.elastic.co/docs/api/doc/elasticsearch/v9/>`_
52
+
53
+ :param interval: Collection interval (e.g., '10s' or '10000ms') of the payload
54
+ :param operations:
55
+ :param system_api_version:
56
+ :param system_id: Identifier of the monitored system
57
+ """
58
+ if interval is None:
59
+ raise ValueError("Empty value passed for parameter 'interval'")
60
+ if operations is None and body is None:
61
+ raise ValueError(
62
+ "Empty value passed for parameters 'operations' and 'body', one of them should be set."
63
+ )
64
+ elif operations is not None and body is not None:
65
+ raise ValueError("Cannot set both 'operations' and 'body'")
66
+ if system_api_version is None:
67
+ raise ValueError("Empty value passed for parameter 'system_api_version'")
68
+ if system_id is None:
69
+ raise ValueError("Empty value passed for parameter 'system_id'")
70
+ __path_parts: t.Dict[str, str] = {}
71
+ __path = "/_monitoring/bulk"
72
+ __query: t.Dict[str, t.Any] = {}
73
+ if interval is not None:
74
+ __query["interval"] = interval
75
+ if system_api_version is not None:
76
+ __query["system_api_version"] = system_api_version
77
+ if system_id is not None:
78
+ __query["system_id"] = system_id
79
+ if error_trace is not None:
80
+ __query["error_trace"] = error_trace
81
+ if filter_path is not None:
82
+ __query["filter_path"] = filter_path
83
+ if human is not None:
84
+ __query["human"] = human
85
+ if pretty is not None:
86
+ __query["pretty"] = pretty
87
+ __body = operations if operations is not None else body
88
+ __headers = {
89
+ "accept": "application/json",
90
+ "content-type": "application/x-ndjson",
91
+ }
92
+ return await self.perform_request( # type: ignore[return-value]
93
+ "PUT",
94
+ __path,
95
+ params=__query,
96
+ headers=__headers,
97
+ body=__body,
98
+ endpoint_id="monitoring.bulk",
99
+ path_parts=__path_parts,
100
+ )
@@ -0,0 +1,543 @@
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, TextApiResponse
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 NodesClient(NamespacedClient):
33
+
34
+ @_rewrite_parameters()
35
+ @_stability_warning(Stability.EXPERIMENTAL)
36
+ async def clear_repositories_metering_archive(
37
+ self,
38
+ *,
39
+ node_id: t.Union[str, t.Sequence[str]],
40
+ max_archive_version: int,
41
+ error_trace: t.Optional[bool] = None,
42
+ filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
43
+ human: t.Optional[bool] = None,
44
+ pretty: t.Optional[bool] = None,
45
+ ) -> ObjectApiResponse[t.Any]:
46
+ """
47
+ .. raw:: html
48
+
49
+ <p>Clear the archived repositories metering.
50
+ Clear the archived repositories metering information in the cluster.</p>
51
+
52
+
53
+ `<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-nodes-clear-repositories-metering-archive>`_
54
+
55
+ :param node_id: Comma-separated list of node IDs or names used to limit returned
56
+ information.
57
+ :param max_archive_version: Specifies the maximum `archive_version` to be cleared
58
+ from the archive.
59
+ """
60
+ if node_id in SKIP_IN_PATH:
61
+ raise ValueError("Empty value passed for parameter 'node_id'")
62
+ if max_archive_version in SKIP_IN_PATH:
63
+ raise ValueError("Empty value passed for parameter 'max_archive_version'")
64
+ __path_parts: t.Dict[str, str] = {
65
+ "node_id": _quote(node_id),
66
+ "max_archive_version": _quote(max_archive_version),
67
+ }
68
+ __path = f'/_nodes/{__path_parts["node_id"]}/_repositories_metering/{__path_parts["max_archive_version"]}'
69
+ __query: t.Dict[str, t.Any] = {}
70
+ if error_trace is not None:
71
+ __query["error_trace"] = error_trace
72
+ if filter_path is not None:
73
+ __query["filter_path"] = filter_path
74
+ if human is not None:
75
+ __query["human"] = human
76
+ if pretty is not None:
77
+ __query["pretty"] = pretty
78
+ __headers = {"accept": "application/json"}
79
+ return await self.perform_request( # type: ignore[return-value]
80
+ "DELETE",
81
+ __path,
82
+ params=__query,
83
+ headers=__headers,
84
+ endpoint_id="nodes.clear_repositories_metering_archive",
85
+ path_parts=__path_parts,
86
+ )
87
+
88
+ @_rewrite_parameters()
89
+ @_stability_warning(Stability.EXPERIMENTAL)
90
+ async def get_repositories_metering_info(
91
+ self,
92
+ *,
93
+ node_id: t.Union[str, t.Sequence[str]],
94
+ error_trace: t.Optional[bool] = None,
95
+ filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
96
+ human: t.Optional[bool] = None,
97
+ pretty: t.Optional[bool] = None,
98
+ ) -> ObjectApiResponse[t.Any]:
99
+ """
100
+ .. raw:: html
101
+
102
+ <p>Get cluster repositories metering.
103
+ Get repositories metering information for a cluster.
104
+ This API exposes monotonically non-decreasing counters and it is expected that clients would durably store the information needed to compute aggregations over a period of time.
105
+ Additionally, the information exposed by this API is volatile, meaning that it will not be present after node restarts.</p>
106
+
107
+
108
+ `<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-nodes-get-repositories-metering-info>`_
109
+
110
+ :param node_id: Comma-separated list of node IDs or names used to limit returned
111
+ information.
112
+ """
113
+ if node_id in SKIP_IN_PATH:
114
+ raise ValueError("Empty value passed for parameter 'node_id'")
115
+ __path_parts: t.Dict[str, str] = {"node_id": _quote(node_id)}
116
+ __path = f'/_nodes/{__path_parts["node_id"]}/_repositories_metering'
117
+ __query: t.Dict[str, t.Any] = {}
118
+ if error_trace is not None:
119
+ __query["error_trace"] = error_trace
120
+ if filter_path is not None:
121
+ __query["filter_path"] = filter_path
122
+ if human is not None:
123
+ __query["human"] = human
124
+ if pretty is not None:
125
+ __query["pretty"] = pretty
126
+ __headers = {"accept": "application/json"}
127
+ return await self.perform_request( # type: ignore[return-value]
128
+ "GET",
129
+ __path,
130
+ params=__query,
131
+ headers=__headers,
132
+ endpoint_id="nodes.get_repositories_metering_info",
133
+ path_parts=__path_parts,
134
+ )
135
+
136
+ @_rewrite_parameters()
137
+ async def hot_threads(
138
+ self,
139
+ *,
140
+ node_id: t.Optional[t.Union[str, t.Sequence[str]]] = None,
141
+ error_trace: t.Optional[bool] = None,
142
+ filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
143
+ human: t.Optional[bool] = None,
144
+ ignore_idle_threads: t.Optional[bool] = None,
145
+ interval: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
146
+ pretty: t.Optional[bool] = None,
147
+ snapshots: t.Optional[int] = None,
148
+ sort: t.Optional[
149
+ t.Union[str, t.Literal["block", "cpu", "gpu", "mem", "wait"]]
150
+ ] = None,
151
+ threads: t.Optional[int] = None,
152
+ timeout: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
153
+ type: t.Optional[
154
+ t.Union[str, t.Literal["block", "cpu", "gpu", "mem", "wait"]]
155
+ ] = None,
156
+ ) -> TextApiResponse:
157
+ """
158
+ .. raw:: html
159
+
160
+ <p>Get the hot threads for nodes.
161
+ Get a breakdown of the hot threads on each selected node in the cluster.
162
+ The output is plain text with a breakdown of the top hot threads for each node.</p>
163
+
164
+
165
+ `<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-nodes-hot-threads>`_
166
+
167
+ :param node_id: List of node IDs or names used to limit returned information.
168
+ :param ignore_idle_threads: If true, known idle threads (e.g. waiting in a socket
169
+ select, or to get a task from an empty queue) are filtered out.
170
+ :param interval: The interval to do the second sampling of threads.
171
+ :param snapshots: Number of samples of thread stacktrace.
172
+ :param sort: The sort order for 'cpu' type (default: total)
173
+ :param threads: Specifies the number of hot threads to provide information for.
174
+ :param timeout: Period to wait for a response. If no response is received before
175
+ the timeout expires, the request fails and returns an error.
176
+ :param type: The type to sample.
177
+ """
178
+ __path_parts: t.Dict[str, str]
179
+ if node_id not in SKIP_IN_PATH:
180
+ __path_parts = {"node_id": _quote(node_id)}
181
+ __path = f'/_nodes/{__path_parts["node_id"]}/hot_threads'
182
+ else:
183
+ __path_parts = {}
184
+ __path = "/_nodes/hot_threads"
185
+ __query: t.Dict[str, t.Any] = {}
186
+ if error_trace is not None:
187
+ __query["error_trace"] = error_trace
188
+ if filter_path is not None:
189
+ __query["filter_path"] = filter_path
190
+ if human is not None:
191
+ __query["human"] = human
192
+ if ignore_idle_threads is not None:
193
+ __query["ignore_idle_threads"] = ignore_idle_threads
194
+ if interval is not None:
195
+ __query["interval"] = interval
196
+ if pretty is not None:
197
+ __query["pretty"] = pretty
198
+ if snapshots is not None:
199
+ __query["snapshots"] = snapshots
200
+ if sort is not None:
201
+ __query["sort"] = sort
202
+ if threads is not None:
203
+ __query["threads"] = threads
204
+ if timeout is not None:
205
+ __query["timeout"] = timeout
206
+ if type is not None:
207
+ __query["type"] = type
208
+ __headers = {"accept": "text/plain"}
209
+ return await self.perform_request( # type: ignore[return-value]
210
+ "GET",
211
+ __path,
212
+ params=__query,
213
+ headers=__headers,
214
+ endpoint_id="nodes.hot_threads",
215
+ path_parts=__path_parts,
216
+ )
217
+
218
+ @_rewrite_parameters()
219
+ async def info(
220
+ self,
221
+ *,
222
+ node_id: t.Optional[t.Union[str, t.Sequence[str]]] = None,
223
+ metric: t.Optional[t.Union[str, t.Sequence[str]]] = None,
224
+ error_trace: t.Optional[bool] = None,
225
+ filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
226
+ flat_settings: t.Optional[bool] = None,
227
+ human: t.Optional[bool] = None,
228
+ pretty: t.Optional[bool] = None,
229
+ timeout: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
230
+ ) -> ObjectApiResponse[t.Any]:
231
+ """
232
+ .. raw:: html
233
+
234
+ <p>Get node information.</p>
235
+ <p>By default, the API returns all attributes and core settings for cluster nodes.</p>
236
+
237
+
238
+ `<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-nodes-info>`_
239
+
240
+ :param node_id: Comma-separated list of node IDs or names used to limit returned
241
+ information.
242
+ :param metric: Limits the information returned to the specific metrics. Supports
243
+ a comma-separated list, such as http,ingest.
244
+ :param flat_settings: If true, returns settings in flat format.
245
+ :param timeout: Period to wait for a response. If no response is received before
246
+ the timeout expires, the request fails and returns an error.
247
+ """
248
+ __path_parts: t.Dict[str, str]
249
+ if node_id not in SKIP_IN_PATH and metric not in SKIP_IN_PATH:
250
+ __path_parts = {"node_id": _quote(node_id), "metric": _quote(metric)}
251
+ __path = f'/_nodes/{__path_parts["node_id"]}/{__path_parts["metric"]}'
252
+ elif node_id not in SKIP_IN_PATH:
253
+ __path_parts = {"node_id": _quote(node_id)}
254
+ __path = f'/_nodes/{__path_parts["node_id"]}'
255
+ elif metric not in SKIP_IN_PATH:
256
+ __path_parts = {"metric": _quote(metric)}
257
+ __path = f'/_nodes/{__path_parts["metric"]}'
258
+ else:
259
+ __path_parts = {}
260
+ __path = "/_nodes"
261
+ __query: t.Dict[str, t.Any] = {}
262
+ if error_trace is not None:
263
+ __query["error_trace"] = error_trace
264
+ if filter_path is not None:
265
+ __query["filter_path"] = filter_path
266
+ if flat_settings is not None:
267
+ __query["flat_settings"] = flat_settings
268
+ if human is not None:
269
+ __query["human"] = human
270
+ if pretty is not None:
271
+ __query["pretty"] = pretty
272
+ if timeout is not None:
273
+ __query["timeout"] = timeout
274
+ __headers = {"accept": "application/json"}
275
+ return await self.perform_request( # type: ignore[return-value]
276
+ "GET",
277
+ __path,
278
+ params=__query,
279
+ headers=__headers,
280
+ endpoint_id="nodes.info",
281
+ path_parts=__path_parts,
282
+ )
283
+
284
+ @_rewrite_parameters(
285
+ body_fields=("secure_settings_password",),
286
+ )
287
+ async def reload_secure_settings(
288
+ self,
289
+ *,
290
+ node_id: t.Optional[t.Union[str, t.Sequence[str]]] = None,
291
+ error_trace: t.Optional[bool] = None,
292
+ filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
293
+ human: t.Optional[bool] = None,
294
+ pretty: t.Optional[bool] = None,
295
+ secure_settings_password: t.Optional[str] = None,
296
+ timeout: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
297
+ body: t.Optional[t.Dict[str, t.Any]] = None,
298
+ ) -> ObjectApiResponse[t.Any]:
299
+ """
300
+ .. raw:: html
301
+
302
+ <p>Reload the keystore on nodes in the cluster.</p>
303
+ <p>Secure settings are stored in an on-disk keystore. Certain of these settings are reloadable.
304
+ That is, you can change them on disk and reload them without restarting any nodes in the cluster.
305
+ When you have updated reloadable secure settings in your keystore, you can use this API to reload those settings on each node.</p>
306
+ <p>When the Elasticsearch keystore is password protected and not simply obfuscated, you must provide the password for the keystore when you reload the secure settings.
307
+ Reloading the settings for the whole cluster assumes that the keystores for all nodes are protected with the same password; this method is allowed only when inter-node communications are encrypted.
308
+ Alternatively, you can reload the secure settings on each node by locally accessing the API and passing the node-specific Elasticsearch keystore password.</p>
309
+
310
+
311
+ `<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-nodes-reload-secure-settings>`_
312
+
313
+ :param node_id: The names of particular nodes in the cluster to target.
314
+ :param secure_settings_password: The password for the Elasticsearch keystore.
315
+ :param timeout: Period to wait for a response. If no response is received before
316
+ the timeout expires, the request fails and returns an error.
317
+ """
318
+ __path_parts: t.Dict[str, str]
319
+ if node_id not in SKIP_IN_PATH:
320
+ __path_parts = {"node_id": _quote(node_id)}
321
+ __path = f'/_nodes/{__path_parts["node_id"]}/reload_secure_settings'
322
+ else:
323
+ __path_parts = {}
324
+ __path = "/_nodes/reload_secure_settings"
325
+ __query: t.Dict[str, t.Any] = {}
326
+ __body: t.Dict[str, t.Any] = body if body is not None else {}
327
+ if error_trace is not None:
328
+ __query["error_trace"] = error_trace
329
+ if filter_path is not None:
330
+ __query["filter_path"] = filter_path
331
+ if human is not None:
332
+ __query["human"] = human
333
+ if pretty is not None:
334
+ __query["pretty"] = pretty
335
+ if timeout is not None:
336
+ __query["timeout"] = timeout
337
+ if not __body:
338
+ if secure_settings_password is not None:
339
+ __body["secure_settings_password"] = secure_settings_password
340
+ if not __body:
341
+ __body = None # type: ignore[assignment]
342
+ __headers = {"accept": "application/json"}
343
+ if __body is not None:
344
+ __headers["content-type"] = "application/json"
345
+ return await self.perform_request( # type: ignore[return-value]
346
+ "POST",
347
+ __path,
348
+ params=__query,
349
+ headers=__headers,
350
+ body=__body,
351
+ endpoint_id="nodes.reload_secure_settings",
352
+ path_parts=__path_parts,
353
+ )
354
+
355
+ @_rewrite_parameters()
356
+ async def stats(
357
+ self,
358
+ *,
359
+ node_id: t.Optional[t.Union[str, t.Sequence[str]]] = None,
360
+ metric: t.Optional[t.Union[str, t.Sequence[str]]] = None,
361
+ index_metric: t.Optional[t.Union[str, t.Sequence[str]]] = None,
362
+ completion_fields: t.Optional[t.Union[str, t.Sequence[str]]] = None,
363
+ error_trace: t.Optional[bool] = None,
364
+ fielddata_fields: t.Optional[t.Union[str, t.Sequence[str]]] = None,
365
+ fields: t.Optional[t.Union[str, t.Sequence[str]]] = None,
366
+ filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
367
+ groups: t.Optional[bool] = None,
368
+ human: t.Optional[bool] = None,
369
+ include_segment_file_sizes: t.Optional[bool] = None,
370
+ include_unloaded_segments: t.Optional[bool] = None,
371
+ level: t.Optional[
372
+ t.Union[str, t.Literal["cluster", "indices", "shards"]]
373
+ ] = None,
374
+ pretty: t.Optional[bool] = None,
375
+ timeout: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
376
+ types: t.Optional[t.Sequence[str]] = None,
377
+ ) -> ObjectApiResponse[t.Any]:
378
+ """
379
+ .. raw:: html
380
+
381
+ <p>Get node statistics.
382
+ Get statistics for nodes in a cluster.
383
+ By default, all stats are returned. You can limit the returned information by using metrics.</p>
384
+
385
+
386
+ `<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-nodes-stats>`_
387
+
388
+ :param node_id: Comma-separated list of node IDs or names used to limit returned
389
+ information.
390
+ :param metric: Limit the information returned to the specified metrics
391
+ :param index_metric: Limit the information returned for indices metric to the
392
+ specific index metrics. It can be used only if indices (or all) metric is
393
+ specified.
394
+ :param completion_fields: Comma-separated list or wildcard expressions of fields
395
+ to include in fielddata and suggest statistics.
396
+ :param fielddata_fields: Comma-separated list or wildcard expressions of fields
397
+ to include in fielddata statistics.
398
+ :param fields: Comma-separated list or wildcard expressions of fields to include
399
+ in the statistics.
400
+ :param groups: Comma-separated list of search groups to include in the search
401
+ statistics.
402
+ :param include_segment_file_sizes: If true, the call reports the aggregated disk
403
+ usage of each one of the Lucene index files (only applies if segment stats
404
+ are requested).
405
+ :param include_unloaded_segments: If `true`, the response includes information
406
+ from segments that are not loaded into memory.
407
+ :param level: Indicates whether statistics are aggregated at the cluster, index,
408
+ or shard level.
409
+ :param timeout: Period to wait for a response. If no response is received before
410
+ the timeout expires, the request fails and returns an error.
411
+ :param types: A comma-separated list of document types for the indexing index
412
+ metric.
413
+ """
414
+ __path_parts: t.Dict[str, str]
415
+ if (
416
+ node_id not in SKIP_IN_PATH
417
+ and metric not in SKIP_IN_PATH
418
+ and index_metric not in SKIP_IN_PATH
419
+ ):
420
+ __path_parts = {
421
+ "node_id": _quote(node_id),
422
+ "metric": _quote(metric),
423
+ "index_metric": _quote(index_metric),
424
+ }
425
+ __path = f'/_nodes/{__path_parts["node_id"]}/stats/{__path_parts["metric"]}/{__path_parts["index_metric"]}'
426
+ elif node_id not in SKIP_IN_PATH and metric not in SKIP_IN_PATH:
427
+ __path_parts = {"node_id": _quote(node_id), "metric": _quote(metric)}
428
+ __path = f'/_nodes/{__path_parts["node_id"]}/stats/{__path_parts["metric"]}'
429
+ elif metric not in SKIP_IN_PATH and index_metric not in SKIP_IN_PATH:
430
+ __path_parts = {
431
+ "metric": _quote(metric),
432
+ "index_metric": _quote(index_metric),
433
+ }
434
+ __path = (
435
+ f'/_nodes/stats/{__path_parts["metric"]}/{__path_parts["index_metric"]}'
436
+ )
437
+ elif node_id not in SKIP_IN_PATH:
438
+ __path_parts = {"node_id": _quote(node_id)}
439
+ __path = f'/_nodes/{__path_parts["node_id"]}/stats'
440
+ elif metric not in SKIP_IN_PATH:
441
+ __path_parts = {"metric": _quote(metric)}
442
+ __path = f'/_nodes/stats/{__path_parts["metric"]}'
443
+ else:
444
+ __path_parts = {}
445
+ __path = "/_nodes/stats"
446
+ __query: t.Dict[str, t.Any] = {}
447
+ if completion_fields is not None:
448
+ __query["completion_fields"] = completion_fields
449
+ if error_trace is not None:
450
+ __query["error_trace"] = error_trace
451
+ if fielddata_fields is not None:
452
+ __query["fielddata_fields"] = fielddata_fields
453
+ if fields is not None:
454
+ __query["fields"] = fields
455
+ if filter_path is not None:
456
+ __query["filter_path"] = filter_path
457
+ if groups is not None:
458
+ __query["groups"] = groups
459
+ if human is not None:
460
+ __query["human"] = human
461
+ if include_segment_file_sizes is not None:
462
+ __query["include_segment_file_sizes"] = include_segment_file_sizes
463
+ if include_unloaded_segments is not None:
464
+ __query["include_unloaded_segments"] = include_unloaded_segments
465
+ if level is not None:
466
+ __query["level"] = level
467
+ if pretty is not None:
468
+ __query["pretty"] = pretty
469
+ if timeout is not None:
470
+ __query["timeout"] = timeout
471
+ if types is not None:
472
+ __query["types"] = types
473
+ __headers = {"accept": "application/json"}
474
+ return await self.perform_request( # type: ignore[return-value]
475
+ "GET",
476
+ __path,
477
+ params=__query,
478
+ headers=__headers,
479
+ endpoint_id="nodes.stats",
480
+ path_parts=__path_parts,
481
+ )
482
+
483
+ @_rewrite_parameters()
484
+ async def usage(
485
+ self,
486
+ *,
487
+ node_id: t.Optional[t.Union[str, t.Sequence[str]]] = None,
488
+ metric: t.Optional[t.Union[str, t.Sequence[str]]] = None,
489
+ error_trace: t.Optional[bool] = None,
490
+ filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
491
+ human: t.Optional[bool] = None,
492
+ pretty: t.Optional[bool] = None,
493
+ timeout: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
494
+ ) -> ObjectApiResponse[t.Any]:
495
+ """
496
+ .. raw:: html
497
+
498
+ <p>Get feature usage information.</p>
499
+
500
+
501
+ `<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-nodes-usage>`_
502
+
503
+ :param node_id: A comma-separated list of node IDs or names to limit the returned
504
+ information; use `_local` to return information from the node you're connecting
505
+ to, leave empty to get information from all nodes
506
+ :param metric: Limits the information returned to the specific metrics. A comma-separated
507
+ list of the following options: `_all`, `rest_actions`.
508
+ :param timeout: Period to wait for a response. If no response is received before
509
+ the timeout expires, the request fails and returns an error.
510
+ """
511
+ __path_parts: t.Dict[str, str]
512
+ if node_id not in SKIP_IN_PATH and metric not in SKIP_IN_PATH:
513
+ __path_parts = {"node_id": _quote(node_id), "metric": _quote(metric)}
514
+ __path = f'/_nodes/{__path_parts["node_id"]}/usage/{__path_parts["metric"]}'
515
+ elif node_id not in SKIP_IN_PATH:
516
+ __path_parts = {"node_id": _quote(node_id)}
517
+ __path = f'/_nodes/{__path_parts["node_id"]}/usage'
518
+ elif metric not in SKIP_IN_PATH:
519
+ __path_parts = {"metric": _quote(metric)}
520
+ __path = f'/_nodes/usage/{__path_parts["metric"]}'
521
+ else:
522
+ __path_parts = {}
523
+ __path = "/_nodes/usage"
524
+ __query: t.Dict[str, t.Any] = {}
525
+ if error_trace is not None:
526
+ __query["error_trace"] = error_trace
527
+ if filter_path is not None:
528
+ __query["filter_path"] = filter_path
529
+ if human is not None:
530
+ __query["human"] = human
531
+ if pretty is not None:
532
+ __query["pretty"] = pretty
533
+ if timeout is not None:
534
+ __query["timeout"] = timeout
535
+ __headers = {"accept": "application/json"}
536
+ return await self.perform_request( # type: ignore[return-value]
537
+ "GET",
538
+ __path,
539
+ params=__query,
540
+ headers=__headers,
541
+ endpoint_id="nodes.usage",
542
+ path_parts=__path_parts,
543
+ )