elasticsearch9 9.2.0__py3-none-any.whl → 9.3.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 (125) hide show
  1. elasticsearch9/_async/client/__init__.py +108 -85
  2. elasticsearch9/_async/client/async_search.py +7 -6
  3. elasticsearch9/_async/client/autoscaling.py +15 -4
  4. elasticsearch9/_async/client/cat.py +203 -10
  5. elasticsearch9/_async/client/ccr.py +10 -10
  6. elasticsearch9/_async/client/cluster.py +98 -66
  7. elasticsearch9/_async/client/connector.py +42 -41
  8. elasticsearch9/_async/client/dangling_indices.py +8 -12
  9. elasticsearch9/_async/client/enrich.py +10 -10
  10. elasticsearch9/_async/client/eql.py +17 -16
  11. elasticsearch9/_async/client/esql.py +173 -24
  12. elasticsearch9/_async/client/features.py +6 -6
  13. elasticsearch9/_async/client/fleet.py +8 -8
  14. elasticsearch9/_async/client/graph.py +3 -3
  15. elasticsearch9/_async/client/ilm.py +18 -18
  16. elasticsearch9/_async/client/indices.py +564 -149
  17. elasticsearch9/_async/client/inference.py +374 -64
  18. elasticsearch9/_async/client/ingest.py +9 -9
  19. elasticsearch9/_async/client/license.py +5 -7
  20. elasticsearch9/_async/client/logstash.py +4 -4
  21. elasticsearch9/_async/client/migration.py +6 -6
  22. elasticsearch9/_async/client/ml.py +132 -88
  23. elasticsearch9/_async/client/monitoring.py +4 -3
  24. elasticsearch9/_async/client/nodes.py +182 -20
  25. elasticsearch9/_async/client/project.py +13 -4
  26. elasticsearch9/_async/client/query_rules.py +16 -16
  27. elasticsearch9/_async/client/rollup.py +21 -21
  28. elasticsearch9/_async/client/search_application.py +19 -19
  29. elasticsearch9/_async/client/searchable_snapshots.py +10 -10
  30. elasticsearch9/_async/client/security.py +34 -10
  31. elasticsearch9/_async/client/shutdown.py +15 -4
  32. elasticsearch9/_async/client/simulate.py +4 -4
  33. elasticsearch9/_async/client/slm.py +17 -17
  34. elasticsearch9/_async/client/snapshot.py +21 -21
  35. elasticsearch9/_async/client/sql.py +17 -16
  36. elasticsearch9/_async/client/streams.py +6 -7
  37. elasticsearch9/_async/client/synonyms.py +10 -10
  38. elasticsearch9/_async/client/tasks.py +8 -8
  39. elasticsearch9/_async/client/text_structure.py +16 -12
  40. elasticsearch9/_async/client/transform.py +51 -12
  41. elasticsearch9/_async/client/utils.py +4 -2
  42. elasticsearch9/_async/client/watcher.py +26 -26
  43. elasticsearch9/_async/client/xpack.py +6 -5
  44. elasticsearch9/_sync/client/__init__.py +110 -85
  45. elasticsearch9/_sync/client/async_search.py +7 -6
  46. elasticsearch9/_sync/client/autoscaling.py +15 -4
  47. elasticsearch9/_sync/client/cat.py +203 -10
  48. elasticsearch9/_sync/client/ccr.py +10 -10
  49. elasticsearch9/_sync/client/cluster.py +98 -66
  50. elasticsearch9/_sync/client/connector.py +42 -41
  51. elasticsearch9/_sync/client/dangling_indices.py +8 -12
  52. elasticsearch9/_sync/client/enrich.py +10 -10
  53. elasticsearch9/_sync/client/eql.py +17 -16
  54. elasticsearch9/_sync/client/esql.py +173 -24
  55. elasticsearch9/_sync/client/features.py +6 -6
  56. elasticsearch9/_sync/client/fleet.py +8 -8
  57. elasticsearch9/_sync/client/graph.py +3 -3
  58. elasticsearch9/_sync/client/ilm.py +18 -18
  59. elasticsearch9/_sync/client/indices.py +564 -149
  60. elasticsearch9/_sync/client/inference.py +374 -64
  61. elasticsearch9/_sync/client/ingest.py +9 -9
  62. elasticsearch9/_sync/client/license.py +5 -7
  63. elasticsearch9/_sync/client/logstash.py +4 -4
  64. elasticsearch9/_sync/client/migration.py +6 -6
  65. elasticsearch9/_sync/client/ml.py +132 -88
  66. elasticsearch9/_sync/client/monitoring.py +4 -3
  67. elasticsearch9/_sync/client/nodes.py +182 -20
  68. elasticsearch9/_sync/client/project.py +13 -4
  69. elasticsearch9/_sync/client/project_routing.py +264 -0
  70. elasticsearch9/_sync/client/query_rules.py +16 -16
  71. elasticsearch9/_sync/client/rollup.py +21 -21
  72. elasticsearch9/_sync/client/search_application.py +19 -19
  73. elasticsearch9/_sync/client/searchable_snapshots.py +10 -10
  74. elasticsearch9/_sync/client/security.py +34 -10
  75. elasticsearch9/_sync/client/shutdown.py +15 -4
  76. elasticsearch9/_sync/client/simulate.py +4 -4
  77. elasticsearch9/_sync/client/slm.py +17 -17
  78. elasticsearch9/_sync/client/snapshot.py +21 -21
  79. elasticsearch9/_sync/client/sql.py +17 -16
  80. elasticsearch9/_sync/client/streams.py +6 -7
  81. elasticsearch9/_sync/client/synonyms.py +10 -10
  82. elasticsearch9/_sync/client/tasks.py +8 -8
  83. elasticsearch9/_sync/client/text_structure.py +16 -12
  84. elasticsearch9/_sync/client/transform.py +51 -12
  85. elasticsearch9/_sync/client/utils.py +16 -2
  86. elasticsearch9/_sync/client/watcher.py +26 -26
  87. elasticsearch9/_sync/client/xpack.py +6 -5
  88. elasticsearch9/_version.py +2 -2
  89. elasticsearch9/dsl/__init__.py +4 -0
  90. elasticsearch9/dsl/_async/document.py +4 -5
  91. elasticsearch9/dsl/_async/index.py +1 -1
  92. elasticsearch9/dsl/_async/search.py +2 -3
  93. elasticsearch9/dsl/_sync/document.py +4 -5
  94. elasticsearch9/dsl/_sync/index.py +1 -1
  95. elasticsearch9/dsl/_sync/search.py +2 -3
  96. elasticsearch9/dsl/aggs.py +9 -9
  97. elasticsearch9/dsl/async_connections.py +1 -2
  98. elasticsearch9/dsl/connections.py +1 -2
  99. elasticsearch9/dsl/document_base.py +1 -1
  100. elasticsearch9/dsl/field.py +90 -6
  101. elasticsearch9/dsl/pydantic.py +1 -1
  102. elasticsearch9/dsl/query.py +25 -2
  103. elasticsearch9/dsl/response/__init__.py +2 -0
  104. elasticsearch9/dsl/serializer.py +1 -2
  105. elasticsearch9/dsl/types.py +63 -8
  106. elasticsearch9/dsl/utils.py +12 -4
  107. elasticsearch9/esql/esql.py +1 -1
  108. elasticsearch9/esql/functions.py +926 -252
  109. elasticsearch9/helpers/__init__.py +2 -0
  110. elasticsearch9/helpers/actions.py +21 -0
  111. elasticsearch9/helpers/vectorstore/__init__.py +7 -7
  112. elasticsearch9/helpers/vectorstore/_async/_utils.py +1 -1
  113. elasticsearch9/helpers/vectorstore/_async/embedding_service.py +2 -2
  114. elasticsearch9/helpers/vectorstore/_async/strategies.py +3 -3
  115. elasticsearch9/helpers/vectorstore/_async/vectorstore.py +8 -5
  116. elasticsearch9/helpers/vectorstore/_sync/_utils.py +1 -1
  117. elasticsearch9/helpers/vectorstore/_sync/embedding_service.py +2 -2
  118. elasticsearch9/helpers/vectorstore/_sync/strategies.py +3 -3
  119. elasticsearch9/helpers/vectorstore/_sync/vectorstore.py +8 -5
  120. {elasticsearch9-9.2.0.dist-info → elasticsearch9-9.3.0.dist-info}/METADATA +2 -1
  121. elasticsearch9-9.3.0.dist-info/RECORD +169 -0
  122. {elasticsearch9-9.2.0.dist-info → elasticsearch9-9.3.0.dist-info}/WHEEL +1 -1
  123. elasticsearch9-9.2.0.dist-info/RECORD +0 -168
  124. {elasticsearch9-9.2.0.dist-info → elasticsearch9-9.3.0.dist-info}/licenses/LICENSE +0 -0
  125. {elasticsearch9-9.2.0.dist-info → elasticsearch9-9.3.0.dist-info}/licenses/NOTICE +0 -0
