elasticsearch 8.17.0__py3-none-any.whl → 8.17.2__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.
- elasticsearch/__init__.py +2 -2
- elasticsearch/_async/client/__init__.py +2034 -740
- elasticsearch/_async/client/async_search.py +33 -22
- elasticsearch/_async/client/autoscaling.py +27 -21
- elasticsearch/_async/client/cat.py +280 -336
- elasticsearch/_async/client/ccr.py +96 -70
- elasticsearch/_async/client/cluster.py +152 -144
- elasticsearch/_async/client/connector.py +488 -55
- elasticsearch/_async/client/dangling_indices.py +22 -16
- elasticsearch/_async/client/enrich.py +25 -6
- elasticsearch/_async/client/eql.py +22 -9
- elasticsearch/_async/client/esql.py +295 -3
- elasticsearch/_async/client/features.py +25 -25
- elasticsearch/_async/client/fleet.py +15 -9
- elasticsearch/_async/client/graph.py +9 -8
- elasticsearch/_async/client/ilm.py +91 -61
- elasticsearch/_async/client/indices.py +746 -324
- elasticsearch/_async/client/inference.py +101 -4
- elasticsearch/_async/client/ingest.py +231 -19
- elasticsearch/_async/client/license.py +48 -31
- elasticsearch/_async/client/logstash.py +20 -6
- elasticsearch/_async/client/migration.py +25 -7
- elasticsearch/_async/client/ml.py +532 -278
- elasticsearch/_async/client/monitoring.py +5 -1
- elasticsearch/_async/client/nodes.py +46 -30
- elasticsearch/_async/client/query_rules.py +65 -18
- elasticsearch/_async/client/rollup.py +126 -13
- elasticsearch/_async/client/search_application.py +170 -13
- elasticsearch/_async/client/searchable_snapshots.py +45 -23
- elasticsearch/_async/client/security.py +1299 -340
- elasticsearch/_async/client/shutdown.py +43 -15
- elasticsearch/_async/client/simulate.py +145 -0
- elasticsearch/_async/client/slm.py +163 -19
- elasticsearch/_async/client/snapshot.py +288 -23
- elasticsearch/_async/client/sql.py +94 -53
- elasticsearch/_async/client/ssl.py +16 -17
- elasticsearch/_async/client/synonyms.py +67 -26
- elasticsearch/_async/client/tasks.py +103 -28
- elasticsearch/_async/client/text_structure.py +475 -46
- elasticsearch/_async/client/transform.py +108 -72
- elasticsearch/_async/client/watcher.py +245 -43
- elasticsearch/_async/client/xpack.py +20 -6
- elasticsearch/_async/helpers.py +1 -1
- elasticsearch/_sync/client/__init__.py +2034 -740
- elasticsearch/_sync/client/async_search.py +33 -22
- elasticsearch/_sync/client/autoscaling.py +27 -21
- elasticsearch/_sync/client/cat.py +280 -336
- elasticsearch/_sync/client/ccr.py +96 -70
- elasticsearch/_sync/client/cluster.py +152 -144
- elasticsearch/_sync/client/connector.py +488 -55
- elasticsearch/_sync/client/dangling_indices.py +22 -16
- elasticsearch/_sync/client/enrich.py +25 -6
- elasticsearch/_sync/client/eql.py +22 -9
- elasticsearch/_sync/client/esql.py +295 -3
- elasticsearch/_sync/client/features.py +25 -25
- elasticsearch/_sync/client/fleet.py +15 -9
- elasticsearch/_sync/client/graph.py +9 -8
- elasticsearch/_sync/client/ilm.py +91 -61
- elasticsearch/_sync/client/indices.py +746 -324
- elasticsearch/_sync/client/inference.py +101 -4
- elasticsearch/_sync/client/ingest.py +231 -19
- elasticsearch/_sync/client/license.py +48 -31
- elasticsearch/_sync/client/logstash.py +20 -6
- elasticsearch/_sync/client/migration.py +25 -7
- elasticsearch/_sync/client/ml.py +532 -278
- elasticsearch/_sync/client/monitoring.py +5 -1
- elasticsearch/_sync/client/nodes.py +46 -30
- elasticsearch/_sync/client/query_rules.py +65 -18
- elasticsearch/_sync/client/rollup.py +126 -13
- elasticsearch/_sync/client/search_application.py +170 -13
- elasticsearch/_sync/client/searchable_snapshots.py +45 -23
- elasticsearch/_sync/client/security.py +1299 -340
- elasticsearch/_sync/client/shutdown.py +43 -15
- elasticsearch/_sync/client/simulate.py +145 -0
- elasticsearch/_sync/client/slm.py +163 -19
- elasticsearch/_sync/client/snapshot.py +288 -23
- elasticsearch/_sync/client/sql.py +94 -53
- elasticsearch/_sync/client/ssl.py +16 -17
- elasticsearch/_sync/client/synonyms.py +67 -26
- elasticsearch/_sync/client/tasks.py +103 -28
- elasticsearch/_sync/client/text_structure.py +475 -46
- elasticsearch/_sync/client/transform.py +108 -72
- elasticsearch/_sync/client/utils.py +1 -1
- elasticsearch/_sync/client/watcher.py +245 -43
- elasticsearch/_sync/client/xpack.py +20 -6
- elasticsearch/_version.py +1 -1
- elasticsearch/client.py +4 -0
- elasticsearch/helpers/actions.py +1 -1
- elasticsearch/helpers/vectorstore/_sync/vectorstore.py +4 -1
- {elasticsearch-8.17.0.dist-info → elasticsearch-8.17.2.dist-info}/METADATA +1 -1
- elasticsearch-8.17.2.dist-info/RECORD +119 -0
- elasticsearch-8.17.0.dist-info/RECORD +0 -117
- {elasticsearch-8.17.0.dist-info → elasticsearch-8.17.2.dist-info}/WHEEL +0 -0
- {elasticsearch-8.17.0.dist-info → elasticsearch-8.17.2.dist-info}/licenses/LICENSE +0 -0
- {elasticsearch-8.17.0.dist-info → elasticsearch-8.17.2.dist-info}/licenses/NOTICE +0 -0
|
@@ -37,12 +37,22 @@ class WatcherClient(NamespacedClient):
|
|
|
37
37
|
pretty: t.Optional[bool] = None,
|
|
38
38
|
) -> ObjectApiResponse[t.Any]:
|
|
39
39
|
"""
|
|
40
|
-
|
|
40
|
+
.. raw:: html
|
|
41
|
+
|
|
42
|
+
<p>Acknowledge a watch.
|
|
43
|
+
Acknowledging a watch enables you to manually throttle the execution of the watch's actions.</p>
|
|
44
|
+
<p>The acknowledgement state of an action is stored in the <code>status.actions.<id>.ack.state</code> structure.</p>
|
|
45
|
+
<p>IMPORTANT: If the specified watch is currently being executed, this API will return an error
|
|
46
|
+
The reason for this behavior is to prevent overwriting the watch status from a watch execution.</p>
|
|
47
|
+
<p>Acknowledging an action throttles further executions of that action until its <code>ack.state</code> is reset to <code>awaits_successful_execution</code>.
|
|
48
|
+
This happens when the condition of the watch is not met (the condition evaluates to false).</p>
|
|
49
|
+
|
|
41
50
|
|
|
42
51
|
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/watcher-api-ack-watch.html>`_
|
|
43
52
|
|
|
44
|
-
:param watch_id:
|
|
45
|
-
:param action_id: A comma-separated list of the action
|
|
53
|
+
:param watch_id: The watch identifier.
|
|
54
|
+
:param action_id: A comma-separated list of the action identifiers to acknowledge.
|
|
55
|
+
If you omit this parameter, all of the actions of the watch are acknowledged.
|
|
46
56
|
"""
|
|
47
57
|
if watch_id in SKIP_IN_PATH:
|
|
48
58
|
raise ValueError("Empty value passed for parameter 'watch_id'")
|
|
@@ -88,11 +98,15 @@ class WatcherClient(NamespacedClient):
|
|
|
88
98
|
pretty: t.Optional[bool] = None,
|
|
89
99
|
) -> ObjectApiResponse[t.Any]:
|
|
90
100
|
"""
|
|
91
|
-
|
|
101
|
+
.. raw:: html
|
|
102
|
+
|
|
103
|
+
<p>Activate a watch.
|
|
104
|
+
A watch can be either active or inactive.</p>
|
|
105
|
+
|
|
92
106
|
|
|
93
107
|
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/watcher-api-activate-watch.html>`_
|
|
94
108
|
|
|
95
|
-
:param watch_id:
|
|
109
|
+
:param watch_id: The watch identifier.
|
|
96
110
|
"""
|
|
97
111
|
if watch_id in SKIP_IN_PATH:
|
|
98
112
|
raise ValueError("Empty value passed for parameter 'watch_id'")
|
|
@@ -128,11 +142,15 @@ class WatcherClient(NamespacedClient):
|
|
|
128
142
|
pretty: t.Optional[bool] = None,
|
|
129
143
|
) -> ObjectApiResponse[t.Any]:
|
|
130
144
|
"""
|
|
131
|
-
|
|
145
|
+
.. raw:: html
|
|
146
|
+
|
|
147
|
+
<p>Deactivate a watch.
|
|
148
|
+
A watch can be either active or inactive.</p>
|
|
149
|
+
|
|
132
150
|
|
|
133
151
|
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/watcher-api-deactivate-watch.html>`_
|
|
134
152
|
|
|
135
|
-
:param watch_id:
|
|
153
|
+
:param watch_id: The watch identifier.
|
|
136
154
|
"""
|
|
137
155
|
if watch_id in SKIP_IN_PATH:
|
|
138
156
|
raise ValueError("Empty value passed for parameter 'watch_id'")
|
|
@@ -168,11 +186,19 @@ class WatcherClient(NamespacedClient):
|
|
|
168
186
|
pretty: t.Optional[bool] = None,
|
|
169
187
|
) -> ObjectApiResponse[t.Any]:
|
|
170
188
|
"""
|
|
171
|
-
|
|
189
|
+
.. raw:: html
|
|
190
|
+
|
|
191
|
+
<p>Delete a watch.
|
|
192
|
+
When the watch is removed, the document representing the watch in the <code>.watches</code> index is gone and it will never be run again.</p>
|
|
193
|
+
<p>Deleting a watch does not delete any watch execution records related to this watch from the watch history.</p>
|
|
194
|
+
<p>IMPORTANT: Deleting a watch must be done by using only this API.
|
|
195
|
+
Do not delete the watch directly from the <code>.watches</code> index using the Elasticsearch delete document API
|
|
196
|
+
When Elasticsearch security features are enabled, make sure no write privileges are granted to anyone for the <code>.watches</code> index.</p>
|
|
197
|
+
|
|
172
198
|
|
|
173
199
|
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/watcher-api-delete-watch.html>`_
|
|
174
200
|
|
|
175
|
-
:param id:
|
|
201
|
+
:param id: The watch identifier.
|
|
176
202
|
"""
|
|
177
203
|
if id in SKIP_IN_PATH:
|
|
178
204
|
raise ValueError("Empty value passed for parameter 'id'")
|
|
@@ -237,17 +263,23 @@ class WatcherClient(NamespacedClient):
|
|
|
237
263
|
body: t.Optional[t.Dict[str, t.Any]] = None,
|
|
238
264
|
) -> ObjectApiResponse[t.Any]:
|
|
239
265
|
"""
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
266
|
+
.. raw:: html
|
|
267
|
+
|
|
268
|
+
<p>Run a watch.
|
|
269
|
+
This API can be used to force execution of the watch outside of its triggering logic or to simulate the watch execution for debugging purposes.</p>
|
|
270
|
+
<p>For testing and debugging purposes, you also have fine-grained control on how the watch runs.
|
|
271
|
+
You can run the watch without running all of its actions or alternatively by simulating them.
|
|
272
|
+
You can also force execution by ignoring the watch condition and control whether a watch record would be written to the watch history after it runs.</p>
|
|
273
|
+
<p>You can use the run watch API to run watches that are not yet registered by specifying the watch definition inline.
|
|
274
|
+
This serves as great tool for testing and debugging your watches prior to adding them to Watcher.</p>
|
|
275
|
+
<p>When Elasticsearch security features are enabled on your cluster, watches are run with the privileges of the user that stored the watches.
|
|
276
|
+
If your user is allowed to read index <code>a</code>, but not index <code>b</code>, then the exact same set of rules will apply during execution of a watch.</p>
|
|
277
|
+
<p>When using the run watch API, the authorization data of the user that called the API will be used as a base, instead of the information who stored the watch.</p>
|
|
278
|
+
|
|
247
279
|
|
|
248
280
|
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/watcher-api-execute-watch.html>`_
|
|
249
281
|
|
|
250
|
-
:param id:
|
|
282
|
+
:param id: The watch identifier.
|
|
251
283
|
:param action_modes: Determines how to handle the watch actions as part of the
|
|
252
284
|
watch execution.
|
|
253
285
|
:param alternative_input: When present, the watch uses this object as a payload
|
|
@@ -258,12 +290,12 @@ class WatcherClient(NamespacedClient):
|
|
|
258
290
|
:param record_execution: When set to `true`, the watch record representing the
|
|
259
291
|
watch execution result is persisted to the `.watcher-history` index for the
|
|
260
292
|
current time. In addition, the status of the watch is updated, possibly throttling
|
|
261
|
-
subsequent
|
|
293
|
+
subsequent runs. This can also be specified as an HTTP parameter.
|
|
262
294
|
:param simulated_actions:
|
|
263
295
|
:param trigger_data: This structure is parsed as the data of the trigger event
|
|
264
|
-
that will be used during the watch execution
|
|
296
|
+
that will be used during the watch execution.
|
|
265
297
|
: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
|
|
298
|
+
the request. This watch is not persisted to the index and `record_execution`
|
|
267
299
|
cannot be set.
|
|
268
300
|
"""
|
|
269
301
|
__path_parts: t.Dict[str, str]
|
|
@@ -315,6 +347,53 @@ class WatcherClient(NamespacedClient):
|
|
|
315
347
|
path_parts=__path_parts,
|
|
316
348
|
)
|
|
317
349
|
|
|
350
|
+
@_rewrite_parameters()
|
|
351
|
+
async def get_settings(
|
|
352
|
+
self,
|
|
353
|
+
*,
|
|
354
|
+
error_trace: t.Optional[bool] = None,
|
|
355
|
+
filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
|
|
356
|
+
human: t.Optional[bool] = None,
|
|
357
|
+
master_timeout: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
|
|
358
|
+
pretty: t.Optional[bool] = None,
|
|
359
|
+
) -> ObjectApiResponse[t.Any]:
|
|
360
|
+
"""
|
|
361
|
+
.. raw:: html
|
|
362
|
+
|
|
363
|
+
<p>Get Watcher index settings.
|
|
364
|
+
Get settings for the Watcher internal index (<code>.watches</code>).
|
|
365
|
+
Only a subset of settings are shown, for example <code>index.auto_expand_replicas</code> and <code>index.number_of_replicas</code>.</p>
|
|
366
|
+
|
|
367
|
+
|
|
368
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/watcher-api-get-settings.html>`_
|
|
369
|
+
|
|
370
|
+
:param master_timeout: The period to wait for a connection to the master node.
|
|
371
|
+
If no response is received before the timeout expires, the request fails
|
|
372
|
+
and returns an error.
|
|
373
|
+
"""
|
|
374
|
+
__path_parts: t.Dict[str, str] = {}
|
|
375
|
+
__path = "/_watcher/settings"
|
|
376
|
+
__query: t.Dict[str, t.Any] = {}
|
|
377
|
+
if error_trace is not None:
|
|
378
|
+
__query["error_trace"] = error_trace
|
|
379
|
+
if filter_path is not None:
|
|
380
|
+
__query["filter_path"] = filter_path
|
|
381
|
+
if human is not None:
|
|
382
|
+
__query["human"] = human
|
|
383
|
+
if master_timeout is not None:
|
|
384
|
+
__query["master_timeout"] = master_timeout
|
|
385
|
+
if pretty is not None:
|
|
386
|
+
__query["pretty"] = pretty
|
|
387
|
+
__headers = {"accept": "application/json"}
|
|
388
|
+
return await self.perform_request( # type: ignore[return-value]
|
|
389
|
+
"GET",
|
|
390
|
+
__path,
|
|
391
|
+
params=__query,
|
|
392
|
+
headers=__headers,
|
|
393
|
+
endpoint_id="watcher.get_settings",
|
|
394
|
+
path_parts=__path_parts,
|
|
395
|
+
)
|
|
396
|
+
|
|
318
397
|
@_rewrite_parameters()
|
|
319
398
|
async def get_watch(
|
|
320
399
|
self,
|
|
@@ -326,11 +405,14 @@ class WatcherClient(NamespacedClient):
|
|
|
326
405
|
pretty: t.Optional[bool] = None,
|
|
327
406
|
) -> ObjectApiResponse[t.Any]:
|
|
328
407
|
"""
|
|
329
|
-
|
|
408
|
+
.. raw:: html
|
|
409
|
+
|
|
410
|
+
<p>Get a watch.</p>
|
|
411
|
+
|
|
330
412
|
|
|
331
413
|
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/watcher-api-get-watch.html>`_
|
|
332
414
|
|
|
333
|
-
:param id:
|
|
415
|
+
:param id: The watch identifier.
|
|
334
416
|
"""
|
|
335
417
|
if id in SKIP_IN_PATH:
|
|
336
418
|
raise ValueError("Empty value passed for parameter 'id'")
|
|
@@ -362,6 +444,7 @@ class WatcherClient(NamespacedClient):
|
|
|
362
444
|
"input",
|
|
363
445
|
"metadata",
|
|
364
446
|
"throttle_period",
|
|
447
|
+
"throttle_period_in_millis",
|
|
365
448
|
"transform",
|
|
366
449
|
"trigger",
|
|
367
450
|
),
|
|
@@ -381,30 +464,51 @@ class WatcherClient(NamespacedClient):
|
|
|
381
464
|
input: t.Optional[t.Mapping[str, t.Any]] = None,
|
|
382
465
|
metadata: t.Optional[t.Mapping[str, t.Any]] = None,
|
|
383
466
|
pretty: t.Optional[bool] = None,
|
|
384
|
-
throttle_period: t.Optional[str] = None,
|
|
467
|
+
throttle_period: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
|
|
468
|
+
throttle_period_in_millis: t.Optional[t.Any] = None,
|
|
385
469
|
transform: t.Optional[t.Mapping[str, t.Any]] = None,
|
|
386
470
|
trigger: t.Optional[t.Mapping[str, t.Any]] = None,
|
|
387
471
|
version: t.Optional[int] = None,
|
|
388
472
|
body: t.Optional[t.Dict[str, t.Any]] = None,
|
|
389
473
|
) -> ObjectApiResponse[t.Any]:
|
|
390
474
|
"""
|
|
391
|
-
|
|
475
|
+
.. raw:: html
|
|
476
|
+
|
|
477
|
+
<p>Create or update a watch.
|
|
478
|
+
When a watch is registered, a new document that represents the watch is added to the <code>.watches</code> index and its trigger is immediately registered with the relevant trigger engine.
|
|
479
|
+
Typically for the <code>schedule</code> trigger, the scheduler is the trigger engine.</p>
|
|
480
|
+
<p>IMPORTANT: You must use Kibana or this API to create a watch.
|
|
481
|
+
Do not add a watch directly to the <code>.watches</code> index by using the Elasticsearch index API.
|
|
482
|
+
If Elasticsearch security features are enabled, do not give users write privileges on the <code>.watches</code> index.</p>
|
|
483
|
+
<p>When you add a watch you can also define its initial active state by setting the <em>active</em> parameter.</p>
|
|
484
|
+
<p>When Elasticsearch security features are enabled, your watch can index or search only on indices for which the user that stored the watch has privileges.
|
|
485
|
+
If the user is able to read index <code>a</code>, but not index <code>b</code>, the same will apply when the watch runs.</p>
|
|
486
|
+
|
|
392
487
|
|
|
393
488
|
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/watcher-api-put-watch.html>`_
|
|
394
489
|
|
|
395
|
-
:param id:
|
|
396
|
-
:param actions:
|
|
397
|
-
:param active:
|
|
398
|
-
|
|
490
|
+
:param id: The identifier for the watch.
|
|
491
|
+
:param actions: The list of actions that will be run if the condition matches.
|
|
492
|
+
:param active: The initial state of the watch. The default value is `true`, which
|
|
493
|
+
means the watch is active by default.
|
|
494
|
+
:param condition: The condition that defines if the actions should be run.
|
|
399
495
|
:param if_primary_term: only update the watch if the last operation that has
|
|
400
496
|
changed the watch has the specified primary term
|
|
401
497
|
:param if_seq_no: only update the watch if the last operation that has changed
|
|
402
498
|
the watch has the specified sequence number
|
|
403
|
-
:param input:
|
|
404
|
-
:param metadata:
|
|
405
|
-
:param throttle_period:
|
|
406
|
-
|
|
407
|
-
|
|
499
|
+
:param input: The input that defines the input that loads the data for the watch.
|
|
500
|
+
:param metadata: Metadata JSON that will be copied into the history entries.
|
|
501
|
+
:param throttle_period: The minimum time between actions being run. The default
|
|
502
|
+
is 5 seconds. This default can be changed in the config file with the setting
|
|
503
|
+
`xpack.watcher.throttle.period.default_period`. If both this value and the
|
|
504
|
+
`throttle_period_in_millis` parameter are specified, Watcher uses the last
|
|
505
|
+
parameter included in the request.
|
|
506
|
+
:param throttle_period_in_millis: Minimum time in milliseconds between actions
|
|
507
|
+
being run. Defaults to 5000. If both this value and the throttle_period parameter
|
|
508
|
+
are specified, Watcher uses the last parameter included in the request.
|
|
509
|
+
:param transform: The transform that processes the watch payload to prepare it
|
|
510
|
+
for the watch actions.
|
|
511
|
+
:param trigger: The trigger that defines when the watch should run.
|
|
408
512
|
:param version: Explicit version number for concurrency control
|
|
409
513
|
"""
|
|
410
514
|
if id in SKIP_IN_PATH:
|
|
@@ -440,6 +544,8 @@ class WatcherClient(NamespacedClient):
|
|
|
440
544
|
__body["metadata"] = metadata
|
|
441
545
|
if throttle_period is not None:
|
|
442
546
|
__body["throttle_period"] = throttle_period
|
|
547
|
+
if throttle_period_in_millis is not None:
|
|
548
|
+
__body["throttle_period_in_millis"] = throttle_period_in_millis
|
|
443
549
|
if transform is not None:
|
|
444
550
|
__body["transform"] = transform
|
|
445
551
|
if trigger is not None:
|
|
@@ -485,16 +591,21 @@ class WatcherClient(NamespacedClient):
|
|
|
485
591
|
body: t.Optional[t.Dict[str, t.Any]] = None,
|
|
486
592
|
) -> ObjectApiResponse[t.Any]:
|
|
487
593
|
"""
|
|
488
|
-
|
|
594
|
+
.. raw:: html
|
|
595
|
+
|
|
596
|
+
<p>Query watches.
|
|
597
|
+
Get all registered watches in a paginated manner and optionally filter watches by a query.</p>
|
|
598
|
+
<p>Note that only the <code>_id</code> and <code>metadata.*</code> fields are queryable or sortable.</p>
|
|
599
|
+
|
|
489
600
|
|
|
490
601
|
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/watcher-api-query-watches.html>`_
|
|
491
602
|
|
|
492
|
-
:param from_: The offset from the first result to fetch.
|
|
493
|
-
:param query:
|
|
494
|
-
:param search_after:
|
|
495
|
-
|
|
496
|
-
:param size: The number of hits to return.
|
|
497
|
-
:param sort:
|
|
603
|
+
:param from_: The offset from the first result to fetch. It must be non-negative.
|
|
604
|
+
:param query: A query that filters the watches to be returned.
|
|
605
|
+
:param search_after: Retrieve the next page of hits using a set of sort values
|
|
606
|
+
from the previous page.
|
|
607
|
+
:param size: The number of hits to return. It must be non-negative.
|
|
608
|
+
:param sort: One or more fields used to sort the search results.
|
|
498
609
|
"""
|
|
499
610
|
__path_parts: t.Dict[str, str] = {}
|
|
500
611
|
__path = "/_watcher/_query/watches"
|
|
@@ -555,7 +666,11 @@ class WatcherClient(NamespacedClient):
|
|
|
555
666
|
pretty: t.Optional[bool] = None,
|
|
556
667
|
) -> ObjectApiResponse[t.Any]:
|
|
557
668
|
"""
|
|
558
|
-
|
|
669
|
+
.. raw:: html
|
|
670
|
+
|
|
671
|
+
<p>Start the watch service.
|
|
672
|
+
Start the Watcher service if it is not already running.</p>
|
|
673
|
+
|
|
559
674
|
|
|
560
675
|
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/watcher-api-start.html>`_
|
|
561
676
|
"""
|
|
@@ -612,7 +727,12 @@ class WatcherClient(NamespacedClient):
|
|
|
612
727
|
pretty: t.Optional[bool] = None,
|
|
613
728
|
) -> ObjectApiResponse[t.Any]:
|
|
614
729
|
"""
|
|
615
|
-
|
|
730
|
+
.. raw:: html
|
|
731
|
+
|
|
732
|
+
<p>Get Watcher statistics.
|
|
733
|
+
This API always returns basic metrics.
|
|
734
|
+
You retrieve more metrics by using the metric parameter.</p>
|
|
735
|
+
|
|
616
736
|
|
|
617
737
|
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/watcher-api-stats.html>`_
|
|
618
738
|
|
|
@@ -655,12 +775,21 @@ class WatcherClient(NamespacedClient):
|
|
|
655
775
|
error_trace: t.Optional[bool] = None,
|
|
656
776
|
filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
|
|
657
777
|
human: t.Optional[bool] = None,
|
|
778
|
+
master_timeout: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
|
|
658
779
|
pretty: t.Optional[bool] = None,
|
|
659
780
|
) -> ObjectApiResponse[t.Any]:
|
|
660
781
|
"""
|
|
661
|
-
|
|
782
|
+
.. raw:: html
|
|
783
|
+
|
|
784
|
+
<p>Stop the watch service.
|
|
785
|
+
Stop the Watcher service if it is running.</p>
|
|
786
|
+
|
|
662
787
|
|
|
663
788
|
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/watcher-api-stop.html>`_
|
|
789
|
+
|
|
790
|
+
:param master_timeout: The period to wait for the master node. If the master
|
|
791
|
+
node is not available before the timeout expires, the request fails and returns
|
|
792
|
+
an error. To indicate that the request should never timeout, set it to `-1`.
|
|
664
793
|
"""
|
|
665
794
|
__path_parts: t.Dict[str, str] = {}
|
|
666
795
|
__path = "/_watcher/_stop"
|
|
@@ -671,6 +800,8 @@ class WatcherClient(NamespacedClient):
|
|
|
671
800
|
__query["filter_path"] = filter_path
|
|
672
801
|
if human is not None:
|
|
673
802
|
__query["human"] = human
|
|
803
|
+
if master_timeout is not None:
|
|
804
|
+
__query["master_timeout"] = master_timeout
|
|
674
805
|
if pretty is not None:
|
|
675
806
|
__query["pretty"] = pretty
|
|
676
807
|
__headers = {"accept": "application/json"}
|
|
@@ -682,3 +813,74 @@ class WatcherClient(NamespacedClient):
|
|
|
682
813
|
endpoint_id="watcher.stop",
|
|
683
814
|
path_parts=__path_parts,
|
|
684
815
|
)
|
|
816
|
+
|
|
817
|
+
@_rewrite_parameters(
|
|
818
|
+
body_fields=("index_auto_expand_replicas", "index_number_of_replicas"),
|
|
819
|
+
parameter_aliases={
|
|
820
|
+
"index.auto_expand_replicas": "index_auto_expand_replicas",
|
|
821
|
+
"index.number_of_replicas": "index_number_of_replicas",
|
|
822
|
+
},
|
|
823
|
+
)
|
|
824
|
+
async def update_settings(
|
|
825
|
+
self,
|
|
826
|
+
*,
|
|
827
|
+
error_trace: t.Optional[bool] = None,
|
|
828
|
+
filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
|
|
829
|
+
human: t.Optional[bool] = None,
|
|
830
|
+
index_auto_expand_replicas: t.Optional[str] = None,
|
|
831
|
+
index_number_of_replicas: t.Optional[int] = None,
|
|
832
|
+
master_timeout: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
|
|
833
|
+
pretty: t.Optional[bool] = None,
|
|
834
|
+
timeout: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
|
|
835
|
+
body: t.Optional[t.Dict[str, t.Any]] = None,
|
|
836
|
+
) -> ObjectApiResponse[t.Any]:
|
|
837
|
+
"""
|
|
838
|
+
.. raw:: html
|
|
839
|
+
|
|
840
|
+
<p>Update Watcher index settings.
|
|
841
|
+
Update settings for the Watcher internal index (<code>.watches</code>).
|
|
842
|
+
Only a subset of settings can be modified.
|
|
843
|
+
This includes <code>index.auto_expand_replicas</code> and <code>index.number_of_replicas</code>.</p>
|
|
844
|
+
|
|
845
|
+
|
|
846
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/watcher-api-update-settings.html>`_
|
|
847
|
+
|
|
848
|
+
:param index_auto_expand_replicas:
|
|
849
|
+
:param index_number_of_replicas:
|
|
850
|
+
:param master_timeout: The period to wait for a connection to the master node.
|
|
851
|
+
If no response is received before the timeout expires, the request fails
|
|
852
|
+
and returns an error.
|
|
853
|
+
:param timeout: The period to wait for a response. If no response is received
|
|
854
|
+
before the timeout expires, the request fails and returns an error.
|
|
855
|
+
"""
|
|
856
|
+
__path_parts: t.Dict[str, str] = {}
|
|
857
|
+
__path = "/_watcher/settings"
|
|
858
|
+
__query: t.Dict[str, t.Any] = {}
|
|
859
|
+
__body: t.Dict[str, t.Any] = body if body is not None else {}
|
|
860
|
+
if error_trace is not None:
|
|
861
|
+
__query["error_trace"] = error_trace
|
|
862
|
+
if filter_path is not None:
|
|
863
|
+
__query["filter_path"] = filter_path
|
|
864
|
+
if human is not None:
|
|
865
|
+
__query["human"] = human
|
|
866
|
+
if master_timeout is not None:
|
|
867
|
+
__query["master_timeout"] = master_timeout
|
|
868
|
+
if pretty is not None:
|
|
869
|
+
__query["pretty"] = pretty
|
|
870
|
+
if timeout is not None:
|
|
871
|
+
__query["timeout"] = timeout
|
|
872
|
+
if not __body:
|
|
873
|
+
if index_auto_expand_replicas is not None:
|
|
874
|
+
__body["index.auto_expand_replicas"] = index_auto_expand_replicas
|
|
875
|
+
if index_number_of_replicas is not None:
|
|
876
|
+
__body["index.number_of_replicas"] = index_number_of_replicas
|
|
877
|
+
__headers = {"accept": "application/json", "content-type": "application/json"}
|
|
878
|
+
return await self.perform_request( # type: ignore[return-value]
|
|
879
|
+
"PUT",
|
|
880
|
+
__path,
|
|
881
|
+
params=__query,
|
|
882
|
+
headers=__headers,
|
|
883
|
+
body=__body,
|
|
884
|
+
endpoint_id="watcher.update_settings",
|
|
885
|
+
path_parts=__path_parts,
|
|
886
|
+
)
|
|
@@ -43,7 +43,16 @@ class XPackClient(NamespacedClient):
|
|
|
43
43
|
pretty: t.Optional[bool] = None,
|
|
44
44
|
) -> ObjectApiResponse[t.Any]:
|
|
45
45
|
"""
|
|
46
|
-
|
|
46
|
+
.. raw:: html
|
|
47
|
+
|
|
48
|
+
<p>Get information.
|
|
49
|
+
The information provided by the API includes:</p>
|
|
50
|
+
<ul>
|
|
51
|
+
<li>Build information including the build number and timestamp.</li>
|
|
52
|
+
<li>License information about the currently installed license.</li>
|
|
53
|
+
<li>Feature information for the features that are currently enabled and available under the current license.</li>
|
|
54
|
+
</ul>
|
|
55
|
+
|
|
47
56
|
|
|
48
57
|
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/info-api.html>`_
|
|
49
58
|
|
|
@@ -87,14 +96,19 @@ class XPackClient(NamespacedClient):
|
|
|
87
96
|
pretty: t.Optional[bool] = None,
|
|
88
97
|
) -> ObjectApiResponse[t.Any]:
|
|
89
98
|
"""
|
|
90
|
-
|
|
91
|
-
|
|
99
|
+
.. raw:: html
|
|
100
|
+
|
|
101
|
+
<p>Get usage information.
|
|
102
|
+
Get information about the features that are currently enabled and available under the current license.
|
|
103
|
+
The API also provides some usage statistics.</p>
|
|
104
|
+
|
|
92
105
|
|
|
93
106
|
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/usage-api.html>`_
|
|
94
107
|
|
|
95
|
-
:param master_timeout:
|
|
96
|
-
no response is received before the timeout expires, the request fails
|
|
97
|
-
returns an error.
|
|
108
|
+
:param master_timeout: The period to wait for a connection to the master node.
|
|
109
|
+
If no response is received before the timeout expires, the request fails
|
|
110
|
+
and returns an error. To indicate that the request should never timeout,
|
|
111
|
+
set it to `-1`.
|
|
98
112
|
"""
|
|
99
113
|
__path_parts: t.Dict[str, str] = {}
|
|
100
114
|
__path = "/_xpack/usage"
|
elasticsearch/_async/helpers.py
CHANGED
|
@@ -257,7 +257,7 @@ async def async_streaming_bulk(
|
|
|
257
257
|
]
|
|
258
258
|
ok: bool
|
|
259
259
|
info: Dict[str, Any]
|
|
260
|
-
async for data, (ok, info) in azip( # type: ignore
|
|
260
|
+
async for data, (ok, info) in azip( # type: ignore[assignment, misc]
|
|
261
261
|
bulk_data,
|
|
262
262
|
_process_bulk_chunk(
|
|
263
263
|
client,
|