elasticsearch 8.11.1__py3-none-any.whl → 8.12.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 (90) hide show
  1. elasticsearch/_async/client/__init__.py +493 -347
  2. elasticsearch/_async/client/async_search.py +108 -72
  3. elasticsearch/_async/client/autoscaling.py +13 -8
  4. elasticsearch/_async/client/cat.py +26 -26
  5. elasticsearch/_async/client/ccr.py +178 -117
  6. elasticsearch/_async/client/cluster.py +56 -48
  7. elasticsearch/_async/client/dangling_indices.py +3 -3
  8. elasticsearch/_async/client/enrich.py +15 -13
  9. elasticsearch/_async/client/eql.py +53 -36
  10. elasticsearch/_async/client/esql.py +99 -0
  11. elasticsearch/_async/client/features.py +2 -2
  12. elasticsearch/_async/client/fleet.py +111 -71
  13. elasticsearch/_async/client/graph.py +13 -11
  14. elasticsearch/_async/client/ilm.py +33 -27
  15. elasticsearch/_async/client/indices.py +326 -227
  16. elasticsearch/_async/client/inference.py +212 -0
  17. elasticsearch/_async/client/ingest.py +28 -24
  18. elasticsearch/_async/client/license.py +15 -13
  19. elasticsearch/_async/client/logstash.py +13 -10
  20. elasticsearch/_async/client/migration.py +3 -3
  21. elasticsearch/_async/client/ml.py +758 -538
  22. elasticsearch/_async/client/monitoring.py +10 -5
  23. elasticsearch/_async/client/nodes.py +13 -11
  24. elasticsearch/_async/client/query_ruleset.py +12 -10
  25. elasticsearch/_async/client/rollup.py +59 -46
  26. elasticsearch/_async/client/search_application.py +23 -16
  27. elasticsearch/_async/client/searchable_snapshots.py +23 -16
  28. elasticsearch/_async/client/security.py +391 -289
  29. elasticsearch/_async/client/shutdown.py +18 -14
  30. elasticsearch/_async/client/slm.py +23 -21
  31. elasticsearch/_async/client/snapshot.py +91 -65
  32. elasticsearch/_async/client/sql.py +81 -58
  33. elasticsearch/_async/client/ssl.py +1 -1
  34. elasticsearch/_async/client/synonyms.py +23 -19
  35. elasticsearch/_async/client/tasks.py +3 -3
  36. elasticsearch/_async/client/text_structure.py +10 -5
  37. elasticsearch/_async/client/transform.py +111 -75
  38. elasticsearch/_async/client/watcher.py +77 -55
  39. elasticsearch/_async/client/xpack.py +2 -2
  40. elasticsearch/_async/helpers.py +1 -1
  41. elasticsearch/_sync/client/__init__.py +493 -347
  42. elasticsearch/_sync/client/async_search.py +108 -72
  43. elasticsearch/_sync/client/autoscaling.py +13 -8
  44. elasticsearch/_sync/client/cat.py +26 -26
  45. elasticsearch/_sync/client/ccr.py +178 -117
  46. elasticsearch/_sync/client/cluster.py +56 -48
  47. elasticsearch/_sync/client/dangling_indices.py +3 -3
  48. elasticsearch/_sync/client/enrich.py +15 -13
  49. elasticsearch/_sync/client/eql.py +53 -36
  50. elasticsearch/_sync/client/esql.py +99 -0
  51. elasticsearch/_sync/client/features.py +2 -2
  52. elasticsearch/_sync/client/fleet.py +111 -71
  53. elasticsearch/_sync/client/graph.py +13 -11
  54. elasticsearch/_sync/client/ilm.py +33 -27
  55. elasticsearch/_sync/client/indices.py +326 -227
  56. elasticsearch/_sync/client/inference.py +212 -0
  57. elasticsearch/_sync/client/ingest.py +28 -24
  58. elasticsearch/_sync/client/license.py +15 -13
  59. elasticsearch/_sync/client/logstash.py +13 -10
  60. elasticsearch/_sync/client/migration.py +3 -3
  61. elasticsearch/_sync/client/ml.py +758 -538
  62. elasticsearch/_sync/client/monitoring.py +10 -5
  63. elasticsearch/_sync/client/nodes.py +13 -11
  64. elasticsearch/_sync/client/query_ruleset.py +12 -10
  65. elasticsearch/_sync/client/rollup.py +59 -46
  66. elasticsearch/_sync/client/search_application.py +23 -16
  67. elasticsearch/_sync/client/searchable_snapshots.py +23 -16
  68. elasticsearch/_sync/client/security.py +391 -289
  69. elasticsearch/_sync/client/shutdown.py +18 -14
  70. elasticsearch/_sync/client/slm.py +23 -21
  71. elasticsearch/_sync/client/snapshot.py +91 -65
  72. elasticsearch/_sync/client/sql.py +81 -58
  73. elasticsearch/_sync/client/ssl.py +1 -1
  74. elasticsearch/_sync/client/synonyms.py +23 -19
  75. elasticsearch/_sync/client/tasks.py +3 -3
  76. elasticsearch/_sync/client/text_structure.py +10 -5
  77. elasticsearch/_sync/client/transform.py +111 -75
  78. elasticsearch/_sync/client/utils.py +34 -10
  79. elasticsearch/_sync/client/watcher.py +77 -55
  80. elasticsearch/_sync/client/xpack.py +2 -2
  81. elasticsearch/_version.py +1 -1
  82. elasticsearch/client.py +2 -0
  83. elasticsearch/helpers/actions.py +1 -1
  84. {elasticsearch-8.11.1.dist-info → elasticsearch-8.12.0.dist-info}/METADATA +2 -3
  85. elasticsearch-8.12.0.dist-info/RECORD +103 -0
  86. elasticsearch-8.11.1.dist-info/RECORD +0 -99
  87. {elasticsearch-8.11.1.dist-info → elasticsearch-8.12.0.dist-info}/LICENSE +0 -0
  88. {elasticsearch-8.11.1.dist-info → elasticsearch-8.12.0.dist-info}/NOTICE +0 -0
  89. {elasticsearch-8.11.1.dist-info → elasticsearch-8.12.0.dist-info}/WHEEL +0 -0
  90. {elasticsearch-8.11.1.dist-info → elasticsearch-8.12.0.dist-info}/top_level.txt +0 -0