@@ -30,7 +30,7 @@ class DanglingIndicesClient(NamespacedClient):
30
30
  self,
31
31
  *,
32
32
  index_uuid: str,
33
- accept_data_loss: bool,
33
+ accept_data_loss: t.Optional[bool] = None,
34
34
  error_trace: t.Optional[bool] = None,
35
35
  filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
36
36
  human: t.Optional[bool] = None,
@@ -41,8 +41,8 @@ class DanglingIndicesClient(NamespacedClient):
41
41
  """
42
42
  .. raw:: html
43
43
 
44
- <p>Delete a dangling index.
45
- If Elasticsearch encounters index data that is absent from the current cluster state, those indices are considered to be dangling.
44
+ <p>Delete a dangling index.</p>
45
+ <p>If Elasticsearch encounters index data that is absent from the current cluster state, those indices are considered to be dangling.
46
46
  For example, this can happen if you delete more than <code>cluster.indices.tombstones.size</code> indices while an Elasticsearch node is offline.</p>
47
47
 
48
48
 
@@ -52,13 +52,11 @@ class DanglingIndicesClient(NamespacedClient):
52
52
  API to find the UUID.
53
53
  :param accept_data_loss: This parameter must be set to true to acknowledge that
54
54
  it will no longer be possible to recove data from the dangling index.
55
- :param master_timeout: Specify timeout for connection to master
56
- :param timeout: Explicit operation timeout
55
+ :param master_timeout: The period to wait for a connection to the master node.
56
+ :param timeout: The period to wait for a response.
57
57
  """
