elasticsearch9 9.2.1__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 (55) hide show
  1. elasticsearch9/_async/client/__init__.py +44 -40
  2. elasticsearch9/_async/client/async_search.py +4 -3
  3. elasticsearch9/_async/client/cat.py +163 -8
  4. elasticsearch9/_async/client/cluster.py +66 -34
  5. elasticsearch9/_async/client/eql.py +7 -6
  6. elasticsearch9/_async/client/esql.py +157 -8
  7. elasticsearch9/_async/client/fleet.py +1 -1
  8. elasticsearch9/_async/client/graph.py +1 -1
  9. elasticsearch9/_async/client/indices.py +436 -17
  10. elasticsearch9/_async/client/inference.py +299 -9
  11. elasticsearch9/_async/client/ml.py +7 -3
  12. elasticsearch9/_async/client/nodes.py +167 -5
  13. elasticsearch9/_async/client/project.py +9 -1
  14. elasticsearch9/_async/client/security.py +26 -3
  15. elasticsearch9/_async/client/snapshot.py +1 -1
  16. elasticsearch9/_async/client/sql.py +7 -6
  17. elasticsearch9/_async/client/streams.py +0 -1
  18. elasticsearch9/_async/client/text_structure.py +3 -3
  19. elasticsearch9/_sync/client/__init__.py +44 -40
  20. elasticsearch9/_sync/client/async_search.py +4 -3
  21. elasticsearch9/_sync/client/cat.py +163 -8
  22. elasticsearch9/_sync/client/cluster.py +66 -34
  23. elasticsearch9/_sync/client/eql.py +7 -6
  24. elasticsearch9/_sync/client/esql.py +157 -8
  25. elasticsearch9/_sync/client/fleet.py +1 -1
  26. elasticsearch9/_sync/client/graph.py +1 -1
  27. elasticsearch9/_sync/client/indices.py +436 -17
  28. elasticsearch9/_sync/client/inference.py +299 -9
  29. elasticsearch9/_sync/client/ml.py +7 -3
  30. elasticsearch9/_sync/client/nodes.py +167 -5
  31. elasticsearch9/_sync/client/project.py +9 -1
  32. elasticsearch9/_sync/client/project_routing.py +264 -0
  33. elasticsearch9/_sync/client/security.py +26 -3
  34. elasticsearch9/_sync/client/snapshot.py +1 -1
  35. elasticsearch9/_sync/client/sql.py +7 -6
  36. elasticsearch9/_sync/client/streams.py +0 -1
  37. elasticsearch9/_sync/client/text_structure.py +3 -3
  38. elasticsearch9/_version.py +2 -2
  39. elasticsearch9/dsl/__init__.py +4 -0
  40. elasticsearch9/dsl/aggs.py +6 -6
  41. elasticsearch9/dsl/field.py +91 -7
  42. elasticsearch9/dsl/query.py +2 -2
  43. elasticsearch9/dsl/response/__init__.py +2 -0
  44. elasticsearch9/dsl/types.py +66 -7
  45. elasticsearch9/dsl/utils.py +11 -2
  46. elasticsearch9/esql/functions.py +924 -250
  47. elasticsearch9/helpers/__init__.py +2 -0
  48. elasticsearch9/helpers/actions.py +21 -0
  49. elasticsearch9/helpers/vectorstore/_async/vectorstore.py +3 -0
  50. elasticsearch9/helpers/vectorstore/_sync/vectorstore.py +3 -0
  51. {elasticsearch9-9.2.1.dist-info → elasticsearch9-9.3.0.dist-info}/METADATA +2 -1
  52. {elasticsearch9-9.2.1.dist-info → elasticsearch9-9.3.0.dist-info}/RECORD +55 -54
  53. {elasticsearch9-9.2.1.dist-info → elasticsearch9-9.3.0.dist-info}/WHEEL +0 -0
  54. {elasticsearch9-9.2.1.dist-info → elasticsearch9-9.3.0.dist-info}/licenses/LICENSE +0 -0
  55. {elasticsearch9-9.2.1.dist-info → elasticsearch9-9.3.0.dist-info}/licenses/NOTICE +0 -0
@@ -328,6 +328,149 @@ class CatClient(NamespacedClient):
328
328
  path_parts=__path_parts,
329
329
  )
330
330
 