@@ -25,7 +25,7 @@ from .utils import SKIP_IN_PATH, _quote, _rewrite_parameters
25
25
 
26
26
  class ClusterClient(NamespacedClient):
27
27
  @_rewrite_parameters(
28
- body_fields=True,
28
+ body_fields=("current_node", "index", "primary", "shard"),
29
29
  )
30
30
  def allocation_explain(
31
31
  self,
@@ -40,11 +40,12 @@ class ClusterClient(NamespacedClient):
40
40
  pretty: t.Optional[bool] = None,
41
41
  primary: t.Optional[bool] = None,
42
42
  shard: t.Optional[int] = None,
43
+ body: t.Optional[t.Dict[str, t.Any]] = None,
43
44
  ) -> ObjectApiResponse[t.Any]:
44
45
  """
45
46
  Provides explanations for shard allocations in the cluster.
46
47
 
47
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.11/cluster-allocation-explain.html>`_
48
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.12/cluster-allocation-explain.html>`_
48
49
 
49
50
  :param current_node: Specifies the node ID or the name of the node to only explain
50
51
  a shard that is currently located on the specified node.
@@ -59,10 +60,8 @@ class ClusterClient(NamespacedClient):
59
60
  for.
60
61
  """
61
62
  __path = "/_cluster/allocation/explain"
62
- __body: t.Dict[str, t.Any] = {}
63
63
  __query: t.Dict[str, t.Any] = {}
64
- if current_node is not None:
65
- __body["current_node"] = current_node
64
+ __body: t.Dict[str, t.Any] = body if body is not None else {}
66
65
  if error_trace is not None:
67
66
  __query["error_trace"] = error_trace
68
67
  if filter_path is not None:
@@ -73,14 +72,17 @@ class ClusterClient(NamespacedClient):
73
72
  __query["include_disk_info"] = include_disk_info
74
73
  if include_yes_decisions is not None:
75
74
  __query["include_yes_decisions"] = include_yes_decisions
76
- if index is not None:
77
- __body["index"] = index
78
75
  if pretty is not None:
79
76
  __query["pretty"] = pretty
