elasticsearch 8.16.0__py3-none-any.whl → 8.17.1__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (90) hide show
  1. elasticsearch/_async/client/__init__.py +234 -96
  2. elasticsearch/_async/client/async_search.py +12 -22
  3. elasticsearch/_async/client/autoscaling.py +39 -4
  4. elasticsearch/_async/client/cat.py +90 -221
  5. elasticsearch/_async/client/ccr.py +85 -35
  6. elasticsearch/_async/client/cluster.py +160 -68
  7. elasticsearch/_async/client/connector.py +362 -25
  8. elasticsearch/_async/client/dangling_indices.py +3 -3
  9. elasticsearch/_async/client/enrich.py +6 -6
  10. elasticsearch/_async/client/eql.py +13 -11
  11. elasticsearch/_async/client/esql.py +3 -2
  12. elasticsearch/_async/client/features.py +27 -5
  13. elasticsearch/_async/client/fleet.py +1 -1
  14. elasticsearch/_async/client/graph.py +9 -3
  15. elasticsearch/_async/client/ilm.py +74 -39
  16. elasticsearch/_async/client/indices.py +633 -152
  17. elasticsearch/_async/client/inference.py +99 -16
  18. elasticsearch/_async/client/ingest.py +201 -23
  19. elasticsearch/_async/client/license.py +38 -22
  20. elasticsearch/_async/client/logstash.py +12 -9
  21. elasticsearch/_async/client/migration.py +17 -8
  22. elasticsearch/_async/client/ml.py +137 -79
  23. elasticsearch/_async/client/monitoring.py +3 -2
  24. elasticsearch/_async/client/nodes.py +37 -23
  25. elasticsearch/_async/client/query_rules.py +47 -25
  26. elasticsearch/_async/client/rollup.py +96 -21
  27. elasticsearch/_async/client/search_application.py +138 -9
  28. elasticsearch/_async/client/searchable_snapshots.py +33 -24
  29. elasticsearch/_async/client/security.py +751 -123
  30. elasticsearch/_async/client/shutdown.py +38 -15
  31. elasticsearch/_async/client/simulate.py +151 -0
  32. elasticsearch/_async/client/slm.py +147 -28
  33. elasticsearch/_async/client/snapshot.py +309 -25
  34. elasticsearch/_async/client/sql.py +79 -58
  35. elasticsearch/_async/client/ssl.py +1 -1
  36. elasticsearch/_async/client/synonyms.py +52 -29
  37. elasticsearch/_async/client/tasks.py +71 -31
  38. elasticsearch/_async/client/text_structure.py +468 -48
  39. elasticsearch/_async/client/transform.py +21 -14
  40. elasticsearch/_async/client/watcher.py +226 -60
  41. elasticsearch/_async/client/xpack.py +13 -8
  42. elasticsearch/_sync/client/__init__.py +234 -96
  43. elasticsearch/_sync/client/async_search.py +12 -22
  44. elasticsearch/_sync/client/autoscaling.py +39 -4
  45. elasticsearch/_sync/client/cat.py +90 -221
  46. elasticsearch/_sync/client/ccr.py +85 -35
  47. elasticsearch/_sync/client/cluster.py +160 -68
  48. elasticsearch/_sync/client/connector.py +362 -25
  49. elasticsearch/_sync/client/dangling_indices.py +3 -3
  50. elasticsearch/_sync/client/enrich.py +6 -6
  51. elasticsearch/_sync/client/eql.py +13 -11
  52. elasticsearch/_sync/client/esql.py +3 -2
  53. elasticsearch/_sync/client/features.py +27 -5
  54. elasticsearch/_sync/client/fleet.py +1 -1
  55. elasticsearch/_sync/client/graph.py +9 -3
  56. elasticsearch/_sync/client/ilm.py +74 -39
  57. elasticsearch/_sync/client/indices.py +633 -152
  58. elasticsearch/_sync/client/inference.py +99 -16
  59. elasticsearch/_sync/client/ingest.py +201 -23
  60. elasticsearch/_sync/client/license.py +38 -22
  61. elasticsearch/_sync/client/logstash.py +12 -9
  62. elasticsearch/_sync/client/migration.py +17 -8
  63. elasticsearch/_sync/client/ml.py +137 -79
  64. elasticsearch/_sync/client/monitoring.py +3 -2
  65. elasticsearch/_sync/client/nodes.py +37 -23
  66. elasticsearch/_sync/client/query_rules.py +47 -25
  67. elasticsearch/_sync/client/rollup.py +96 -21
  68. elasticsearch/_sync/client/search_application.py +138 -9
  69. elasticsearch/_sync/client/searchable_snapshots.py +33 -24
  70. elasticsearch/_sync/client/security.py +751 -123
  71. elasticsearch/_sync/client/shutdown.py +38 -15
  72. elasticsearch/_sync/client/simulate.py +151 -0
  73. elasticsearch/_sync/client/slm.py +147 -28
  74. elasticsearch/_sync/client/snapshot.py +309 -25
  75. elasticsearch/_sync/client/sql.py +79 -58
  76. elasticsearch/_sync/client/ssl.py +1 -1
  77. elasticsearch/_sync/client/synonyms.py +52 -29
  78. elasticsearch/_sync/client/tasks.py +71 -31
  79. elasticsearch/_sync/client/text_structure.py +468 -48
  80. elasticsearch/_sync/client/transform.py +21 -14
  81. elasticsearch/_sync/client/watcher.py +226 -60
  82. elasticsearch/_sync/client/xpack.py +13 -8
  83. elasticsearch/_version.py +1 -1
  84. elasticsearch/client.py +2 -0
  85. {elasticsearch-8.16.0.dist-info → elasticsearch-8.17.1.dist-info}/METADATA +6 -4
  86. elasticsearch-8.17.1.dist-info/RECORD +119 -0
  87. {elasticsearch-8.16.0.dist-info → elasticsearch-8.17.1.dist-info}/WHEEL +1 -1
  88. elasticsearch-8.16.0.dist-info/RECORD +0 -117
  89. {elasticsearch-8.16.0.dist-info → elasticsearch-8.17.1.dist-info}/licenses/LICENSE +0 -0
  90. {elasticsearch-8.16.0.dist-info → elasticsearch-8.17.1.dist-info}/licenses/NOTICE +0 -0
