elasticsearch 8.12.1__py3-none-any.whl → 8.13.1__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (105) hide show
  1. elasticsearch/__init__.py +7 -0
  2. elasticsearch/_async/client/__init__.py +477 -128
  3. elasticsearch/_async/client/_base.py +41 -1
  4. elasticsearch/_async/client/async_search.py +40 -12
  5. elasticsearch/_async/client/autoscaling.py +37 -11
  6. elasticsearch/_async/client/cat.py +260 -69
  7. elasticsearch/_async/client/ccr.py +123 -38
  8. elasticsearch/_async/client/cluster.py +153 -42
  9. elasticsearch/_async/client/dangling_indices.py +27 -8
  10. elasticsearch/_async/client/enrich.py +48 -14
  11. elasticsearch/_async/client/eql.py +38 -12
  12. elasticsearch/_async/client/esql.py +10 -2
  13. elasticsearch/_async/client/features.py +17 -4
  14. elasticsearch/_async/client/fleet.py +30 -7
  15. elasticsearch/_async/client/graph.py +11 -3
  16. elasticsearch/_async/client/ilm.py +101 -29
  17. elasticsearch/_async/client/indices.py +688 -181
  18. elasticsearch/_async/client/inference.py +111 -44
  19. elasticsearch/_async/client/ingest.py +59 -16
  20. elasticsearch/_async/client/license.py +58 -14
  21. elasticsearch/_async/client/logstash.py +31 -9
  22. elasticsearch/_async/client/migration.py +28 -7
  23. elasticsearch/_async/client/ml.py +781 -214
  24. elasticsearch/_async/client/monitoring.py +10 -2
  25. elasticsearch/_async/client/nodes.py +103 -29
  26. elasticsearch/_async/client/query_ruleset.py +37 -11
  27. elasticsearch/_async/client/rollup.py +79 -24
  28. elasticsearch/_async/client/search_application.py +76 -23
  29. elasticsearch/_async/client/searchable_snapshots.py +49 -12
  30. elasticsearch/_async/client/security.py +544 -143
  31. elasticsearch/_async/client/shutdown.py +28 -6
  32. elasticsearch/_async/client/slm.py +80 -22
  33. elasticsearch/_async/client/snapshot.py +140 -54
  34. elasticsearch/_async/client/sql.py +55 -15
  35. elasticsearch/_async/client/ssl.py +9 -2
  36. elasticsearch/_async/client/synonyms.py +75 -21
  37. elasticsearch/_async/client/tasks.py +29 -8
  38. elasticsearch/_async/client/text_structure.py +74 -2
  39. elasticsearch/_async/client/transform.py +106 -32
  40. elasticsearch/_async/client/watcher.py +110 -31
  41. elasticsearch/_async/client/xpack.py +16 -4
  42. elasticsearch/_async/helpers.py +1 -1
  43. elasticsearch/_otel.py +92 -0
  44. elasticsearch/_sync/client/__init__.py +477 -128
  45. elasticsearch/_sync/client/_base.py +41 -1
  46. elasticsearch/_sync/client/async_search.py +40 -12
  47. elasticsearch/_sync/client/autoscaling.py +37 -11
  48. elasticsearch/_sync/client/cat.py +260 -69
  49. elasticsearch/_sync/client/ccr.py +123 -38
  50. elasticsearch/_sync/client/cluster.py +153 -42
  51. elasticsearch/_sync/client/dangling_indices.py +27 -8
  52. elasticsearch/_sync/client/enrich.py +48 -14
  53. elasticsearch/_sync/client/eql.py +38 -12
  54. elasticsearch/_sync/client/esql.py +10 -2
  55. elasticsearch/_sync/client/features.py +17 -4
  56. elasticsearch/_sync/client/fleet.py +30 -7
  57. elasticsearch/_sync/client/graph.py +11 -3
  58. elasticsearch/_sync/client/ilm.py +101 -29
  59. elasticsearch/_sync/client/indices.py +688 -181
  60. elasticsearch/_sync/client/inference.py +111 -44
  61. elasticsearch/_sync/client/ingest.py +59 -16
  62. elasticsearch/_sync/client/license.py +58 -14
  63. elasticsearch/_sync/client/logstash.py +31 -9
  64. elasticsearch/_sync/client/migration.py +28 -7
  65. elasticsearch/_sync/client/ml.py +781 -214
  66. elasticsearch/_sync/client/monitoring.py +10 -2
  67. elasticsearch/_sync/client/nodes.py +103 -29
  68. elasticsearch/_sync/client/query_ruleset.py +37 -11
  69. elasticsearch/_sync/client/rollup.py +79 -24
  70. elasticsearch/_sync/client/search_application.py +76 -23
  71. elasticsearch/_sync/client/searchable_snapshots.py +49 -12
  72. elasticsearch/_sync/client/security.py +544 -143
  73. elasticsearch/_sync/client/shutdown.py +28 -6
  74. elasticsearch/_sync/client/slm.py +80 -22
  75. elasticsearch/_sync/client/snapshot.py +140 -54
  76. elasticsearch/_sync/client/sql.py +55 -15
  77. elasticsearch/_sync/client/ssl.py +9 -2
  78. elasticsearch/_sync/client/synonyms.py +75 -21
  79. elasticsearch/_sync/client/tasks.py +29 -8
  80. elasticsearch/_sync/client/text_structure.py +74 -2
  81. elasticsearch/_sync/client/transform.py +106 -32
  82. elasticsearch/_sync/client/watcher.py +110 -31
  83. elasticsearch/_sync/client/xpack.py +16 -4
  84. elasticsearch/_version.py +1 -1
  85. elasticsearch/helpers/actions.py +1 -1
  86. elasticsearch/helpers/vectorstore/__init__.py +62 -0
  87. elasticsearch/helpers/vectorstore/_async/__init__.py +16 -0
  88. elasticsearch/helpers/vectorstore/_async/_utils.py +39 -0
  89. elasticsearch/helpers/vectorstore/_async/embedding_service.py +89 -0
  90. elasticsearch/helpers/vectorstore/_async/strategies.py +466 -0
  91. elasticsearch/helpers/vectorstore/_async/vectorstore.py +391 -0
  92. elasticsearch/helpers/vectorstore/_sync/__init__.py +16 -0
  93. elasticsearch/helpers/vectorstore/_sync/_utils.py +39 -0
  94. elasticsearch/helpers/vectorstore/_sync/embedding_service.py +89 -0
  95. elasticsearch/helpers/vectorstore/_sync/strategies.py +466 -0
  96. elasticsearch/helpers/vectorstore/_sync/vectorstore.py +388 -0
  97. elasticsearch/helpers/vectorstore/_utils.py +116 -0
  98. elasticsearch/serializer.py +14 -0
  99. {elasticsearch-8.12.1.dist-info → elasticsearch-8.13.1.dist-info}/METADATA +28 -8
  100. elasticsearch-8.13.1.dist-info/RECORD +116 -0
  101. {elasticsearch-8.12.1.dist-info → elasticsearch-8.13.1.dist-info}/WHEEL +1 -1
  102. elasticsearch-8.12.1.dist-info/RECORD +0 -103
  103. {elasticsearch-8.12.1.dist-info → elasticsearch-8.13.1.dist-info}/LICENSE +0 -0
  104. {elasticsearch-8.12.1.dist-info → elasticsearch-8.13.1.dist-info}/NOTICE +0 -0
  105. {elasticsearch-8.12.1.dist-info → elasticsearch-8.13.1.dist-info}/top_level.txt +0 -0