331
+ @_rewrite_parameters()
332
+ def circuit_breaker(
333
+ self,
334
+ *,
335
+ circuit_breaker_patterns: t.Optional[t.Union[str, t.Sequence[str]]] = None,
336
+ bytes: t.Optional[
337
+ t.Union[str, t.Literal["b", "gb", "kb", "mb", "pb", "tb"]]
338
+ ] = None,
339
+ error_trace: t.Optional[bool] = None,
340
+ filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
341
+ format: t.Optional[str] = None,
342
+ h: t.Optional[
343
+ t.Union[
344
+ t.Sequence[
345
+ t.Union[
346
+ str,
347
+ t.Literal[
348
+ "breaker",
349
+ "estimated",
350
+ "estimated_bytes",
351
+ "limit",
352
+ "limit_bytes",
353
+ "node_id",
354
+ "node_name",
355
+ "overhead",
356
+ "tripped",
357
+ ],
358
+ ]
359
+ ],
360
+ t.Union[
361
+ str,
362
+ t.Literal[
363
+ "breaker",
364
+ "estimated",
365
+ "estimated_bytes",
366
+ "limit",
367
+ "limit_bytes",
368
+ "node_id",
369
+ "node_name",
370
+ "overhead",
371
+ "tripped",
372
+ ],
373
+ ],
374
+ ]
375
+ ] = None,
376
+ help: t.Optional[bool] = None,
377
+ human: t.Optional[bool] = None,
378
+ local: t.Optional[bool] = None,
379
+ master_timeout: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
380
+ pretty: t.Optional[bool] = None,
381
+ s: t.Optional[t.Union[str, t.Sequence[str]]] = None,
382
+ time: t.Optional[
383
+ t.Union[str, t.Literal["d", "h", "m", "micros", "ms", "nanos", "s"]]
384
+ ] = None,
385
+ v: t.Optional[bool] = None,
386
+ ) -> t.Union[ObjectApiResponse[t.Any], TextApiResponse]:
387
+ """
388
+ .. raw:: html
389
+
390
+ <p>Get circuit breakers statistics.</p>
391
+ <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>
392
+
393
+
394
+ `<https://www.elastic.co/docs/api/doc/elasticsearch#TODO>`_
395
+
396
+ :param circuit_breaker_patterns: A comma-separated list of regular-expressions
397
+ to filter the circuit breakers in the output
398
+ :param bytes: Sets the units for columns that contain a byte-size value. Note
399
+ that byte-size value units work in terms of powers of 1024. For instance
400
+ `1kb` means 1024 bytes, not 1000 bytes. If omitted, byte-size values are
401
+ rendered with a suffix such as `kb`, `mb`, or `gb`, chosen such that the
402
+ numeric value of the column is as small as possible whilst still being at
403
+ least `1.0`. If given, byte-size values are rendered as an integer with no
404
+ suffix, representing the value of the column in the chosen unit. Values that
405
+ are not an exact multiple of the chosen unit are rounded down.
406
+ :param format: Specifies the format to return the columnar data in, can be set
407
+ to `text`, `json`, `cbor`, `yaml`, or `smile`.
408
+ :param h: A comma-separated list of columns names to display. It supports simple
409
+ wildcards.
410
+ :param help: When set to `true` will output available columns. This option can't
411
+ be combined with any other query string option.
412
+ :param local: If `true`, the request computes the list of selected nodes from
413
+ the local cluster state. If `false` the list of selected nodes are computed
414
+ from the cluster state of the master node. In both cases the coordinating
415
+ node will send requests for further information to each selected node.
416
+ :param master_timeout: Period to wait for a connection to the master node.
417
+ :param s: List of columns that determine how the table should be sorted. Sorting
418
+ defaults to ascending and can be changed by setting `:asc` or `:desc` as
419
+ a suffix to the column name.
420
+ :param time: Sets the units for columns that contain a time duration. If omitted,
421
+ time duration values are rendered with a suffix such as `ms`, `s`, `m` or
422
+ `h`, chosen such that the numeric value of the column is as small as possible
423
+ whilst still being at least `1.0`. If given, time duration values are rendered
424
+ as an integer with no suffix. Values that are not an exact multiple of the
425
+ chosen unit are rounded down.
426
+ :param v: When set to `true` will enable verbose output.
427
+ """
428
+ __path_parts: t.Dict[str, str]
429
+ if circuit_breaker_patterns not in SKIP_IN_PATH:
430
+ __path_parts = {
431
+ "circuit_breaker_patterns": _quote(circuit_breaker_patterns)
432
+ }
433
+ __path = f'/_cat/circuit_breaker/{__path_parts["circuit_breaker_patterns"]}'
434
+ else:
435
+ __path_parts = {}
436
+ __path = "/_cat/circuit_breaker"
437
+ __query: t.Dict[str, t.Any] = {}
438
+ if bytes is not None:
439
+ __query["bytes"] = bytes
440
+ if error_trace is not None:
441
+ __query["error_trace"] = error_trace
442
+ if filter_path is not None:
443
+ __query["filter_path"] = filter_path
444
+ if format is not None:
445
+ __query["format"] = format
446
+ if h is not None:
447
+ __query["h"] = h
448
+ if help is not None:
449
+ __query["help"] = help
450
+ if human is not None:
451
+ __query["human"] = human
452
+ if local is not None:
453
+ __query["local"] = local
454
+ if master_timeout is not None:
455
+ __query["master_timeout"] = master_timeout
456
+ if pretty is not None:
457
+ __query["pretty"] = pretty
458
+ if s is not None:
459
+ __query["s"] = s
460
+ if time is not None:
461
+ __query["time"] = time
462
+ if v is not None:
463
+ __query["v"] = v
464
+ __headers = {"accept": "text/plain,application/json"}
465
+ return self.perform_request( # type: ignore[return-value]
466
+ "GET",
467
+ __path,
468
+ params=__query,
469
+ headers=__headers,
470
+ endpoint_id="cat.circuit_breaker",
471
+ path_parts=__path_parts,
472
+ )
473
+
331
474
  @_rewrite_parameters()