@@ -41,7 +41,7 @@ class TransformClient(NamespacedClient):
41
41
  """
42
42
  Delete a transform. Deletes a transform.
43
43
 
44
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.16/delete-transform.html>`_
44
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/delete-transform.html>`_
45
45
 
46
46
  :param transform_id: Identifier for the transform.
47
47
  :param delete_dest_index: If this value is true, the destination index is deleted
@@ -101,7 +101,7 @@ class TransformClient(NamespacedClient):
101
101
  """
102
102
  Get transforms. Retrieves configuration information for transforms.
103
103
 
104
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.16/get-transform.html>`_
104
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/get-transform.html>`_
105
105
 
106
106
  :param transform_id: Identifier for the transform. It can be a transform identifier
107
107
  or a wildcard expression. You can get information for all transforms by using
@@ -170,7 +170,7 @@ class TransformClient(NamespacedClient):
170
170
  """
171
171
  Get transform stats. Retrieves usage information for transforms.
172
172
 
173
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.16/get-transform-stats.html>`_
173
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/get-transform-stats.html>`_
174
174
 
175
175
  :param transform_id: Identifier for the transform. It can be a transform identifier
176
176
  or a wildcard expression. You can get information for all transforms by using
@@ -256,7 +256,7 @@ class TransformClient(NamespacedClient):
256
256
  These values are determined based on the field types of the source index and
257
257
  the transform aggregations.
258
258
 
259
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.16/preview-transform.html>`_
259
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/preview-transform.html>`_
260
260
 
261
261
  :param transform_id: Identifier for the transform to preview. If you specify
262
262
  this path parameter, you cannot provide transform configuration details in
@@ -393,7 +393,7 @@ class TransformClient(NamespacedClient):
393
393
  If you used transforms prior to 7.5, also do not give users any privileges on
394
394
  `.data-frame-internal*` indices.
395
395
 
396
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.16/put-transform.html>`_
396
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/put-transform.html>`_
397
397
 
398
398
  :param transform_id: Identifier for the transform. This identifier can contain
399
399
  lowercase alphanumeric characters (a-z and 0-9), hyphens, and underscores.
@@ -495,7 +495,7 @@ class TransformClient(NamespacedClient):
495
495
  it; alternatively, use the `force` query parameter. If the destination index
496
496
  was created by the transform, it is deleted.
497
497
 
498
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.16/reset-transform.html>`_
498
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/reset-transform.html>`_
499
499
 
500
500
  :param transform_id: Identifier for the transform. This identifier can contain
501
501
  lowercase alphanumeric characters (a-z and 0-9), hyphens, and underscores.
@@ -547,7 +547,7 @@ class TransformClient(NamespacedClient):
547
547
  the transform will be processed again at now + frequency unless _schedule_now
548
548
  API is called again in the meantime.
549
549
 
550
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.16/schedule-now-transform.html>`_
550
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/schedule-now-transform.html>`_
551
551
 
552
552
  :param transform_id: Identifier for the transform.
553
553
  :param timeout: Controls the time to wait for the scheduling to take place
@@ -611,7 +611,7 @@ class TransformClient(NamespacedClient):
611
611
  privileges on the source and destination indices, the transform fails when it
612
612
  attempts unauthorized operations.
613
613
 
614
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.16/start-transform.html>`_
614
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/start-transform.html>`_
615
615
 
616
616
  :param transform_id: Identifier for the transform.
617
617
  :param from_: Restricts the set of transformed entities to those changed after
@@ -665,7 +665,7 @@ class TransformClient(NamespacedClient):
665
665
  """