@@ -24,6 +24,7 @@ from .utils import SKIP_IN_PATH, _quote, _rewrite_parameters
24
24
 
25
25
 
26
26
  class SynonymsClient(NamespacedClient):
27
+
27
28
  @_rewrite_parameters()
28
29
  async def delete_synonym(
29
30
  self,
@@ -37,13 +38,14 @@ class SynonymsClient(NamespacedClient):
37
38
  """
38
39
  Deletes a synonym set
39
40
 
40
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.12/delete-synonyms-set.html>`_
41
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/delete-synonyms-set.html>`_
41
42
 
42
43
  :param id: The id of the synonyms set to be deleted
43
44
  """
44
45
  if id in SKIP_IN_PATH:
45
46
  raise ValueError("Empty value passed for parameter 'id'")
46
- __path = f"/_synonyms/{_quote(id)}"
47
+ __path_parts: t.Dict[str, str] = {"id": _quote(id)}
48
+ __path = f'/_synonyms/{__path_parts["id"]}'
47
49
  __query: t.Dict[str, t.Any] = {}
48
50
  if error_trace is not None:
49
51
  __query["error_trace"] = error_trace
@@ -55,7 +57,12 @@ class SynonymsClient(NamespacedClient):
55
57
  __query["pretty"] = pretty
56
58
  __headers = {"accept": "application/json"}
57
59
  return await self.perform_request( # type: ignore[return-value]
58
- "DELETE", __path, params=__query, headers=__headers
60
+ "DELETE",
61
+ __path,
62
+ params=__query,
63
+ headers=__headers,
64
+ endpoint_id="synonyms.delete_synonym",
65
+ path_parts=__path_parts,
59
66
  )
60
67
 
61
68
  @_rewrite_parameters()
@@ -72,7 +79,7 @@ class SynonymsClient(NamespacedClient):
72
79
  """
73
80
  Deletes a synonym rule in a synonym set
74
81
 
75
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.12/delete-synonym-rule.html>`_
82
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/delete-synonym-rule.html>`_
76
83
 
77
84
  :param set_id: The id of the synonym set to be updated
78
85
  :param rule_id: The id of the synonym rule to be deleted
@@ -81,7 +88,11 @@ class SynonymsClient(NamespacedClient):
81
88
  raise ValueError("Empty value passed for parameter 'set_id'")
82
89
  if rule_id in SKIP_IN_PATH:
83
90
  raise ValueError("Empty value passed for parameter 'rule_id'")
84
- __path = f"/_synonyms/{_quote(set_id)}/{_quote(rule_id)}"
91
+ __path_parts: t.Dict[str, str] = {
92
+ "set_id": _quote(set_id),
93
+ "rule_id": _quote(rule_id),
94
+ }
95
+ __path = f'/_synonyms/{__path_parts["set_id"]}/{__path_parts["rule_id"]}'
85
96
  __query: t.Dict[str, t.Any] = {}
86
97
  if error_trace is not None:
87
98
  __query["error_trace"] = error_trace
@@ -93,7 +104,12 @@ class SynonymsClient(NamespacedClient):
93
104
  __query["pretty"] = pretty
94
105
  __headers = {"accept": "application/json"}
95
106
  return await self.perform_request( # type: ignore[return-value]
96
- "DELETE", __path, params=__query, headers=__headers
107
+ "DELETE",
108
+ __path,
109
+ params=__query,
110
+ headers=__headers,
111
+ endpoint_id="synonyms.delete_synonym_rule",
112
+ path_parts=__path_parts,
97
113
  )
98
114
 
99
115
  @_rewrite_parameters(
@@ -113,7 +129,7 @@ class SynonymsClient(NamespacedClient):
113
129
  """
114
130
  Retrieves a synonym set
115
131
 
116
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.12/get-synonyms-set.html>`_
132
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/get-synonyms-set.html>`_
117
133
 
118
134
  :param id: "The id of the synonyms set to be retrieved
119
135
  :param from_: Starting offset for query rules to be retrieved
@@ -121,7 +137,8 @@ class SynonymsClient(NamespacedClient):
121
137
  """
122
138
  if id in SKIP_IN_PATH:
123
139
  raise ValueError("Empty value passed for parameter 'id'")
124
- __path = f"/_synonyms/{_quote(id)}"
140
+ __path_parts: t.Dict[str, str] = {"id": _quote(id)}
141
+ __path = f'/_synonyms/{__path_parts["id"]}'
125
142
  __query: t.Dict[str, t.Any] = {}
126
143
  if error_trace is not None:
127
144
  __query["error_trace"] = error_trace
@@ -137,7 +154,12 @@ class SynonymsClient(NamespacedClient):
137
154
  __query["size"] = size
138
155
  __headers = {"accept": "application/json"}
139
156
  return await self.perform_request( # type: ignore[return-value]
140
- "GET", __path, params=__query, headers=__headers
157
+ "GET",
158
+ __path,
159
+ params=__query,
160
+ headers=__headers,
161
+ endpoint_id="synonyms.get_synonym",
162
+ path_parts=__path_parts,
141
163
  )
142
164
 
143
165
  @_rewrite_parameters()
@@ -154,7 +176,7 @@ class SynonymsClient(NamespacedClient):
154
176
  """
155
177
  Retrieves a synonym rule from a synonym set
156
178
 
157
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.12/get-synonym-rule.html>`_
179
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/get-synonym-rule.html>`_
158
180
 
159
181
  :param set_id: The id of the synonym set to retrieve the synonym rule from
160
182
  :param rule_id: The id of the synonym rule to retrieve
@@ -163,7 +185,11 @@ class SynonymsClient(NamespacedClient):
163
185
  raise ValueError("Empty value passed for parameter 'set_id'")
164
186
  if rule_id in SKIP_IN_PATH:
165
187
  raise ValueError("Empty value passed for parameter 'rule_id'")
166
- __path = f"/_synonyms/{_quote(set_id)}/{_quote(rule_id)}"
188
+ __path_parts: t.Dict[str, str] = {
189
+ "set_id": _quote(set_id),
190
+ "rule_id": _quote(rule_id),
191
+ }
192
+ __path = f'/_synonyms/{__path_parts["set_id"]}/{__path_parts["rule_id"]}'
167
193
  __query: t.Dict[str, t.Any] = {}
168
194
  if error_trace is not None:
169
195
  __query["error_trace"] = error_trace
@@ -175,7 +201,12 @@ class SynonymsClient(NamespacedClient):
175
201
  __query["pretty"] = pretty
176
202
  __headers = {"accept": "application/json"}
177
203
  return await self.perform_request( # type: ignore[return-value]
178
- "GET", __path, params=__query, headers=__headers
204
+ "GET",
205
+ __path,
206
+ params=__query,
207
+ headers=__headers,
208
+ endpoint_id="synonyms.get_synonym_rule",
209
+ path_parts=__path_parts,
179
210
  )
180
211
 
181
212
  @_rewrite_parameters(
@@ -194,11 +225,12 @@ class SynonymsClient(NamespacedClient):
194
225
  """
195
226
  Retrieves a summary of all defined synonym sets
196
227
 
197
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.12/list-synonyms-sets.html>`_
228
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/list-synonyms-sets.html>`_
198
229
 
199
230
  :param from_: Starting offset
200
231
  :param size: specifies a max number of results to get
201
232
  """
233
+ __path_parts: t.Dict[str, str] = {}
202
234
  __path = "/_synonyms"
203
235
  __query: t.Dict[str, t.Any] = {}
204
236
  if error_trace is not None:
@@ -215,7 +247,12 @@ class SynonymsClient(NamespacedClient):
215
247
  __query["size"] = size
216
248
  __headers = {"accept": "application/json"}
217
249
  return await self.perform_request( # type: ignore[return-value]
218
- "GET", __path, params=__query, headers=__headers
250
+ "GET",
251
+ __path,
252
+ params=__query,
253
+ headers=__headers,
254
+ endpoint_id="synonyms.get_synonyms_sets",
255
+ path_parts=__path_parts,
219
256
  )
220
257
 
221
258
  @_rewrite_parameters(
@@ -235,7 +272,7 @@ class SynonymsClient(NamespacedClient):
235
272
  """
236
273
  Creates or updates a synonyms set
237
274
 
238
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.12/put-synonyms-set.html>`_
275
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/put-synonyms-set.html>`_
239
276
 
240
277
  :param id: The id of the synonyms set to be created or updated
241
278
  :param synonyms_set: The synonym set information to update
@@ -244,7 +281,8 @@ class SynonymsClient(NamespacedClient):
244
281
  raise ValueError("Empty value passed for parameter 'id'")
245
282
  if synonyms_set is None and body is None:
246
283
  raise ValueError("Empty value passed for parameter 'synonyms_set'")
247
- __path = f"/_synonyms/{_quote(id)}"
284
+ __path_parts: t.Dict[str, str] = {"id": _quote(id)}
285
+ __path = f'/_synonyms/{__path_parts["id"]}'
248
286
  __query: t.Dict[str, t.Any] = {}
249
287
  __body: t.Dict[str, t.Any] = body if body is not None else {}
250
288
  if error_trace is not None:
@@ -260,7 +298,13 @@ class SynonymsClient(NamespacedClient):
260
298
  __body["synonyms_set"] = synonyms_set
261
299
  __headers = {"accept": "application/json", "content-type": "application/json"}
262
300
  return await self.perform_request( # type: ignore[return-value]
263
- "PUT", __path, params=__query, headers=__headers, body=__body
301
+ "PUT",
302
+ __path,
303
+ params=__query,
304
+ headers=__headers,
305
+ body=__body,
306
+ endpoint_id="synonyms.put_synonym",
307
+ path_parts=__path_parts,
264
308
  )
265
309
 
266
310
  @_rewrite_parameters(
@@ -271,7 +315,7 @@ class SynonymsClient(NamespacedClient):
271
315
  *,
272
316
  set_id: str,
273
317
  rule_id: str,
274
- synonyms: t.Optional[t.Sequence[str]] = None,
318
+ synonyms: t.Optional[str] = None,
275
319
  error_trace: t.Optional[bool] = None,
276
320
  filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
277
321
  human: t.Optional[bool] = None,
@@ -281,7 +325,7 @@ class SynonymsClient(NamespacedClient):
281
325
  """
282
326
  Creates or updates a synonym rule in a synonym set
283
327
 
284
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.12/put-synonym-rule.html>`_
328
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/put-synonym-rule.html>`_
285
329
 
286
330
  :param set_id: The id of the synonym set to be updated with the synonym rule
287
331
  :param rule_id: The id of the synonym rule to be updated or created
@@ -293,7 +337,11 @@ class SynonymsClient(NamespacedClient):
293
337
  raise ValueError("Empty value passed for parameter 'rule_id'")
294
338
  if synonyms is None and body is None:
295
339
  raise ValueError("Empty value passed for parameter 'synonyms'")
296
- __path = f"/_synonyms/{_quote(set_id)}/{_quote(rule_id)}"
340
+ __path_parts: t.Dict[str, str] = {
341
+ "set_id": _quote(set_id),
342
+ "rule_id": _quote(rule_id),
343
+ }
344
+ __path = f'/_synonyms/{__path_parts["set_id"]}/{__path_parts["rule_id"]}'
297
345
  __query: t.Dict[str, t.Any] = {}
298
346
  __body: t.Dict[str, t.Any] = body if body is not None else {}
299
347
  if error_trace is not None:
@@ -309,5 +357,11 @@ class SynonymsClient(NamespacedClient):
309
357
  __body["synonyms"] = synonyms
310
358
  __headers = {"accept": "application/json", "content-type": "application/json"}
311
359
  return await self.perform_request( # type: ignore[return-value]
312
- "PUT", __path, params=__query, headers=__headers, body=__body
360
+ "PUT",
361
+ __path,
362
+ params=__query,
363
+ headers=__headers,
364
+ body=__body,
365
+ endpoint_id="synonyms.put_synonym_rule",
366
+ path_parts=__path_parts,
313
367
  )
@@ -24,6 +24,7 @@ from .utils import SKIP_IN_PATH, _quote, _rewrite_parameters
24
24
 
25
25
 
26
26
  class TasksClient(NamespacedClient):
27
+
27
28
  @_rewrite_parameters()
28
29
  async def cancel(
29
30
  self,
@@ -41,7 +42,7 @@ class TasksClient(NamespacedClient):
41
42
  """
42
43
  Cancels a task, if it can be cancelled through an API.
43
44
 
44
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.12/tasks.html>`_
45
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/tasks.html>`_
45
46
 
46
47
  :param task_id: ID of the task.
47
48
  :param actions: Comma-separated list or wildcard expression of actions used to
@@ -51,9 +52,12 @@ class TasksClient(NamespacedClient):
51
52
  :param wait_for_completion: Should the request block until the cancellation of
52
53
  the task and its descendant tasks is completed. Defaults to false
53
54
  """
55
+ __path_parts: t.Dict[str, str]
54
56
  if task_id not in SKIP_IN_PATH:
55
- __path = f"/_tasks/{_quote(task_id)}/_cancel"
57
+ __path_parts = {"task_id": _quote(task_id)}
58
+ __path = f'/_tasks/{__path_parts["task_id"]}/_cancel'
56
59
  else:
60
+ __path_parts = {}
57
61
  __path = "/_tasks/_cancel"
58
62
  __query: t.Dict[str, t.Any] = {}
59
63
  if actions is not None:
@@ -74,7 +78,12 @@ class TasksClient(NamespacedClient):
74
78
  __query["wait_for_completion"] = wait_for_completion
75
79
  __headers = {"accept": "application/json"}
76
80
  return await self.perform_request( # type: ignore[return-value]
77
- "POST", __path, params=__query, headers=__headers
81
+ "POST",
82
+ __path,
83
+ params=__query,
84
+ headers=__headers,
85
+ endpoint_id="tasks.cancel",
86
+ path_parts=__path_parts,
78
87
  )
79
88
 
80
89
  @_rewrite_parameters()
@@ -92,7 +101,7 @@ class TasksClient(NamespacedClient):
92
101
  """
93
102
  Returns information about a task.
94
103
 
95
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.12/tasks.html>`_
104
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/tasks.html>`_
96
105
 
97
106
  :param task_id: ID of the task.
98
107
  :param timeout: Period to wait for a response. If no response is received before
@@ -102,7 +111,8 @@ class TasksClient(NamespacedClient):
102
111
  """
103
112
  if task_id in SKIP_IN_PATH:
104
113
  raise ValueError("Empty value passed for parameter 'task_id'")
105
- __path = f"/_tasks/{_quote(task_id)}"
114
+ __path_parts: t.Dict[str, str] = {"task_id": _quote(task_id)}
115
+ __path = f'/_tasks/{__path_parts["task_id"]}'
106
116
  __query: t.Dict[str, t.Any] = {}
107
117
  if error_trace is not None:
108
118
  __query["error_trace"] = error_trace
@@ -118,7 +128,12 @@ class TasksClient(NamespacedClient):
118
128
  __query["wait_for_completion"] = wait_for_completion
119
129
  __headers = {"accept": "application/json"}
120
130
  return await self.perform_request( # type: ignore[return-value]
121
- "GET", __path, params=__query, headers=__headers
131
+ "GET",
132
+ __path,
133
+ params=__query,
134
+ headers=__headers,
135
+ endpoint_id="tasks.get",
136
+ path_parts=__path_parts,
122
137
  )
123
138
 
124
139
  @_rewrite_parameters()
@@ -145,7 +160,7 @@ class TasksClient(NamespacedClient):
145
160
  """
146
161
  Returns a list of tasks.
147
162
 
148
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.12/tasks.html>`_
163
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/tasks.html>`_
149
164
 
150
165
  :param actions: Comma-separated list or wildcard expression of actions used to
151
166
  limit the request.
@@ -164,6 +179,7 @@ class TasksClient(NamespacedClient):
164
179
  :param wait_for_completion: If `true`, the request blocks until the operation
165
180
  is complete.
166
181
  """
182
+ __path_parts: t.Dict[str, str] = {}
167
183
  __path = "/_tasks"
168
184
  __query: t.Dict[str, t.Any] = {}
169
185
  if actions is not None:
@@ -192,5 +208,10 @@ class TasksClient(NamespacedClient):
192
208
  __query["wait_for_completion"] = wait_for_completion
193
209
  __headers = {"accept": "application/json"}
194
210
  return await self.perform_request( # type: ignore[return-value]
195
- "GET", __path, params=__query, headers=__headers
211
+ "GET",
212
+ __path,
213
+ params=__query,
214
+ headers=__headers,
215
+ endpoint_id="tasks.list",
216
+ path_parts=__path_parts,
196
217
  )
@@ -24,6 +24,7 @@ from .utils import _rewrite_parameters
24
24
 
25
25
 
26
26
  class TextStructureClient(NamespacedClient):
27
+
27
28
  @_rewrite_parameters(
28
29
  body_name="text_files",
29
30
  )
@@ -35,6 +36,7 @@ class TextStructureClient(NamespacedClient):
35
36
  charset: t.Optional[str] = None,
36
37
  column_names: t.Optional[str] = None,
37
38
  delimiter: t.Optional[str] = None,
39
+ ecs_compatibility: t.Optional[str] = None,
38
40
  explain: t.Optional[bool] = None,
39
41
  format: t.Optional[str] = None,
40
42
  grok_pattern: t.Optional[str] = None,
@@ -51,7 +53,7 @@ class TextStructureClient(NamespacedClient):
51
53
  Finds the structure of a text file. The text file must contain data that is suitable
52
54
  to be ingested into Elasticsearch.
53
55
 
54
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.12/find-structure.html>`_
56
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/find-structure.html>`_
55
57
 
56
58
  :param text_files:
57
59
  :param charset: The text’s character set. It must be a character set that is
@@ -70,6 +72,8 @@ class TextStructureClient(NamespacedClient):
70
72
  default scenario, all rows must have the same number of fields for the delimited
71
73
  format to be detected. If you specify a delimiter, up to 10% of the rows
72
74
  can have a different number of columns than the first row.
75
+ :param ecs_compatibility: The mode of compatibility with ECS compliant Grok patterns
76
+ (disabled or v1, default: disabled).
73
77
  :param explain: If this parameter is set to true, the response includes a field
74
78
  named explanation, which is an array of strings that indicate how the structure
75
79
  finder produced its result.
@@ -123,6 +127,7 @@ class TextStructureClient(NamespacedClient):
123
127
  )
124
128
  elif text_files is not None and body is not None:
125
129
  raise ValueError("Cannot set both 'text_files' and 'body'")
130
+ __path_parts: t.Dict[str, str] = {}
126
131
  __path = "/_text_structure/find_structure"
127
132
  __query: t.Dict[str, t.Any] = {}
128
133
  if charset is not None:
@@ -131,6 +136,8 @@ class TextStructureClient(NamespacedClient):
131
136
  __query["column_names"] = column_names
132
137
  if delimiter is not None:
133
138
  __query["delimiter"] = delimiter
139
+ if ecs_compatibility is not None:
140
+ __query["ecs_compatibility"] = ecs_compatibility
134
141
  if explain is not None:
135
142
  __query["explain"] = explain
136
143
  if format is not None:
@@ -159,5 +166,70 @@ class TextStructureClient(NamespacedClient):
159
166
  "content-type": "application/x-ndjson",
160
167
  }
161
168
  return await self.perform_request( # type: ignore[return-value]
162
- "POST", __path, params=__query, headers=__headers, body=__body
169
+ "POST",
170
+ __path,
171
+ params=__query,
172
+ headers=__headers,
173
+ body=__body,
174
+ endpoint_id="text_structure.find_structure",
175
+ path_parts=__path_parts,
176
+ )
177
+
178
+ @_rewrite_parameters(
179
+ body_fields=("grok_pattern", "text"),
180
+ )
181
+ async def test_grok_pattern(
182
+ self,
183
+ *,
184
+ grok_pattern: t.Optional[str] = None,
185
+ text: t.Optional[t.Sequence[str]] = None,
186
+ ecs_compatibility: t.Optional[str] = None,
187
+ error_trace: t.Optional[bool] = None,
188
+ filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
189
+ human: t.Optional[bool] = None,
190
+ pretty: t.Optional[bool] = None,
191
+ body: t.Optional[t.Dict[str, t.Any]] = None,
192
+ ) -> ObjectApiResponse[t.Any]:
193
+ """
194
+ Tests a Grok pattern on some text.
195
+
196
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.13/test-grok-pattern.html>`_
197
+
198
+ :param grok_pattern: Grok pattern to run on the text.
199
+ :param text: Lines of text to run the Grok pattern on.
200
+ :param ecs_compatibility: The mode of compatibility with ECS compliant Grok patterns
201
+ (disabled or v1, default: disabled).
202
+ """
203
+ if grok_pattern is None and body is None:
204
+ raise ValueError("Empty value passed for parameter 'grok_pattern'")
205
+ if text is None and body is None:
206
+ raise ValueError("Empty value passed for parameter 'text'")
207
+ __path_parts: t.Dict[str, str] = {}
208
+ __path = "/_text_structure/test_grok_pattern"
209
+ __query: t.Dict[str, t.Any] = {}
210
+ __body: t.Dict[str, t.Any] = body if body is not None else {}
211
+ if ecs_compatibility is not None:
212
+ __query["ecs_compatibility"] = ecs_compatibility
213
+ if error_trace is not None:
214
+ __query["error_trace"] = error_trace
215
+ if filter_path is not None:
216
+ __query["filter_path"] = filter_path
217
+ if human is not None:
218
+ __query["human"] = human
219
+ if pretty is not None:
220
+ __query["pretty"] = pretty
221
+ if not __body:
222
+ if grok_pattern is not None:
223
+ __body["grok_pattern"] = grok_pattern
224
+ if text is not None:
225
+ __body["text"] = text
226
+ __headers = {"accept": "application/json", "content-type": "application/json"}
227
+ return await self.perform_request( # type: ignore[return-value]
228
+ "POST",
229
+ __path,
230
+ params=__query,
231
+ headers=__headers,
232
+ body=__body,
233
+ endpoint_id="text_structure.test_grok_pattern",
234
+ path_parts=__path_parts,
163
235
  )