80
- if primary is not None:
81
- __body["primary"] = primary
82
- if shard is not None:
83
- __body["shard"] = shard
77
+ if not __body:
78
+ if current_node is not None:
79
+ __body["current_node"] = current_node
80
+ if index is not None:
81
+ __body["index"] = index
82
+ if primary is not None:
83
+ __body["primary"] = primary
84
+ if shard is not None:
85
+ __body["shard"] = shard
84
86
  if not __body:
85
87
  __body = None # type: ignore[assignment]
86
88
  __headers = {"accept": "application/json"}
@@ -107,7 +109,7 @@ class ClusterClient(NamespacedClient):
107
109
  """
108
110
  Deletes a component template
109
111
 
110
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.11/indices-component-template.html>`_
112
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.12/indices-component-template.html>`_
111
113
 
112
114
  :param name: Comma-separated list or wildcard expression of component template
113
115
  names used to limit the request.
@@ -151,7 +153,7 @@ class ClusterClient(NamespacedClient):
151
153
  """
152
154
  Clears cluster voting config exclusions.
153
155
 
154
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.11/voting-config-exclusions.html>`_
156
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.12/voting-config-exclusions.html>`_
155
157
 
156
158
  :param wait_for_removal: Specifies whether to wait for all excluded nodes to
157
159
  be removed from the cluster before clearing the voting configuration exclusions
@@ -194,7 +196,7 @@ class ClusterClient(NamespacedClient):
194
196
  """
195
197
  Returns information about whether a particular component template exist
196
198
 
197
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.11/indices-component-template.html>`_
199
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.12/indices-component-template.html>`_
198
200
 
199
201
  :param name: Comma-separated list of component template names used to limit the
200
202
  request. Wildcard (*) expressions are supported.
@@ -245,7 +247,7 @@ class ClusterClient(NamespacedClient):
245
247
  """
246
248
  Returns one or more component templates
247
249
 
248
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.11/indices-component-template.html>`_
250
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.12/indices-component-template.html>`_
249
251
 
250
252
  :param name: Comma-separated list of component template names used to limit the
251
253
  request. Wildcard (`*`) expressions are supported.
@@ -302,7 +304,7 @@ class ClusterClient(NamespacedClient):
302
304
  """
303
305
  Returns cluster settings.
304
306
 
305
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.11/cluster-get-settings.html>`_
307
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.12/cluster-get-settings.html>`_
306
308
 
307
309
  :param flat_settings: If `true`, returns settings in flat format.
308
310
  :param include_defaults: If `true`, returns default cluster settings from the
@@ -380,7 +382,7 @@ class ClusterClient(NamespacedClient):
380
382
  """
381
383
  Returns basic information about the health of the cluster.
382
384
 
383
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.11/cluster-health.html>`_
385
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.12/cluster-health.html>`_
384
386
 
385
387
  :param index: Comma-separated list of data streams, indices, and index aliases
386
388
  used to limit the request. Wildcard expressions (*) are supported. To target
@@ -478,7 +480,7 @@ class ClusterClient(NamespacedClient):
478
480
  """
479
481
  Returns different information about the cluster.
480
482
 
481
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.11/cluster-info.html>`_
483
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.12/cluster-info.html>`_
482
484
 
483
485
  :param target: Limits the information returned to the specific target. Supports
484
486
  a comma-separated list, such as http,ingest.
@@ -517,7 +519,7 @@ class ClusterClient(NamespacedClient):
517
519
  Returns a list of any cluster-level changes (e.g. create index, update mapping,
518
520
  allocate or fail shard) which have not yet been executed.
519
521
 
520
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.11/cluster-pending.html>`_
522
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.12/cluster-pending.html>`_
521
523
 
522
524
  :param local: If `true`, the request retrieves information from the local node
523
525
  only. If `false`, information is retrieved from the master node.
@@ -559,7 +561,7 @@ class ClusterClient(NamespacedClient):
559
561
  """
560
562
  Updates the cluster voting config exclusions by node ids or node names.
561
563
 
562
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.11/voting-config-exclusions.html>`_
564
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.12/voting-config-exclusions.html>`_
563
565
 
564
566
  :param node_ids: A comma-separated list of the persistent ids of the nodes to
565
567
  exclude from the voting configuration. If specified, you may not also specify
@@ -593,14 +595,14 @@ class ClusterClient(NamespacedClient):
593
595
  )