666
666
  Stop transforms. Stops one or more transforms.
667
667
 
668
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.16/stop-transform.html>`_
668
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/stop-transform.html>`_
669
669
 
670
670
  :param transform_id: Identifier for the transform. To stop multiple transforms,
671
671
  use a comma-separated list or a wildcard expression. To stop all transforms,
@@ -765,7 +765,7 @@ class TransformClient(NamespacedClient):
765
765
  which roles the user who updated it had at the time of update and runs with those
766
766
  privileges.
767
767
 
768
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.16/update-transform.html>`_
768
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/update-transform.html>`_
769
769
 
770
770
  :param transform_id: Identifier for the transform.
771
771
  :param defer_validation: When true, deferrable validations are not run. This
@@ -844,15 +844,22 @@ class TransformClient(NamespacedClient):
844
844
  timeout: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
845
845
  ) -> ObjectApiResponse[t.Any]:
846
846
  """
847
- Upgrades all transforms. This API identifies transforms that have a legacy configuration
847
+ Upgrade all transforms. Transforms are compatible across minor versions and between
848
+ supported major versions. However, over time, the format of transform configuration
849
+ information may change. This API identifies transforms that have a legacy configuration
848
850
  format and upgrades them to the latest version. It also cleans up the internal
849
851
  data structures that store the transform state and checkpoints. The upgrade does
850
852
  not affect the source and destination indices. The upgrade also does not affect
851
853
  the roles that transforms use when Elasticsearch security features are enabled;
852
854
  the role used to read source data and write to the destination index remains
853
- unchanged.
854
-
855
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.16/upgrade-transforms.html>`_
855
+ unchanged. If a transform upgrade step fails, the upgrade stops and an error
856
+ is returned about the underlying issue. Resolve the issue then re-run the process
857
+ again. A summary is returned when the upgrade is finished. To ensure continuous
858
+ transforms remain running during a major version upgrade of the cluster – for
859
+ example, from 7.16 to 8.0 – it is recommended to upgrade transforms before upgrading
860
+ the cluster. You may want to perform a recent cluster backup prior to the upgrade.
861
+
862
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/upgrade-transforms.html>`_
856
863
 
857
864
  :param dry_run: When true, the request checks for updates but does not run them.
858
865
  :param timeout: Period to wait for a response. If no response is received before
@@ -37,12 +37,20 @@ class WatcherClient(NamespacedClient):
37
37
  pretty: t.Optional[bool] = None,
38
38
  ) -> ObjectApiResponse[t.Any]:
39
39
  """
40
- Acknowledges a watch, manually throttling the execution of the watch's actions.
41
-
42
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.16/watcher-api-ack-watch.html>`_
43
-
44
- :param watch_id: Watch ID
45
- :param action_id: A comma-separated list of the action ids to be acked
40
+ Acknowledge a watch. Acknowledging a watch enables you to manually throttle the
41
+ execution of the watch's actions. The acknowledgement state of an action is stored
42
+ in the `status.actions.<id>.ack.state` structure. IMPORTANT: If the specified
43
+ watch is currently being executed, this API will return an error The reason for
44
+ this behavior is to prevent overwriting the watch status from a watch execution.
45
+ Acknowledging an action throttles further executions of that action until its
46
+ `ack.state` is reset to `awaits_successful_execution`. This happens when the
47
+ condition of the watch is not met (the condition evaluates to false).
48
+
49
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/watcher-api-ack-watch.html>`_
50
+
51
+ :param watch_id: The watch identifier.
52
+ :param action_id: A comma-separated list of the action identifiers to acknowledge.
53
+ If you omit this parameter, all of the actions of the watch are acknowledged.
46
54
  """
47
55
  if watch_id in SKIP_IN_PATH:
48
56
  raise ValueError("Empty value passed for parameter 'watch_id'")
@@ -88,11 +96,11 @@ class WatcherClient(NamespacedClient):
88
96
  pretty: t.Optional[bool] = None,
89
97
  ) -> ObjectApiResponse[t.Any]:
90
98
  """
91
- Activates a currently inactive watch.
99
+ Activate a watch. A watch can be either active or inactive.
92
100
 
93
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.16/watcher-api-activate-watch.html>`_
101
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/watcher-api-activate-watch.html>`_
94
102
 