58
58
  if index_uuid in SKIP_IN_PATH:
59
59
  raise ValueError("Empty value passed for parameter 'index_uuid'")
60
- if accept_data_loss is None:
61
- raise ValueError("Empty value passed for parameter 'accept_data_loss'")
62
60
  __path_parts: t.Dict[str, str] = {"index_uuid": _quote(index_uuid)}
63
61
  __path = f'/_dangling/{__path_parts["index_uuid"]}'
64
62
  __query: t.Dict[str, t.Any] = {}
@@ -91,7 +89,7 @@ class DanglingIndicesClient(NamespacedClient):
91
89
  self,
92
90
  *,
93
91
  index_uuid: str,
94
- accept_data_loss: bool,
92
+ accept_data_loss: t.Optional[bool] = None,
95
93
  error_trace: t.Optional[bool] = None,
96
94
  filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
97
95
  human: t.Optional[bool] = None,
@@ -116,13 +114,11 @@ class DanglingIndicesClient(NamespacedClient):
116
114
  from or determine which shard copies are fresh and which are stale, it cannot
117
115
  guarantee that the imported data represents the latest state of the index
118
116
  when it was last in the cluster.
119
- :param master_timeout: Specify timeout for connection to master
120
- :param timeout: Explicit operation timeout
117
+ :param master_timeout: The period to wait for a connection to the master node.
118
+ :param timeout: The period to wait for a response.
121
119
  """
122
120
  if index_uuid in SKIP_IN_PATH:
123
121
  raise ValueError("Empty value passed for parameter 'index_uuid'")
124
- if accept_data_loss is None:
125
- raise ValueError("Empty value passed for parameter 'accept_data_loss'")
126
122
  __path_parts: t.Dict[str, str] = {"index_uuid": _quote(index_uuid)}
127
123
  __path = f'/_dangling/{__path_parts["index_uuid"]}'
128
124
  __query: t.Dict[str, t.Any] = {}
@@ -39,8 +39,8 @@ class EnrichClient(NamespacedClient):
39
39
  """
40
40
  .. raw:: html
41
41
 
42
- <p>Delete an enrich policy.
43
- Deletes an existing enrich policy and its enrich index.</p>
42
+ <p>Delete an enrich policy.</p>
43
+ <p>Deletes an existing enrich policy and its enrich index.</p>
44
44
 
45
45
 
46
46
  `<https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-enrich-delete-policy>`_
@@ -88,8 +88,8 @@ class EnrichClient(NamespacedClient):
88
88
  """
89
89
  .. raw:: html
90
90
 
91
- <p>Run an enrich policy.
92
- Create the enrich index for an existing enrich policy.</p>
91
+ <p>Run an enrich policy.</p>
92
+ <p>Create the enrich index for an existing enrich policy.</p>
93
93
 
94
94
 
95
95
  `<https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-enrich-execute-policy>`_
@@ -140,8 +140,8 @@ class EnrichClient(NamespacedClient):
140
140
  """
141
141
  .. raw:: html
142
142
 
143
- <p>Get an enrich policy.
144
- Returns information about an enrich policy.</p>
143
+ <p>Get an enrich policy.</p>
144
+ <p>Returns information about an enrich policy.</p>
145
145
 
146
146
 
147
147
  `<https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-enrich-get-policy>`_
@@ -198,8 +198,8 @@ class EnrichClient(NamespacedClient):
198
198
  """
199
199
  .. raw:: html
200
200
 
201
- <p>Create an enrich policy.
202
- Creates an enrich policy.</p>
201
+ <p>Create an enrich policy.</p>
202
+ <p>Creates an enrich policy.</p>
203
203
 
204
204
 
205
205
  `<https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-enrich-put-policy>`_
@@ -259,8 +259,8 @@ class EnrichClient(NamespacedClient):
259
259
  """