594
596
 
595
597
  @_rewrite_parameters(
596
- body_fields=True,
598
+ body_fields=("template", "allow_auto_create", "meta", "version"),
597
599
  parameter_aliases={"_meta": "meta"},
598
600
  )
599
601
  def put_component_template(
600
602
  self,
601
603
  *,
602
604
  name: str,
603
- template: t.Mapping[str, t.Any],
605
+ template: t.Optional[t.Mapping[str, t.Any]] = None,
604
606
  allow_auto_create: t.Optional[bool] = None,
605
607
  create: t.Optional[bool] = None,
606
608
  error_trace: t.Optional[bool] = None,
@@ -612,11 +614,12 @@ class ClusterClient(NamespacedClient):
612
614
  meta: t.Optional[t.Mapping[str, t.Any]] = None,
613
615
  pretty: t.Optional[bool] = None,
614
616
  version: t.Optional[int] = None,
617
+ body: t.Optional[t.Dict[str, t.Any]] = None,
615
618
  ) -> ObjectApiResponse[t.Any]:
616
619
  """
617
620
  Creates or updates a component template
618
621
 
619
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.11/indices-component-template.html>`_
622
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.12/indices-component-template.html>`_
620
623
 
621
624
  :param name: Name of the component template to create. Elasticsearch includes
622
625
  the following built-in component templates: `logs-mappings`; 'logs-settings`;
@@ -649,15 +652,11 @@ class ClusterClient(NamespacedClient):
649
652
  """
650
653
  if name in SKIP_IN_PATH:
651
654
  raise ValueError("Empty value passed for parameter 'name'")
652
- if template is None:
655
+ if template is None and body is None:
653
656
  raise ValueError("Empty value passed for parameter 'template'")
654
657
  __path = f"/_component_template/{_quote(name)}"
655
- __body: t.Dict[str, t.Any] = {}
656
658
  __query: t.Dict[str, t.Any] = {}
657
- if template is not None:
658
- __body["template"] = template
659
- if allow_auto_create is not None:
660
- __body["allow_auto_create"] = allow_auto_create
659
+ __body: t.Dict[str, t.Any] = body if body is not None else {}
661
660
  if create is not None:
662
661
  __query["create"] = create
663
662
  if error_trace is not None:
@@ -668,19 +667,24 @@ class ClusterClient(NamespacedClient):
668
667
  __query["human"] = human
669
668
  if master_timeout is not None:
670
669
  __query["master_timeout"] = master_timeout
671
- if meta is not None:
672
- __body["_meta"] = meta
673
670
  if pretty is not None:
674
671
  __query["pretty"] = pretty
675
- if version is not None:
676
- __body["version"] = version
672
+ if not __body:
673
+ if template is not None:
674
+ __body["template"] = template
675
+ if allow_auto_create is not None:
676
+ __body["allow_auto_create"] = allow_auto_create
677
+ if meta is not None:
678
+ __body["_meta"] = meta
679
+ if version is not None:
680
+ __body["version"] = version
677
681
  __headers = {"accept": "application/json", "content-type": "application/json"}
678
682
  return self.perform_request( # type: ignore[return-value]
679
683
  "PUT", __path, params=__query, headers=__headers, body=__body
680
684
  )
681
685
 
682
686
  @_rewrite_parameters(
683
- body_fields=True,
687
+ body_fields=("persistent", "transient"),
684
688
  )
685
689
  def put_settings(
686
690
  self,
@@ -696,11 +700,12 @@ class ClusterClient(NamespacedClient):
696
700
  pretty: t.Optional[bool] = None,
697
701
  timeout: t.Optional[t.Union["t.Literal[-1]", "t.Literal[0]", str]] = None,
698
702
  transient: t.Optional[t.Mapping[str, t.Any]] = None,
703
+ body: t.Optional[t.Dict[str, t.Any]] = None,
699
704
  ) -> ObjectApiResponse[t.Any]:
700
705
  """
701
706
  Updates the cluster settings.
702
707
 
703
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.11/cluster-update-settings.html>`_
708
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.12/cluster-update-settings.html>`_
704
709
 
705
710
  :param flat_settings: Return settings in flat format (default: false)
706
711
  :param master_timeout: Explicit operation timeout for connection to master node
@@ -710,7 +715,7 @@ class ClusterClient(NamespacedClient):
710
715
  """