95
- :param watch_id: Watch ID
103
+ :param watch_id: The watch identifier.
96
104
  """
97
105
  if watch_id in SKIP_IN_PATH:
98
106
  raise ValueError("Empty value passed for parameter 'watch_id'")
@@ -128,11 +136,11 @@ class WatcherClient(NamespacedClient):
128
136
  pretty: t.Optional[bool] = None,
129
137
  ) -> ObjectApiResponse[t.Any]:
130
138
  """
131
- Deactivates a currently active watch.
139
+ Deactivate a watch. A watch can be either active or inactive.
132
140
 
133
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.16/watcher-api-deactivate-watch.html>`_
141
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/watcher-api-deactivate-watch.html>`_
134
142
 
135
- :param watch_id: Watch ID
143
+ :param watch_id: The watch identifier.
136
144
  """
137
145
  if watch_id in SKIP_IN_PATH:
138
146
  raise ValueError("Empty value passed for parameter 'watch_id'")
@@ -168,11 +176,17 @@ class WatcherClient(NamespacedClient):
168
176
  pretty: t.Optional[bool] = None,
169
177
  ) -> ObjectApiResponse[t.Any]:
170
178
  """
171
- Removes a watch from Watcher.
179
+ Delete a watch. When the watch is removed, the document representing the watch
180
+ in the `.watches` index is gone and it will never be run again. Deleting a watch
181
+ does not delete any watch execution records related to this watch from the watch
182
+ history. IMPORTANT: Deleting a watch must be done by using only this API. Do
183
+ not delete the watch directly from the `.watches` index using the Elasticsearch
184
+ delete document API When Elasticsearch security features are enabled, make sure
185
+ no write privileges are granted to anyone for the `.watches` index.
172
186
 
173
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.16/watcher-api-delete-watch.html>`_
187
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/watcher-api-delete-watch.html>`_
174
188
 
175
- :param id: Watch ID
189
+ :param id: The watch identifier.
176
190
  """
177
191
  if id in SKIP_IN_PATH:
178
192
  raise ValueError("Empty value passed for parameter 'id'")
@@ -237,17 +251,25 @@ class WatcherClient(NamespacedClient):
237
251
  body: t.Optional[t.Dict[str, t.Any]] = None,
238
252
  ) -> ObjectApiResponse[t.Any]:
239
253
  """
240
- This API can be used to force execution of the watch outside of its triggering
241
- logic or to simulate the watch execution for debugging purposes. For testing
242
- and debugging purposes, you also have fine-grained control on how the watch runs.
243
- You can execute the watch without executing all of its actions or alternatively
254
+ Run a watch. This API can be used to force execution of the watch outside of
255
+ its triggering logic or to simulate the watch execution for debugging purposes.
256
+ For testing and debugging purposes, you also have fine-grained control on how
257
+ the watch runs. You can run the watch without running all of its actions or alternatively
244
258
  by simulating them. You can also force execution by ignoring the watch condition
245
259
  and control whether a watch record would be written to the watch history after
246
- execution.
247
-
248
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.16/watcher-api-execute-watch.html>`_
249
-
250
- :param id: Identifier for the watch.
260
+ it runs. You can use the run watch API to run watches that are not yet registered
261
+ by specifying the watch definition inline. This serves as great tool for testing
262
+ and debugging your watches prior to adding them to Watcher. When Elasticsearch
263
+ security features are enabled on your cluster, watches are run with the privileges
264
+ of the user that stored the watches. If your user is allowed to read index `a`,
265
+ but not index `b`, then the exact same set of rules will apply during execution
266
+ of a watch. When using the run watch API, the authorization data of the user
267
+ that called the API will be used as a base, instead of the information who stored
268
+ the watch.
269
+
270
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/watcher-api-execute-watch.html>`_
271
+
272
+ :param id: The watch identifier.
251
273
  :param action_modes: Determines how to handle the watch actions as part of the
252
274
  watch execution.
253
275
  :param alternative_input: When present, the watch uses this object as a payload
@@ -258,12 +280,12 @@ class WatcherClient(NamespacedClient):
258
280
  :param record_execution: When set to `true`, the watch record representing the
259
281
  watch execution result is persisted to the `.watcher-history` index for the
260
282
  current time. In addition, the status of the watch is updated, possibly throttling
261
- subsequent executions. This can also be specified as an HTTP parameter.
283
+ subsequent runs. This can also be specified as an HTTP parameter.
262
284
  :param simulated_actions:
263
285
  :param trigger_data: This structure is parsed as the data of the trigger event
264
- that will be used during the watch execution
286
+ that will be used during the watch execution.
265
287
  :param watch: When present, this watch is used instead of the one specified in
266
- the request. This watch is not persisted to the index and record_execution
288
+ the request. This watch is not persisted to the index and `record_execution`
267
289
  cannot be set.