260
260
  .. raw:: html
261
261
 
262
- <p>Get enrich stats.
263
- Returns enrich coordinator statistics and information about enrich policies that are currently executing.</p>
262
+ <p>Get enrich stats.</p>
263
+ <p>Returns enrich coordinator statistics and information about enrich policies that are currently executing.</p>
264
264
 
265
265
 
266
266
  `<https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-enrich-stats>`_
@@ -38,8 +38,8 @@ class EqlClient(NamespacedClient):
38
38
  """
39
39
  .. raw:: html
40
40
 
41
- <p>Delete an async EQL search.
42
- Delete an async EQL search or a stored synchronous EQL search.
41
+ <p>Delete an async EQL search.</p>
42
+ <p>Delete an async EQL search or a stored synchronous EQL search.
43
43
  The API also deletes results for the search.</p>
44
44
 
45
45
 
@@ -89,8 +89,8 @@ class EqlClient(NamespacedClient):
89
89
  """
90
90
  .. raw:: html
91
91
 
92
- <p>Get async EQL search results.
93
- Get the current status and available results for an async EQL search or a stored synchronous EQL search.</p>
92
+ <p>Get async EQL search results.</p>
93
+ <p>Get the current status and available results for an async EQL search or a stored synchronous EQL search.</p>
94
94
 
95
95
 
96
96
  `<https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-eql-get>`_
@@ -143,8 +143,8 @@ class EqlClient(NamespacedClient):
143
143
  """
144
144
  .. raw:: html
145
145
 
146
- <p>Get the async EQL status.
147
- Get the current status for an async EQL search or a stored synchronous EQL search without returning results.</p>
146
+ <p>Get the async EQL status.</p>
147
+ <p>Get the current status for an async EQL search or a stored synchronous EQL search without returning results.</p>
148
148
 
149
149
 
150
150
  `<https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-eql-get-status>`_
@@ -187,6 +187,7 @@ class EqlClient(NamespacedClient):
187
187
  "keep_alive",
188
188
  "keep_on_completion",
189
189
  "max_samples_per_key",
190
+ "project_routing",
190
191
  "result_position",
191
192
  "runtime_mappings",
192
193
  "size",
@@ -243,14 +244,14 @@ class EqlClient(NamespacedClient):
243
244
  """
244
245
  .. raw:: html
245
246
 
246
- <p>Get EQL search results.
247
- Returns search results for an Event Query Language (EQL) query.
247
+ <p>Get EQL search results.</p>
248
+ <p>Returns search results for an Event Query Language (EQL) query.
248
249
  EQL assumes each document in a data stream or index corresponds to an event.</p>
249
250
 
250
251
 
251
252
  `<https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-eql-search>`_
252
253
 
253
- :param index: The name of the index to scope the operation
254
+ :param index: Comma-separated list of index names to scope the operation
254
255
  :param query: EQL query you wish to run.
255
256
  :param allow_no_indices: Whether to ignore if a wildcard indices expression resolves
