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
@@ -31,7 +31,8 @@ class MonitoringClient(NamespacedClient):
31
31
  self,
32
32
  *,
33
33
  interval: t.Union["t.Literal[-1]", "t.Literal[0]", str],
34
- operations: t.Sequence[t.Mapping[str, t.Any]],
34
+ operations: t.Optional[t.Sequence[t.Mapping[str, t.Any]]] = None,
35
+ body: t.Optional[t.Sequence[t.Mapping[str, t.Any]]] = None,
35
36
  system_api_version: str,
36
37
  system_id: str,
37
38
  error_trace: t.Optional[bool] = None,
@@ -42,7 +43,7 @@ class MonitoringClient(NamespacedClient):
42
43
  """
43
44
  Used by the monitoring features to send monitoring data.
44
45
 
45
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.11/monitor-elasticsearch-cluster.html>`_
46
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.12/monitor-elasticsearch-cluster.html>`_
46
47
 
47
48
  :param interval: Collection interval (e.g., '10s' or '10000ms') of the payload
48
49
  :param operations:
@@ -51,8 +52,12 @@ class MonitoringClient(NamespacedClient):
51
52
  """
52
53
  if interval is None:
53
54
  raise ValueError("Empty value passed for parameter 'interval'")
54
- if operations is None:
55
- raise ValueError("Empty value passed for parameter 'operations'")
55
+ if operations is None and body is None:
56
+ raise ValueError(
57
+ "Empty value passed for parameters 'operations' and 'body', one of them should be set."
58
+ )
59
+ elif operations is not None and body is not None:
60
+ raise ValueError("Cannot set both 'operations' and 'body'")
56
61
  if system_api_version is None:
57
62
  raise ValueError("Empty value passed for parameter 'system_api_version'")
58
63
  if system_id is None:
@@ -73,7 +78,7 @@ class MonitoringClient(NamespacedClient):
73
78
  __query["human"] = human
74
79
  if pretty is not None:
75
80
  __query["pretty"] = pretty