268
290
  """
269
291
  __path_parts: t.Dict[str, str]
@@ -315,6 +337,50 @@ class WatcherClient(NamespacedClient):
315
337
  path_parts=__path_parts,
316
338
  )
317
339
 
340
+ @_rewrite_parameters()
341
+ def get_settings(
342
+ self,
343
+ *,
344
+ error_trace: t.Optional[bool] = None,
345
+ filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
346
+ human: t.Optional[bool] = None,
347
+ master_timeout: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
348
+ pretty: t.Optional[bool] = None,
349
+ ) -> ObjectApiResponse[t.Any]:
350
+ """
351
+ Get Watcher index settings. Get settings for the Watcher internal index (`.watches`).
352
+ Only a subset of settings are shown, for example `index.auto_expand_replicas`
353
+ and `index.number_of_replicas`.
354
+
355
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/watcher-api-get-settings.html>`_
356
+
357
+ :param master_timeout: The period to wait for a connection to the master node.
358
+ If no response is received before the timeout expires, the request fails
359
+ and returns an error.
360
+ """
361
+ __path_parts: t.Dict[str, str] = {}
362
+ __path = "/_watcher/settings"
363
+ __query: t.Dict[str, t.Any] = {}
364
+ if error_trace is not None:
365
+ __query["error_trace"] = error_trace
366
+ if filter_path is not None:
367
+ __query["filter_path"] = filter_path
368
+ if human is not None:
369
+ __query["human"] = human
370
+ if master_timeout is not None:
371
+ __query["master_timeout"] = master_timeout
372
+ if pretty is not None:
373
+ __query["pretty"] = pretty
374
+ __headers = {"accept": "application/json"}
375
+ return self.perform_request( # type: ignore[return-value]
376
+ "GET",
377
+ __path,
378
+ params=__query,
379
+ headers=__headers,
380
+ endpoint_id="watcher.get_settings",
381
+ path_parts=__path_parts,
382
+ )
383
+
318
384
  @_rewrite_parameters()
319
385
  def get_watch(
320
386
  self,
@@ -326,11 +392,11 @@ class WatcherClient(NamespacedClient):
326
392
  pretty: t.Optional[bool] = None,
327
393
  ) -> ObjectApiResponse[t.Any]:
328
394
  """
329
- Retrieves a watch by its ID.
395
+ Get a watch.
330
396
 
331
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.16/watcher-api-get-watch.html>`_
397
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/watcher-api-get-watch.html>`_
332
398
 
333
- :param id: Watch ID
399
+ :param id: The watch identifier.
334
400
  """
335
401
  if id in SKIP_IN_PATH:
336
402
  raise ValueError("Empty value passed for parameter 'id'")
@@ -362,6 +428,7 @@ class WatcherClient(NamespacedClient):
362
428
  "input",
363
429
  "metadata",
364
430
  "throttle_period",
431
+ "throttle_period_in_millis",
365
432
  "transform",
366
433
  "trigger",
367
434
  ),
@@ -381,30 +448,50 @@ class WatcherClient(NamespacedClient):
381
448
  input: t.Optional[t.Mapping[str, t.Any]] = None,
382
449
  metadata: t.Optional[t.Mapping[str, t.Any]] = None,
383
450
  pretty: t.Optional[bool] = None,
384
- throttle_period: t.Optional[str] = None,
451
+ throttle_period: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
452
+ throttle_period_in_millis: t.Optional[t.Any] = None,
385
453
  transform: t.Optional[t.Mapping[str, t.Any]] = None,
386
454
  trigger: t.Optional[t.Mapping[str, t.Any]] = None,
387
455
  version: t.Optional[int] = None,
388
456
  body: t.Optional[t.Dict[str, t.Any]] = None,
389
457
  ) -> ObjectApiResponse[t.Any]:
390
458
  """
391
- Creates a new watch, or updates an existing one.
392
-
393
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.16/watcher-api-put-watch.html>`_
394
-
395
- :param id: Watch ID
396
- :param actions:
397
- :param active: Specify whether the watch is in/active by default
398
- :param condition:
459
+ Create or update a watch. When a watch is registered, a new document that represents
460
+ the watch is added to the `.watches` index and its trigger is immediately registered
461
+ with the relevant trigger engine. Typically for the `schedule` trigger, the scheduler
462
+ is the trigger engine. IMPORTANT: You must use Kibana or this API to create a
463
+ watch. Do not add a watch directly to the `.watches` index by using the Elasticsearch
464
+ index API. If Elasticsearch security features are enabled, do not give users
465
+ write privileges on the `.watches` index. When you add a watch you can also define
466
+ its initial active state by setting the *active* parameter. When Elasticsearch
467
+ security features are enabled, your watch can index or search only on indices
468
+ for which the user that stored the watch has privileges. If the user is able
469
+ to read index `a`, but not index `b`, the same will apply when the watch runs.
470
+
471
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/watcher-api-put-watch.html>`_
472
+
473
+ :param id: The identifier for the watch.
474
+ :param actions: The list of actions that will be run if the condition matches.
475
+ :param active: The initial state of the watch. The default value is `true`, which
476
+ means the watch is active by default.
477
+ :param condition: The condition that defines if the actions should be run.
399
478
  :param if_primary_term: only update the watch if the last operation that has
400
479
  changed the watch has the specified primary term
401
480
  :param if_seq_no: only update the watch if the last operation that has changed
402
481
  the watch has the specified sequence number
403
- :param input:
404
- :param metadata:
405
- :param throttle_period:
406
- :param transform:
407
- :param trigger:
482
+ :param input: The input that defines the input that loads the data for the watch.
483
+ :param metadata: Metadata JSON that will be copied into the history entries.
484
+ :param throttle_period: The minimum time between actions being run. The default
485
+ is 5 seconds. This default can be changed in the config file with the setting
486
+ `xpack.watcher.throttle.period.default_period`. If both this value and the
487
+ `throttle_period_in_millis` parameter are specified, Watcher uses the last
488
+ parameter included in the request.
489
+ :param throttle_period_in_millis: Minimum time in milliseconds between actions
490
+ being run. Defaults to 5000. If both this value and the throttle_period parameter
491
+ are specified, Watcher uses the last parameter included in the request.
492
+ :param transform: The transform that processes the watch payload to prepare it
493
+ for the watch actions.
494
+ :param trigger: The trigger that defines when the watch should run.
408
495
  :param version: Explicit version number for concurrency control
409
496
  """
410
497
  if id in SKIP_IN_PATH:
@@ -440,6 +527,8 @@ class WatcherClient(NamespacedClient):
440
527
  __body["metadata"] = metadata
441
528
  if throttle_period is not None:
442
529
  __body["throttle_period"] = throttle_period
530
+ if throttle_period_in_millis is not None:
531
+ __body["throttle_period_in_millis"] = throttle_period_in_millis
443
532
  if transform is not None:
444
533
  __body["transform"] = transform
445
534
  if trigger is not None:
@@ -485,16 +574,18 @@ class WatcherClient(NamespacedClient):
485
574
  body: t.Optional[t.Dict[str, t.Any]] = None,
486
575
  ) -> ObjectApiResponse[t.Any]:
487
576
  """
488
- Retrieves stored watches.
489
-
490
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.16/watcher-api-query-watches.html>`_
491
-
492
- :param from_: The offset from the first result to fetch. Needs to be non-negative.
493
- :param query: Optional, query filter watches to be returned.
494
- :param search_after: Optional search After to do pagination using last hit’s
495
- sort values.
496
- :param size: The number of hits to return. Needs to be non-negative.
497
- :param sort: Optional sort definition.
577
+ Query watches. Get all registered watches in a paginated manner and optionally
578
+ filter watches by a query. Note that only the `_id` and `metadata.*` fields are
579
+ queryable or sortable.
580
+
581
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/watcher-api-query-watches.html>`_
582
+
583
+ :param from_: The offset from the first result to fetch. It must be non-negative.
584
+ :param query: A query that filters the watches to be returned.
585
+ :param search_after: Retrieve the next page of hits using a set of sort values
586
+ from the previous page.
587
+ :param size: The number of hits to return. It must be non-negative.
588
+ :param sort: One or more fields used to sort the search results.
498
589
  """
499
590
  __path_parts: t.Dict[str, str] = {}
500
591
  __path = "/_watcher/_query/watches"
@@ -555,9 +646,9 @@ class WatcherClient(NamespacedClient):
555
646
  pretty: t.Optional[bool] = None,
556
647
  ) -> ObjectApiResponse[t.Any]:
557
648
  """
558
- Starts Watcher if it is not already running.
649
+ Start the watch service. Start the Watcher service if it is not already running.
559
650
 
560
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.16/watcher-api-start.html>`_
651
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/watcher-api-start.html>`_
561
652
  """
562
653
  __path_parts: t.Dict[str, str] = {}
563
654
  __path = "/_watcher/_start"
@@ -612,9 +703,10 @@ class WatcherClient(NamespacedClient):
612
703
  pretty: t.Optional[bool] = None,
613
704
  ) -> ObjectApiResponse[t.Any]:
614
705
  """
615
- Retrieves the current Watcher metrics.
706
+ Get Watcher statistics. This API always returns basic metrics. You retrieve more
707
+ metrics by using the metric parameter.
616
708
 
617
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.16/watcher-api-stats.html>`_
709
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/watcher-api-stats.html>`_
618
710
 
619
711
  :param metric: Defines which additional metrics are included in the response.
620
712
  :param emit_stacktraces: Defines whether stack traces are generated for each
@@ -655,12 +747,17 @@ class WatcherClient(NamespacedClient):
655
747
  error_trace: t.Optional[bool] = None,
656
748
  filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
657
749
  human: t.Optional[bool] = None,
750
+ master_timeout: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
658
751
  pretty: t.Optional[bool] = None,
659
752
  ) -> ObjectApiResponse[t.Any]:
660
753
  """
661
- Stops Watcher if it is running.
754
+ Stop the watch service. Stop the Watcher service if it is running.
755
+
756
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/watcher-api-stop.html>`_
662
757
 