256
257
  into no concrete indices. (This includes `_all` string or when no indices
@@ -286,17 +287,17 @@ class EqlClient(NamespacedClient):
286
287
  `size` parameter to get a smaller or larger set of samples. To retrieve more
287
288
  than one sample per set of join keys, use the `max_samples_per_key` parameter.
288
289
  Pipes are not supported for sample queries.
289
- :param project_routing: Specifies a subset of projects to target for the search
290
- using project metadata tags in a subset of Lucene query syntax. Allowed Lucene
291
- queries: the _alias tag and a single value (possibly wildcarded). Examples:
292
- _alias:my-project _alias:_origin _alias:*pr* Supported in serverless only.
290
+ :param project_routing: Specifies a subset of projects to target using project
291
+ metadata tags in a subset of Lucene query syntax. Allowed Lucene queries:
292
+ the _alias tag and a single value (possibly wildcarded). Examples: _alias:my-project
293
+ _alias:_origin _alias:*pr* Supported in serverless only.
293
294
  :param result_position:
294
295
  :param runtime_mappings:
295
296
  :param size: For basic queries, the maximum number of matching events to return.
296
297
  Defaults to 10
297
298
  :param tiebreaker_field: Field used to sort hits with the same timestamp in ascending
298
299
  order
299
- :param timestamp_field: Field containing event timestamp. Default "@timestamp"
300
+ :param timestamp_field: Field containing event timestamp.
300
301
  :param wait_for_completion_timeout:
301
302
  """
302
303
  if index in SKIP_IN_PATH:
@@ -323,8 +324,6 @@ class EqlClient(NamespacedClient):
323
324
  __query["ignore_unavailable"] = ignore_unavailable
324
325
  if pretty is not None:
325
326
  __query["pretty"] = pretty
326
- if project_routing is not None:
327
- __query["project_routing"] = project_routing
328
327
  if not __body:
329
328
  if query is not None:
330
329
  __body["query"] = query
@@ -350,6 +349,8 @@ class EqlClient(NamespacedClient):
350
349
  __body["keep_on_completion"] = keep_on_completion
351
350
  if max_samples_per_key is not None:
352
351
  __body["max_samples_per_key"] = max_samples_per_key
352
+ if project_routing is not None:
353
+ __body["project_routing"] = project_routing
353
354
  if result_position is not None:
354
355
  __body["result_position"] = result_position
355
356
  if runtime_mappings is not None:
@@ -23,13 +23,13 @@ from ._base import NamespacedClient
23
23
  from .utils import (
24
24
  SKIP_IN_PATH,
25
25
  Stability,
26
+ _availability_warning,
26
27
  _quote,
27
28
  _rewrite_parameters,
28
- _stability_warning,
29
29
  )
30
30
 
31
31
  if t.TYPE_CHECKING:
32
- from elasticsearch.esql import ESQLBase
32
+ from ...esql import ESQLBase
33
33
 
34
34
 
35
35
  class EsqlClient(NamespacedClient):
@@ -90,8 +90,8 @@ class EsqlClient(NamespacedClient):
90
90
  """
91
91
  .. raw:: html
92
92
 
93
- <p>Run an async ES|QL query.
94
- Asynchronously run an ES|QL (Elasticsearch query language) query, monitor its progress, and retrieve results when they become available.</p>
93
+ <p>Run an async ES|QL query.</p>
94
+ <p>Asynchronously run an ES|QL (Elasticsearch query language) query, monitor its progress, and retrieve results when they become available.</p>
95
95
  <p>The API accepts the same parameters and request body as the synchronous query API, along with additional async related properties.</p>
96
96
 
97
97
 
@@ -126,10 +126,10 @@ class EsqlClient(NamespacedClient):
126
126
  query, the response will include an extra `_clusters` object with information
127
127
  about the clusters that participated in the search along with info such as
128
128
  shards count.
129
- :param include_execution_metadata: When set to `true` and performing a cross-cluster/cross-project
130
- query, the response will include an extra `_clusters` object with information
131
- about the clusters that participated in the search along with info such as
132
- shards count.
129
+ :param include_execution_metadata: When set to `true`, the response will include
130
+ an extra `_clusters` object with information about the clusters that participated
131
+ in the search along with info such as shards count. This is similar to `include_ccs_metadata`,
132
+ but it also returns metadata when the query is not CCS/CPS
133
133
  :param keep_alive: The period for which the query and its results are stored
134
134
  in the cluster. The default period is five days. When this period expires,
135
135
  the query and its results are deleted, even if the query is still ongoing.
@@ -226,8 +226,8 @@ class EsqlClient(NamespacedClient):
226
226
  """
227
227
  .. raw:: html
228
228
 
229
- <p>Delete an async ES|QL query.
230
- If the query is still running, it is cancelled.
229
+ <p>Delete an async ES|QL query.</p>
230
+ <p>If the query is still running, it is cancelled.
231
231
  Otherwise, the stored results are deleted.</p>
232
232
  <p>If the Elasticsearch security features are enabled, only the following users can use this API to delete a query:</p>
233
233
  <ul>
@@ -292,8 +292,8 @@ class EsqlClient(NamespacedClient):
292
292
  """
293
293
  .. raw:: html
294
294
 
295
- <p>Get async ES|QL query results.
296
- Get the current status and available results or stored results for an ES|QL asynchronous query.
295
+ <p>Get async ES|QL query results.</p>
296
+ <p>Get the current status and available results or stored results for an ES|QL asynchronous query.
297
297
  If the Elasticsearch security features are enabled, only the user who first submitted the ES|QL query can retrieve the results using this API.</p>
298
298
 
299
299
 
@@ -404,7 +404,52 @@ class EsqlClient(NamespacedClient):
404
404
  )
405
405
 
406
406
  @_rewrite_parameters()