332
475
  def component_templates(
333
476
  self,
@@ -468,7 +611,9 @@ class CatClient(NamespacedClient):
468
611
  path_parts=__path_parts,
469
612
  )
470
613
 
471
- @_rewrite_parameters()
614
+ @_rewrite_parameters(
615
+ body_fields=("project_routing",),
616
+ )
472
617
  def count(
473
618
  self,
474
619
  *,
@@ -494,6 +639,7 @@ class CatClient(NamespacedClient):
494
639
  t.Union[str, t.Literal["d", "h", "m", "micros", "ms", "nanos", "s"]]
495
640
  ] = None,
496
641
  v: t.Optional[bool] = None,
642
+ body: t.Optional[t.Dict[str, t.Any]] = None,
497
643
  ) -> t.Union[ObjectApiResponse[t.Any], TextApiResponse]:
498
644
  """
499
645
  .. raw:: html
@@ -524,10 +670,10 @@ class CatClient(NamespacedClient):
524
670
  wildcards.
525
671
  :param help: When set to `true` will output available columns. This option can't
526
672
  be combined with any other query string option.
527
- :param project_routing: Specifies a subset of projects to target for the search
528
- using project metadata tags in a subset of Lucene query syntax. Allowed Lucene
529
- queries: the _alias tag and a single value (possibly wildcarded). Examples:
530
- _alias:my-project _alias:_origin _alias:*pr* Supported in serverless only.
673
+ :param project_routing: Specifies a subset of projects to target using project
674
+ metadata tags in a subset of Lucene query syntax. Allowed Lucene queries:
675
+ the _alias tag and a single value (possibly wildcarded). Examples: _alias:my-project
676
+ _alias:_origin _alias:*pr* Supported in serverless only.
531
677
  :param s: List of columns that determine how the table should be sorted. Sorting
532
678
  defaults to ascending and can be changed by setting `:asc` or `:desc` as
533
679
  a suffix to the column name.
@@ -547,6 +693,7 @@ class CatClient(NamespacedClient):
547
693
  __path_parts = {}
548
694
  __path = "/_cat/count"
549
695
  __query: t.Dict[str, t.Any] = {}
696
+ __body: t.Dict[str, t.Any] = body if body is not None else {}
550
697
  if bytes is not None:
551
698
  __query["bytes"] = bytes
552
699
  if error_trace is not None:
@@ -563,20 +710,26 @@ class CatClient(NamespacedClient):
563
710
  __query["human"] = human
564
711
  if pretty is not None:
565
712
  __query["pretty"] = pretty
566
- if project_routing is not None:
567
- __query["project_routing"] = project_routing
568
713
  if s is not None:
569
714
  __query["s"] = s
570
715
  if time is not None:
571
716
  __query["time"] = time
572
717
  if v is not None:
573
718
  __query["v"] = v
719
+ if not __body:
720
+ if project_routing is not None:
721
+ __body["project_routing"] = project_routing
722
+ if not __body:
723
+ __body = None # type: ignore[assignment]
574
724
  __headers = {"accept": "text/plain,application/json"}
725
+ if __body is not None:
726
+ __headers["content-type"] = "application/json"
575
727
  return self.perform_request( # type: ignore[return-value]
576
- "GET",
728
+ "POST",
577
729
  __path,
578
730
  params=__query,
579
731
  headers=__headers,
732
+ body=__body,
580
733
  endpoint_id="cat.count",
581
734
  path_parts=__path_parts,
582
735
  )
@@ -2516,6 +2669,7 @@ class CatClient(NamespacedClient):
2516
2669
  t.Union[
2517
2670
  str,
2518
2671
  t.Literal[
2672
+ "available_processors",
2519
2673
  "build",
2520
2674
  "completion.size",
2521
2675
  "cpu",
@@ -2611,6 +2765,7 @@ class CatClient(NamespacedClient):
2611
2765
  t.Union[
2612
2766
  str,
2613
2767
  t.Literal[
2768
+ "available_processors",
2614
2769
  "build",
2615
2770
  "completion.size",
2616
2771
  "cpu",
@@ -302,8 +302,8 @@ class ClusterClient(NamespacedClient):
302
302
 
303
303
  `<https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-cluster-put-component-template>`_
304
304
 
305
- :param name: Comma-separated list of component template names used to limit the
306
- request. Wildcard (`*`) expressions are supported.
305
+ :param name: Name of component template to retrieve. Wildcard (`*`) expressions
306
+ are supported.
307
307
  :param flat_settings: If `true`, returns settings in flat format.
308
308
  :param include_defaults: Return all default configurations for the component
309
309
  template
@@ -470,39 +470,38 @@ class ClusterClient(NamespacedClient):
470
470
 
471
471
  `<https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-cluster-health>`_
472
472
 
473
- :param index: Comma-separated list of data streams, indices, and index aliases
474
- used to limit the request. Wildcard expressions (`*`) are supported. To target
473
+ :param index: A comma-separated list of data streams, indices, and index aliases
474
+ that limit the request. Wildcard expressions (`*`) are supported. To target
475
475
  all data streams and indices in a cluster, omit this parameter or use _all
476
476
  or `*`.
477
- :param expand_wildcards: Whether to expand wildcard expression to concrete indices
478
- that are open, closed or both.
479
- :param level: Can be one of cluster, indices or shards. Controls the details
480
- level of the health information returned.
481
- :param local: If true, the request retrieves information from the local node
482
- only. Defaults to false, which means information is retrieved from the master
483
- node.
484
- :param master_timeout: Period to wait for a connection to the master node. If
485
- no response is received before the timeout expires, the request fails and
486
- returns an error.
487
- :param timeout: Period to wait for a response. If no response is received before
488
- the timeout expires, the request fails and returns an error.
489
- :param wait_for_active_shards: A number controlling to how many active shards
490
- to wait for, all to wait for all shards in the cluster to be active, or 0
491
- to not wait.
492
- :param wait_for_events: Can be one of immediate, urgent, high, normal, low, languid.
493
- Wait until all currently queued events with the given priority are processed.
494
- :param wait_for_no_initializing_shards: A boolean value which controls whether
495
- to wait (until the timeout provided) for the cluster to have no shard initializations.
496
- Defaults to false, which means it will not wait for initializing shards.
497
- :param wait_for_no_relocating_shards: A boolean value which controls whether
498
- to wait (until the timeout provided) for the cluster to have no shard relocations.
499
- Defaults to false, which means it will not wait for relocating shards.
500
- :param wait_for_nodes: The request waits until the specified number N of nodes
501
- is available. It also accepts >=N, <=N, >N and <N. Alternatively, it is possible
502
- to use ge(N), le(N), gt(N) and lt(N) notation.
503
- :param wait_for_status: One of green, yellow or red. Will wait (until the timeout
504
- provided) until the status of the cluster changes to the one provided or
505
- better, i.e. green > yellow > red. By default, will not wait for any status.
477
+ :param expand_wildcards: Expand wildcard expression to concrete indices that
478
+ are open, closed or both.
479
+ :param level: Return health information at a specific level of detail.
480
+ :param local: If true, retrieve information from the local node only. If false,
481
+ retrieve information from the master node.
482
+ :param master_timeout: The period to wait for a connection to the master node.
483
+ If no response is received before the timeout expires, the request fails
484
+ and returns an error.
485
+ :param timeout: The period to wait for a response. If no response is received
486
+ before the timeout expires, the request fails and returns an error.
487
+ :param wait_for_active_shards: Wait for the specified number of active shards.
488
+ Use `all` to wait for all shards in the cluster to be active. Use `0` to
489
+ not wait.
490
+ :param wait_for_events: Wait until all currently queued events with the given
491
+ priority are processed.
492
+ :param wait_for_no_initializing_shards: Wait (until the timeout expires) for
493
+ the cluster to have no shard initializations. If false, the request does
494
+ not wait for initializing shards.
495
+ :param wait_for_no_relocating_shards: Wait (until the timeout expires) for the
496
+ cluster to have no shard relocations. If false, the request not wait for
497
+ relocating shards.
498
+ :param wait_for_nodes: Wait until the specified number (N) of nodes is available.
499
+ It also accepts `>=N`, `<=N`, `>N` and `<N`. Alternatively, use the notations
500
+ `ge(N)`, `le(N)`, `gt(N)`, and `lt(N)`.
501
+ :param wait_for_status: Wait (until the timeout expires) for the cluster to reach
502
+ a specific health status (or a better status). A green status is better than
503
+ yellow and yellow is better than red. By default, the request does not wait
504
+ for a particular status.
506
505
  """