663
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.16/watcher-api-stop.html>`_
758
+ :param master_timeout: The period to wait for the master node. If the master
759
+ node is not available before the timeout expires, the request fails and returns
760
+ an error. To indicate that the request should never timeout, set it to `-1`.
664
761
  """
665
762
  __path_parts: t.Dict[str, str] = {}
666
763
  __path = "/_watcher/_stop"
@@ -671,6 +768,8 @@ class WatcherClient(NamespacedClient):
671
768
  __query["filter_path"] = filter_path
672
769
  if human is not None:
673
770
  __query["human"] = human
771
+ if master_timeout is not None:
772
+ __query["master_timeout"] = master_timeout
674
773
  if pretty is not None:
675
774
  __query["pretty"] = pretty
676
775
  __headers = {"accept": "application/json"}
@@ -682,3 +781,70 @@ class WatcherClient(NamespacedClient):
682
781
  endpoint_id="watcher.stop",
683
782
  path_parts=__path_parts,
684
783
  )
784
+
785
+ @_rewrite_parameters(
786
+ body_fields=("index_auto_expand_replicas", "index_number_of_replicas"),
787
+ parameter_aliases={
788
+ "index.auto_expand_replicas": "index_auto_expand_replicas",
789
+ "index.number_of_replicas": "index_number_of_replicas",
790
+ },
791
+ )
792
+ def update_settings(
793
+ self,
794
+ *,
795
+ error_trace: t.Optional[bool] = None,
796
+ filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
797
+ human: t.Optional[bool] = None,
798
+ index_auto_expand_replicas: t.Optional[str] = None,
799
+ index_number_of_replicas: t.Optional[int] = None,
800
+ master_timeout: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
801
+ pretty: t.Optional[bool] = None,
802
+ timeout: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
803
+ body: t.Optional[t.Dict[str, t.Any]] = None,
804
+ ) -> ObjectApiResponse[t.Any]:
805
+ """
806
+ Update Watcher index settings. Update settings for the Watcher internal index
807
+ (`.watches`). Only a subset of settings can be modified. This includes `index.auto_expand_replicas`
808
+ and `index.number_of_replicas`.
809
+
810
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/watcher-api-update-settings.html>`_
811
+
812
+ :param index_auto_expand_replicas:
813
+ :param index_number_of_replicas:
814
+ :param master_timeout: The period to wait for a connection to the master node.
815
+ If no response is received before the timeout expires, the request fails
816
+ and returns an error.
817
+ :param timeout: The period to wait for a response. If no response is received
818
+ before the timeout expires, the request fails and returns an error.
819
+ """
820
+ __path_parts: t.Dict[str, str] = {}
821
+ __path = "/_watcher/settings"
822
+ __query: t.Dict[str, t.Any] = {}
823
+ __body: t.Dict[str, t.Any] = body if body is not None else {}
824
+ if error_trace is not None:
825
+ __query["error_trace"] = error_trace
826
+ if filter_path is not None:
827
+ __query["filter_path"] = filter_path
828
+ if human is not None:
829
+ __query["human"] = human
830
+ if master_timeout is not None:
831
+ __query["master_timeout"] = master_timeout
832
+ if pretty is not None:
833
+ __query["pretty"] = pretty
834
+ if timeout is not None:
835
+ __query["timeout"] = timeout
836
+ if not __body:
837
+ if index_auto_expand_replicas is not None:
838
+ __body["index.auto_expand_replicas"] = index_auto_expand_replicas
839
+ if index_number_of_replicas is not None:
840
+ __body["index.number_of_replicas"] = index_number_of_replicas
841
+ __headers = {"accept": "application/json", "content-type": "application/json"}
842
+ return self.perform_request( # type: ignore[return-value]
843
+ "PUT",
844
+ __path,
845
+ params=__query,
846
+ headers=__headers,
847
+ body=__body,
848
+ endpoint_id="watcher.update_settings",
849
+ path_parts=__path_parts,
850
+ )
@@ -43,9 +43,12 @@ class XPackClient(NamespacedClient):
43
43
  pretty: t.Optional[bool] = None,
44
44
  ) -> ObjectApiResponse[t.Any]:
45
45
  """