407
- @_stability_warning(Stability.EXPERIMENTAL)
407
+ @_availability_warning(Stability.EXPERIMENTAL)
408
+ def delete_view(
409
+ self,
410
+ *,
411
+ name: str,
412
+ error_trace: t.Optional[bool] = None,
413
+ filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
414
+ human: t.Optional[bool] = None,
415
+ pretty: t.Optional[bool] = None,
416
+ ) -> ObjectApiResponse[t.Any]:
417
+ """
418
+ .. raw:: html
419
+
420
+ <p>Delete an ES|QL view.</p>
421
+ <p>Deletes a stored ES|QL view.</p>
422
+
423
+
424
+ `<https://www.elastic.co/docs/api/doc/elasticsearch#TODO>`_
425
+
426
+ :param name: The view name to remove.
427
+ """
428
+ if name in SKIP_IN_PATH:
429
+ raise ValueError("Empty value passed for parameter 'name'")
430
+ __path_parts: t.Dict[str, str] = {"name": _quote(name)}
431
+ __path = f'/_query/view/{__path_parts["name"]}'
432
+ __query: t.Dict[str, t.Any] = {}
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 human is not None:
438
+ __query["human"] = human
439
+ if pretty is not None:
440
+ __query["pretty"] = pretty
441
+ __headers = {"accept": "application/json"}
442
+ return self.perform_request( # type: ignore[return-value]
443
+ "DELETE",
444
+ __path,
445
+ params=__query,
446
+ headers=__headers,
447
+ endpoint_id="esql.delete_view",
448
+ path_parts=__path_parts,
449
+ )
450
+
451
+ @_rewrite_parameters()
452
+ @_availability_warning(Stability.EXPERIMENTAL)
408
453
  def get_query(
409
454
  self,
410
455
  *,
@@ -417,8 +462,8 @@ class EsqlClient(NamespacedClient):
417
462
  """
418
463
  .. raw:: html
419
464
 
420
- <p>Get a specific running ES|QL query information.
421
- Returns an object extended information about a running ES|QL query.</p>
465
+ <p>Get a specific running ES|QL query information.</p>
466
+ <p>Returns an object extended information about a running ES|QL query.</p>
422
467
 
423
468
 
424
469
  `<https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-esql-get-query>`_
@@ -449,7 +494,55 @@ class EsqlClient(NamespacedClient):
449
494
  )
450
495
 
451
496
  @_rewrite_parameters()
452
- @_stability_warning(Stability.EXPERIMENTAL)
497
+ @_availability_warning(Stability.EXPERIMENTAL)
498
+ def get_view(
499
+ self,
500
+ *,
501
+ name: t.Optional[str] = None,
502
+ error_trace: t.Optional[bool] = None,
503
+ filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
504
+ human: t.Optional[bool] = None,
505
+ pretty: t.Optional[bool] = None,
506
+ ) -> ObjectApiResponse[t.Any]:
507
+ """
508
+ .. raw:: html
509
+
510
+ <p>Get an ES|QL view.</p>
511
+ <p>Returns a stored ES|QL view.</p>
512
+
513
+
514
+ `<https://www.elastic.co/docs/api/doc/elasticsearch#TODO>`_
515
+
516
+ :param name: The comma-separated view names to retrieve.
517
+ """
518
+ __path_parts: t.Dict[str, str]
519
+ if name not in SKIP_IN_PATH:
520
+ __path_parts = {"name": _quote(name)}
521
+ __path = f'/_query/view/{__path_parts["name"]}'
522
+ else:
523
+ __path_parts = {}
524
+ __path = "/_query/view"
525
+ __query: t.Dict[str, t.Any] = {}
526
+ if error_trace is not None:
527
+ __query["error_trace"] = error_trace
528
+ if filter_path is not None:
529
+ __query["filter_path"] = filter_path
530
+ if human is not None:
531
+ __query["human"] = human
532
+ if pretty is not None:
533
+ __query["pretty"] = pretty
534
+ __headers = {"accept": "application/json"}
535
+ return self.perform_request( # type: ignore[return-value]
536
+ "GET",
537
+ __path,
538
+ params=__query,
539
+ headers=__headers,
540
+ endpoint_id="esql.get_view",
541
+ path_parts=__path_parts,
542
+ )
543
+
544
+ @_rewrite_parameters()
545
+ @_availability_warning(Stability.EXPERIMENTAL)
453
546
  def list_queries(
454
547
  self,
455
548
  *,
@@ -461,8 +554,8 @@ class EsqlClient(NamespacedClient):
461
554
  """
462
555
  .. raw:: html
463
556
 
464
- <p>Get running ES|QL queries information.
465
- Returns an object containing IDs and other information about the running ES|QL queries.</p>
557
+ <p>Get running ES|QL queries information.</p>
558
+ <p>Returns an object containing IDs and other information about the running ES|QL queries.</p>
466
559
 
467
560
 
468
561
  `<https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-esql-list-queries>`_
@@ -488,6 +581,62 @@ class EsqlClient(NamespacedClient):
488
581
  path_parts=__path_parts,
489
582
  )
490
583
 