507
506
  __path_parts: t.Dict[str, str]
508
507
  if index not in SKIP_IN_PATH:
@@ -1068,7 +1067,40 @@ class ClusterClient(NamespacedClient):
1068
1067
  def state(
1069
1068
  self,
1070
1069
  *,
1071
- metric: t.Optional[t.Union[str, t.Sequence[str]]] = None,
1070
+ metric: t.Optional[
1071
+ t.Union[
1072
+ t.Sequence[
1073
+ t.Union[
1074
+ str,
1075
+ t.Literal[
1076
+ "_all",
1077
+ "blocks",
1078
+ "customs",
1079
+ "master_node",
1080
+ "metadata",
1081
+ "nodes",
1082
+ "routing_nodes",
1083
+ "routing_table",
1084
+ "version",
1085
+ ],
1086
+ ]
1087
+ ],
1088
+ t.Union[
1089
+ str,
1090
+ t.Literal[
1091
+ "_all",
1092
+ "blocks",
1093
+ "customs",
1094
+ "master_node",
1095
+ "metadata",
1096
+ "nodes",
1097
+ "routing_nodes",
1098
+ "routing_table",
1099
+ "version",
1100
+ ],
1101
+ ],
1102
+ ]
1103
+ ] = None,
1072
1104
  index: t.Optional[t.Union[str, t.Sequence[str]]] = None,
1073
1105
  allow_no_indices: t.Optional[bool] = None,
1074
1106
  error_trace: t.Optional[bool] = None,
@@ -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",
@@ -286,10 +287,10 @@ 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.
@@ -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:
@@ -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.
@@ -403,6 +403,51 @@ class EsqlClient(NamespacedClient):
403
403
  path_parts=__path_parts,
404
404
  )
405
405
 
406
+ @_rewrite_parameters()
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
+
406
451
  @_rewrite_parameters()
407
452
  @_availability_warning(Stability.EXPERIMENTAL)
408
453
  def get_query(
@@ -448,6 +493,54 @@ class EsqlClient(NamespacedClient):
448
493
  path_parts=__path_parts,
449
494
  )
450
495
 
496
+ @_rewrite_parameters()
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
+
451
544
  @_rewrite_parameters()
452
545
  @_availability_warning(Stability.EXPERIMENTAL)
453
546
  def 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",
@@ -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 (?)
@@ -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,
@@ -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,