711
716
  __path = "/_cluster/settings"
712
717
  __query: t.Dict[str, t.Any] = {}
713
- __body: t.Dict[str, t.Any] = {}
718
+ __body: t.Dict[str, t.Any] = body if body is not None else {}
714
719
  if error_trace is not None:
715
720
  __query["error_trace"] = error_trace
716
721
  if filter_path is not None:
@@ -721,14 +726,15 @@ class ClusterClient(NamespacedClient):
721
726
  __query["human"] = human
722
727
  if master_timeout is not None:
723
728
  __query["master_timeout"] = master_timeout
724
- if persistent is not None:
725
- __body["persistent"] = persistent
726
729
  if pretty is not None:
727
730
  __query["pretty"] = pretty
728
731
  if timeout is not None:
729
732
  __query["timeout"] = timeout
730
- if transient is not None:
731
- __body["transient"] = transient
733
+ if not __body:
734
+ if persistent is not None:
735
+ __body["persistent"] = persistent
736
+ if transient is not None:
737
+ __body["transient"] = transient
732
738
  __headers = {"accept": "application/json", "content-type": "application/json"}
733
739
  return self.perform_request( # type: ignore[return-value]
734
740
  "PUT", __path, params=__query, headers=__headers, body=__body
@@ -746,7 +752,7 @@ class ClusterClient(NamespacedClient):
746
752
  """
747
753
  Returns the information about configured remote clusters.
748
754
 
749
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.11/cluster-remote-info.html>`_
755
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.12/cluster-remote-info.html>`_
750
756
  """
751
757
  __path = "/_remote/info"
752
758
  __query: t.Dict[str, t.Any] = {}
@@ -764,7 +770,7 @@ class ClusterClient(NamespacedClient):
764
770
  )
765
771
 
766
772
  @_rewrite_parameters(
767
- body_fields=True,
773
+ body_fields=("commands",),
768
774
  )
769
775
  def reroute(
770
776
  self,
@@ -782,11 +788,12 @@ class ClusterClient(NamespacedClient):
782
788
  pretty: t.Optional[bool] = None,
783
789
  retry_failed: t.Optional[bool] = None,
784
790
  timeout: t.Optional[t.Union["t.Literal[-1]", "t.Literal[0]", str]] = None,
791
+ body: t.Optional[t.Dict[str, t.Any]] = None,
785
792
  ) -> ObjectApiResponse[t.Any]:
786
793
  """
787
794
  Allows to manually change the allocation of individual shards in the cluster.
788
795
 
789
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.11/cluster-reroute.html>`_
796
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.12/cluster-reroute.html>`_
790
797
 
791
798
  :param commands: Defines the commands to perform.
792
799
  :param dry_run: If true, then the request simulates the operation only and returns
@@ -803,10 +810,8 @@ class ClusterClient(NamespacedClient):
803
810
  the timeout expires, the request fails and returns an error.
804
811
  """
805
812
  __path = "/_cluster/reroute"
806
- __body: t.Dict[str, t.Any] = {}
807
813
  __query: t.Dict[str, t.Any] = {}
808
- if commands is not None:
809
- __body["commands"] = commands
814
+ __body: t.Dict[str, t.Any] = body if body is not None else {}
810
815
  if dry_run is not None:
811
816
  __query["dry_run"] = dry_run
812
817
  if error_trace is not None:
@@ -827,6 +832,9 @@ class ClusterClient(NamespacedClient):
827
832
  __query["retry_failed"] = retry_failed
828
833
  if timeout is not None:
829
834
  __query["timeout"] = timeout
835
+ if not __body:
836
+ if commands is not None:
837
+ __body["commands"] = commands
830
838
  if not __body:
831
839
  __body = None # type: ignore[assignment]
832
840
  __headers = {"accept": "application/json"}
@@ -869,7 +877,7 @@ class ClusterClient(NamespacedClient):
869
877
  """
870
878
  Returns a comprehensive information about the state of the cluster.
871
879
 
872
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.11/cluster-state.html>`_
880
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.12/cluster-state.html>`_
873
881
 
874
882
  :param metric: Limit the information returned to the specified metrics
875
883
  :param index: A comma-separated list of index names; use `_all` or empty string
@@ -943,7 +951,7 @@ class ClusterClient(NamespacedClient):
943
951
  """