584
+ @_rewrite_parameters(
585
+ body_fields=("query",),
586
+ )
587
+ @_availability_warning(Stability.EXPERIMENTAL)
588
+ def put_view(
589
+ self,
590
+ *,
591
+ name: str,
592
+ query: t.Optional[t.Union[str, "ESQLBase"]] = None,
593
+ error_trace: t.Optional[bool] = None,
594
+ filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
595
+ human: t.Optional[bool] = None,
596
+ pretty: t.Optional[bool] = None,
597
+ body: t.Optional[t.Dict[str, t.Any]] = None,
598
+ ) -> ObjectApiResponse[t.Any]:
599
+ """
600
+ .. raw:: html
601
+
602
+ <p>Create or update an ES|QL view.</p>
603
+
604
+
605
+ `<https://www.elastic.co/docs/api/doc/elasticsearch#TODO>`_
606
+
607
+ :param name: The view name to create or update.
608
+ :param query: The ES|QL query string from which to create a view.
609
+ """
610
+ if name in SKIP_IN_PATH:
611
+ raise ValueError("Empty value passed for parameter 'name'")
612
+ if query is None and body is None:
613
+ raise ValueError("Empty value passed for parameter 'query'")
614
+ __path_parts: t.Dict[str, str] = {"name": _quote(name)}
615
+ __path = f'/_query/view/{__path_parts["name"]}'
616
+ __query: t.Dict[str, t.Any] = {}
617
+ __body: t.Dict[str, t.Any] = body if body is not None else {}
618
+ if error_trace is not None:
619
+ __query["error_trace"] = error_trace
620
+ if filter_path is not None:
621
+ __query["filter_path"] = filter_path
622
+ if human is not None:
623
+ __query["human"] = human
624
+ if pretty is not None:
625
+ __query["pretty"] = pretty
626
+ if not __body:
627
+ if query is not None:
628
+ __body["query"] = str(query)
629
+ __headers = {"accept": "application/json", "content-type": "application/json"}
630
+ return self.perform_request( # type: ignore[return-value]
631
+ "PUT",
632
+ __path,
633
+ params=__query,
634
+ headers=__headers,
635
+ body=__body,
636
+ endpoint_id="esql.put_view",
637
+ path_parts=__path_parts,
638
+ )
639
+
491
640
  @_rewrite_parameters(
492
641
  body_fields=(
493
642
  "query",
@@ -543,8 +692,8 @@ class EsqlClient(NamespacedClient):
543
692
  """
544
693
  .. raw:: html
545
694
 
546
- <p>Run an ES|QL query.
547
- Get search results for an ES|QL (Elasticsearch query language) query.</p>
695
+ <p>Run an ES|QL query.</p>
696
+ <p>Get search results for an ES|QL (Elasticsearch query language) query.</p>
548
697
 
549
698
 
550
699
  `<https://www.elastic.co/docs/explore-analyze/query-filter/languages/esql-rest>`_
@@ -575,10 +724,10 @@ class EsqlClient(NamespacedClient):
575
724
  query, the response will include an extra `_clusters` object with information
576
725
  about the clusters that participated in the search along with info such as
577
726
  shards count.
578
- :param include_execution_metadata: When set to `true` and performing a cross-cluster/cross-project
579
- query, the response will include an extra `_clusters` object with information
580
- about the clusters that participated in the search along with info such as
581
- shards count.
727
+ :param include_execution_metadata: When set to `true`, the response will include
728
+ an extra `_clusters` object with information about the clusters that participated
729
+ in the search along with info such as shards count. This is similar to `include_ccs_metadata`,
730
+ but it also returns metadata when the query is not CCS/CPS
582
731
  :param locale:
583
732
  :param params: To avoid any attempts of hacking or code injection, extract the
584
733
  values in a separate list of parameters. Use question mark placeholders (?)
@@ -20,7 +20,7 @@ import typing as t
20
20
  from elastic_transport import ObjectApiResponse
21
21
 
22
22
  from ._base import NamespacedClient
23
- from .utils import Stability, _rewrite_parameters, _stability_warning
23
+ from .utils import Stability, _availability_warning, _rewrite_parameters
24
24
 
25
25
 
26
26
  class FeaturesClient(NamespacedClient):
@@ -38,8 +38,8 @@ class FeaturesClient(NamespacedClient):
38
38
  """
39
39
  .. raw:: html
40
40
 
41
- <p>Get the features.
42
- Get a list of features that can be included in snapshots using the <code>feature_states</code> field when creating a snapshot.
41
+ <p>Get the features.</p>
42
+ <p>Get a list of features that can be included in snapshots using the <code>feature_states</code> field when creating a snapshot.
43
43
  You can use this API to determine which feature states to include when taking a snapshot.
44
44
  By default, all feature states are included in a snapshot if that snapshot includes the global state, or none if it does not.</p>
45
45
  <p>A feature state includes one or more system indices necessary for a given feature to function.
@@ -76,7 +76,7 @@ class FeaturesClient(NamespacedClient):
76
76
  )
77
77
 
78
78
  @_rewrite_parameters()
79
- @_stability_warning(Stability.EXPERIMENTAL)
79
+ @_availability_warning(Stability.EXPERIMENTAL)
80
80
  def reset_features(
81
81
  self,
82
82
  *,
@@ -89,8 +89,8 @@ class FeaturesClient(NamespacedClient):
89
89
  """
90
90
  .. raw:: html
91
91
 
92
- <p>Reset the features.
93
- Clear all of the state information stored in system indices by Elasticsearch features, including the security and machine learning indices.</p>
92
+ <p>Reset the features.</p>
93
+ <p>Clear all of the state information stored in system indices by Elasticsearch features, including the security and machine learning indices.</p>
94
94
  <p>WARNING: Intended for development and testing use only. Do not reset features on a production cluster.</p>
95
95
  <p>Return a cluster to the same state as a new installation by resetting the feature state for all Elasticsearch features.
96
96
  This deletes all state information stored in system indices.</p>
@@ -23,9 +23,9 @@ from ._base import NamespacedClient
23
23
  from .utils import (
24
24
  SKIP_IN_PATH,
25
25
  Stability,
26
+ _availability_warning,
26
27
  _quote,
27
28
  _rewrite_parameters,
28
- _stability_warning,
29
29
  )
30
30
 
31
31
 
@@ -101,7 +101,7 @@ class FleetClient(NamespacedClient):
101
101
  @_rewrite_parameters(
102
102
  body_name="searches",
103
103
  )
104
- @_stability_warning(Stability.EXPERIMENTAL)
104
+ @_availability_warning(Stability.EXPERIMENTAL)
105
105
  def msearch(
106
106
  self,
107
107
  *,
@@ -138,8 +138,8 @@ class FleetClient(NamespacedClient):
138
138
  """
139
139
  .. raw:: html
140
140
 
141
- <p>Run multiple Fleet searches.
142
- Run several Fleet searches with a single API request.
141
+ <p>Run multiple Fleet searches.</p>
142
+ <p>Run several Fleet searches with a single API request.
143
143
  The API follows the same structure as the multi search API.
144
144
  However, similar to the Fleet search API, it supports the <code>wait_for_checkpoints</code> parameter.</p>
145
145
 
@@ -293,7 +293,7 @@ class FleetClient(NamespacedClient):
293
293
  "from": "from_",
294
294
  },
295
295
  )
