Watcher
- class elasticsearch.client.WatcherClient(client)
- Parameters:
client (BaseClient) –
- ack_watch(*, watch_id, action_id=None, error_trace=None, filter_path=None, human=None, pretty=None)
Acknowledges a watch, manually throttling the execution of the watch’s actions.
https://www.elastic.co/guide/en/elasticsearch/reference/8.12/watcher-api-ack-watch.html
- activate_watch(*, watch_id, error_trace=None, filter_path=None, human=None, pretty=None)
Activates a currently inactive watch.
https://www.elastic.co/guide/en/elasticsearch/reference/8.12/watcher-api-activate-watch.html
- deactivate_watch(*, watch_id, error_trace=None, filter_path=None, human=None, pretty=None)
Deactivates a currently active watch.
https://www.elastic.co/guide/en/elasticsearch/reference/8.12/watcher-api-deactivate-watch.html
- delete_watch(*, id, error_trace=None, filter_path=None, human=None, pretty=None)
Removes a watch from Watcher.
https://www.elastic.co/guide/en/elasticsearch/reference/8.12/watcher-api-delete-watch.html
- execute_watch(*, id=None, action_modes=None, alternative_input=None, debug=None, error_trace=None, filter_path=None, human=None, ignore_condition=None, pretty=None, record_execution=None, simulated_actions=None, trigger_data=None, watch=None, body=None)
Forces the execution of a stored watch.
https://www.elastic.co/guide/en/elasticsearch/reference/8.12/watcher-api-execute-watch.html
- Parameters:
id (str | None) – Identifier for the watch.
action_modes (Mapping[str, Literal['execute', 'force_execute', 'force_simulate', 'simulate', 'skip'] | str] | None) – Determines how to handle the watch actions as part of the watch execution.
alternative_input (Mapping[str, Any] | None) – When present, the watch uses this object as a payload instead of executing its own input.
debug (bool | None) – Defines whether the watch runs in debug mode.
ignore_condition (bool | None) – When set to true, the watch execution uses the always condition. This can also be specified as an HTTP parameter.
record_execution (bool | None) – When set to true, the watch record representing the watch execution result is persisted to the .watcher-history index for the current time. In addition, the status of the watch is updated, possibly throttling subsequent executions. This can also be specified as an HTTP parameter.
trigger_data (Mapping[str, Any] | None) – This structure is parsed as the data of the trigger event that will be used during the watch execution
watch (Mapping[str, Any] | None) – When present, this watch is used instead of the one specified in the request. This watch is not persisted to the index and record_execution cannot be set.
error_trace (bool | None) –
human (bool | None) –
pretty (bool | None) –
- Return type:
ObjectApiResponse[Any]
- get_watch(*, id, error_trace=None, filter_path=None, human=None, pretty=None)
Retrieves a watch by its ID.
https://www.elastic.co/guide/en/elasticsearch/reference/8.12/watcher-api-get-watch.html
- put_watch(*, id, actions=None, active=None, condition=None, error_trace=None, filter_path=None, human=None, if_primary_term=None, if_seq_no=None, input=None, metadata=None, pretty=None, throttle_period=None, transform=None, trigger=None, version=None, body=None)
Creates a new watch, or updates an existing one.
https://www.elastic.co/guide/en/elasticsearch/reference/8.12/watcher-api-put-watch.html
- Parameters:
id (str) – Watch ID
active (bool | None) – Specify whether the watch is in/active by default
if_primary_term (int | None) – only update the watch if the last operation that has changed the watch has the specified primary term
if_seq_no (int | None) – only update the watch if the last operation that has changed the watch has the specified sequence number
throttle_period (str | None) –
version (int | None) – Explicit version number for concurrency control
error_trace (bool | None) –
human (bool | None) –
pretty (bool | None) –
- Return type:
ObjectApiResponse[Any]
- query_watches(*, error_trace=None, filter_path=None, from_=None, human=None, pretty=None, query=None, search_after=None, size=None, sort=None, body=None)
Retrieves stored watches.
https://www.elastic.co/guide/en/elasticsearch/reference/8.12/watcher-api-query-watches.html
- Parameters:
from – The offset from the first result to fetch. Needs to be non-negative.
query (Mapping[str, Any] | None) – Optional, query filter watches to be returned.
search_after (Sequence[None | bool | float | int | str | Any] | None) – Optional search After to do pagination using last hit’s sort values.
size (int | None) – The number of hits to return. Needs to be non-negative.
sort (Sequence[str | Mapping[str, Any]] | str | Mapping[str, Any] | None) – Optional sort definition.
error_trace (bool | None) –
from_ (int | None) –
human (bool | None) –
pretty (bool | None) –
- Return type:
ObjectApiResponse[Any]
- start(*, error_trace=None, filter_path=None, human=None, pretty=None)
Starts Watcher if it is not already running.
https://www.elastic.co/guide/en/elasticsearch/reference/8.12/watcher-api-start.html
- stats(*, metric=None, emit_stacktraces=None, error_trace=None, filter_path=None, human=None, pretty=None)
Retrieves the current Watcher metrics.
https://www.elastic.co/guide/en/elasticsearch/reference/8.12/watcher-api-stats.html
- Parameters:
metric (Sequence[Literal['_all', 'current_watches', 'pending_watches', 'queued_watches'] | str] | ~typing.Literal['_all', 'current_watches', 'pending_watches', 'queued_watches'] | str | None) – Defines which additional metrics are included in the response.
emit_stacktraces (bool | None) – Defines whether stack traces are generated for each watch that is running.
error_trace (bool | None) –
human (bool | None) –
pretty (bool | None) –
- Return type:
ObjectApiResponse[Any]
- stop(*, error_trace=None, filter_path=None, human=None, pretty=None)
Stops Watcher if it is running.
https://www.elastic.co/guide/en/elasticsearch/reference/8.12/watcher-api-stop.html