944
952
  Returns high-level overview of cluster statistics.
945
953
 
946
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.11/cluster-stats.html>`_
954
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.12/cluster-stats.html>`_
947
955
 
948
956
  :param node_id: Comma-separated list of node filters used to limit returned information.
949
957
  Defaults to all nodes in the cluster.
@@ -42,7 +42,7 @@ class DanglingIndicesClient(NamespacedClient):
42
42
  """
43
43
  Deletes the specified dangling index
44
44
 
45
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.11/modules-gateway-dangling-indices.html>`_
45
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.12/modules-gateway-dangling-indices.html>`_
46
46
 
47
47
  :param index_uuid: The UUID of the dangling index
48
48
  :param accept_data_loss: Must be set to true in order to delete the dangling
@@ -93,7 +93,7 @@ class DanglingIndicesClient(NamespacedClient):
93
93
  """
94
94
  Imports the specified dangling index
95
95
 
96
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.11/modules-gateway-dangling-indices.html>`_
96
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.12/modules-gateway-dangling-indices.html>`_
97
97
 
98
98
  :param index_uuid: The UUID of the dangling index
99
99
  :param accept_data_loss: Must be set to true in order to import the dangling
@@ -138,7 +138,7 @@ class DanglingIndicesClient(NamespacedClient):
138
138
  """
139
139
  Returns all dangling indices.
140
140
 
141
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.11/modules-gateway-dangling-indices.html>`_
141
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.12/modules-gateway-dangling-indices.html>`_
142
142
  """
143
143
  __path = "/_dangling"
144
144
  __query: t.Dict[str, t.Any] = {}
@@ -37,7 +37,7 @@ class EnrichClient(NamespacedClient):
37
37
  """
38
38
  Deletes an existing enrich policy and its enrich index.
39
39
 
40
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.11/delete-enrich-policy-api.html>`_
40
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.12/delete-enrich-policy-api.html>`_
41
41
 
42
42
  :param name: Enrich policy to delete.
43
43
  """
@@ -72,7 +72,7 @@ class EnrichClient(NamespacedClient):
72
72
  """
73
73
  Creates the enrich index for an existing enrich policy.
74
74
 
75
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.11/execute-enrich-policy-api.html>`_
75
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.12/execute-enrich-policy-api.html>`_
76
76
 
77
77
  :param name: Enrich policy to execute.
78
78
  :param wait_for_completion: If `true`, the request blocks other enrich policy
@@ -110,7 +110,7 @@ class EnrichClient(NamespacedClient):
110
110
  """
111
111
  Gets information about an enrich policy.
112
112
 
113
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.11/get-enrich-policy-api.html>`_
113
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.12/get-enrich-policy-api.html>`_
114
114
 
115
115
  :param name: Comma-separated list of enrich policy names used to limit the request.
116
116
  To return information for all enrich policies, omit this parameter.
@@ -134,7 +134,7 @@ class EnrichClient(NamespacedClient):
134
134
  )
135
135
 
136
136
  @_rewrite_parameters(
137
- body_fields=True,
137
+ body_fields=("geo_match", "match", "range"),
138
138
  )
139
139
  def put_policy(
140
140
  self,
@@ -147,11 +147,12 @@ class EnrichClient(NamespacedClient):
147
147
  match: t.Optional[t.Mapping[str, t.Any]] = None,
148
148
  pretty: t.Optional[bool] = None,
149
149
  range: t.Optional[t.Mapping[str, t.Any]] = None,
150
+ body: t.Optional[t.Dict[str, t.Any]] = None,
150
151
  ) -> ObjectApiResponse[t.Any]:
151
152
  """
152
153
  Creates a new enrich policy.
153
154
 
154
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.11/put-enrich-policy-api.html>`_
155
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.12/put-enrich-policy-api.html>`_
155
156
 
156
157
  :param name: Name of the enrich policy to create or update.
157
158
  :param geo_match: Matches enrich data to incoming documents based on a `geo_shape`
@@ -164,21 +165,22 @@ class EnrichClient(NamespacedClient):
164
165
  raise ValueError("Empty value passed for parameter 'name'")
165
166
  __path = f"/_enrich/policy/{_quote(name)}"
166
167
  __query: t.Dict[str, t.Any] = {}
167
- __body: t.Dict[str, t.Any] = {}
168
+ __body: t.Dict[str, t.Any] = body if body is not None else {}
168
169
  if error_trace is not None:
169
170
  __query["error_trace"] = error_trace
170
171
  if filter_path is not None:
171
172
  __query["filter_path"] = filter_path
172
- if geo_match is not None:
173
- __body["geo_match"] = geo_match
174
173
  if human is not None:
175
174
  __query["human"] = human
176
- if match is not None:
177
- __body["match"] = match
178
175
  if pretty is not None:
179
176
  __query["pretty"] = pretty
180
- if range is not None:
181
- __body["range"] = range
177
+ if not __body:
178
+ if geo_match is not None:
179
+ __body["geo_match"] = geo_match
180
+ if match is not None:
181
+ __body["match"] = match
182
+ if range is not None:
183
+ __body["range"] = range
182
184
  __headers = {"accept": "application/json", "content-type": "application/json"}
183
185
  return self.perform_request( # type: ignore[return-value]
184
186
  "PUT", __path, params=__query, headers=__headers, body=__body
@@ -197,7 +199,7 @@ class EnrichClient(NamespacedClient):
197
199
  Gets enrich coordinator statistics and information about enrich policies that
198
200
  are currently executing.
199
201
 
200
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.11/enrich-stats-api.html>`_
202
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.12/enrich-stats-api.html>`_
201
203
  """
202
204
  __path = "/_enrich/_stats"
203
205
  __query: t.Dict[str, t.Any] = {}
@@ -38,7 +38,7 @@ class EqlClient(NamespacedClient):
38
38
  Deletes an async EQL search by ID. If the search is still running, the search
39
39
  request will be cancelled. Otherwise, the saved search results are deleted.
40
40
 
41
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.11/eql-search-api.html>`_
41
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.12/eql-search-api.html>`_
42
42
 
43
43
  :param id: Identifier for the search to delete. A search ID is provided in the
44
44
  EQL search API's response for an async search. A search ID is also provided
@@ -78,7 +78,7 @@ class EqlClient(NamespacedClient):
78
78
  """
79
79
  Returns async results from previously executed Event Query Language (EQL) search
80
80
 
81
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.11/get-async-eql-search-api.html>`_
81
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.12/get-async-eql-search-api.html>`_
82
82
 
83
83
  :param id: Identifier for the search.
84
84
  :param keep_alive: Period for which the search and its results are stored on
@@ -123,7 +123,7 @@ class EqlClient(NamespacedClient):
123
123
  Returns the status of a previously submitted async or stored Event Query Language
124
124
  (EQL) search
125
125
 
126
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.11/get-async-eql-status-api.html>`_
126
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.12/get-async-eql-status-api.html>`_
127
127
 
128
128
  :param id: Identifier for the search.
129
129
  """
@@ -145,13 +145,28 @@ class EqlClient(NamespacedClient):
145
145
  )
146
146
 
147
147
  @_rewrite_parameters(
148
- body_fields=True,
148
+ body_fields=(
149
+ "query",
150
+ "case_sensitive",
151
+ "event_category_field",
152
+ "fetch_size",
153
+ "fields",
154
+ "filter",
155
+ "keep_alive",
156
+ "keep_on_completion",
157
+ "result_position",
158
+ "runtime_mappings",
159
+ "size",
160
+ "tiebreaker_field",
161
+ "timestamp_field",
162
+ "wait_for_completion_timeout",
163
+ ),
149
164
  )
150
165
  def search(
151
166
  self,
152
167
  *,
153
168
  index: t.Union[str, t.Sequence[str]],
154
- query: str,
169
+ query: t.Optional[str] = None,
155
170
  allow_no_indices: t.Optional[bool] = None,
156
171
  case_sensitive: t.Optional[bool] = None,
157
172
  error_trace: t.Optional[bool] = None,
@@ -185,11 +200,12 @@ class EqlClient(NamespacedClient):
185
200
  wait_for_completion_timeout: t.Optional[
186
201
  t.Union["t.Literal[-1]", "t.Literal[0]", str]
187
202
  ] = None,
203
+ body: t.Optional[t.Dict[str, t.Any]] = None,
188
204
  ) -> ObjectApiResponse[t.Any]:
189
205
  """
190
206
  Returns results matching a query expressed in Event Query Language (EQL)
191
207
 
192
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.11/eql-search-api.html>`_
208
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.12/eql-search-api.html>`_
193
209
 
194
210
  :param index: The name of the index to scope the operation
195
211
  :param query: EQL query you wish to run.
@@ -219,53 +235,54 @@ class EqlClient(NamespacedClient):
219
235
  """
220
236
  if index in SKIP_IN_PATH:
221
237
  raise ValueError("Empty value passed for parameter 'index'")
222
- if query is None:
238
+ if query is None and body is None:
223
239
  raise ValueError("Empty value passed for parameter 'query'")
224
240
  __path = f"/{_quote(index)}/_eql/search"
225
- __body: t.Dict[str, t.Any] = {}
226
241
  __query: t.Dict[str, t.Any] = {}
227
- if query is not None:
228
- __body["query"] = query
242
+ __body: t.Dict[str, t.Any] = body if body is not None else {}
229
243
  if allow_no_indices is not None:
230
244
  __query["allow_no_indices"] = allow_no_indices
231
- if case_sensitive is not None:
232
- __body["case_sensitive"] = case_sensitive
233
245
  if error_trace is not None:
234
246
  __query["error_trace"] = error_trace
235
- if event_category_field is not None:
236
- __body["event_category_field"] = event_category_field
237
247
  if expand_wildcards is not None:
238
248
  __query["expand_wildcards"] = expand_wildcards
239
- if fetch_size is not None:
240
- __body["fetch_size"] = fetch_size
241
- if fields is not None:
242
- __body["fields"] = fields
243
- if filter is not None:
244
- __body["filter"] = filter
245
249
  if filter_path is not None:
246
250
  __query["filter_path"] = filter_path
247
251
  if human is not None:
248
252
  __query["human"] = human
249
253
  if ignore_unavailable is not None:
250
254
  __query["ignore_unavailable"] = ignore_unavailable
251
- if keep_alive is not None:
252
- __body["keep_alive"] = keep_alive
253
- if keep_on_completion is not None:
254
- __body["keep_on_completion"] = keep_on_completion
255
255
  if pretty is not None:
256
256
  __query["pretty"] = pretty
257
- if result_position is not None:
258
- __body["result_position"] = result_position
259
- if runtime_mappings is not None:
260
- __body["runtime_mappings"] = runtime_mappings
261
- if size is not None:
262
- __body["size"] = size
263
- if tiebreaker_field is not None:
264
- __body["tiebreaker_field"] = tiebreaker_field
265
- if timestamp_field is not None:
266
- __body["timestamp_field"] = timestamp_field
267
- if wait_for_completion_timeout is not None:
268
- __body["wait_for_completion_timeout"] = wait_for_completion_timeout
257
+ if not __body:
258
+ if query is not None:
259
+ __body["query"] = query
260
+ if case_sensitive is not None:
261
+ __body["case_sensitive"] = case_sensitive
262
+ if event_category_field is not None:
263
+ __body["event_category_field"] = event_category_field
264
+ if fetch_size is not None:
265
+ __body["fetch_size"] = fetch_size
266
+ if fields is not None:
267
+ __body["fields"] = fields
268
+ if filter is not None:
269
+ __body["filter"] = filter
270
+ if keep_alive is not None:
271
+ __body["keep_alive"] = keep_alive
272
+ if keep_on_completion is not None:
273
+ __body["keep_on_completion"] = keep_on_completion
274
+ if result_position is not None:
275
+ __body["result_position"] = result_position
276
+ if runtime_mappings is not None:
277
+ __body["runtime_mappings"] = runtime_mappings
278
+ if size is not None:
279
+ __body["size"] = size
280
+ if tiebreaker_field is not None:
281
+ __body["tiebreaker_field"] = tiebreaker_field
282
+ if timestamp_field is not None:
283
+ __body["timestamp_field"] = timestamp_field
284
+ if wait_for_completion_timeout is not None:
285
+ __body["wait_for_completion_timeout"] = wait_for_completion_timeout
269
286
  __headers = {"accept": "application/json", "content-type": "application/json"}
270
287
  return self.perform_request( # type: ignore[return-value]
271
288
  "POST", __path, params=__query, headers=__headers, body=__body