296
- @_stability_warning(Stability.EXPERIMENTAL)
296
+ @_availability_warning(Stability.EXPERIMENTAL)
297
297
  def search(
298
298
  self,
299
299
  *,
@@ -345,7 +345,7 @@ class FleetClient(NamespacedClient):
345
345
  t.Union[t.Mapping[str, t.Any], t.Sequence[t.Mapping[str, t.Any]]]
346
346
  ] = None,
347
347
  rest_total_hits_as_int: t.Optional[bool] = None,
348
- routing: t.Optional[str] = None,
348
+ routing: t.Optional[t.Union[str, t.Sequence[str]]] = None,
349
349
  runtime_mappings: t.Optional[t.Mapping[str, t.Mapping[str, t.Any]]] = None,
350
350
  script_fields: t.Optional[t.Mapping[str, t.Mapping[str, t.Any]]] = None,
351
351
  scroll: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
@@ -388,8 +388,8 @@ class FleetClient(NamespacedClient):
388
388
  """
389
389
  .. raw:: html
390
390
 
391
- <p>Run a Fleet search.
392
- The purpose of the Fleet search API is to provide an API where the search will be run only
391
+ <p>Run a Fleet search.</p>
392
+ <p>The purpose of the Fleet search API is to provide an API where the search will be run only
393
393
  after the provided checkpoint has been processed and is visible for searches inside of Elasticsearch.</p>
394
394
 
395
395
 
@@ -39,7 +39,7 @@ class GraphClient(NamespacedClient):
39
39
  human: t.Optional[bool] = None,
40
40
  pretty: t.Optional[bool] = None,
41
41
  query: t.Optional[t.Mapping[str, t.Any]] = None,
42
- routing: t.Optional[str] = None,
42
+ routing: t.Optional[t.Union[str, t.Sequence[str]]] = None,
43
43
  timeout: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
44
44
  vertices: t.Optional[t.Sequence[t.Mapping[str, t.Any]]] = None,
45
45
  body: t.Optional[t.Dict[str, t.Any]] = None,
@@ -47,8 +47,8 @@ class GraphClient(NamespacedClient):
47
47
  """
48
48
  .. raw:: html
49
49
 
50
- <p>Explore graph analytics.
51
- Extract and summarize information about the documents and terms in an Elasticsearch data stream or index.
50
+ <p>Explore graph analytics.</p>
51
+ <p>Extract and summarize information about the documents and terms in an Elasticsearch data stream or index.
52
52
  The easiest way to understand the behavior of this API is to use the Graph UI to explore connections.
53
53
  An initial request to the <code>_explore</code> API contains a seed query that identifies the documents of interest and specifies the fields that define the vertices and connections you want to include in the graph.
54
54
  Subsequent requests enable you to spider out from one more vertices of interest.