76
- __body = operations
81
+ __body = operations if operations is not None else body
77
82
  __headers = {
78
83
  "accept": "application/json",
79
84
  "content-type": "application/x-ndjson",
@@ -38,7 +38,7 @@ class NodesClient(NamespacedClient):
38
38
  """
39
39
  Removes the archived repositories metering information present in the cluster.
40
40
 
41
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.11/clear-repositories-metering-archive-api.html>`_
41
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.12/clear-repositories-metering-archive-api.html>`_
42
42
 
43
43
  :param node_id: Comma-separated list of node IDs or names used to limit returned
44
44
  information. All the nodes selective options are explained [here](https://www.elastic.co/guide/en/elasticsearch/reference/current/cluster.html#cluster-nodes).
@@ -77,7 +77,7 @@ class NodesClient(NamespacedClient):
77
77
  """
78
78
  Returns cluster repositories metering information.
79
79
 
80
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.11/get-repositories-metering-api.html>`_
80
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.12/get-repositories-metering-api.html>`_
81
81
 
82
82
  :param node_id: Comma-separated list of node IDs or names used to limit returned
83
83
  information. All the nodes selective options are explained [here](https://www.elastic.co/guide/en/elasticsearch/reference/current/cluster.html#cluster-nodes).
@@ -126,7 +126,7 @@ class NodesClient(NamespacedClient):
126
126
  """
127
127
  Returns information about hot threads on each node in the cluster.
128
128
 
129
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.11/cluster-nodes-hot-threads.html>`_
129
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.12/cluster-nodes-hot-threads.html>`_
130
130
 
131
131
  :param node_id: List of node IDs or names used to limit returned information.
132
132
  :param ignore_idle_threads: If true, known idle threads (e.g. waiting in a socket
@@ -195,7 +195,7 @@ class NodesClient(NamespacedClient):
195
195
  """
196
196
  Returns information about nodes in the cluster.
197
197
 
198
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.11/cluster-nodes-info.html>`_
198
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.12/cluster-nodes-info.html>`_
199
199
 
200
200
  :param node_id: Comma-separated list of node IDs or names used to limit returned
201
201
  information.
@@ -237,7 +237,7 @@ class NodesClient(NamespacedClient):
237
237
  )
238
238
 
239
239
  @_rewrite_parameters(
240
- body_fields=True,
240
+ body_fields=("secure_settings_password",),
241
241
  )
242
242
  async def reload_secure_settings(
243
243
  self,
@@ -249,11 +249,12 @@ class NodesClient(NamespacedClient):
249
249
  pretty: t.Optional[bool] = None,
250
250
  secure_settings_password: t.Optional[str] = None,
251
251
  timeout: t.Optional[t.Union["t.Literal[-1]", "t.Literal[0]", str]] = None,
252
+ body: t.Optional[t.Dict[str, t.Any]] = None,
252
253
  ) -> ObjectApiResponse[t.Any]:
253
254
  """
254
255
  Reloads secure settings.
255
256
 
256
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.11/secure-settings.html#reloadable-secure-settings>`_
257
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.12/secure-settings.html#reloadable-secure-settings>`_
257
258
 
258
259
  :param node_id: The names of particular nodes in the cluster to target.
259
260
  :param secure_settings_password: The password for the Elasticsearch keystore.
@@ -265,7 +266,7 @@ class NodesClient(NamespacedClient):
265
266
  else:
266
267
  __path = "/_nodes/reload_secure_settings"
267
268
  __query: t.Dict[str, t.Any] = {}
268
- __body: t.Dict[str, t.Any] = {}
269
+ __body: t.Dict[str, t.Any] = body if body is not None else {}
269
270
  if error_trace is not None:
270
271
  __query["error_trace"] = error_trace
271
272
  if filter_path is not None:
@@ -274,10 +275,11 @@ class NodesClient(NamespacedClient):
274
275
  __query["human"] = human
275
276
  if pretty is not None:
276
277
  __query["pretty"] = pretty
277
- if secure_settings_password is not None:
278
- __body["secure_settings_password"] = secure_settings_password
279
278
  if timeout is not None:
280
279
  __query["timeout"] = timeout
280
+ if not __body:
281
+ if secure_settings_password is not None:
282
+ __body["secure_settings_password"] = secure_settings_password
281
283
  if not __body:
282
284
  __body = None # type: ignore[assignment]
283
285
  __headers = {"accept": "application/json"}
@@ -316,7 +318,7 @@ class NodesClient(NamespacedClient):
316
318
  """
317
319
  Returns statistical information about nodes in the cluster.
318
320
 
319
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.11/cluster-nodes-stats.html>`_
321
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.12/cluster-nodes-stats.html>`_
320
322
 
321
323
  :param node_id: Comma-separated list of node IDs or names used to limit returned
322
324
  information.
@@ -412,7 +414,7 @@ class NodesClient(NamespacedClient):
412
414
  """
413
415
  Returns low-level information about REST actions usage on nodes.
414
416
 
415
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.11/cluster-nodes-usage.html>`_
417
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.12/cluster-nodes-usage.html>`_
416
418
 
417
419
  :param node_id: A comma-separated list of node IDs or names to limit the returned
418
420
  information; use `_local` to return information from the node you're connecting
@@ -37,7 +37,7 @@ class QueryRulesetClient(NamespacedClient):
37
37
  """
38
38
  Deletes a query ruleset.
39
39
 
40
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.11/delete-query-ruleset.html>`_
40
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.12/delete-query-ruleset.html>`_
41
41
 
42
42
  :param ruleset_id: The unique identifier of the query ruleset to delete
43
43
  """
@@ -71,7 +71,7 @@ class QueryRulesetClient(NamespacedClient):
71
71
  """
72
72
  Returns the details about a query ruleset.
73
73
 
74
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.11/get-query-ruleset.html>`_
74
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.12/get-query-ruleset.html>`_
75
75
 
76
76
  :param ruleset_id: The unique identifier of the query ruleset
77
77
  """
@@ -108,7 +108,7 @@ class QueryRulesetClient(NamespacedClient):
108
108
  """
109
109
  Lists query rulesets.
110
110
 
111
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.11/list-query-rulesets.html>`_
111
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.12/list-query-rulesets.html>`_
112
112
 
113
113
  :param from_: Starting offset (default: 0)
114
114
  :param size: specifies a max number of results to get
@@ -133,22 +133,23 @@ class QueryRulesetClient(NamespacedClient):
133
133
  )