46
- Provides general information about the installed X-Pack features.
46
+ Get information. The information provided by the API includes: * Build information
47
+ including the build number and timestamp. * License information about the currently
48
+ installed license. * Feature information for the features that are currently
49
+ enabled and available under the current license.
47
50
 
48
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.16/info-api.html>`_
51
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/info-api.html>`_
49
52
 
50
53
  :param accept_enterprise: If this param is used it must be set to true
51
54
  :param categories: A comma-separated list of the information categories to include
@@ -87,14 +90,16 @@ class XPackClient(NamespacedClient):
87
90
  pretty: t.Optional[bool] = None,
88
91
  ) -> ObjectApiResponse[t.Any]:
89
92
  """
90
- This API provides information about which features are currently enabled and
91
- available under the current license and some usage statistics.
93
+ Get usage information. Get information about the features that are currently
94
+ enabled and available under the current license. The API also provides some usage
95
+ statistics.
92
96
 
93
- `<https://www.elastic.co/guide/en/elasticsearch/reference/8.16/usage-api.html>`_
97
+ `<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/usage-api.html>`_
94
98
 
95
- :param master_timeout: Period to wait for a connection to the master node. If
96
- no response is received before the timeout expires, the request fails and
97
- returns an error.
99
+ :param master_timeout: The period to wait for a connection to the master node.
100
+ If no response is received before the timeout expires, the request fails
101
+ and returns an error. To indicate that the request should never timeout,
102
+ set it to `-1`.
98
103
  """
