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,2995 @@
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 CatClient(NamespacedClient):
33
+
34
+ @_rewrite_parameters()
35
+ def aliases(
36
+ self,
37
+ *,
38
+ name: t.Optional[t.Union[str, t.Sequence[str]]] = None,
39
+ error_trace: t.Optional[bool] = None,
40
+ expand_wildcards: t.Optional[
41
+ t.Union[
42
+ t.Sequence[
43
+ t.Union[str, t.Literal["all", "closed", "hidden", "none", "open"]]
44
+ ],
45
+ t.Union[str, t.Literal["all", "closed", "hidden", "none", "open"]],
46
+ ]
47
+ ] = None,
48
+ filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
49
+ format: t.Optional[str] = None,
50
+ h: t.Optional[t.Union[str, t.Sequence[str]]] = None,
51
+ help: t.Optional[bool] = None,
52
+ human: t.Optional[bool] = None,
53
+ master_timeout: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
54
+ pretty: t.Optional[bool] = None,
55
+ s: t.Optional[t.Union[str, t.Sequence[str]]] = None,
56
+ v: t.Optional[bool] = None,
57
+ ) -> t.Union[ObjectApiResponse[t.Any], TextApiResponse]:
58
+ """
59
+ .. raw:: html
60
+
61
+ <p>Get aliases.</p>
62
+ <p>Get the cluster's index aliases, including filter and routing information.
63
+ This API does not return data stream aliases.</p>
64
+ <p>IMPORTANT: CAT APIs are only intended for human consumption using the command line or the Kibana console. They are not intended for use by applications. For application consumption, use the aliases API.</p>
65
+
66
+
67
+ `<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-cat-aliases>`_
68
+
69
+ :param name: A comma-separated list of aliases to retrieve. Supports wildcards
70
+ (`*`). To retrieve all aliases, omit this parameter or use `*` or `_all`.
71
+ :param expand_wildcards: The type of index that wildcard patterns can match.
72
+ If the request can target data streams, this argument determines whether
73
+ wildcard expressions match hidden data streams. It supports comma-separated
74
+ values, such as `open,hidden`.
75
+ :param format: Specifies the format to return the columnar data in, can be set
76
+ to `text`, `json`, `cbor`, `yaml`, or `smile`.
77
+ :param h: List of columns to appear in the response. Supports simple wildcards.
78
+ :param help: When set to `true` will output available columns. This option can't
79
+ be combined with any other query string option.
80
+ :param master_timeout: The period to wait for a connection to the master node.
81
+ If the master node is not available before the timeout expires, the request
82
+ fails and returns an error. To indicated that the request should never timeout,
83
+ you can set it to `-1`.
84
+ :param s: List of columns that determine how the table should be sorted. Sorting
85
+ defaults to ascending and can be changed by setting `:asc` or `:desc` as
86
+ a suffix to the column name.
87
+ :param v: When set to `true` will enable verbose output.
88
+ """
89
+ __path_parts: t.Dict[str, str]
90
+ if name not in SKIP_IN_PATH:
91
+ __path_parts = {"name": _quote(name)}
92
+ __path = f'/_cat/aliases/{__path_parts["name"]}'
93
+ else:
94
+ __path_parts = {}
95
+ __path = "/_cat/aliases"
96
+ __query: t.Dict[str, t.Any] = {}
97
+ if error_trace is not None:
98
+ __query["error_trace"] = error_trace
99
+ if expand_wildcards is not None:
100
+ __query["expand_wildcards"] = expand_wildcards
101
+ if filter_path is not None:
102
+ __query["filter_path"] = filter_path
103
+ if format is not None:
104
+ __query["format"] = format
105
+ if h is not None:
106
+ __query["h"] = h
107
+ if help is not None:
108
+ __query["help"] = help
109
+ if human is not None:
110
+ __query["human"] = human
111
+ if master_timeout is not None:
112
+ __query["master_timeout"] = master_timeout
113
+ if pretty is not None:
114
+ __query["pretty"] = pretty
115
+ if s is not None:
116
+ __query["s"] = s
117
+ if v is not None:
118
+ __query["v"] = v
119
+ __headers = {"accept": "text/plain,application/json"}
120
+ return self.perform_request( # type: ignore[return-value]
121
+ "GET",
122
+ __path,
123
+ params=__query,
124
+ headers=__headers,
125
+ endpoint_id="cat.aliases",
126
+ path_parts=__path_parts,
127
+ )
128
+
129
+ @_rewrite_parameters()
130
+ def allocation(
131
+ self,
132
+ *,
133
+ node_id: t.Optional[t.Union[str, t.Sequence[str]]] = None,
134
+ bytes: t.Optional[
135
+ t.Union[str, t.Literal["b", "gb", "kb", "mb", "pb", "tb"]]
136
+ ] = None,
137
+ error_trace: t.Optional[bool] = None,
138
+ filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
139
+ format: t.Optional[str] = None,
140
+ h: t.Optional[t.Union[str, t.Sequence[str]]] = None,
141
+ help: t.Optional[bool] = None,
142
+ human: t.Optional[bool] = None,
143
+ local: t.Optional[bool] = None,
144
+ master_timeout: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
145
+ pretty: t.Optional[bool] = None,
146
+ s: t.Optional[t.Union[str, t.Sequence[str]]] = None,
147
+ v: t.Optional[bool] = None,
148
+ ) -> t.Union[ObjectApiResponse[t.Any], TextApiResponse]:
149
+ """
150
+ .. raw:: html
151
+
152
+ <p>Get shard allocation information.</p>
153
+ <p>Get a snapshot of the number of shards allocated to each data node and their disk space.</p>
154
+ <p>IMPORTANT: CAT APIs are only intended for human consumption using the command line or Kibana console. They are not intended for use by applications.</p>
155
+
156
+
157
+ `<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-cat-allocation>`_
158
+
159
+ :param node_id: A comma-separated list of node identifiers or names used to limit
160
+ the returned information.
161
+ :param bytes: The unit used to display byte values.
162
+ :param format: Specifies the format to return the columnar data in, can be set
163
+ to `text`, `json`, `cbor`, `yaml`, or `smile`.
164
+ :param h: List of columns to appear in the response. Supports simple wildcards.
165
+ :param help: When set to `true` will output available columns. This option can't
166
+ be combined with any other query string option.
167
+ :param local: If `true`, the request computes the list of selected nodes from
168
+ the local cluster state. If `false` the list of selected nodes are computed
169
+ from the cluster state of the master node. In both cases the coordinating
170
+ node will send requests for further information to each selected node.
171
+ :param master_timeout: Period to wait for a connection to the master node.
172
+ :param s: List of columns that determine how the table should be sorted. Sorting
173
+ defaults to ascending and can be changed by setting `:asc` or `:desc` as
174
+ a suffix to the column name.
175
+ :param v: When set to `true` will enable verbose output.
176
+ """
177
+ __path_parts: t.Dict[str, str]
178
+ if node_id not in SKIP_IN_PATH:
179
+ __path_parts = {"node_id": _quote(node_id)}
180
+ __path = f'/_cat/allocation/{__path_parts["node_id"]}'
181
+ else:
182
+ __path_parts = {}
183
+ __path = "/_cat/allocation"
184
+ __query: t.Dict[str, t.Any] = {}
185
+ if bytes is not None:
186
+ __query["bytes"] = bytes
187
+ if error_trace is not None:
188
+ __query["error_trace"] = error_trace
189
+ if filter_path is not None:
190
+ __query["filter_path"] = filter_path
191
+ if format is not None:
192
+ __query["format"] = format
193
+ if h is not None:
194
+ __query["h"] = h
195
+ if help is not None:
196
+ __query["help"] = help
197
+ if human is not None:
198
+ __query["human"] = human
199
+ if local is not None:
200
+ __query["local"] = local
201
+ if master_timeout is not None:
202
+ __query["master_timeout"] = master_timeout
203
+ if pretty is not None:
204
+ __query["pretty"] = pretty
205
+ if s is not None:
206
+ __query["s"] = s
207
+ if v is not None:
208
+ __query["v"] = v
209
+ __headers = {"accept": "text/plain,application/json"}
210
+ return self.perform_request( # type: ignore[return-value]
211
+ "GET",
212
+ __path,
213
+ params=__query,
214
+ headers=__headers,
215
+ endpoint_id="cat.allocation",
216
+ path_parts=__path_parts,
217
+ )
218
+
219
+ @_rewrite_parameters()
220
+ def component_templates(
221
+ self,
222
+ *,
223
+ name: t.Optional[str] = None,
224
+ error_trace: t.Optional[bool] = None,
225
+ filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
226
+ format: t.Optional[str] = None,
227
+ h: t.Optional[t.Union[str, t.Sequence[str]]] = None,
228
+ help: t.Optional[bool] = None,
229
+ human: t.Optional[bool] = None,
230
+ local: t.Optional[bool] = None,
231
+ master_timeout: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
232
+ pretty: t.Optional[bool] = None,
233
+ s: t.Optional[t.Union[str, t.Sequence[str]]] = None,
234
+ v: t.Optional[bool] = None,
235
+ ) -> t.Union[ObjectApiResponse[t.Any], TextApiResponse]:
236
+ """
237
+ .. raw:: html
238
+
239
+ <p>Get component templates.</p>
240
+ <p>Get information about component templates in a cluster.
241
+ Component templates are building blocks for constructing index templates that specify index mappings, settings, and aliases.</p>
242
+ <p>IMPORTANT: CAT APIs are only intended for human consumption using the command line or Kibana console.
243
+ They are not intended for use by applications. For application consumption, use the get component template API.</p>
244
+
245
+
246
+ `<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-cat-component-templates>`_
247
+
248
+ :param name: The name of the component template. It accepts wildcard expressions.
249
+ If it is omitted, all component templates are returned.
250
+ :param format: Specifies the format to return the columnar data in, can be set
251
+ to `text`, `json`, `cbor`, `yaml`, or `smile`.
252
+ :param h: List of columns to appear in the response. Supports simple wildcards.
253
+ :param help: When set to `true` will output available columns. This option can't
254
+ be combined with any other query string option.
255
+ :param local: If `true`, the request computes the list of selected nodes from
256
+ the local cluster state. If `false` the list of selected nodes are computed
257
+ from the cluster state of the master node. In both cases the coordinating
258
+ node will send requests for further information to each selected node.
259
+ :param master_timeout: The period to wait for a connection to the master node.
260
+ :param s: List of columns that determine how the table should be sorted. Sorting
261
+ defaults to ascending and can be changed by setting `:asc` or `:desc` as
262
+ a suffix to the column name.
263
+ :param v: When set to `true` will enable verbose output.
264
+ """
265
+ __path_parts: t.Dict[str, str]
266
+ if name not in SKIP_IN_PATH:
267
+ __path_parts = {"name": _quote(name)}
268
+ __path = f'/_cat/component_templates/{__path_parts["name"]}'
269
+ else:
270
+ __path_parts = {}
271
+ __path = "/_cat/component_templates"
272
+ __query: t.Dict[str, t.Any] = {}
273
+ if error_trace is not None:
274
+ __query["error_trace"] = error_trace
275
+ if filter_path is not None:
276
+ __query["filter_path"] = filter_path
277
+ if format is not None:
278
+ __query["format"] = format
279
+ if h is not None:
280
+ __query["h"] = h
281
+ if help is not None:
282
+ __query["help"] = help
283
+ if human is not None:
284
+ __query["human"] = human
285
+ if local is not None:
286
+ __query["local"] = local
287
+ if master_timeout is not None:
288
+ __query["master_timeout"] = master_timeout
289
+ if pretty is not None:
290
+ __query["pretty"] = pretty
291
+ if s is not None:
292
+ __query["s"] = s
293
+ if v is not None:
294
+ __query["v"] = v
295
+ __headers = {"accept": "text/plain,application/json"}
296
+ return self.perform_request( # type: ignore[return-value]
297
+ "GET",
298
+ __path,
299
+ params=__query,
300
+ headers=__headers,
301
+ endpoint_id="cat.component_templates",
302
+ path_parts=__path_parts,
303
+ )
304
+
305
+ @_rewrite_parameters()
306
+ def count(
307
+ self,
308
+ *,
309
+ index: t.Optional[t.Union[str, t.Sequence[str]]] = None,
310
+ error_trace: t.Optional[bool] = None,
311
+ filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
312
+ format: t.Optional[str] = None,
313
+ h: t.Optional[t.Union[str, t.Sequence[str]]] = None,
314
+ help: t.Optional[bool] = None,
315
+ human: t.Optional[bool] = None,
316
+ pretty: t.Optional[bool] = None,
317
+ s: t.Optional[t.Union[str, t.Sequence[str]]] = None,
318
+ v: t.Optional[bool] = None,
319
+ ) -> t.Union[ObjectApiResponse[t.Any], TextApiResponse]:
320
+ """
321
+ .. raw:: html
322
+
323
+ <p>Get a document count.</p>
324
+ <p>Get quick access to a document count for a data stream, an index, or an entire cluster.
325
+ The document count only includes live documents, not deleted documents which have not yet been removed by the merge process.</p>
326
+ <p>IMPORTANT: CAT APIs are only intended for human consumption using the command line or Kibana console.
327
+ They are not intended for use by applications. For application consumption, use the count API.</p>
328
+
329
+
330
+ `<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-cat-count>`_
331
+
332
+ :param index: A comma-separated list of data streams, indices, and aliases used
333
+ to limit the request. It supports wildcards (`*`). To target all data streams
334
+ and indices, omit this parameter or use `*` or `_all`.
335
+ :param format: Specifies the format to return the columnar data in, can be set
336
+ to `text`, `json`, `cbor`, `yaml`, or `smile`.
337
+ :param h: List of columns to appear in the response. Supports simple wildcards.
338
+ :param help: When set to `true` will output available columns. This option can't
339
+ be combined with any other query string option.
340
+ :param s: List of columns that determine how the table should be sorted. Sorting
341
+ defaults to ascending and can be changed by setting `:asc` or `:desc` as
342
+ a suffix to the column name.
343
+ :param v: When set to `true` will enable verbose output.
344
+ """
345
+ __path_parts: t.Dict[str, str]
346
+ if index not in SKIP_IN_PATH:
347
+ __path_parts = {"index": _quote(index)}
348
+ __path = f'/_cat/count/{__path_parts["index"]}'
349
+ else:
350
+ __path_parts = {}
351
+ __path = "/_cat/count"
352
+ __query: t.Dict[str, t.Any] = {}
353
+ if error_trace is not None:
354
+ __query["error_trace"] = error_trace
355
+ if filter_path is not None:
356
+ __query["filter_path"] = filter_path
357
+ if format is not None:
358
+ __query["format"] = format
359
+ if h is not None:
360
+ __query["h"] = h
361
+ if help is not None:
362
+ __query["help"] = help
363
+ if human is not None:
364
+ __query["human"] = human
365
+ if pretty is not None:
366
+ __query["pretty"] = pretty
367
+ if s is not None:
368
+ __query["s"] = s
369
+ if v is not None:
370
+ __query["v"] = v
371
+ __headers = {"accept": "text/plain,application/json"}
372
+ return self.perform_request( # type: ignore[return-value]
373
+ "GET",
374
+ __path,
375
+ params=__query,
376
+ headers=__headers,
377
+ endpoint_id="cat.count",
378
+ path_parts=__path_parts,
379
+ )
380
+
381
+ @_rewrite_parameters()
382
+ def fielddata(
383
+ self,
384
+ *,
385
+ fields: t.Optional[t.Union[str, t.Sequence[str]]] = None,
386
+ bytes: t.Optional[
387
+ t.Union[str, t.Literal["b", "gb", "kb", "mb", "pb", "tb"]]
388
+ ] = None,
389
+ error_trace: t.Optional[bool] = None,
390
+ filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
391
+ format: t.Optional[str] = None,
392
+ h: t.Optional[t.Union[str, t.Sequence[str]]] = None,
393
+ help: t.Optional[bool] = None,
394
+ human: t.Optional[bool] = None,
395
+ pretty: t.Optional[bool] = None,
396
+ s: t.Optional[t.Union[str, t.Sequence[str]]] = None,
397
+ v: t.Optional[bool] = None,
398
+ ) -> t.Union[ObjectApiResponse[t.Any], TextApiResponse]:
399
+ """
400
+ .. raw:: html
401
+
402
+ <p>Get field data cache information.</p>
403
+ <p>Get the amount of heap memory currently used by the field data cache on every data node in the cluster.</p>
404
+ <p>IMPORTANT: cat APIs are only intended for human consumption using the command line or Kibana console.
405
+ They are not intended for use by applications. For application consumption, use the nodes stats API.</p>
406
+
407
+
408
+ `<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-cat-fielddata>`_
409
+
410
+ :param fields: Comma-separated list of fields used to limit returned information.
411
+ To retrieve all fields, omit this parameter.
412
+ :param bytes: The unit used to display byte values.
413
+ :param format: Specifies the format to return the columnar data in, can be set
414
+ to `text`, `json`, `cbor`, `yaml`, or `smile`.
415
+ :param h: List of columns to appear in the response. Supports simple wildcards.
416
+ :param help: When set to `true` will output available columns. This option can't
417
+ be combined with any other query string option.
418
+ :param s: List of columns that determine how the table should be sorted. Sorting
419
+ defaults to ascending and can be changed by setting `:asc` or `:desc` as
420
+ a suffix to the column name.
421
+ :param v: When set to `true` will enable verbose output.
422
+ """
423
+ __path_parts: t.Dict[str, str]
424
+ if fields not in SKIP_IN_PATH:
425
+ __path_parts = {"fields": _quote(fields)}
426
+ __path = f'/_cat/fielddata/{__path_parts["fields"]}'
427
+ else:
428
+ __path_parts = {}
429
+ __path = "/_cat/fielddata"
430
+ __query: t.Dict[str, t.Any] = {}
431
+ if bytes is not None:
432
+ __query["bytes"] = bytes
433
+ if error_trace is not None:
434
+ __query["error_trace"] = error_trace
435
+ if filter_path is not None:
436
+ __query["filter_path"] = filter_path
437
+ if format is not None:
438
+ __query["format"] = format
439
+ if h is not None:
440
+ __query["h"] = h
441
+ if help is not None:
442
+ __query["help"] = help
443
+ if human is not None:
444
+ __query["human"] = human
445
+ if pretty is not None:
446
+ __query["pretty"] = pretty
447
+ if s is not None:
448
+ __query["s"] = s
449
+ if v is not None:
450
+ __query["v"] = v
451
+ __headers = {"accept": "text/plain,application/json"}
452
+ return self.perform_request( # type: ignore[return-value]
453
+ "GET",
454
+ __path,
455
+ params=__query,
456
+ headers=__headers,
457
+ endpoint_id="cat.fielddata",
458
+ path_parts=__path_parts,
459
+ )
460
+
461
+ @_rewrite_parameters()
462
+ def health(
463
+ self,
464
+ *,
465
+ error_trace: t.Optional[bool] = None,
466
+ filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
467
+ format: t.Optional[str] = None,
468
+ h: t.Optional[t.Union[str, t.Sequence[str]]] = None,
469
+ help: t.Optional[bool] = None,
470
+ human: t.Optional[bool] = None,
471
+ pretty: t.Optional[bool] = None,
472
+ s: t.Optional[t.Union[str, t.Sequence[str]]] = None,
473
+ time: t.Optional[
474
+ t.Union[str, t.Literal["d", "h", "m", "micros", "ms", "nanos", "s"]]
475
+ ] = None,
476
+ ts: t.Optional[bool] = None,
477
+ v: t.Optional[bool] = None,
478
+ ) -> t.Union[ObjectApiResponse[t.Any], TextApiResponse]:
479
+ """
480
+ .. raw:: html
481
+
482
+ <p>Get the cluster health status.</p>
483
+ <p>IMPORTANT: CAT APIs are only intended for human consumption using the command line or Kibana console.
484
+ They are not intended for use by applications. For application consumption, use the cluster health API.
485
+ This API is often used to check malfunctioning clusters.
486
+ To help you track cluster health alongside log files and alerting systems, the API returns timestamps in two formats:
487
+ <code>HH:MM:SS</code>, which is human-readable but includes no date information;
488
+ <code>Unix epoch time</code>, which is machine-sortable and includes date information.
489
+ The latter format is useful for cluster recoveries that take multiple days.
490
+ You can use the cat health API to verify cluster health across multiple nodes.
491
+ You also can use the API to track the recovery of a large cluster over a longer period of time.</p>
492
+
493
+
494
+ `<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-cat-health>`_
495
+
496
+ :param format: Specifies the format to return the columnar data in, can be set
497
+ to `text`, `json`, `cbor`, `yaml`, or `smile`.
498
+ :param h: List of columns to appear in the response. Supports simple wildcards.
499
+ :param help: When set to `true` will output available columns. This option can't
500
+ be combined with any other query string option.
501
+ :param s: List of columns that determine how the table should be sorted. Sorting
502
+ defaults to ascending and can be changed by setting `:asc` or `:desc` as
503
+ a suffix to the column name.
504
+ :param time: The unit used to display time values.
505
+ :param ts: If true, returns `HH:MM:SS` and Unix epoch timestamps.
506
+ :param v: When set to `true` will enable verbose output.
507
+ """
508
+ __path_parts: t.Dict[str, str] = {}
509
+ __path = "/_cat/health"
510
+ __query: t.Dict[str, t.Any] = {}
511
+ if error_trace is not None:
512
+ __query["error_trace"] = error_trace
513
+ if filter_path is not None:
514
+ __query["filter_path"] = filter_path
515
+ if format is not None:
516
+ __query["format"] = format
517
+ if h is not None:
518
+ __query["h"] = h
519
+ if help is not None:
520
+ __query["help"] = help
521
+ if human is not None:
522
+ __query["human"] = human
523
+ if pretty is not None:
524
+ __query["pretty"] = pretty
525
+ if s is not None:
526
+ __query["s"] = s
527
+ if time is not None:
528
+ __query["time"] = time
529
+ if ts is not None:
530
+ __query["ts"] = ts
531
+ if v is not None:
532
+ __query["v"] = v
533
+ __headers = {"accept": "text/plain,application/json"}
534
+ return self.perform_request( # type: ignore[return-value]
535
+ "GET",
536
+ __path,
537
+ params=__query,
538
+ headers=__headers,
539
+ endpoint_id="cat.health",
540
+ path_parts=__path_parts,
541
+ )
542
+
543
+ @_rewrite_parameters()
544
+ def help(self) -> TextApiResponse:
545
+ """
546
+ .. raw:: html
547
+
548
+ <p>Get CAT help.</p>
549
+ <p>Get help for the CAT APIs.</p>
550
+
551
+
552
+ `<https://www.elastic.co/docs/api/doc/elasticsearch/v9/group/endpoint-cat>`_
553
+ """
554
+ __path_parts: t.Dict[str, str] = {}
555
+ __path = "/_cat"
556
+ __query: t.Dict[str, t.Any] = {}
557
+ __headers = {"accept": "text/plain"}
558
+ return self.perform_request( # type: ignore[return-value]
559
+ "GET",
560
+ __path,
561
+ params=__query,
562
+ headers=__headers,
563
+ endpoint_id="cat.help",
564
+ path_parts=__path_parts,
565
+ )
566
+
567
+ @_rewrite_parameters()
568
+ def indices(
569
+ self,
570
+ *,
571
+ index: t.Optional[t.Union[str, t.Sequence[str]]] = None,
572
+ bytes: t.Optional[
573
+ t.Union[str, t.Literal["b", "gb", "kb", "mb", "pb", "tb"]]
574
+ ] = None,
575
+ error_trace: t.Optional[bool] = None,
576
+ expand_wildcards: t.Optional[
577
+ t.Union[
578
+ t.Sequence[
579
+ t.Union[str, t.Literal["all", "closed", "hidden", "none", "open"]]
580
+ ],
581
+ t.Union[str, t.Literal["all", "closed", "hidden", "none", "open"]],
582
+ ]
583
+ ] = None,
584
+ filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
585
+ format: t.Optional[str] = None,
586
+ h: t.Optional[t.Union[str, t.Sequence[str]]] = None,
587
+ health: t.Optional[t.Union[str, t.Literal["green", "red", "yellow"]]] = None,
588
+ help: t.Optional[bool] = None,
589
+ human: t.Optional[bool] = None,
590
+ include_unloaded_segments: t.Optional[bool] = None,
591
+ master_timeout: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
592
+ pretty: t.Optional[bool] = None,
593
+ pri: t.Optional[bool] = None,
594
+ s: t.Optional[t.Union[str, t.Sequence[str]]] = None,
595
+ time: t.Optional[
596
+ t.Union[str, t.Literal["d", "h", "m", "micros", "ms", "nanos", "s"]]
597
+ ] = None,
598
+ v: t.Optional[bool] = None,
599
+ ) -> t.Union[ObjectApiResponse[t.Any], TextApiResponse]:
600
+ """
601
+ .. raw:: html
602
+
603
+ <p>Get index information.</p>
604
+ <p>Get high-level information about indices in a cluster, including backing indices for data streams.</p>
605
+ <p>Use this request to get the following information for each index in a cluster:</p>
606
+ <ul>
607
+ <li>shard count</li>
608
+ <li>document count</li>
609
+ <li>deleted document count</li>
610
+ <li>primary store size</li>
611
+ <li>total store size of all shards, including shard replicas</li>
612
+ </ul>
613
+ <p>These metrics are retrieved directly from Lucene, which Elasticsearch uses internally to power indexing and search. As a result, all document counts include hidden nested documents.
614
+ To get an accurate count of Elasticsearch documents, use the cat count or count APIs.</p>
615
+ <p>CAT APIs are only intended for human consumption using the command line or Kibana console.
616
+ They are not intended for use by applications. For application consumption, use an index endpoint.</p>
617
+
618
+
619
+ `<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-cat-indices>`_
620
+
621
+ :param index: Comma-separated list of data streams, indices, and aliases used
622
+ to limit the request. Supports wildcards (`*`). To target all data streams
623
+ and indices, omit this parameter or use `*` or `_all`.
624
+ :param bytes: The unit used to display byte values.
625
+ :param expand_wildcards: The type of index that wildcard patterns can match.
626
+ :param format: Specifies the format to return the columnar data in, can be set
627
+ to `text`, `json`, `cbor`, `yaml`, or `smile`.
628
+ :param h: List of columns to appear in the response. Supports simple wildcards.
629
+ :param health: The health status used to limit returned indices. By default,
630
+ the response includes indices of any health status.
631
+ :param help: When set to `true` will output available columns. This option can't
632
+ be combined with any other query string option.
633
+ :param include_unloaded_segments: If true, the response includes information
634
+ from segments that are not loaded into memory.
635
+ :param master_timeout: Period to wait for a connection to the master node.
636
+ :param pri: If true, the response only includes information from primary shards.
637
+ :param s: List of columns that determine how the table should be sorted. Sorting
638
+ defaults to ascending and can be changed by setting `:asc` or `:desc` as
639
+ a suffix to the column name.
640
+ :param time: The unit used to display time values.
641
+ :param v: When set to `true` will enable verbose output.
642
+ """
643
+ __path_parts: t.Dict[str, str]
644
+ if index not in SKIP_IN_PATH:
645
+ __path_parts = {"index": _quote(index)}
646
+ __path = f'/_cat/indices/{__path_parts["index"]}'
647
+ else:
648
+ __path_parts = {}
649
+ __path = "/_cat/indices"
650
+ __query: t.Dict[str, t.Any] = {}
651
+ if bytes is not None:
652
+ __query["bytes"] = bytes
653
+ if error_trace is not None:
654
+ __query["error_trace"] = error_trace
655
+ if expand_wildcards is not None:
656
+ __query["expand_wildcards"] = expand_wildcards
657
+ if filter_path is not None:
658
+ __query["filter_path"] = filter_path
659
+ if format is not None:
660
+ __query["format"] = format
661
+ if h is not None:
662
+ __query["h"] = h
663
+ if health is not None:
664
+ __query["health"] = health
665
+ if help is not None:
666
+ __query["help"] = help
667
+ if human is not None:
668
+ __query["human"] = human
669
+ if include_unloaded_segments is not None:
670
+ __query["include_unloaded_segments"] = include_unloaded_segments
671
+ if master_timeout is not None:
672
+ __query["master_timeout"] = master_timeout
673
+ if pretty is not None:
674
+ __query["pretty"] = pretty
675
+ if pri is not None:
676
+ __query["pri"] = pri
677
+ if s is not None:
678
+ __query["s"] = s
679
+ if time is not None:
680
+ __query["time"] = time
681
+ if v is not None:
682
+ __query["v"] = v
683
+ __headers = {"accept": "text/plain,application/json"}
684
+ return self.perform_request( # type: ignore[return-value]
685
+ "GET",
686
+ __path,
687
+ params=__query,
688
+ headers=__headers,
689
+ endpoint_id="cat.indices",
690
+ path_parts=__path_parts,
691
+ )
692
+
693
+ @_rewrite_parameters()
694
+ def master(
695
+ self,
696
+ *,
697
+ error_trace: t.Optional[bool] = None,
698
+ filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
699
+ format: t.Optional[str] = None,
700
+ h: t.Optional[t.Union[str, t.Sequence[str]]] = None,
701
+ help: t.Optional[bool] = None,
702
+ human: t.Optional[bool] = None,
703
+ local: t.Optional[bool] = None,
704
+ master_timeout: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
705
+ pretty: t.Optional[bool] = None,
706
+ s: t.Optional[t.Union[str, t.Sequence[str]]] = None,
707
+ v: t.Optional[bool] = None,
708
+ ) -> t.Union[ObjectApiResponse[t.Any], TextApiResponse]:
709
+ """
710
+ .. raw:: html
711
+
712
+ <p>Get master node information.</p>
713
+ <p>Get information about the master node, including the ID, bound IP address, and name.</p>
714
+ <p>IMPORTANT: cat APIs are only intended for human consumption using the command line or Kibana console. They are not intended for use by applications. For application consumption, use the nodes info API.</p>
715
+
716
+
717
+ `<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-cat-master>`_
718
+
719
+ :param format: Specifies the format to return the columnar data in, can be set
720
+ to `text`, `json`, `cbor`, `yaml`, or `smile`.
721
+ :param h: List of columns to appear in the response. Supports simple wildcards.
722
+ :param help: When set to `true` will output available columns. This option can't
723
+ be combined with any other query string option.
724
+ :param local: If `true`, the request computes the list of selected nodes from
725
+ the local cluster state. If `false` the list of selected nodes are computed
726
+ from the cluster state of the master node. In both cases the coordinating
727
+ node will send requests for further information to each selected node.
728
+ :param master_timeout: Period to wait for a connection to the master node.
729
+ :param s: List of columns that determine how the table should be sorted. Sorting
730
+ defaults to ascending and can be changed by setting `:asc` or `:desc` as
731
+ a suffix to the column name.
732
+ :param v: When set to `true` will enable verbose output.
733
+ """
734
+ __path_parts: t.Dict[str, str] = {}
735
+ __path = "/_cat/master"
736
+ __query: t.Dict[str, t.Any] = {}
737
+ if error_trace is not None:
738
+ __query["error_trace"] = error_trace
739
+ if filter_path is not None:
740
+ __query["filter_path"] = filter_path
741
+ if format is not None:
742
+ __query["format"] = format
743
+ if h is not None:
744
+ __query["h"] = h
745
+ if help is not None:
746
+ __query["help"] = help
747
+ if human is not None:
748
+ __query["human"] = human
749
+ if local is not None:
750
+ __query["local"] = local
751
+ if master_timeout is not None:
752
+ __query["master_timeout"] = master_timeout
753
+ if pretty is not None:
754
+ __query["pretty"] = pretty
755
+ if s is not None:
756
+ __query["s"] = s
757
+ if v is not None:
758
+ __query["v"] = v
759
+ __headers = {"accept": "text/plain,application/json"}
760
+ return self.perform_request( # type: ignore[return-value]
761
+ "GET",
762
+ __path,
763
+ params=__query,
764
+ headers=__headers,
765
+ endpoint_id="cat.master",
766
+ path_parts=__path_parts,
767
+ )
768
+
769
+ @_rewrite_parameters()
770
+ def ml_data_frame_analytics(
771
+ self,
772
+ *,
773
+ id: t.Optional[str] = None,
774
+ allow_no_match: t.Optional[bool] = None,
775
+ bytes: t.Optional[
776
+ t.Union[str, t.Literal["b", "gb", "kb", "mb", "pb", "tb"]]
777
+ ] = None,
778
+ error_trace: t.Optional[bool] = None,
779
+ filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
780
+ format: t.Optional[str] = None,
781
+ h: t.Optional[
782
+ t.Union[
783
+ t.Sequence[
784
+ t.Union[
785
+ str,
786
+ t.Literal[
787
+ "assignment_explanation",
788
+ "create_time",
789
+ "description",
790
+ "dest_index",
791
+ "failure_reason",
792
+ "id",
793
+ "model_memory_limit",
794
+ "node.address",
795
+ "node.ephemeral_id",
796
+ "node.id",
797
+ "node.name",
798
+ "progress",
799
+ "source_index",
800
+ "state",
801
+ "type",
802
+ "version",
803
+ ],
804
+ ]
805
+ ],
806
+ t.Union[
807
+ str,
808
+ t.Literal[
809
+ "assignment_explanation",
810
+ "create_time",
811
+ "description",
812
+ "dest_index",
813
+ "failure_reason",
814
+ "id",
815
+ "model_memory_limit",
816
+ "node.address",
817
+ "node.ephemeral_id",
818
+ "node.id",
819
+ "node.name",
820
+ "progress",
821
+ "source_index",
822
+ "state",
823
+ "type",
824
+ "version",
825
+ ],
826
+ ],
827
+ ]
828
+ ] = None,
829
+ help: t.Optional[bool] = None,
830
+ human: t.Optional[bool] = None,
831
+ pretty: t.Optional[bool] = None,
832
+ s: t.Optional[
833
+ t.Union[
834
+ t.Sequence[
835
+ t.Union[
836
+ str,
837
+ t.Literal[
838
+ "assignment_explanation",
839
+ "create_time",
840
+ "description",
841
+ "dest_index",
842
+ "failure_reason",
843
+ "id",
844
+ "model_memory_limit",
845
+ "node.address",
846
+ "node.ephemeral_id",
847
+ "node.id",
848
+ "node.name",
849
+ "progress",
850
+ "source_index",
851
+ "state",
852
+ "type",
853
+ "version",
854
+ ],
855
+ ]
856
+ ],
857
+ t.Union[
858
+ str,
859
+ t.Literal[
860
+ "assignment_explanation",
861
+ "create_time",
862
+ "description",
863
+ "dest_index",
864
+ "failure_reason",
865
+ "id",
866
+ "model_memory_limit",
867
+ "node.address",
868
+ "node.ephemeral_id",
869
+ "node.id",
870
+ "node.name",
871
+ "progress",
872
+ "source_index",
873
+ "state",
874
+ "type",
875
+ "version",
876
+ ],
877
+ ],
878
+ ]
879
+ ] = None,
880
+ time: t.Optional[
881
+ t.Union[str, t.Literal["d", "h", "m", "micros", "ms", "nanos", "s"]]
882
+ ] = None,
883
+ v: t.Optional[bool] = None,
884
+ ) -> t.Union[ObjectApiResponse[t.Any], TextApiResponse]:
885
+ """
886
+ .. raw:: html
887
+
888
+ <p>Get data frame analytics jobs.</p>
889
+ <p>Get configuration and usage information about data frame analytics jobs.</p>
890
+ <p>IMPORTANT: CAT APIs are only intended for human consumption using the Kibana
891
+ console or command line. They are not intended for use by applications. For
892
+ application consumption, use the get data frame analytics jobs statistics API.</p>
893
+
894
+
895
+ `<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-cat-ml-data-frame-analytics>`_
896
+
897
+ :param id: The ID of the data frame analytics to fetch
898
+ :param allow_no_match: Whether to ignore if a wildcard expression matches no
899
+ configs. (This includes `_all` string or when no configs have been specified)
900
+ :param bytes: The unit in which to display byte values
901
+ :param format: Specifies the format to return the columnar data in, can be set
902
+ to `text`, `json`, `cbor`, `yaml`, or `smile`.
903
+ :param h: Comma-separated list of column names to display.
904
+ :param help: When set to `true` will output available columns. This option can't
905
+ be combined with any other query string option.
906
+ :param s: Comma-separated list of column names or column aliases used to sort
907
+ the response.
908
+ :param time: Unit used to display time values.
909
+ :param v: When set to `true` will enable verbose output.
910
+ """
911
+ __path_parts: t.Dict[str, str]
912
+ if id not in SKIP_IN_PATH:
913
+ __path_parts = {"id": _quote(id)}
914
+ __path = f'/_cat/ml/data_frame/analytics/{__path_parts["id"]}'
915
+ else:
916
+ __path_parts = {}
917
+ __path = "/_cat/ml/data_frame/analytics"
918
+ __query: t.Dict[str, t.Any] = {}
919
+ if allow_no_match is not None:
920
+ __query["allow_no_match"] = allow_no_match
921
+ if bytes is not None:
922
+ __query["bytes"] = bytes
923
+ if error_trace is not None:
924
+ __query["error_trace"] = error_trace
925
+ if filter_path is not None:
926
+ __query["filter_path"] = filter_path
927
+ if format is not None:
928
+ __query["format"] = format
929
+ if h is not None:
930
+ __query["h"] = h
931
+ if help is not None:
932
+ __query["help"] = help
933
+ if human is not None:
934
+ __query["human"] = human
935
+ if pretty is not None:
936
+ __query["pretty"] = pretty
937
+ if s is not None:
938
+ __query["s"] = s
939
+ if time is not None:
940
+ __query["time"] = time
941
+ if v is not None:
942
+ __query["v"] = v
943
+ __headers = {"accept": "text/plain,application/json"}
944
+ return self.perform_request( # type: ignore[return-value]
945
+ "GET",
946
+ __path,
947
+ params=__query,
948
+ headers=__headers,
949
+ endpoint_id="cat.ml_data_frame_analytics",
950
+ path_parts=__path_parts,
951
+ )
952
+
953
+ @_rewrite_parameters()
954
+ def ml_datafeeds(
955
+ self,
956
+ *,
957
+ datafeed_id: t.Optional[str] = None,
958
+ allow_no_match: t.Optional[bool] = None,
959
+ error_trace: t.Optional[bool] = None,
960
+ filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
961
+ format: t.Optional[str] = None,
962
+ h: t.Optional[
963
+ t.Union[
964
+ t.Sequence[
965
+ t.Union[
966
+ str,
967
+ t.Literal[
968
+ "ae",
969
+ "bc",
970
+ "id",
971
+ "na",
972
+ "ne",
973
+ "ni",
974
+ "nn",
975
+ "s",
976
+ "sba",
977
+ "sc",
978
+ "seah",
979
+ "st",
980
+ ],
981
+ ]
982
+ ],
983
+ t.Union[
984
+ str,
985
+ t.Literal[
986
+ "ae",
987
+ "bc",
988
+ "id",
989
+ "na",
990
+ "ne",
991
+ "ni",
992
+ "nn",
993
+ "s",
994
+ "sba",
995
+ "sc",
996
+ "seah",
997
+ "st",
998
+ ],
999
+ ],
1000
+ ]
1001
+ ] = None,
1002
+ help: t.Optional[bool] = None,
1003
+ human: t.Optional[bool] = None,
1004
+ pretty: t.Optional[bool] = None,
1005
+ s: t.Optional[
1006
+ t.Union[
1007
+ t.Sequence[
1008
+ t.Union[
1009
+ str,
1010
+ t.Literal[
1011
+ "ae",
1012
+ "bc",
1013
+ "id",
1014
+ "na",
1015
+ "ne",
1016
+ "ni",
1017
+ "nn",
1018
+ "s",
1019
+ "sba",
1020
+ "sc",
1021
+ "seah",
1022
+ "st",
1023
+ ],
1024
+ ]
1025
+ ],
1026
+ t.Union[
1027
+ str,
1028
+ t.Literal[
1029
+ "ae",
1030
+ "bc",
1031
+ "id",
1032
+ "na",
1033
+ "ne",
1034
+ "ni",
1035
+ "nn",
1036
+ "s",
1037
+ "sba",
1038
+ "sc",
1039
+ "seah",
1040
+ "st",
1041
+ ],
1042
+ ],
1043
+ ]
1044
+ ] = None,
1045
+ time: t.Optional[
1046
+ t.Union[str, t.Literal["d", "h", "m", "micros", "ms", "nanos", "s"]]
1047
+ ] = None,
1048
+ v: t.Optional[bool] = None,
1049
+ ) -> t.Union[ObjectApiResponse[t.Any], TextApiResponse]:
1050
+ """
1051
+ .. raw:: html
1052
+
1053
+ <p>Get datafeeds.</p>
1054
+ <p>Get configuration and usage information about datafeeds.
1055
+ This API returns a maximum of 10,000 datafeeds.
1056
+ If the Elasticsearch security features are enabled, you must have <code>monitor_ml</code>, <code>monitor</code>, <code>manage_ml</code>, or <code>manage</code>
1057
+ cluster privileges to use this API.</p>
1058
+ <p>IMPORTANT: CAT APIs are only intended for human consumption using the Kibana
1059
+ console or command line. They are not intended for use by applications. For
1060
+ application consumption, use the get datafeed statistics API.</p>
1061
+
1062
+
1063
+ `<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-cat-ml-datafeeds>`_
1064
+
1065
+ :param datafeed_id: A numerical character string that uniquely identifies the
1066
+ datafeed.
1067
+ :param allow_no_match: Specifies what to do when the request: * Contains wildcard
1068
+ expressions and there are no datafeeds that match. * Contains the `_all`
1069
+ string or no identifiers and there are no matches. * Contains wildcard expressions
1070
+ and there are only partial matches. If `true`, the API returns an empty datafeeds
1071
+ array when there are no matches and the subset of results when there are
1072
+ partial matches. If `false`, the API returns a 404 status code when there
1073
+ are no matches or only partial matches.
1074
+ :param format: Specifies the format to return the columnar data in, can be set
1075
+ to `text`, `json`, `cbor`, `yaml`, or `smile`.
1076
+ :param h: Comma-separated list of column names to display.
1077
+ :param help: When set to `true` will output available columns. This option can't
1078
+ be combined with any other query string option.
1079
+ :param s: Comma-separated list of column names or column aliases used to sort
1080
+ the response.
1081
+ :param time: The unit used to display time values.
1082
+ :param v: When set to `true` will enable verbose output.
1083
+ """
1084
+ __path_parts: t.Dict[str, str]
1085
+ if datafeed_id not in SKIP_IN_PATH:
1086
+ __path_parts = {"datafeed_id": _quote(datafeed_id)}
1087
+ __path = f'/_cat/ml/datafeeds/{__path_parts["datafeed_id"]}'
1088
+ else:
1089
+ __path_parts = {}
1090
+ __path = "/_cat/ml/datafeeds"
1091
+ __query: t.Dict[str, t.Any] = {}
1092
+ if allow_no_match is not None:
1093
+ __query["allow_no_match"] = allow_no_match
1094
+ if error_trace is not None:
1095
+ __query["error_trace"] = error_trace
1096
+ if filter_path is not None:
1097
+ __query["filter_path"] = filter_path
1098
+ if format is not None:
1099
+ __query["format"] = format
1100
+ if h is not None:
1101
+ __query["h"] = h
1102
+ if help is not None:
1103
+ __query["help"] = help
1104
+ if human is not None:
1105
+ __query["human"] = human
1106
+ if pretty is not None:
1107
+ __query["pretty"] = pretty
1108
+ if s is not None:
1109
+ __query["s"] = s
1110
+ if time is not None:
1111
+ __query["time"] = time
1112
+ if v is not None:
1113
+ __query["v"] = v
1114
+ __headers = {"accept": "text/plain,application/json"}
1115
+ return self.perform_request( # type: ignore[return-value]
1116
+ "GET",
1117
+ __path,
1118
+ params=__query,
1119
+ headers=__headers,
1120
+ endpoint_id="cat.ml_datafeeds",
1121
+ path_parts=__path_parts,
1122
+ )
1123
+
1124
+ @_rewrite_parameters()
1125
+ def ml_jobs(
1126
+ self,
1127
+ *,
1128
+ job_id: t.Optional[str] = None,
1129
+ allow_no_match: t.Optional[bool] = None,
1130
+ bytes: t.Optional[
1131
+ t.Union[str, t.Literal["b", "gb", "kb", "mb", "pb", "tb"]]
1132
+ ] = None,
1133
+ error_trace: t.Optional[bool] = None,
1134
+ filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
1135
+ format: t.Optional[str] = None,
1136
+ h: t.Optional[
1137
+ t.Union[
1138
+ t.Sequence[
1139
+ t.Union[
1140
+ str,
1141
+ t.Literal[
1142
+ "assignment_explanation",
1143
+ "buckets.count",
1144
+ "buckets.time.exp_avg",
1145
+ "buckets.time.exp_avg_hour",
1146
+ "buckets.time.max",
1147
+ "buckets.time.min",
1148
+ "buckets.time.total",
1149
+ "data.buckets",
1150
+ "data.earliest_record",
1151
+ "data.empty_buckets",
1152
+ "data.input_bytes",
1153
+ "data.input_fields",
1154
+ "data.input_records",
1155
+ "data.invalid_dates",
1156
+ "data.last",
1157
+ "data.last_empty_bucket",
1158
+ "data.last_sparse_bucket",
1159
+ "data.latest_record",
1160
+ "data.missing_fields",
1161
+ "data.out_of_order_timestamps",
1162
+ "data.processed_fields",
1163
+ "data.processed_records",
1164
+ "data.sparse_buckets",
1165
+ "forecasts.memory.avg",
1166
+ "forecasts.memory.max",
1167
+ "forecasts.memory.min",
1168
+ "forecasts.memory.total",
1169
+ "forecasts.records.avg",
1170
+ "forecasts.records.max",
1171
+ "forecasts.records.min",
1172
+ "forecasts.records.total",
1173
+ "forecasts.time.avg",
1174
+ "forecasts.time.max",
1175
+ "forecasts.time.min",
1176
+ "forecasts.time.total",
1177
+ "forecasts.total",
1178
+ "id",
1179
+ "model.bucket_allocation_failures",
1180
+ "model.by_fields",
1181
+ "model.bytes",
1182
+ "model.bytes_exceeded",
1183
+ "model.categorization_status",
1184
+ "model.categorized_doc_count",
1185
+ "model.dead_category_count",
1186
+ "model.failed_category_count",
1187
+ "model.frequent_category_count",
1188
+ "model.log_time",
1189
+ "model.memory_limit",
1190
+ "model.memory_status",
1191
+ "model.over_fields",
1192
+ "model.partition_fields",
1193
+ "model.rare_category_count",
1194
+ "model.timestamp",
1195
+ "model.total_category_count",
1196
+ "node.address",
1197
+ "node.ephemeral_id",
1198
+ "node.id",
1199
+ "node.name",
1200
+ "opened_time",
1201
+ "state",
1202
+ ],
1203
+ ]
1204
+ ],
1205
+ t.Union[
1206
+ str,
1207
+ t.Literal[
1208
+ "assignment_explanation",
1209
+ "buckets.count",
1210
+ "buckets.time.exp_avg",
1211
+ "buckets.time.exp_avg_hour",
1212
+ "buckets.time.max",
1213
+ "buckets.time.min",
1214
+ "buckets.time.total",
1215
+ "data.buckets",
1216
+ "data.earliest_record",
1217
+ "data.empty_buckets",
1218
+ "data.input_bytes",
1219
+ "data.input_fields",
1220
+ "data.input_records",
1221
+ "data.invalid_dates",
1222
+ "data.last",
1223
+ "data.last_empty_bucket",
1224
+ "data.last_sparse_bucket",
1225
+ "data.latest_record",
1226
+ "data.missing_fields",
1227
+ "data.out_of_order_timestamps",
1228
+ "data.processed_fields",
1229
+ "data.processed_records",
1230
+ "data.sparse_buckets",
1231
+ "forecasts.memory.avg",
1232
+ "forecasts.memory.max",
1233
+ "forecasts.memory.min",
1234
+ "forecasts.memory.total",
1235
+ "forecasts.records.avg",
1236
+ "forecasts.records.max",
1237
+ "forecasts.records.min",
1238
+ "forecasts.records.total",
1239
+ "forecasts.time.avg",
1240
+ "forecasts.time.max",
1241
+ "forecasts.time.min",
1242
+ "forecasts.time.total",
1243
+ "forecasts.total",
1244
+ "id",
1245
+ "model.bucket_allocation_failures",
1246
+ "model.by_fields",
1247
+ "model.bytes",
1248
+ "model.bytes_exceeded",
1249
+ "model.categorization_status",
1250
+ "model.categorized_doc_count",
1251
+ "model.dead_category_count",
1252
+ "model.failed_category_count",
1253
+ "model.frequent_category_count",
1254
+ "model.log_time",
1255
+ "model.memory_limit",
1256
+ "model.memory_status",
1257
+ "model.over_fields",
1258
+ "model.partition_fields",
1259
+ "model.rare_category_count",
1260
+ "model.timestamp",
1261
+ "model.total_category_count",
1262
+ "node.address",
1263
+ "node.ephemeral_id",
1264
+ "node.id",
1265
+ "node.name",
1266
+ "opened_time",
1267
+ "state",
1268
+ ],
1269
+ ],
1270
+ ]
1271
+ ] = None,
1272
+ help: t.Optional[bool] = None,
1273
+ human: t.Optional[bool] = None,
1274
+ pretty: t.Optional[bool] = None,
1275
+ s: t.Optional[
1276
+ t.Union[
1277
+ t.Sequence[
1278
+ t.Union[
1279
+ str,
1280
+ t.Literal[
1281
+ "assignment_explanation",
1282
+ "buckets.count",
1283
+ "buckets.time.exp_avg",
1284
+ "buckets.time.exp_avg_hour",
1285
+ "buckets.time.max",
1286
+ "buckets.time.min",
1287
+ "buckets.time.total",
1288
+ "data.buckets",
1289
+ "data.earliest_record",
1290
+ "data.empty_buckets",
1291
+ "data.input_bytes",
1292
+ "data.input_fields",
1293
+ "data.input_records",
1294
+ "data.invalid_dates",
1295
+ "data.last",
1296
+ "data.last_empty_bucket",
1297
+ "data.last_sparse_bucket",
1298
+ "data.latest_record",
1299
+ "data.missing_fields",
1300
+ "data.out_of_order_timestamps",
1301
+ "data.processed_fields",
1302
+ "data.processed_records",
1303
+ "data.sparse_buckets",
1304
+ "forecasts.memory.avg",
1305
+ "forecasts.memory.max",
1306
+ "forecasts.memory.min",
1307
+ "forecasts.memory.total",
1308
+ "forecasts.records.avg",
1309
+ "forecasts.records.max",
1310
+ "forecasts.records.min",
1311
+ "forecasts.records.total",
1312
+ "forecasts.time.avg",
1313
+ "forecasts.time.max",
1314
+ "forecasts.time.min",
1315
+ "forecasts.time.total",
1316
+ "forecasts.total",
1317
+ "id",
1318
+ "model.bucket_allocation_failures",
1319
+ "model.by_fields",
1320
+ "model.bytes",
1321
+ "model.bytes_exceeded",
1322
+ "model.categorization_status",
1323
+ "model.categorized_doc_count",
1324
+ "model.dead_category_count",
1325
+ "model.failed_category_count",
1326
+ "model.frequent_category_count",
1327
+ "model.log_time",
1328
+ "model.memory_limit",
1329
+ "model.memory_status",
1330
+ "model.over_fields",
1331
+ "model.partition_fields",
1332
+ "model.rare_category_count",
1333
+ "model.timestamp",
1334
+ "model.total_category_count",
1335
+ "node.address",
1336
+ "node.ephemeral_id",
1337
+ "node.id",
1338
+ "node.name",
1339
+ "opened_time",
1340
+ "state",
1341
+ ],
1342
+ ]
1343
+ ],
1344
+ t.Union[
1345
+ str,
1346
+ t.Literal[
1347
+ "assignment_explanation",
1348
+ "buckets.count",
1349
+ "buckets.time.exp_avg",
1350
+ "buckets.time.exp_avg_hour",
1351
+ "buckets.time.max",
1352
+ "buckets.time.min",
1353
+ "buckets.time.total",
1354
+ "data.buckets",
1355
+ "data.earliest_record",
1356
+ "data.empty_buckets",
1357
+ "data.input_bytes",
1358
+ "data.input_fields",
1359
+ "data.input_records",
1360
+ "data.invalid_dates",
1361
+ "data.last",
1362
+ "data.last_empty_bucket",
1363
+ "data.last_sparse_bucket",
1364
+ "data.latest_record",
1365
+ "data.missing_fields",
1366
+ "data.out_of_order_timestamps",
1367
+ "data.processed_fields",
1368
+ "data.processed_records",
1369
+ "data.sparse_buckets",
1370
+ "forecasts.memory.avg",
1371
+ "forecasts.memory.max",
1372
+ "forecasts.memory.min",
1373
+ "forecasts.memory.total",
1374
+ "forecasts.records.avg",
1375
+ "forecasts.records.max",
1376
+ "forecasts.records.min",
1377
+ "forecasts.records.total",
1378
+ "forecasts.time.avg",
1379
+ "forecasts.time.max",
1380
+ "forecasts.time.min",
1381
+ "forecasts.time.total",
1382
+ "forecasts.total",
1383
+ "id",
1384
+ "model.bucket_allocation_failures",
1385
+ "model.by_fields",
1386
+ "model.bytes",
1387
+ "model.bytes_exceeded",
1388
+ "model.categorization_status",
1389
+ "model.categorized_doc_count",
1390
+ "model.dead_category_count",
1391
+ "model.failed_category_count",
1392
+ "model.frequent_category_count",
1393
+ "model.log_time",
1394
+ "model.memory_limit",
1395
+ "model.memory_status",
1396
+ "model.over_fields",
1397
+ "model.partition_fields",
1398
+ "model.rare_category_count",
1399
+ "model.timestamp",
1400
+ "model.total_category_count",
1401
+ "node.address",
1402
+ "node.ephemeral_id",
1403
+ "node.id",
1404
+ "node.name",
1405
+ "opened_time",
1406
+ "state",
1407
+ ],
1408
+ ],
1409
+ ]
1410
+ ] = None,
1411
+ time: t.Optional[
1412
+ t.Union[str, t.Literal["d", "h", "m", "micros", "ms", "nanos", "s"]]
1413
+ ] = None,
1414
+ v: t.Optional[bool] = None,
1415
+ ) -> t.Union[ObjectApiResponse[t.Any], TextApiResponse]:
1416
+ """
1417
+ .. raw:: html
1418
+
1419
+ <p>Get anomaly detection jobs.</p>
1420
+ <p>Get configuration and usage information for anomaly detection jobs.
1421
+ This API returns a maximum of 10,000 jobs.
1422
+ If the Elasticsearch security features are enabled, you must have <code>monitor_ml</code>,
1423
+ <code>monitor</code>, <code>manage_ml</code>, or <code>manage</code> cluster privileges to use this API.</p>
1424
+ <p>IMPORTANT: CAT APIs are only intended for human consumption using the Kibana
1425
+ console or command line. They are not intended for use by applications. For
1426
+ application consumption, use the get anomaly detection job statistics API.</p>
1427
+
1428
+
1429
+ `<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-cat-ml-jobs>`_
1430
+
1431
+ :param job_id: Identifier for the anomaly detection job.
1432
+ :param allow_no_match: Specifies what to do when the request: * Contains wildcard
1433
+ expressions and there are no jobs that match. * Contains the `_all` string
1434
+ or no identifiers and there are no matches. * Contains wildcard expressions
1435
+ and there are only partial matches. If `true`, the API returns an empty jobs
1436
+ array when there are no matches and the subset of results when there are
1437
+ partial matches. If `false`, the API returns a 404 status code when there
1438
+ are no matches or only partial matches.
1439
+ :param bytes: The unit used to display byte values.
1440
+ :param format: Specifies the format to return the columnar data in, can be set
1441
+ to `text`, `json`, `cbor`, `yaml`, or `smile`.
1442
+ :param h: Comma-separated list of column names to display.
1443
+ :param help: When set to `true` will output available columns. This option can't
1444
+ be combined with any other query string option.
1445
+ :param s: Comma-separated list of column names or column aliases used to sort
1446
+ the response.
1447
+ :param time: The unit used to display time values.
1448
+ :param v: When set to `true` will enable verbose output.
1449
+ """
1450
+ __path_parts: t.Dict[str, str]
1451
+ if job_id not in SKIP_IN_PATH:
1452
+ __path_parts = {"job_id": _quote(job_id)}
1453
+ __path = f'/_cat/ml/anomaly_detectors/{__path_parts["job_id"]}'
1454
+ else:
1455
+ __path_parts = {}
1456
+ __path = "/_cat/ml/anomaly_detectors"
1457
+ __query: t.Dict[str, t.Any] = {}
1458
+ if allow_no_match is not None:
1459
+ __query["allow_no_match"] = allow_no_match
1460
+ if bytes is not None:
1461
+ __query["bytes"] = bytes
1462
+ if error_trace is not None:
1463
+ __query["error_trace"] = error_trace
1464
+ if filter_path is not None:
1465
+ __query["filter_path"] = filter_path
1466
+ if format is not None:
1467
+ __query["format"] = format
1468
+ if h is not None:
1469
+ __query["h"] = h
1470
+ if help is not None:
1471
+ __query["help"] = help
1472
+ if human is not None:
1473
+ __query["human"] = human
1474
+ if pretty is not None:
1475
+ __query["pretty"] = pretty
1476
+ if s is not None:
1477
+ __query["s"] = s
1478
+ if time is not None:
1479
+ __query["time"] = time
1480
+ if v is not None:
1481
+ __query["v"] = v
1482
+ __headers = {"accept": "text/plain,application/json"}
1483
+ return self.perform_request( # type: ignore[return-value]
1484
+ "GET",
1485
+ __path,
1486
+ params=__query,
1487
+ headers=__headers,
1488
+ endpoint_id="cat.ml_jobs",
1489
+ path_parts=__path_parts,
1490
+ )
1491
+
1492
+ @_rewrite_parameters(
1493
+ parameter_aliases={"from": "from_"},
1494
+ )
1495
+ def ml_trained_models(
1496
+ self,
1497
+ *,
1498
+ model_id: t.Optional[str] = None,
1499
+ allow_no_match: t.Optional[bool] = None,
1500
+ bytes: t.Optional[
1501
+ t.Union[str, t.Literal["b", "gb", "kb", "mb", "pb", "tb"]]
1502
+ ] = None,
1503
+ error_trace: t.Optional[bool] = None,
1504
+ filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
1505
+ format: t.Optional[str] = None,
1506
+ from_: t.Optional[int] = None,
1507
+ h: t.Optional[
1508
+ t.Union[
1509
+ t.Sequence[
1510
+ t.Union[
1511
+ str,
1512
+ t.Literal[
1513
+ "create_time",
1514
+ "created_by",
1515
+ "data_frame_analytics_id",
1516
+ "description",
1517
+ "heap_size",
1518
+ "id",
1519
+ "ingest.count",
1520
+ "ingest.current",
1521
+ "ingest.failed",
1522
+ "ingest.pipelines",
1523
+ "ingest.time",
1524
+ "license",
1525
+ "operations",
1526
+ "version",
1527
+ ],
1528
+ ]
1529
+ ],
1530
+ t.Union[
1531
+ str,
1532
+ t.Literal[
1533
+ "create_time",
1534
+ "created_by",
1535
+ "data_frame_analytics_id",
1536
+ "description",
1537
+ "heap_size",
1538
+ "id",
1539
+ "ingest.count",
1540
+ "ingest.current",
1541
+ "ingest.failed",
1542
+ "ingest.pipelines",
1543
+ "ingest.time",
1544
+ "license",
1545
+ "operations",
1546
+ "version",
1547
+ ],
1548
+ ],
1549
+ ]
1550
+ ] = None,
1551
+ help: t.Optional[bool] = None,
1552
+ human: t.Optional[bool] = None,
1553
+ pretty: t.Optional[bool] = None,
1554
+ s: t.Optional[
1555
+ t.Union[
1556
+ t.Sequence[
1557
+ t.Union[
1558
+ str,
1559
+ t.Literal[
1560
+ "create_time",
1561
+ "created_by",
1562
+ "data_frame_analytics_id",
1563
+ "description",
1564
+ "heap_size",
1565
+ "id",
1566
+ "ingest.count",
1567
+ "ingest.current",
1568
+ "ingest.failed",
1569
+ "ingest.pipelines",
1570
+ "ingest.time",
1571
+ "license",
1572
+ "operations",
1573
+ "version",
1574
+ ],
1575
+ ]
1576
+ ],
1577
+ t.Union[
1578
+ str,
1579
+ t.Literal[
1580
+ "create_time",
1581
+ "created_by",
1582
+ "data_frame_analytics_id",
1583
+ "description",
1584
+ "heap_size",
1585
+ "id",
1586
+ "ingest.count",
1587
+ "ingest.current",
1588
+ "ingest.failed",
1589
+ "ingest.pipelines",
1590
+ "ingest.time",
1591
+ "license",
1592
+ "operations",
1593
+ "version",
1594
+ ],
1595
+ ],
1596
+ ]
1597
+ ] = None,
1598
+ size: t.Optional[int] = None,
1599
+ time: t.Optional[
1600
+ t.Union[str, t.Literal["d", "h", "m", "micros", "ms", "nanos", "s"]]
1601
+ ] = None,
1602
+ v: t.Optional[bool] = None,
1603
+ ) -> t.Union[ObjectApiResponse[t.Any], TextApiResponse]:
1604
+ """
1605
+ .. raw:: html
1606
+
1607
+ <p>Get trained models.</p>
1608
+ <p>Get configuration and usage information about inference trained models.</p>
1609
+ <p>IMPORTANT: CAT APIs are only intended for human consumption using the Kibana
1610
+ console or command line. They are not intended for use by applications. For
1611
+ application consumption, use the get trained models statistics API.</p>
1612
+
1613
+
1614
+ `<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-cat-ml-trained-models>`_
1615
+
1616
+ :param model_id: A unique identifier for the trained model.
1617
+ :param allow_no_match: Specifies what to do when the request: contains wildcard
1618
+ expressions and there are no models that match; contains the `_all` string
1619
+ or no identifiers and there are no matches; contains wildcard expressions
1620
+ and there are only partial matches. If `true`, the API returns an empty array
1621
+ when there are no matches and the subset of results when there are partial
1622
+ matches. If `false`, the API returns a 404 status code when there are no
1623
+ matches or only partial matches.
1624
+ :param bytes: The unit used to display byte values.
1625
+ :param format: Specifies the format to return the columnar data in, can be set
1626
+ to `text`, `json`, `cbor`, `yaml`, or `smile`.
1627
+ :param from_: Skips the specified number of transforms.
1628
+ :param h: A comma-separated list of column names to display.
1629
+ :param help: When set to `true` will output available columns. This option can't
1630
+ be combined with any other query string option.
1631
+ :param s: A comma-separated list of column names or aliases used to sort the
1632
+ response.
1633
+ :param size: The maximum number of transforms to display.
1634
+ :param time: Unit used to display time values.
1635
+ :param v: When set to `true` will enable verbose output.
1636
+ """
1637
+ __path_parts: t.Dict[str, str]
1638
+ if model_id not in SKIP_IN_PATH:
1639
+ __path_parts = {"model_id": _quote(model_id)}
1640
+ __path = f'/_cat/ml/trained_models/{__path_parts["model_id"]}'
1641
+ else:
1642
+ __path_parts = {}
1643
+ __path = "/_cat/ml/trained_models"
1644
+ __query: t.Dict[str, t.Any] = {}
1645
+ if allow_no_match is not None:
1646
+ __query["allow_no_match"] = allow_no_match
1647
+ if bytes is not None:
1648
+ __query["bytes"] = bytes
1649
+ if error_trace is not None:
1650
+ __query["error_trace"] = error_trace
1651
+ if filter_path is not None:
1652
+ __query["filter_path"] = filter_path
1653
+ if format is not None:
1654
+ __query["format"] = format
1655
+ if from_ is not None:
1656
+ __query["from"] = from_
1657
+ if h is not None:
1658
+ __query["h"] = h
1659
+ if help is not None:
1660
+ __query["help"] = help
1661
+ if human is not None:
1662
+ __query["human"] = human
1663
+ if pretty is not None:
1664
+ __query["pretty"] = pretty
1665
+ if s is not None:
1666
+ __query["s"] = s
1667
+ if size is not None:
1668
+ __query["size"] = size
1669
+ if time is not None:
1670
+ __query["time"] = time
1671
+ if v is not None:
1672
+ __query["v"] = v
1673
+ __headers = {"accept": "text/plain,application/json"}
1674
+ return self.perform_request( # type: ignore[return-value]
1675
+ "GET",
1676
+ __path,
1677
+ params=__query,
1678
+ headers=__headers,
1679
+ endpoint_id="cat.ml_trained_models",
1680
+ path_parts=__path_parts,
1681
+ )
1682
+
1683
+ @_rewrite_parameters()
1684
+ def nodeattrs(
1685
+ self,
1686
+ *,
1687
+ error_trace: t.Optional[bool] = None,
1688
+ filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
1689
+ format: t.Optional[str] = None,
1690
+ h: t.Optional[t.Union[str, t.Sequence[str]]] = None,
1691
+ help: t.Optional[bool] = None,
1692
+ human: t.Optional[bool] = None,
1693
+ local: t.Optional[bool] = None,
1694
+ master_timeout: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
1695
+ pretty: t.Optional[bool] = None,
1696
+ s: t.Optional[t.Union[str, t.Sequence[str]]] = None,
1697
+ v: t.Optional[bool] = None,
1698
+ ) -> t.Union[ObjectApiResponse[t.Any], TextApiResponse]:
1699
+ """
1700
+ .. raw:: html
1701
+
1702
+ <p>Get node attribute information.</p>
1703
+ <p>Get information about custom node attributes.
1704
+ IMPORTANT: cat APIs are only intended for human consumption using the command line or Kibana console. They are not intended for use by applications. For application consumption, use the nodes info API.</p>
1705
+
1706
+
1707
+ `<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-cat-nodeattrs>`_
1708
+
1709
+ :param format: Specifies the format to return the columnar data in, can be set
1710
+ to `text`, `json`, `cbor`, `yaml`, or `smile`.
1711
+ :param h: List of columns to appear in the response. Supports simple wildcards.
1712
+ :param help: When set to `true` will output available columns. This option can't
1713
+ be combined with any other query string option.
1714
+ :param local: If `true`, the request computes the list of selected nodes from
1715
+ the local cluster state. If `false` the list of selected nodes are computed
1716
+ from the cluster state of the master node. In both cases the coordinating
1717
+ node will send requests for further information to each selected node.
1718
+ :param master_timeout: Period to wait for a connection to the master node.
1719
+ :param s: List of columns that determine how the table should be sorted. Sorting
1720
+ defaults to ascending and can be changed by setting `:asc` or `:desc` as
1721
+ a suffix to the column name.
1722
+ :param v: When set to `true` will enable verbose output.
1723
+ """
1724
+ __path_parts: t.Dict[str, str] = {}
1725
+ __path = "/_cat/nodeattrs"
1726
+ __query: t.Dict[str, t.Any] = {}
1727
+ if error_trace is not None:
1728
+ __query["error_trace"] = error_trace
1729
+ if filter_path is not None:
1730
+ __query["filter_path"] = filter_path
1731
+ if format is not None:
1732
+ __query["format"] = format
1733
+ if h is not None:
1734
+ __query["h"] = h
1735
+ if help is not None:
1736
+ __query["help"] = help
1737
+ if human is not None:
1738
+ __query["human"] = human
1739
+ if local is not None:
1740
+ __query["local"] = local
1741
+ if master_timeout is not None:
1742
+ __query["master_timeout"] = master_timeout
1743
+ if pretty is not None:
1744
+ __query["pretty"] = pretty
1745
+ if s is not None:
1746
+ __query["s"] = s
1747
+ if v is not None:
1748
+ __query["v"] = v
1749
+ __headers = {"accept": "text/plain,application/json"}
1750
+ return self.perform_request( # type: ignore[return-value]
1751
+ "GET",
1752
+ __path,
1753
+ params=__query,
1754
+ headers=__headers,
1755
+ endpoint_id="cat.nodeattrs",
1756
+ path_parts=__path_parts,
1757
+ )
1758
+
1759
+ @_rewrite_parameters()
1760
+ def nodes(
1761
+ self,
1762
+ *,
1763
+ bytes: t.Optional[
1764
+ t.Union[str, t.Literal["b", "gb", "kb", "mb", "pb", "tb"]]
1765
+ ] = None,
1766
+ error_trace: t.Optional[bool] = None,
1767
+ filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
1768
+ format: t.Optional[str] = None,
1769
+ full_id: t.Optional[t.Union[bool, str]] = None,
1770
+ h: t.Optional[t.Union[str, t.Sequence[str]]] = None,
1771
+ help: t.Optional[bool] = None,
1772
+ human: t.Optional[bool] = None,
1773
+ include_unloaded_segments: t.Optional[bool] = None,
1774
+ master_timeout: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
1775
+ pretty: t.Optional[bool] = None,
1776
+ s: t.Optional[t.Union[str, t.Sequence[str]]] = None,
1777
+ time: t.Optional[
1778
+ t.Union[str, t.Literal["d", "h", "m", "micros", "ms", "nanos", "s"]]
1779
+ ] = None,
1780
+ v: t.Optional[bool] = None,
1781
+ ) -> t.Union[ObjectApiResponse[t.Any], TextApiResponse]:
1782
+ """
1783
+ .. raw:: html
1784
+
1785
+ <p>Get node information.</p>
1786
+ <p>Get information about the nodes in a cluster.
1787
+ IMPORTANT: cat APIs are only intended for human consumption using the command line or Kibana console. They are not intended for use by applications. For application consumption, use the nodes info API.</p>
1788
+
1789
+
1790
+ `<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-cat-nodes>`_
1791
+
1792
+ :param bytes: The unit used to display byte values.
1793
+ :param format: Specifies the format to return the columnar data in, can be set
1794
+ to `text`, `json`, `cbor`, `yaml`, or `smile`.
1795
+ :param full_id: If `true`, return the full node ID. If `false`, return the shortened
1796
+ node ID.
1797
+ :param h: List of columns to appear in the response. Supports simple wildcards.
1798
+ :param help: When set to `true` will output available columns. This option can't
1799
+ be combined with any other query string option.
1800
+ :param include_unloaded_segments: If true, the response includes information
1801
+ from segments that are not loaded into memory.
1802
+ :param master_timeout: Period to wait for a connection to the master node.
1803
+ :param s: List of columns that determine how the table should be sorted. Sorting
1804
+ defaults to ascending and can be changed by setting `:asc` or `:desc` as
1805
+ a suffix to the column name.
1806
+ :param time: Unit used to display time values.
1807
+ :param v: When set to `true` will enable verbose output.
1808
+ """
1809
+ __path_parts: t.Dict[str, str] = {}
1810
+ __path = "/_cat/nodes"
1811
+ __query: t.Dict[str, t.Any] = {}
1812
+ if bytes is not None:
1813
+ __query["bytes"] = bytes
1814
+ if error_trace is not None:
1815
+ __query["error_trace"] = error_trace
1816
+ if filter_path is not None:
1817
+ __query["filter_path"] = filter_path
1818
+ if format is not None:
1819
+ __query["format"] = format
1820
+ if full_id is not None:
1821
+ __query["full_id"] = full_id
1822
+ if h is not None:
1823
+ __query["h"] = h
1824
+ if help is not None:
1825
+ __query["help"] = help
1826
+ if human is not None:
1827
+ __query["human"] = human
1828
+ if include_unloaded_segments is not None:
1829
+ __query["include_unloaded_segments"] = include_unloaded_segments
1830
+ if master_timeout is not None:
1831
+ __query["master_timeout"] = master_timeout
1832
+ if pretty is not None:
1833
+ __query["pretty"] = pretty
1834
+ if s is not None:
1835
+ __query["s"] = s
1836
+ if time is not None:
1837
+ __query["time"] = time
1838
+ if v is not None:
1839
+ __query["v"] = v
1840
+ __headers = {"accept": "text/plain,application/json"}
1841
+ return self.perform_request( # type: ignore[return-value]
1842
+ "GET",
1843
+ __path,
1844
+ params=__query,
1845
+ headers=__headers,
1846
+ endpoint_id="cat.nodes",
1847
+ path_parts=__path_parts,
1848
+ )
1849
+
1850
+ @_rewrite_parameters()
1851
+ def pending_tasks(
1852
+ self,
1853
+ *,
1854
+ error_trace: t.Optional[bool] = None,
1855
+ filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
1856
+ format: t.Optional[str] = None,
1857
+ h: t.Optional[t.Union[str, t.Sequence[str]]] = None,
1858
+ help: t.Optional[bool] = None,
1859
+ human: t.Optional[bool] = None,
1860
+ local: t.Optional[bool] = None,
1861
+ master_timeout: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
1862
+ pretty: t.Optional[bool] = None,
1863
+ s: t.Optional[t.Union[str, t.Sequence[str]]] = None,
1864
+ time: t.Optional[
1865
+ t.Union[str, t.Literal["d", "h", "m", "micros", "ms", "nanos", "s"]]
1866
+ ] = None,
1867
+ v: t.Optional[bool] = None,
1868
+ ) -> t.Union[ObjectApiResponse[t.Any], TextApiResponse]:
1869
+ """
1870
+ .. raw:: html
1871
+
1872
+ <p>Get pending task information.</p>
1873
+ <p>Get information about cluster-level changes that have not yet taken effect.
1874
+ IMPORTANT: cat APIs are only intended for human consumption using the command line or Kibana console. They are not intended for use by applications. For application consumption, use the pending cluster tasks API.</p>
1875
+
1876
+
1877
+ `<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-cat-pending-tasks>`_
1878
+
1879
+ :param format: Specifies the format to return the columnar data in, can be set
1880
+ to `text`, `json`, `cbor`, `yaml`, or `smile`.
1881
+ :param h: List of columns to appear in the response. Supports simple wildcards.
1882
+ :param help: When set to `true` will output available columns. This option can't
1883
+ be combined with any other query string option.
1884
+ :param local: If `true`, the request computes the list of selected nodes from
1885
+ the local cluster state. If `false` the list of selected nodes are computed
1886
+ from the cluster state of the master node. In both cases the coordinating
1887
+ node will send requests for further information to each selected node.
1888
+ :param master_timeout: Period to wait for a connection to the master node.
1889
+ :param s: List of columns that determine how the table should be sorted. Sorting
1890
+ defaults to ascending and can be changed by setting `:asc` or `:desc` as
1891
+ a suffix to the column name.
1892
+ :param time: Unit used to display time values.
1893
+ :param v: When set to `true` will enable verbose output.
1894
+ """
1895
+ __path_parts: t.Dict[str, str] = {}
1896
+ __path = "/_cat/pending_tasks"
1897
+ __query: t.Dict[str, t.Any] = {}
1898
+ if error_trace is not None:
1899
+ __query["error_trace"] = error_trace
1900
+ if filter_path is not None:
1901
+ __query["filter_path"] = filter_path
1902
+ if format is not None:
1903
+ __query["format"] = format
1904
+ if h is not None:
1905
+ __query["h"] = h
1906
+ if help is not None:
1907
+ __query["help"] = help
1908
+ if human is not None:
1909
+ __query["human"] = human
1910
+ if local is not None:
1911
+ __query["local"] = local
1912
+ if master_timeout is not None:
1913
+ __query["master_timeout"] = master_timeout
1914
+ if pretty is not None:
1915
+ __query["pretty"] = pretty
1916
+ if s is not None:
1917
+ __query["s"] = s
1918
+ if time is not None:
1919
+ __query["time"] = time
1920
+ if v is not None:
1921
+ __query["v"] = v
1922
+ __headers = {"accept": "text/plain,application/json"}
1923
+ return self.perform_request( # type: ignore[return-value]
1924
+ "GET",
1925
+ __path,
1926
+ params=__query,
1927
+ headers=__headers,
1928
+ endpoint_id="cat.pending_tasks",
1929
+ path_parts=__path_parts,
1930
+ )
1931
+
1932
+ @_rewrite_parameters()
1933
+ def plugins(
1934
+ self,
1935
+ *,
1936
+ error_trace: t.Optional[bool] = None,
1937
+ filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
1938
+ format: t.Optional[str] = None,
1939
+ h: t.Optional[t.Union[str, t.Sequence[str]]] = None,
1940
+ help: t.Optional[bool] = None,
1941
+ human: t.Optional[bool] = None,
1942
+ include_bootstrap: t.Optional[bool] = None,
1943
+ local: t.Optional[bool] = None,
1944
+ master_timeout: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
1945
+ pretty: t.Optional[bool] = None,
1946
+ s: t.Optional[t.Union[str, t.Sequence[str]]] = None,
1947
+ v: t.Optional[bool] = None,
1948
+ ) -> t.Union[ObjectApiResponse[t.Any], TextApiResponse]:
1949
+ """
1950
+ .. raw:: html
1951
+
1952
+ <p>Get plugin information.</p>
1953
+ <p>Get a list of plugins running on each node of a cluster.
1954
+ IMPORTANT: cat APIs are only intended for human consumption using the command line or Kibana console. They are not intended for use by applications. For application consumption, use the nodes info API.</p>
1955
+
1956
+
1957
+ `<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-cat-plugins>`_
1958
+
1959
+ :param format: Specifies the format to return the columnar data in, can be set
1960
+ to `text`, `json`, `cbor`, `yaml`, or `smile`.
1961
+ :param h: List of columns to appear in the response. Supports simple wildcards.
1962
+ :param help: When set to `true` will output available columns. This option can't
1963
+ be combined with any other query string option.
1964
+ :param include_bootstrap: Include bootstrap plugins in the response
1965
+ :param local: If `true`, the request computes the list of selected nodes from
1966
+ the local cluster state. If `false` the list of selected nodes are computed
1967
+ from the cluster state of the master node. In both cases the coordinating
1968
+ node will send requests for further information to each selected node.
1969
+ :param master_timeout: Period to wait for a connection to the master node.
1970
+ :param s: List of columns that determine how the table should be sorted. Sorting
1971
+ defaults to ascending and can be changed by setting `:asc` or `:desc` as
1972
+ a suffix to the column name.
1973
+ :param v: When set to `true` will enable verbose output.
1974
+ """
1975
+ __path_parts: t.Dict[str, str] = {}
1976
+ __path = "/_cat/plugins"
1977
+ __query: t.Dict[str, t.Any] = {}
1978
+ if error_trace is not None:
1979
+ __query["error_trace"] = error_trace
1980
+ if filter_path is not None:
1981
+ __query["filter_path"] = filter_path
1982
+ if format is not None:
1983
+ __query["format"] = format
1984
+ if h is not None:
1985
+ __query["h"] = h
1986
+ if help is not None:
1987
+ __query["help"] = help
1988
+ if human is not None:
1989
+ __query["human"] = human
1990
+ if include_bootstrap is not None:
1991
+ __query["include_bootstrap"] = include_bootstrap
1992
+ if local is not None:
1993
+ __query["local"] = local
1994
+ if master_timeout is not None:
1995
+ __query["master_timeout"] = master_timeout
1996
+ if pretty is not None:
1997
+ __query["pretty"] = pretty
1998
+ if s is not None:
1999
+ __query["s"] = s
2000
+ if v is not None:
2001
+ __query["v"] = v
2002
+ __headers = {"accept": "text/plain,application/json"}
2003
+ return self.perform_request( # type: ignore[return-value]
2004
+ "GET",
2005
+ __path,
2006
+ params=__query,
2007
+ headers=__headers,
2008
+ endpoint_id="cat.plugins",
2009
+ path_parts=__path_parts,
2010
+ )
2011
+
2012
+ @_rewrite_parameters()
2013
+ def recovery(
2014
+ self,
2015
+ *,
2016
+ index: t.Optional[t.Union[str, t.Sequence[str]]] = None,
2017
+ active_only: t.Optional[bool] = None,
2018
+ bytes: t.Optional[
2019
+ t.Union[str, t.Literal["b", "gb", "kb", "mb", "pb", "tb"]]
2020
+ ] = None,
2021
+ detailed: t.Optional[bool] = None,
2022
+ error_trace: t.Optional[bool] = None,
2023
+ filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
2024
+ format: t.Optional[str] = None,
2025
+ h: t.Optional[t.Union[str, t.Sequence[str]]] = None,
2026
+ help: t.Optional[bool] = None,
2027
+ human: t.Optional[bool] = None,
2028
+ pretty: t.Optional[bool] = None,
2029
+ s: t.Optional[t.Union[str, t.Sequence[str]]] = None,
2030
+ time: t.Optional[
2031
+ t.Union[str, t.Literal["d", "h", "m", "micros", "ms", "nanos", "s"]]
2032
+ ] = None,
2033
+ v: t.Optional[bool] = None,
2034
+ ) -> t.Union[ObjectApiResponse[t.Any], TextApiResponse]:
2035
+ """
2036
+ .. raw:: html
2037
+
2038
+ <p>Get shard recovery information.</p>
2039
+ <p>Get information about ongoing and completed shard recoveries.
2040
+ Shard recovery is the process of initializing a shard copy, such as restoring a primary shard from a snapshot or syncing a replica shard from a primary shard. When a shard recovery completes, the recovered shard is available for search and indexing.
2041
+ For data streams, the API returns information about the stream’s backing indices.
2042
+ IMPORTANT: cat APIs are only intended for human consumption using the command line or Kibana console. They are not intended for use by applications. For application consumption, use the index recovery API.</p>
2043
+
2044
+
2045
+ `<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-cat-recovery>`_
2046
+
2047
+ :param index: A comma-separated list of data streams, indices, and aliases used
2048
+ to limit the request. Supports wildcards (`*`). To target all data streams
2049
+ and indices, omit this parameter or use `*` or `_all`.
2050
+ :param active_only: If `true`, the response only includes ongoing shard recoveries.
2051
+ :param bytes: The unit used to display byte values.
2052
+ :param detailed: If `true`, the response includes detailed information about
2053
+ shard recoveries.
2054
+ :param format: Specifies the format to return the columnar data in, can be set
2055
+ to `text`, `json`, `cbor`, `yaml`, or `smile`.
2056
+ :param h: List of columns to appear in the response. Supports simple wildcards.
2057
+ :param help: When set to `true` will output available columns. This option can't
2058
+ be combined with any other query string option.
2059
+ :param s: List of columns that determine how the table should be sorted. Sorting
2060
+ defaults to ascending and can be changed by setting `:asc` or `:desc` as
2061
+ a suffix to the column name.
2062
+ :param time: Unit used to display time values.
2063
+ :param v: When set to `true` will enable verbose output.
2064
+ """
2065
+ __path_parts: t.Dict[str, str]
2066
+ if index not in SKIP_IN_PATH:
2067
+ __path_parts = {"index": _quote(index)}
2068
+ __path = f'/_cat/recovery/{__path_parts["index"]}'
2069
+ else:
2070
+ __path_parts = {}
2071
+ __path = "/_cat/recovery"
2072
+ __query: t.Dict[str, t.Any] = {}
2073
+ if active_only is not None:
2074
+ __query["active_only"] = active_only
2075
+ if bytes is not None:
2076
+ __query["bytes"] = bytes
2077
+ if detailed is not None:
2078
+ __query["detailed"] = detailed
2079
+ if error_trace is not None:
2080
+ __query["error_trace"] = error_trace
2081
+ if filter_path is not None:
2082
+ __query["filter_path"] = filter_path
2083
+ if format is not None:
2084
+ __query["format"] = format
2085
+ if h is not None:
2086
+ __query["h"] = h
2087
+ if help is not None:
2088
+ __query["help"] = help
2089
+ if human is not None:
2090
+ __query["human"] = human
2091
+ if pretty is not None:
2092
+ __query["pretty"] = pretty
2093
+ if s is not None:
2094
+ __query["s"] = s
2095
+ if time is not None:
2096
+ __query["time"] = time
2097
+ if v is not None:
2098
+ __query["v"] = v
2099
+ __headers = {"accept": "text/plain,application/json"}
2100
+ return self.perform_request( # type: ignore[return-value]
2101
+ "GET",
2102
+ __path,
2103
+ params=__query,
2104
+ headers=__headers,
2105
+ endpoint_id="cat.recovery",
2106
+ path_parts=__path_parts,
2107
+ )
2108
+
2109
+ @_rewrite_parameters()
2110
+ def repositories(
2111
+ self,
2112
+ *,
2113
+ error_trace: t.Optional[bool] = None,
2114
+ filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
2115
+ format: t.Optional[str] = None,
2116
+ h: t.Optional[t.Union[str, t.Sequence[str]]] = None,
2117
+ help: t.Optional[bool] = None,
2118
+ human: t.Optional[bool] = None,
2119
+ local: t.Optional[bool] = None,
2120
+ master_timeout: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
2121
+ pretty: t.Optional[bool] = None,
2122
+ s: t.Optional[t.Union[str, t.Sequence[str]]] = None,
2123
+ v: t.Optional[bool] = None,
2124
+ ) -> t.Union[ObjectApiResponse[t.Any], TextApiResponse]:
2125
+ """
2126
+ .. raw:: html
2127
+
2128
+ <p>Get snapshot repository information.</p>
2129
+ <p>Get a list of snapshot repositories for a cluster.
2130
+ IMPORTANT: cat APIs are only intended for human consumption using the command line or Kibana console. They are not intended for use by applications. For application consumption, use the get snapshot repository API.</p>
2131
+
2132
+
2133
+ `<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-cat-repositories>`_
2134
+
2135
+ :param format: Specifies the format to return the columnar data in, can be set
2136
+ to `text`, `json`, `cbor`, `yaml`, or `smile`.
2137
+ :param h: List of columns to appear in the response. Supports simple wildcards.
2138
+ :param help: When set to `true` will output available columns. This option can't
2139
+ be combined with any other query string option.
2140
+ :param local: If `true`, the request computes the list of selected nodes from
2141
+ the local cluster state. If `false` the list of selected nodes are computed
2142
+ from the cluster state of the master node. In both cases the coordinating
2143
+ node will send requests for further information to each selected node.
2144
+ :param master_timeout: Period to wait for a connection to the master node.
2145
+ :param s: List of columns that determine how the table should be sorted. Sorting
2146
+ defaults to ascending and can be changed by setting `:asc` or `:desc` as
2147
+ a suffix to the column name.
2148
+ :param v: When set to `true` will enable verbose output.
2149
+ """
2150
+ __path_parts: t.Dict[str, str] = {}
2151
+ __path = "/_cat/repositories"
2152
+ __query: t.Dict[str, t.Any] = {}
2153
+ if error_trace is not None:
2154
+ __query["error_trace"] = error_trace
2155
+ if filter_path is not None:
2156
+ __query["filter_path"] = filter_path
2157
+ if format is not None:
2158
+ __query["format"] = format
2159
+ if h is not None:
2160
+ __query["h"] = h
2161
+ if help is not None:
2162
+ __query["help"] = help
2163
+ if human is not None:
2164
+ __query["human"] = human
2165
+ if local is not None:
2166
+ __query["local"] = local
2167
+ if master_timeout is not None:
2168
+ __query["master_timeout"] = master_timeout
2169
+ if pretty is not None:
2170
+ __query["pretty"] = pretty
2171
+ if s is not None:
2172
+ __query["s"] = s
2173
+ if v is not None:
2174
+ __query["v"] = v
2175
+ __headers = {"accept": "text/plain,application/json"}
2176
+ return self.perform_request( # type: ignore[return-value]
2177
+ "GET",
2178
+ __path,
2179
+ params=__query,
2180
+ headers=__headers,
2181
+ endpoint_id="cat.repositories",
2182
+ path_parts=__path_parts,
2183
+ )
2184
+
2185
+ @_rewrite_parameters()
2186
+ def segments(
2187
+ self,
2188
+ *,
2189
+ index: t.Optional[t.Union[str, t.Sequence[str]]] = None,
2190
+ bytes: t.Optional[
2191
+ t.Union[str, t.Literal["b", "gb", "kb", "mb", "pb", "tb"]]
2192
+ ] = None,
2193
+ error_trace: t.Optional[bool] = None,
2194
+ filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
2195
+ format: t.Optional[str] = None,
2196
+ h: t.Optional[t.Union[str, t.Sequence[str]]] = None,
2197
+ help: t.Optional[bool] = None,
2198
+ human: t.Optional[bool] = None,
2199
+ local: t.Optional[bool] = None,
2200
+ master_timeout: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
2201
+ pretty: t.Optional[bool] = None,
2202
+ s: t.Optional[t.Union[str, t.Sequence[str]]] = None,
2203
+ v: t.Optional[bool] = None,
2204
+ ) -> t.Union[ObjectApiResponse[t.Any], TextApiResponse]:
2205
+ """
2206
+ .. raw:: html
2207
+
2208
+ <p>Get segment information.</p>
2209
+ <p>Get low-level information about the Lucene segments in index shards.
2210
+ For data streams, the API returns information about the backing indices.
2211
+ IMPORTANT: cat APIs are only intended for human consumption using the command line or Kibana console. They are not intended for use by applications. For application consumption, use the index segments API.</p>
2212
+
2213
+
2214
+ `<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-cat-segments>`_
2215
+
2216
+ :param index: A comma-separated list of data streams, indices, and aliases used
2217
+ to limit the request. Supports wildcards (`*`). To target all data streams
2218
+ and indices, omit this parameter or use `*` or `_all`.
2219
+ :param bytes: The unit used to display byte values.
2220
+ :param format: Specifies the format to return the columnar data in, can be set
2221
+ to `text`, `json`, `cbor`, `yaml`, or `smile`.
2222
+ :param h: List of columns to appear in the response. Supports simple wildcards.
2223
+ :param help: When set to `true` will output available columns. This option can't
2224
+ be combined with any other query string option.
2225
+ :param local: If `true`, the request computes the list of selected nodes from
2226
+ the local cluster state. If `false` the list of selected nodes are computed
2227
+ from the cluster state of the master node. In both cases the coordinating
2228
+ node will send requests for further information to each selected node.
2229
+ :param master_timeout: Period to wait for a connection to the master node.
2230
+ :param s: List of columns that determine how the table should be sorted. Sorting
2231
+ defaults to ascending and can be changed by setting `:asc` or `:desc` as
2232
+ a suffix to the column name.
2233
+ :param v: When set to `true` will enable verbose output.
2234
+ """
2235
+ __path_parts: t.Dict[str, str]
2236
+ if index not in SKIP_IN_PATH:
2237
+ __path_parts = {"index": _quote(index)}
2238
+ __path = f'/_cat/segments/{__path_parts["index"]}'
2239
+ else:
2240
+ __path_parts = {}
2241
+ __path = "/_cat/segments"
2242
+ __query: t.Dict[str, t.Any] = {}
2243
+ if bytes is not None:
2244
+ __query["bytes"] = bytes
2245
+ if error_trace is not None:
2246
+ __query["error_trace"] = error_trace
2247
+ if filter_path is not None:
2248
+ __query["filter_path"] = filter_path
2249
+ if format is not None:
2250
+ __query["format"] = format
2251
+ if h is not None:
2252
+ __query["h"] = h
2253
+ if help is not None:
2254
+ __query["help"] = help
2255
+ if human is not None:
2256
+ __query["human"] = human
2257
+ if local is not None:
2258
+ __query["local"] = local
2259
+ if master_timeout is not None:
2260
+ __query["master_timeout"] = master_timeout
2261
+ if pretty is not None:
2262
+ __query["pretty"] = pretty
2263
+ if s is not None:
2264
+ __query["s"] = s
2265
+ if v is not None:
2266
+ __query["v"] = v
2267
+ __headers = {"accept": "text/plain,application/json"}
2268
+ return self.perform_request( # type: ignore[return-value]
2269
+ "GET",
2270
+ __path,
2271
+ params=__query,
2272
+ headers=__headers,
2273
+ endpoint_id="cat.segments",
2274
+ path_parts=__path_parts,
2275
+ )
2276
+
2277
+ @_rewrite_parameters()
2278
+ def shards(
2279
+ self,
2280
+ *,
2281
+ index: t.Optional[t.Union[str, t.Sequence[str]]] = None,
2282
+ bytes: t.Optional[
2283
+ t.Union[str, t.Literal["b", "gb", "kb", "mb", "pb", "tb"]]
2284
+ ] = None,
2285
+ error_trace: t.Optional[bool] = None,
2286
+ filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
2287
+ format: t.Optional[str] = None,
2288
+ h: t.Optional[t.Union[str, t.Sequence[str]]] = None,
2289
+ help: t.Optional[bool] = None,
2290
+ human: t.Optional[bool] = None,
2291
+ master_timeout: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
2292
+ pretty: t.Optional[bool] = None,
2293
+ s: t.Optional[t.Union[str, t.Sequence[str]]] = None,
2294
+ time: t.Optional[
2295
+ t.Union[str, t.Literal["d", "h", "m", "micros", "ms", "nanos", "s"]]
2296
+ ] = None,
2297
+ v: t.Optional[bool] = None,
2298
+ ) -> t.Union[ObjectApiResponse[t.Any], TextApiResponse]:
2299
+ """
2300
+ .. raw:: html
2301
+
2302
+ <p>Get shard information.</p>
2303
+ <p>Get information about the shards in a cluster.
2304
+ For data streams, the API returns information about the backing indices.
2305
+ IMPORTANT: cat APIs are only intended for human consumption using the command line or Kibana console. They are not intended for use by applications.</p>
2306
+
2307
+
2308
+ `<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-cat-shards>`_
2309
+
2310
+ :param index: A comma-separated list of data streams, indices, and aliases used
2311
+ to limit the request. Supports wildcards (`*`). To target all data streams
2312
+ and indices, omit this parameter or use `*` or `_all`.
2313
+ :param bytes: The unit used to display byte values.
2314
+ :param format: Specifies the format to return the columnar data in, can be set
2315
+ to `text`, `json`, `cbor`, `yaml`, or `smile`.
2316
+ :param h: List of columns to appear in the response. Supports simple wildcards.
2317
+ :param help: When set to `true` will output available columns. This option can't
2318
+ be combined with any other query string option.
2319
+ :param master_timeout: Period to wait for a connection to the master node.
2320
+ :param s: List of columns that determine how the table should be sorted. Sorting
2321
+ defaults to ascending and can be changed by setting `:asc` or `:desc` as
2322
+ a suffix to the column name.
2323
+ :param time: Unit used to display time values.
2324
+ :param v: When set to `true` will enable verbose output.
2325
+ """
2326
+ __path_parts: t.Dict[str, str]
2327
+ if index not in SKIP_IN_PATH:
2328
+ __path_parts = {"index": _quote(index)}
2329
+ __path = f'/_cat/shards/{__path_parts["index"]}'
2330
+ else:
2331
+ __path_parts = {}
2332
+ __path = "/_cat/shards"
2333
+ __query: t.Dict[str, t.Any] = {}
2334
+ if bytes is not None:
2335
+ __query["bytes"] = bytes
2336
+ if error_trace is not None:
2337
+ __query["error_trace"] = error_trace
2338
+ if filter_path is not None:
2339
+ __query["filter_path"] = filter_path
2340
+ if format is not None:
2341
+ __query["format"] = format
2342
+ if h is not None:
2343
+ __query["h"] = h
2344
+ if help is not None:
2345
+ __query["help"] = help
2346
+ if human is not None:
2347
+ __query["human"] = human
2348
+ if master_timeout is not None:
2349
+ __query["master_timeout"] = master_timeout
2350
+ if pretty is not None:
2351
+ __query["pretty"] = pretty
2352
+ if s is not None:
2353
+ __query["s"] = s
2354
+ if time is not None:
2355
+ __query["time"] = time
2356
+ if v is not None:
2357
+ __query["v"] = v
2358
+ __headers = {"accept": "text/plain,application/json"}
2359
+ return self.perform_request( # type: ignore[return-value]
2360
+ "GET",
2361
+ __path,
2362
+ params=__query,
2363
+ headers=__headers,
2364
+ endpoint_id="cat.shards",
2365
+ path_parts=__path_parts,
2366
+ )
2367
+
2368
+ @_rewrite_parameters()
2369
+ def snapshots(
2370
+ self,
2371
+ *,
2372
+ repository: t.Optional[t.Union[str, t.Sequence[str]]] = None,
2373
+ error_trace: t.Optional[bool] = None,
2374
+ filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
2375
+ format: t.Optional[str] = None,
2376
+ h: t.Optional[t.Union[str, t.Sequence[str]]] = None,
2377
+ help: t.Optional[bool] = None,
2378
+ human: t.Optional[bool] = None,
2379
+ ignore_unavailable: t.Optional[bool] = None,
2380
+ master_timeout: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
2381
+ pretty: t.Optional[bool] = None,
2382
+ s: t.Optional[t.Union[str, t.Sequence[str]]] = None,
2383
+ time: t.Optional[
2384
+ t.Union[str, t.Literal["d", "h", "m", "micros", "ms", "nanos", "s"]]
2385
+ ] = None,
2386
+ v: t.Optional[bool] = None,
2387
+ ) -> t.Union[ObjectApiResponse[t.Any], TextApiResponse]:
2388
+ """
2389
+ .. raw:: html
2390
+
2391
+ <p>Get snapshot information.</p>
2392
+ <p>Get information about the snapshots stored in one or more repositories.
2393
+ A snapshot is a backup of an index or running Elasticsearch cluster.
2394
+ IMPORTANT: cat APIs are only intended for human consumption using the command line or Kibana console. They are not intended for use by applications. For application consumption, use the get snapshot API.</p>
2395
+
2396
+
2397
+ `<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-cat-snapshots>`_
2398
+
2399
+ :param repository: A comma-separated list of snapshot repositories used to limit
2400
+ the request. Accepts wildcard expressions. `_all` returns all repositories.
2401
+ If any repository fails during the request, Elasticsearch returns an error.
2402
+ :param format: Specifies the format to return the columnar data in, can be set
2403
+ to `text`, `json`, `cbor`, `yaml`, or `smile`.
2404
+ :param h: List of columns to appear in the response. Supports simple wildcards.
2405
+ :param help: When set to `true` will output available columns. This option can't
2406
+ be combined with any other query string option.
2407
+ :param ignore_unavailable: If `true`, the response does not include information
2408
+ from unavailable snapshots.
2409
+ :param master_timeout: Period to wait for a connection to the master node.
2410
+ :param s: List of columns that determine how the table should be sorted. Sorting
2411
+ defaults to ascending and can be changed by setting `:asc` or `:desc` as
2412
+ a suffix to the column name.
2413
+ :param time: Unit used to display time values.
2414
+ :param v: When set to `true` will enable verbose output.
2415
+ """
2416
+ __path_parts: t.Dict[str, str]
2417
+ if repository not in SKIP_IN_PATH:
2418
+ __path_parts = {"repository": _quote(repository)}
2419
+ __path = f'/_cat/snapshots/{__path_parts["repository"]}'
2420
+ else:
2421
+ __path_parts = {}
2422
+ __path = "/_cat/snapshots"
2423
+ __query: t.Dict[str, t.Any] = {}
2424
+ if error_trace is not None:
2425
+ __query["error_trace"] = error_trace
2426
+ if filter_path is not None:
2427
+ __query["filter_path"] = filter_path
2428
+ if format is not None:
2429
+ __query["format"] = format
2430
+ if h is not None:
2431
+ __query["h"] = h
2432
+ if help is not None:
2433
+ __query["help"] = help
2434
+ if human is not None:
2435
+ __query["human"] = human
2436
+ if ignore_unavailable is not None:
2437
+ __query["ignore_unavailable"] = ignore_unavailable
2438
+ if master_timeout is not None:
2439
+ __query["master_timeout"] = master_timeout
2440
+ if pretty is not None:
2441
+ __query["pretty"] = pretty
2442
+ if s is not None:
2443
+ __query["s"] = s
2444
+ if time is not None:
2445
+ __query["time"] = time
2446
+ if v is not None:
2447
+ __query["v"] = v
2448
+ __headers = {"accept": "text/plain,application/json"}
2449
+ return self.perform_request( # type: ignore[return-value]
2450
+ "GET",
2451
+ __path,
2452
+ params=__query,
2453
+ headers=__headers,
2454
+ endpoint_id="cat.snapshots",
2455
+ path_parts=__path_parts,
2456
+ )
2457
+
2458
+ @_rewrite_parameters()
2459
+ @_stability_warning(Stability.EXPERIMENTAL)
2460
+ def tasks(
2461
+ self,
2462
+ *,
2463
+ actions: t.Optional[t.Sequence[str]] = None,
2464
+ detailed: t.Optional[bool] = None,
2465
+ error_trace: t.Optional[bool] = None,
2466
+ filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
2467
+ format: t.Optional[str] = None,
2468
+ h: t.Optional[t.Union[str, t.Sequence[str]]] = None,
2469
+ help: t.Optional[bool] = None,
2470
+ human: t.Optional[bool] = None,
2471
+ nodes: t.Optional[t.Sequence[str]] = None,
2472
+ parent_task_id: t.Optional[str] = None,
2473
+ pretty: t.Optional[bool] = None,
2474
+ s: t.Optional[t.Union[str, t.Sequence[str]]] = None,
2475
+ time: t.Optional[
2476
+ t.Union[str, t.Literal["d", "h", "m", "micros", "ms", "nanos", "s"]]
2477
+ ] = None,
2478
+ timeout: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
2479
+ v: t.Optional[bool] = None,
2480
+ wait_for_completion: t.Optional[bool] = None,
2481
+ ) -> t.Union[ObjectApiResponse[t.Any], TextApiResponse]:
2482
+ """
2483
+ .. raw:: html
2484
+
2485
+ <p>Get task information.</p>
2486
+ <p>Get information about tasks currently running in the cluster.
2487
+ IMPORTANT: cat APIs are only intended for human consumption using the command line or Kibana console. They are not intended for use by applications. For application consumption, use the task management API.</p>
2488
+
2489
+
2490
+ `<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-cat-tasks>`_
2491
+
2492
+ :param actions: The task action names, which are used to limit the response.
2493
+ :param detailed: If `true`, the response includes detailed information about
2494
+ shard recoveries.
2495
+ :param format: Specifies the format to return the columnar data in, can be set
2496
+ to `text`, `json`, `cbor`, `yaml`, or `smile`.
2497
+ :param h: List of columns to appear in the response. Supports simple wildcards.
2498
+ :param help: When set to `true` will output available columns. This option can't
2499
+ be combined with any other query string option.
2500
+ :param nodes: Unique node identifiers, which are used to limit the response.
2501
+ :param parent_task_id: The parent task identifier, which is used to limit the
2502
+ response.
2503
+ :param s: List of columns that determine how the table should be sorted. Sorting
2504
+ defaults to ascending and can be changed by setting `:asc` or `:desc` as
2505
+ a suffix to the column name.
2506
+ :param time: Unit used to display time values.
2507
+ :param timeout: Period to wait for a response. If no response is received before
2508
+ the timeout expires, the request fails and returns an error.
2509
+ :param v: When set to `true` will enable verbose output.
2510
+ :param wait_for_completion: If `true`, the request blocks until the task has
2511
+ completed.
2512
+ """
2513
+ __path_parts: t.Dict[str, str] = {}
2514
+ __path = "/_cat/tasks"
2515
+ __query: t.Dict[str, t.Any] = {}
2516
+ if actions is not None:
2517
+ __query["actions"] = actions
2518
+ if detailed is not None:
2519
+ __query["detailed"] = detailed
2520
+ if error_trace is not None:
2521
+ __query["error_trace"] = error_trace
2522
+ if filter_path is not None:
2523
+ __query["filter_path"] = filter_path
2524
+ if format is not None:
2525
+ __query["format"] = format
2526
+ if h is not None:
2527
+ __query["h"] = h
2528
+ if help is not None:
2529
+ __query["help"] = help
2530
+ if human is not None:
2531
+ __query["human"] = human
2532
+ if nodes is not None:
2533
+ __query["nodes"] = nodes
2534
+ if parent_task_id is not None:
2535
+ __query["parent_task_id"] = parent_task_id
2536
+ if pretty is not None:
2537
+ __query["pretty"] = pretty
2538
+ if s is not None:
2539
+ __query["s"] = s
2540
+ if time is not None:
2541
+ __query["time"] = time
2542
+ if timeout is not None:
2543
+ __query["timeout"] = timeout
2544
+ if v is not None:
2545
+ __query["v"] = v
2546
+ if wait_for_completion is not None:
2547
+ __query["wait_for_completion"] = wait_for_completion
2548
+ __headers = {"accept": "text/plain,application/json"}
2549
+ return self.perform_request( # type: ignore[return-value]
2550
+ "GET",
2551
+ __path,
2552
+ params=__query,
2553
+ headers=__headers,
2554
+ endpoint_id="cat.tasks",
2555
+ path_parts=__path_parts,
2556
+ )
2557
+
2558
+ @_rewrite_parameters()
2559
+ def templates(
2560
+ self,
2561
+ *,
2562
+ name: t.Optional[str] = None,
2563
+ error_trace: t.Optional[bool] = None,
2564
+ filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
2565
+ format: t.Optional[str] = None,
2566
+ h: t.Optional[t.Union[str, t.Sequence[str]]] = None,
2567
+ help: t.Optional[bool] = None,
2568
+ human: t.Optional[bool] = None,
2569
+ local: t.Optional[bool] = None,
2570
+ master_timeout: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
2571
+ pretty: t.Optional[bool] = None,
2572
+ s: t.Optional[t.Union[str, t.Sequence[str]]] = None,
2573
+ v: t.Optional[bool] = None,
2574
+ ) -> t.Union[ObjectApiResponse[t.Any], TextApiResponse]:
2575
+ """
2576
+ .. raw:: html
2577
+
2578
+ <p>Get index template information.</p>
2579
+ <p>Get information about the index templates in a cluster.
2580
+ You can use index templates to apply index settings and field mappings to new indices at creation.
2581
+ IMPORTANT: cat APIs are only intended for human consumption using the command line or Kibana console. They are not intended for use by applications. For application consumption, use the get index template API.</p>
2582
+
2583
+
2584
+ `<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-cat-templates>`_
2585
+
2586
+ :param name: The name of the template to return. Accepts wildcard expressions.
2587
+ If omitted, all templates are returned.
2588
+ :param format: Specifies the format to return the columnar data in, can be set
2589
+ to `text`, `json`, `cbor`, `yaml`, or `smile`.
2590
+ :param h: List of columns to appear in the response. Supports simple wildcards.
2591
+ :param help: When set to `true` will output available columns. This option can't
2592
+ be combined with any other query string option.
2593
+ :param local: If `true`, the request computes the list of selected nodes from
2594
+ the local cluster state. If `false` the list of selected nodes are computed
2595
+ from the cluster state of the master node. In both cases the coordinating
2596
+ node will send requests for further information to each selected node.
2597
+ :param master_timeout: Period to wait for a connection to the master node.
2598
+ :param s: List of columns that determine how the table should be sorted. Sorting
2599
+ defaults to ascending and can be changed by setting `:asc` or `:desc` as
2600
+ a suffix to the column name.
2601
+ :param v: When set to `true` will enable verbose output.
2602
+ """
2603
+ __path_parts: t.Dict[str, str]
2604
+ if name not in SKIP_IN_PATH:
2605
+ __path_parts = {"name": _quote(name)}
2606
+ __path = f'/_cat/templates/{__path_parts["name"]}'
2607
+ else:
2608
+ __path_parts = {}
2609
+ __path = "/_cat/templates"
2610
+ __query: t.Dict[str, t.Any] = {}
2611
+ if error_trace is not None:
2612
+ __query["error_trace"] = error_trace
2613
+ if filter_path is not None:
2614
+ __query["filter_path"] = filter_path
2615
+ if format is not None:
2616
+ __query["format"] = format
2617
+ if h is not None:
2618
+ __query["h"] = h
2619
+ if help is not None:
2620
+ __query["help"] = help
2621
+ if human is not None:
2622
+ __query["human"] = human
2623
+ if local is not None:
2624
+ __query["local"] = local
2625
+ if master_timeout is not None:
2626
+ __query["master_timeout"] = master_timeout
2627
+ if pretty is not None:
2628
+ __query["pretty"] = pretty
2629
+ if s is not None:
2630
+ __query["s"] = s
2631
+ if v is not None:
2632
+ __query["v"] = v
2633
+ __headers = {"accept": "text/plain,application/json"}
2634
+ return self.perform_request( # type: ignore[return-value]
2635
+ "GET",
2636
+ __path,
2637
+ params=__query,
2638
+ headers=__headers,
2639
+ endpoint_id="cat.templates",
2640
+ path_parts=__path_parts,
2641
+ )
2642
+
2643
+ @_rewrite_parameters()
2644
+ def thread_pool(
2645
+ self,
2646
+ *,
2647
+ thread_pool_patterns: t.Optional[t.Union[str, t.Sequence[str]]] = None,
2648
+ error_trace: t.Optional[bool] = None,
2649
+ filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
2650
+ format: t.Optional[str] = None,
2651
+ h: t.Optional[t.Union[str, t.Sequence[str]]] = None,
2652
+ help: t.Optional[bool] = None,
2653
+ human: t.Optional[bool] = None,
2654
+ local: t.Optional[bool] = None,
2655
+ master_timeout: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
2656
+ pretty: t.Optional[bool] = None,
2657
+ s: t.Optional[t.Union[str, t.Sequence[str]]] = None,
2658
+ time: t.Optional[
2659
+ t.Union[str, t.Literal["d", "h", "m", "micros", "ms", "nanos", "s"]]
2660
+ ] = None,
2661
+ v: t.Optional[bool] = None,
2662
+ ) -> t.Union[ObjectApiResponse[t.Any], TextApiResponse]:
2663
+ """
2664
+ .. raw:: html
2665
+
2666
+ <p>Get thread pool statistics.</p>
2667
+ <p>Get thread pool statistics for each node in a cluster.
2668
+ Returned information includes all built-in thread pools and custom thread pools.
2669
+ IMPORTANT: cat APIs are only intended for human consumption using the command line or Kibana console. They are not intended for use by applications. For application consumption, use the nodes info API.</p>
2670
+
2671
+
2672
+ `<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-cat-thread-pool>`_
2673
+
2674
+ :param thread_pool_patterns: A comma-separated list of thread pool names used
2675
+ to limit the request. Accepts wildcard expressions.
2676
+ :param format: Specifies the format to return the columnar data in, can be set
2677
+ to `text`, `json`, `cbor`, `yaml`, or `smile`.
2678
+ :param h: List of columns to appear in the response. Supports simple wildcards.
2679
+ :param help: When set to `true` will output available columns. This option can't
2680
+ be combined with any other query string option.
2681
+ :param local: If `true`, the request computes the list of selected nodes from
2682
+ the local cluster state. If `false` the list of selected nodes are computed
2683
+ from the cluster state of the master node. In both cases the coordinating
2684
+ node will send requests for further information to each selected node.
2685
+ :param master_timeout: Period to wait for a connection to the master node.
2686
+ :param s: List of columns that determine how the table should be sorted. Sorting
2687
+ defaults to ascending and can be changed by setting `:asc` or `:desc` as
2688
+ a suffix to the column name.
2689
+ :param time: The unit used to display time values.
2690
+ :param v: When set to `true` will enable verbose output.
2691
+ """
2692
+ __path_parts: t.Dict[str, str]
2693
+ if thread_pool_patterns not in SKIP_IN_PATH:
2694
+ __path_parts = {"thread_pool_patterns": _quote(thread_pool_patterns)}
2695
+ __path = f'/_cat/thread_pool/{__path_parts["thread_pool_patterns"]}'
2696
+ else:
2697
+ __path_parts = {}
2698
+ __path = "/_cat/thread_pool"
2699
+ __query: t.Dict[str, t.Any] = {}
2700
+ if error_trace is not None:
2701
+ __query["error_trace"] = error_trace
2702
+ if filter_path is not None:
2703
+ __query["filter_path"] = filter_path
2704
+ if format is not None:
2705
+ __query["format"] = format
2706
+ if h is not None:
2707
+ __query["h"] = h
2708
+ if help is not None:
2709
+ __query["help"] = help
2710
+ if human is not None:
2711
+ __query["human"] = human
2712
+ if local is not None:
2713
+ __query["local"] = local
2714
+ if master_timeout is not None:
2715
+ __query["master_timeout"] = master_timeout
2716
+ if pretty is not None:
2717
+ __query["pretty"] = pretty
2718
+ if s is not None:
2719
+ __query["s"] = s
2720
+ if time is not None:
2721
+ __query["time"] = time
2722
+ if v is not None:
2723
+ __query["v"] = v
2724
+ __headers = {"accept": "text/plain,application/json"}
2725
+ return self.perform_request( # type: ignore[return-value]
2726
+ "GET",
2727
+ __path,
2728
+ params=__query,
2729
+ headers=__headers,
2730
+ endpoint_id="cat.thread_pool",
2731
+ path_parts=__path_parts,
2732
+ )
2733
+
2734
+ @_rewrite_parameters(
2735
+ parameter_aliases={"from": "from_"},
2736
+ )
2737
+ def transforms(
2738
+ self,
2739
+ *,
2740
+ transform_id: t.Optional[str] = None,
2741
+ allow_no_match: t.Optional[bool] = None,
2742
+ error_trace: t.Optional[bool] = None,
2743
+ filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
2744
+ format: t.Optional[str] = None,
2745
+ from_: t.Optional[int] = None,
2746
+ h: t.Optional[
2747
+ t.Union[
2748
+ t.Sequence[
2749
+ t.Union[
2750
+ str,
2751
+ t.Literal[
2752
+ "changes_last_detection_time",
2753
+ "checkpoint",
2754
+ "checkpoint_duration_time_exp_avg",
2755
+ "checkpoint_progress",
2756
+ "create_time",
2757
+ "delete_time",
2758
+ "description",
2759
+ "dest_index",
2760
+ "docs_per_second",
2761
+ "documents_deleted",
2762
+ "documents_indexed",
2763
+ "documents_processed",
2764
+ "frequency",
2765
+ "id",
2766
+ "index_failure",
2767
+ "index_time",
2768
+ "index_total",
2769
+ "indexed_documents_exp_avg",
2770
+ "last_search_time",
2771
+ "max_page_search_size",
2772
+ "pages_processed",
2773
+ "pipeline",
2774
+ "processed_documents_exp_avg",
2775
+ "processing_time",
2776
+ "reason",
2777
+ "search_failure",
2778
+ "search_time",
2779
+ "search_total",
2780
+ "source_index",
2781
+ "state",
2782
+ "transform_type",
2783
+ "trigger_count",
2784
+ "version",
2785
+ ],
2786
+ ]
2787
+ ],
2788
+ t.Union[
2789
+ str,
2790
+ t.Literal[
2791
+ "changes_last_detection_time",
2792
+ "checkpoint",
2793
+ "checkpoint_duration_time_exp_avg",
2794
+ "checkpoint_progress",
2795
+ "create_time",
2796
+ "delete_time",
2797
+ "description",
2798
+ "dest_index",
2799
+ "docs_per_second",
2800
+ "documents_deleted",
2801
+ "documents_indexed",
2802
+ "documents_processed",
2803
+ "frequency",
2804
+ "id",
2805
+ "index_failure",
2806
+ "index_time",
2807
+ "index_total",
2808
+ "indexed_documents_exp_avg",
2809
+ "last_search_time",
2810
+ "max_page_search_size",
2811
+ "pages_processed",
2812
+ "pipeline",
2813
+ "processed_documents_exp_avg",
2814
+ "processing_time",
2815
+ "reason",
2816
+ "search_failure",
2817
+ "search_time",
2818
+ "search_total",
2819
+ "source_index",
2820
+ "state",
2821
+ "transform_type",
2822
+ "trigger_count",
2823
+ "version",
2824
+ ],
2825
+ ],
2826
+ ]
2827
+ ] = None,
2828
+ help: t.Optional[bool] = None,
2829
+ human: t.Optional[bool] = None,
2830
+ pretty: t.Optional[bool] = None,
2831
+ s: t.Optional[
2832
+ t.Union[
2833
+ t.Sequence[
2834
+ t.Union[
2835
+ str,
2836
+ t.Literal[
2837
+ "changes_last_detection_time",
2838
+ "checkpoint",
2839
+ "checkpoint_duration_time_exp_avg",
2840
+ "checkpoint_progress",
2841
+ "create_time",
2842
+ "delete_time",
2843
+ "description",
2844
+ "dest_index",
2845
+ "docs_per_second",
2846
+ "documents_deleted",
2847
+ "documents_indexed",
2848
+ "documents_processed",
2849
+ "frequency",
2850
+ "id",
2851
+ "index_failure",
2852
+ "index_time",
2853
+ "index_total",
2854
+ "indexed_documents_exp_avg",
2855
+ "last_search_time",
2856
+ "max_page_search_size",
2857
+ "pages_processed",
2858
+ "pipeline",
2859
+ "processed_documents_exp_avg",
2860
+ "processing_time",
2861
+ "reason",
2862
+ "search_failure",
2863
+ "search_time",
2864
+ "search_total",
2865
+ "source_index",
2866
+ "state",
2867
+ "transform_type",
2868
+ "trigger_count",
2869
+ "version",
2870
+ ],
2871
+ ]
2872
+ ],
2873
+ t.Union[
2874
+ str,
2875
+ t.Literal[
2876
+ "changes_last_detection_time",
2877
+ "checkpoint",
2878
+ "checkpoint_duration_time_exp_avg",
2879
+ "checkpoint_progress",
2880
+ "create_time",
2881
+ "delete_time",
2882
+ "description",
2883
+ "dest_index",
2884
+ "docs_per_second",
2885
+ "documents_deleted",
2886
+ "documents_indexed",
2887
+ "documents_processed",
2888
+ "frequency",
2889
+ "id",
2890
+ "index_failure",
2891
+ "index_time",
2892
+ "index_total",
2893
+ "indexed_documents_exp_avg",
2894
+ "last_search_time",
2895
+ "max_page_search_size",
2896
+ "pages_processed",
2897
+ "pipeline",
2898
+ "processed_documents_exp_avg",
2899
+ "processing_time",
2900
+ "reason",
2901
+ "search_failure",
2902
+ "search_time",
2903
+ "search_total",
2904
+ "source_index",
2905
+ "state",
2906
+ "transform_type",
2907
+ "trigger_count",
2908
+ "version",
2909
+ ],
2910
+ ],
2911
+ ]
2912
+ ] = None,
2913
+ size: t.Optional[int] = None,
2914
+ time: t.Optional[
2915
+ t.Union[str, t.Literal["d", "h", "m", "micros", "ms", "nanos", "s"]]
2916
+ ] = None,
2917
+ v: t.Optional[bool] = None,
2918
+ ) -> t.Union[ObjectApiResponse[t.Any], TextApiResponse]:
2919
+ """
2920
+ .. raw:: html
2921
+
2922
+ <p>Get transform information.</p>
2923
+ <p>Get configuration and usage information about transforms.</p>
2924
+ <p>CAT APIs are only intended for human consumption using the Kibana
2925
+ console or command line. They are not intended for use by applications. For
2926
+ application consumption, use the get transform statistics API.</p>
2927
+
2928
+
2929
+ `<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-cat-transforms>`_
2930
+
2931
+ :param transform_id: A transform identifier or a wildcard expression. If you
2932
+ do not specify one of these options, the API returns information for all
2933
+ transforms.
2934
+ :param allow_no_match: Specifies what to do when the request: contains wildcard
2935
+ expressions and there are no transforms that match; contains the `_all` string
2936
+ or no identifiers and there are no matches; contains wildcard expressions
2937
+ and there are only partial matches. If `true`, it returns an empty transforms
2938
+ array when there are no matches and the subset of results when there are
2939
+ partial matches. If `false`, the request returns a 404 status code when there
2940
+ are no matches or only partial matches.
2941
+ :param format: Specifies the format to return the columnar data in, can be set
2942
+ to `text`, `json`, `cbor`, `yaml`, or `smile`.
2943
+ :param from_: Skips the specified number of transforms.
2944
+ :param h: Comma-separated list of column names to display.
2945
+ :param help: When set to `true` will output available columns. This option can't
2946
+ be combined with any other query string option.
2947
+ :param s: Comma-separated list of column names or column aliases used to sort
2948
+ the response.
2949
+ :param size: The maximum number of transforms to obtain.
2950
+ :param time: The unit used to display time values.
2951
+ :param v: When set to `true` will enable verbose output.
2952
+ """
2953
+ __path_parts: t.Dict[str, str]
2954
+ if transform_id not in SKIP_IN_PATH:
2955
+ __path_parts = {"transform_id": _quote(transform_id)}
2956
+ __path = f'/_cat/transforms/{__path_parts["transform_id"]}'
2957
+ else:
2958
+ __path_parts = {}
2959
+ __path = "/_cat/transforms"
2960
+ __query: t.Dict[str, t.Any] = {}
2961
+ if allow_no_match is not None:
2962
+ __query["allow_no_match"] = allow_no_match
2963
+ if error_trace is not None:
2964
+ __query["error_trace"] = error_trace
2965
+ if filter_path is not None:
2966
+ __query["filter_path"] = filter_path
2967
+ if format is not None:
2968
+ __query["format"] = format
2969
+ if from_ is not None:
2970
+ __query["from"] = from_
2971
+ if h is not None:
2972
+ __query["h"] = h
2973
+ if help is not None:
2974
+ __query["help"] = help
2975
+ if human is not None:
2976
+ __query["human"] = human
2977
+ if pretty is not None:
2978
+ __query["pretty"] = pretty
2979
+ if s is not None:
2980
+ __query["s"] = s
2981
+ if size is not None:
2982
+ __query["size"] = size
2983
+ if time is not None:
2984
+ __query["time"] = time
2985
+ if v is not None:
2986
+ __query["v"] = v
2987
+ __headers = {"accept": "text/plain,application/json"}
2988
+ return self.perform_request( # type: ignore[return-value]
2989
+ "GET",
2990
+ __path,
2991
+ params=__query,
2992
+ headers=__headers,
2993
+ endpoint_id="cat.transforms",
2994
+ path_parts=__path_parts,
2995
+ )