134
134
 
135
135
  @_rewrite_parameters(
136
- body_fields=True,
136
+ body_fields=("rules",),
137
137
  )
138
138
  async def put(
139
139
  self,
140
140
  *,
141
141
  ruleset_id: str,
142
- rules: t.Sequence[t.Mapping[str, t.Any]],
142
+ rules: t.Optional[t.Sequence[t.Mapping[str, t.Any]]] = None,
143
143
  error_trace: t.Optional[bool] = None,
144
144
  filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
145
145
  human: t.Optional[bool] = None,
146
146
  pretty: t.Optional[bool] = None,
147
+ body: t.Optional[t.Dict[str, t.Any]] = None,
147
148
  ) -> ObjectApiResponse[t.Any]:
148
149
  """
149
150
  Creates or updates a query ruleset.
150
151
 
151
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.11/put-query-ruleset.html>`_
152
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.12/put-query-ruleset.html>`_
152
153
 
153
154
  :param ruleset_id: The unique identifier of the query ruleset to be created or
154
155
  updated
@@ -156,13 +157,11 @@ class QueryRulesetClient(NamespacedClient):
156
157
  """
157
158
  if ruleset_id in SKIP_IN_PATH:
158
159
  raise ValueError("Empty value passed for parameter 'ruleset_id'")
159
- if rules is None:
160
+ if rules is None and body is None:
160
161
  raise ValueError("Empty value passed for parameter 'rules'")
161
162
  __path = f"/_query_rules/{_quote(ruleset_id)}"
162
- __body: t.Dict[str, t.Any] = {}
163
163
  __query: t.Dict[str, t.Any] = {}
164
- if rules is not None:
165
- __body["rules"] = rules
164
+ __body: t.Dict[str, t.Any] = body if body is not None else {}
166
165
  if error_trace is not None:
167
166
  __query["error_trace"] = error_trace
168
167
  if filter_path is not None:
@@ -171,6 +170,9 @@ class QueryRulesetClient(NamespacedClient):
171
170
  __query["human"] = human
172
171
  if pretty is not None:
173
172
  __query["pretty"] = pretty
173
+ if not __body:
174
+ if rules is not None:
175
+ __body["rules"] = rules
174
176
  __headers = {"accept": "application/json", "content-type": "application/json"}