99
104
  __path_parts: t.Dict[str, str] = {}
100
105
  __path = "/_xpack/usage"
elasticsearch/_version.py CHANGED
@@ -15,4 +15,4 @@
15
15
  # specific language governing permissions and limitations
16
16
  # under the License.
17
17
 
18
- __versionstr__ = "8.16.0"
18
+ __versionstr__ = "8.17.1"
elasticsearch/client.py CHANGED
@@ -57,6 +57,7 @@ from ._sync.client.searchable_snapshots import ( # noqa: F401
57
57
  )
58
58
  from ._sync.client.security import SecurityClient as SecurityClient # noqa: F401
59
59
  from ._sync.client.shutdown import ShutdownClient as ShutdownClient # noqa: F401
60
+ from ._sync.client.simulate import SimulateClient as SimulateClient # noqa: F401
60
61
  from ._sync.client.slm import SlmClient as SlmClient # noqa: F401
61
62
  from ._sync.client.snapshot import SnapshotClient as SnapshotClient # noqa: F401
62
63
  from ._sync.client.sql import SqlClient as SqlClient # noqa: F401
@@ -107,6 +108,7 @@ __all__ = [
107
108
  "SearchableSnapshotsClient",
108
109
  "SecurityClient",
109
110
  "ShutdownClient",
111
+ "SimulateClient",
110
112
  "SlmClient",
111
113
  "SnapshotClient",
112
114
  "SqlClient",
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.3
1
+ Metadata-Version: 2.4
2
2
  Name: elasticsearch
3
- Version: 8.16.0
3
+ Version: 8.17.1
4
4
  Summary: Python client for Elasticsearch
5
5
  Project-URL: Documentation, https://elasticsearch-py.readthedocs.io/
6
6
  Project-URL: Homepage, https://github.com/elastic/elasticsearch-py
@@ -8,7 +8,9 @@ Project-URL: Issue Tracker, https://github.com/elastic/elasticsearch-py/issues
8
8
  Project-URL: Source Code, https://github.com/elastic/elasticsearch-py
9
9
  Author-email: Elastic Client Library Maintainers <client-libs@elastic.co>
10
10
  Maintainer-email: Elastic Client Library Maintainers <client-libs@elastic.co>
11
- License: Apache-2.0
11
+ License-Expression: Apache-2.0
12
+ License-File: LICENSE
13
+ License-File: NOTICE
12
14
  Keywords: REST,client,elastic,elasticsearch,index,kibana,mapping,search
13
15
  Classifier: Development Status :: 5 - Production/Stable
14
16
  Classifier: Intended Audience :: Developers
@@ -47,7 +49,7 @@ Requires-Dist: pytest-cov; extra == 'dev'
47
49
  Requires-Dist: python-dateutil; extra == 'dev'
48
50
  Requires-Dist: pyyaml>=5.4; extra == 'dev'
49
51
  Requires-Dist: requests<3,>=2; extra == 'dev'
50
- Requires-Dist: simsimd; (python_version < '3.13') and extra == 'dev'
52
+ Requires-Dist: simsimd; extra == 'dev'
51
53
  Requires-Dist: twine; extra == 'dev'
52
54
  Requires-Dist: unasync; extra == 'dev'
53
55
  Provides-Extra: docs