175
177
  return await self.perform_request( # type: ignore[return-value]
176
178
  "PUT", __path, params=__query, headers=__headers, body=__body
@@ -37,7 +37,7 @@ class RollupClient(NamespacedClient):
37
37
  """
38
38
  Deletes an existing rollup job.
39
39
 
40
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.11/rollup-delete-job.html>`_
40
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.12/rollup-delete-job.html>`_
41
41
 
42
42
  :param id: Identifier for the job.
43
43
  """
@@ -71,7 +71,7 @@ class RollupClient(NamespacedClient):
71
71
  """
72
72
  Retrieves the configuration, stats, and status of rollup jobs.
73
73
 
74
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.11/rollup-get-job.html>`_
74
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.12/rollup-get-job.html>`_
75
75
 
76
76
  :param id: Identifier for the rollup job. If it is `_all` or omitted, the API
77
77
  returns all rollup jobs.
@@ -108,7 +108,7 @@ class RollupClient(NamespacedClient):
108
108
  Returns the capabilities of any rollup jobs that have been configured for a specific
109
109
  index or index pattern.
110
110
 
111
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.11/rollup-get-rollup-caps.html>`_
111
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.12/rollup-get-rollup-caps.html>`_
112
112
 
113
113
  :param id: Index, indices or index-pattern to return rollup capabilities for.
114
114
  `_all` may be used to fetch rollup capabilities from all jobs.
@@ -145,7 +145,7 @@ class RollupClient(NamespacedClient):
145
145
  Returns the rollup capabilities of all jobs inside of a rollup index (e.g. the
146
146
  index where rollup data is stored).
147
147
 
148
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.11/rollup-get-rollup-index-caps.html>`_
148
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.12/rollup-get-rollup-index-caps.html>`_
149
149
 
150
150
  :param index: Data stream or index to check for rollup capabilities. Wildcard
151
151
  (`*`) expressions are supported.
@@ -168,18 +168,27 @@ class RollupClient(NamespacedClient):
168
168
  )
169
169
 
170
170
  @_rewrite_parameters(
171
- body_fields=True,
171
+ body_fields=(
172
+ "cron",
173
+ "groups",
174
+ "index_pattern",
175
+ "page_size",
176
+ "rollup_index",
177
+ "headers",
178
+ "metrics",
179
+ "timeout",
180
+ ),
172
181
  ignore_deprecated_options={"headers"},
173
182
  )
174
183
  async def put_job(
175
184
  self,
176
185
  *,
177
186
  id: str,
178
- cron: str,
179
- groups: t.Mapping[str, t.Any],
180
- index_pattern: str,
181
- page_size: int,
182
- rollup_index: str,
187
+ cron: t.Optional[str] = None,
188
+ groups: t.Optional[t.Mapping[str, t.Any]] = None,
189
+ index_pattern: t.Optional[str] = None,
190
+ page_size: t.Optional[int] = None,
191
+ rollup_index: t.Optional[str] = None,
183
192
  error_trace: t.Optional[bool] = None,
184
193
  filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
185
194
  headers: t.Optional[t.Mapping[str, t.Union[str, t.Sequence[str]]]] = None,
@@ -187,11 +196,12 @@ class RollupClient(NamespacedClient):
187
196
  metrics: t.Optional[t.Sequence[t.Mapping[str, t.Any]]] = None,
188
197
  pretty: t.Optional[bool] = None,
189
198
  timeout: t.Optional[t.Union["t.Literal[-1]", "t.Literal[0]", str]] = None,
199
+ body: t.Optional[t.Dict[str, t.Any]] = None,
190
200
  ) -> ObjectApiResponse[t.Any]:
191
201
  """
192
202
  Creates a rollup job.
193
203
 
194
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.11/rollup-put-job.html>`_
204
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.12/rollup-put-job.html>`_
195
205
 
196
206
  :param id: Identifier for the rollup job. This can be any alphanumeric string
197
207
  and uniquely identifies the data that is associated with the rollup job.
@@ -235,50 +245,51 @@ class RollupClient(NamespacedClient):
235
245
  """
236
246
  if id in SKIP_IN_PATH:
237
247
  raise ValueError("Empty value passed for parameter 'id'")
238
- if cron is None:
248
+ if cron is None and body is None:
239
249
  raise ValueError("Empty value passed for parameter 'cron'")
240
- if groups is None:
250
+ if groups is None and body is None:
241
251
  raise ValueError("Empty value passed for parameter 'groups'")
242
- if index_pattern is None:
252
+ if index_pattern is None and body is None:
243
253
  raise ValueError("Empty value passed for parameter 'index_pattern'")
244
- if page_size is None:
254
+ if page_size is None and body is None:
245
255
  raise ValueError("Empty value passed for parameter 'page_size'")
246
- if rollup_index is None:
256
+ if rollup_index is None and body is None:
247
257
  raise ValueError("Empty value passed for parameter 'rollup_index'")
248
258
  __path = f"/_rollup/job/{_quote(id)}"
249
- __body: t.Dict[str, t.Any] = {}
250
259
  __query: t.Dict[str, t.Any] = {}
251
- if cron is not None:
252
- __body["cron"] = cron
253
- if groups is not None:
254
- __body["groups"] = groups
255
- if index_pattern is not None:
256
- __body["index_pattern"] = index_pattern
257
- if page_size is not None:
258
- __body["page_size"] = page_size
259
- if rollup_index is not None:
260
- __body["rollup_index"] = rollup_index
260
+ __body: t.Dict[str, t.Any] = body if body is not None else {}
261
261
  if error_trace is not None:
262
262
  __query["error_trace"] = error_trace
263
263
  if filter_path is not None:
264
264
  __query["filter_path"] = filter_path
265
- if headers is not None:
266
- __body["headers"] = headers
267
265
  if human is not None:
268
266
  __query["human"] = human
269
- if metrics is not None:
270
- __body["metrics"] = metrics
271
267
  if pretty is not None:
272
268
  __query["pretty"] = pretty
273
- if timeout is not None:
274
- __body["timeout"] = timeout
269
+ if not __body:
270
+ if cron is not None:
271
+ __body["cron"] = cron
272
+ if groups is not None:
273
+ __body["groups"] = groups
274
+ if index_pattern is not None:
275
+ __body["index_pattern"] = index_pattern
276
+ if page_size is not None:
277
+ __body["page_size"] = page_size
278
+ if rollup_index is not None:
279
+ __body["rollup_index"] = rollup_index
280
+ if headers is not None:
281
+ __body["headers"] = headers
282
+ if metrics is not None:
283
+ __body["metrics"] = metrics
284
+ if timeout is not None:
285
+ __body["timeout"] = timeout
275
286
  __headers = {"accept": "application/json", "content-type": "application/json"}
276
287
  return await self.perform_request( # type: ignore[return-value]
277
288
  "PUT", __path, params=__query, headers=__headers, body=__body
278
289
  )
279
290
 
280
291
  @_rewrite_parameters(
281
- body_fields=True,
292
+ body_fields=("aggregations", "aggs", "query", "size"),
282
293
  )
283
294
  async def rollup_search(
284
295
  self,
@@ -294,11 +305,12 @@ class RollupClient(NamespacedClient):
294
305
  rest_total_hits_as_int: t.Optional[bool] = None,
295
306
  size: t.Optional[int] = None,
296
307
  typed_keys: t.Optional[bool] = None,
308
+ body: t.Optional[t.Dict[str, t.Any]] = None,
297
309
  ) -> ObjectApiResponse[t.Any]:
298
310
  """
299
311
  Enables searching rolled-up data using the standard query DSL.
300
312
 
301
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.11/rollup-search.html>`_
313
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.12/rollup-search.html>`_
302
314
 
303
315
  :param index: Enables searching rolled-up data using the standard Query DSL.
304
316
  :param aggregations: Specifies aggregations.
@@ -313,12 +325,8 @@ class RollupClient(NamespacedClient):
313
325
  if index in SKIP_IN_PATH:
314
326
  raise ValueError("Empty value passed for parameter 'index'")
315
327
  __path = f"/{_quote(index)}/_rollup_search"
316
- __body: t.Dict[str, t.Any] = {}
317
328
  __query: t.Dict[str, t.Any] = {}
318
- if aggregations is not None:
319
- __body["aggregations"] = aggregations
320
- if aggs is not None:
321
- __body["aggs"] = aggs
329
+ __body: t.Dict[str, t.Any] = body if body is not None else {}
322
330
  if error_trace is not None:
323
331
  __query["error_trace"] = error_trace
324
332
  if filter_path is not None:
@@ -327,14 +335,19 @@ class RollupClient(NamespacedClient):
327
335
  __query["human"] = human
328
336
  if pretty is not None:
329
337
  __query["pretty"] = pretty
330
- if query is not None:
331
- __body["query"] = query
332
338
  if rest_total_hits_as_int is not None:
333
339
  __query["rest_total_hits_as_int"] = rest_total_hits_as_int
334
- if size is not None:
335
- __body["size"] = size
336
340
  if typed_keys is not None:
337
341
  __query["typed_keys"] = typed_keys
342
+ if not __body:
343
+ if aggregations is not None:
344
+ __body["aggregations"] = aggregations
345
+ if aggs is not None:
346
+ __body["aggs"] = aggs
347
+ if query is not None:
348
+ __body["query"] = query
349
+ if size is not None:
350
+ __body["size"] = size
338
351
  __headers = {"accept": "application/json", "content-type": "application/json"}
339
352
  return await self.perform_request( # type: ignore[return-value]
340
353
  "POST", __path, params=__query, headers=__headers, body=__body
@@ -353,7 +366,7 @@ class RollupClient(NamespacedClient):
353
366
  """
354
367
  Starts an existing, stopped rollup job.
355
368
 
356
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.11/rollup-start-job.html>`_
369
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.12/rollup-start-job.html>`_
357
370
 
358
371
  :param id: Identifier for the rollup job.
359
372
  """
@@ -389,7 +402,7 @@ class RollupClient(NamespacedClient):
389
402
  """
390
403
  Stops an existing, started rollup job.
391
404
 
392
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.11/rollup-stop-job.html>`_
405
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.12/rollup-stop-job.html>`_
393
406
 
394
407
  :param id: Identifier for the rollup job.
395
408
  :param timeout: If `wait_for_completion` is `true`, the API blocks for (at maximum)
@@ -37,7 +37,7 @@ class SearchApplicationClient(NamespacedClient):
37
37
  """
38
38
  Deletes a search application.
39
39
 
40
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.11/put-search-application.html>`_
40
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.12/delete-search-application.html>`_
41
41
 
42
42
  :param name: The name of the search application to delete
43
43
  """
@@ -71,7 +71,7 @@ class SearchApplicationClient(NamespacedClient):
71
71
  """
72
72
  Delete a behavioral analytics collection.
73
73
 
74
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.11/delete-analytics-collection.html>`_
74
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.12/delete-analytics-collection.html>`_
75
75
 
76
76
  :param name: The name of the analytics collection to be deleted
77
77
  """
@@ -105,7 +105,7 @@ class SearchApplicationClient(NamespacedClient):
105
105
  """
106
106
  Returns the details about a search application.
107
107
 
108
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.11/get-search-application.html>`_
108
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.12/get-search-application.html>`_
109
109
 
110
110
  :param name: The name of the search application
111
111
  """
@@ -139,7 +139,7 @@ class SearchApplicationClient(NamespacedClient):
139
139
  """
140
140
  Returns the existing behavioral analytics collections.
141
141
 
142
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.11/list-analytics-collection.html>`_
142
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.12/list-analytics-collection.html>`_
143
143
 
144
144
  :param name: A list of analytics collections to limit the returned information
145
145
  """
@@ -178,7 +178,7 @@ class SearchApplicationClient(NamespacedClient):
178
178
  """
179
179
  Returns the existing search applications.
180
180
 
181
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.11/list-search-applications.html>`_
181
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.12/list-search-applications.html>`_
182
182
 
183
183
  :param from_: Starting offset.
184
184
  :param q: Query in the Lucene query string syntax.
@@ -212,7 +212,8 @@ class SearchApplicationClient(NamespacedClient):
212
212
  self,
213
213
  *,
214
214
  name: str,
215
- search_application: t.Mapping[str, t.Any],
215
+ search_application: t.Optional[t.Mapping[str, t.Any]] = None,
216
+ body: t.Optional[t.Mapping[str, t.Any]] = None,
216
217
  create: t.Optional[bool] = None,
217
218
  error_trace: t.Optional[bool] = None,
218
219
  filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
@@ -222,7 +223,7 @@ class SearchApplicationClient(NamespacedClient):
222
223
  """
223
224
  Creates or updates a search application.
224
225
 
225
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.11/put-search-application.html>`_
226
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.12/put-search-application.html>`_
226
227
 
227
228
  :param name: The name of the search application to be created or updated.
228
229
  :param search_application:
@@ -231,8 +232,12 @@ class SearchApplicationClient(NamespacedClient):
231
232
  """
232
233
  if name in SKIP_IN_PATH:
233
234
  raise ValueError("Empty value passed for parameter 'name'")
234
- if search_application is None:
235
- raise ValueError("Empty value passed for parameter 'search_application'")
235
+ if search_application is None and body is None:
236
+ raise ValueError(
237
+ "Empty value passed for parameters 'search_application' and 'body', one of them should be set."
238
+ )
239
+ elif search_application is not None and body is not None:
240
+ raise ValueError("Cannot set both 'search_application' and 'body'")
236
241
  __path = f"/_application/search_application/{_quote(name)}"
237
242
  __query: t.Dict[str, t.Any] = {}
238
243
  if create is not None:
@@ -245,7 +250,7 @@ class SearchApplicationClient(NamespacedClient):
245
250
  __query["human"] = human
246
251
  if pretty is not None:
247
252
  __query["pretty"] = pretty
248
- __body = search_application
253
+ __body = search_application if search_application is not None else body
249
254
  __headers = {"accept": "application/json", "content-type": "application/json"}
250
255
  return await self.perform_request( # type: ignore[return-value]
251
256
  "PUT", __path, params=__query, headers=__headers, body=__body
@@ -264,7 +269,7 @@ class SearchApplicationClient(NamespacedClient):
264
269
  """
265
270
  Creates a behavioral analytics collection.
266
271
 
267
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.11/put-analytics-collection.html>`_
272
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.12/put-analytics-collection.html>`_
268
273
 
269
274
  :param name: The name of the analytics collection to be created or updated.
270
275
  """
@@ -286,7 +291,7 @@ class SearchApplicationClient(NamespacedClient):
286
291
  )
287
292
 
288
293
  @_rewrite_parameters(
289
- body_fields=True,
294
+ body_fields=("params",),
290
295
  ignore_deprecated_options={"params"},
291
296
  )
292
297
  async def search(
@@ -298,11 +303,12 @@ class SearchApplicationClient(NamespacedClient):
298
303
  human: t.Optional[bool] = None,
299
304
  params: t.Optional[t.Mapping[str, t.Any]] = None,
300
305
  pretty: t.Optional[bool] = None,
306
+ body: t.Optional[t.Dict[str, t.Any]] = None,
301
307
  ) -> ObjectApiResponse[t.Any]:
302
308
  """
303
309
  Perform a search against a search application
304
310
 
305
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.11/search-application-search.html>`_
311
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.12/search-application-search.html>`_
306
312
 
307
313
  :param name: The name of the search application to be searched.
308
314
  :param params: Query parameters specific to this request, which will override
@@ -312,17 +318,18 @@ class SearchApplicationClient(NamespacedClient):
312
318
  raise ValueError("Empty value passed for parameter 'name'")
313
319
  __path = f"/_application/search_application/{_quote(name)}/_search"
314
320
  __query: t.Dict[str, t.Any] = {}
315
- __body: t.Dict[str, t.Any] = {}
321
+ __body: t.Dict[str, t.Any] = body if body is not None else {}
316
322
  if error_trace is not None:
317
323
  __query["error_trace"] = error_trace
318
324
  if filter_path is not None:
319
325
  __query["filter_path"] = filter_path
320
326
  if human is not None:
321
327
  __query["human"] = human
322
- if params is not None:
323
- __body["params"] = params
324
328
  if pretty is not None:
325
329
  __query["pretty"] = pretty
330
+ if not __body:
331
+ if params is not None:
332
+ __body["params"] = params
326
333
  if not __body:
327
334
  __body = None # type: ignore[assignment]
328
335
  __headers = {"accept": "application/json"}