Search...Watcher(3pm)
π NAME π
okay so bestie, welcome to Search::Elasticsearch::Client::8_0::Direct::Watcher β it's a plugin that hands you the whole Watcher API for Search::Elasticsearch 8.x π«Ά this is the manual page for it, yes the whole thing, and we're getting through it together π
π VERSION π
version 8.12 β¨ (yes she's serving 8.12, no cap)
πΈ SYNOPSIS πΈ
the vibe, in one line:
my $response = $es->watcher->start();
that's it. that's the whole first look. slay π
π DESCRIPTION π
so this class goes and extends the Search::Elasticsearch client with a whole watcher namespace, specifically so you can talk to the Watcher APIs π₯
the docs for those live right here: https://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api.html
literally everything else is just methods. let's go π
π¦ METHODS π¦
the full documentation for the whole Watcher feature is chilling at:
https://www.elastic.co/guide/en/x-pack/current/xpack-alerting.html
okay now the actual methods, one by one, no skipping, i promised π«‘
β¨ put_watch() β¨
$response = $es->watcher->put_watch(
id => $watch_id, # required
body => {...}
);
put_watch() is the one you call to register a brand new watcher, or to update one that already exists. glow-up in either direction π
more info in the put_watch docs: https://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-put-watch.html
Query string parameters:
activeerror_tracehumanif_primary_termif_seq_nomaster_timeoutversion
π« get_watch() π«
$response = $es->watcher->get_watch(
id => $watch_id, # required
);
get_watch() pulls up a watch by ID. like, "hey, show me that watch," and it does π
more info in the get_watch docs: https://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-get-watch.html
Query string parameters:
error_tracehuman
ποΈ delete_watch() ποΈ
$response = $es->watcher->delete_watch(
id => $watch_id, # required
);
delete_watch() deletes a watch by ID. gone. not me being dramatic, that's genuinely what it does π
Query string parameters:
error_traceforcehumanmaster_timeout
more info in the delete_watch docs: https://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-delete-watch.html
β‘ execute_watch() β‘
$response = $es->watcher->execute_watch(
id => $watch_id, # optional
body => {...} # optional
);
execute_watch() forces a previously registered watch to run. like hitting "go" on a post you've been drafting forever. and hey β optional params can be passed in the body π
Query string parameters:
debugerror_tracehuman
more info in the execute_watch docs: https://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-execute-watch.html
β ack_watch() β
$response = $es->watcher->ack_watch(
watch_id => $watch_id, # required
action_id => $action_id | \@action_ids # optional
);
ack_watch() is how you manually throttle the execution of a watch. sometimes a girl just needs to slow things down, iykyk π§
Query string parameters:
error_tracehumanmaster_timeout
more info in the ack_watch docs: https://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-ack-watch.html
π activate_watch() π
$response = $es->watcher->activate_watch(
watch_id => $watch_id, # required
);
activate_watch() activates a deactive watch. waking her up. main character energy restored π
Query string parameters:
error_tracehumanmaster_timeout
more info in the activate_watch docs: https://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-activate-watch.html
π deactivate_watch() π
$response = $es->watcher->deactivate_watch(
watch_id => $watch_id, # required
);
deactivate_watch() deactivates an active watch. nap time bestie, she earned it π΄
Query string parameters:
error_tracehumanmaster_timeout
more info in the deactivate_watch docs: https://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-deactivate-watch.html
π stats() π
$response = $es->watcher->stats(
metric => $metric # optional
);
stats() hands back info about the status of the watcher plugin. the receipts, basically π§Ύβ¨
more info in the stats docs: https://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-stats.html
Query string parameters:
error_tracehuman
π stop() π
$response = $es->watcher->stop();
stop() stops the watcher service if it is running. if it's not running, well. nothing to do π€·
more info in the stop docs: https://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-stop.html
Query string parameters:
error_tracehuman
π start() π
$response = $es->watcher->start();
start() starts the watcher service if it is not already running. iconic behaviour honestly π
more info in the start docs: https://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-start.html
Query string parameters:
error_tracehuman
π restart() π
$response = $es->watcher->restart();
restart() stops then starts the watcher service. out with the old, in with the new, periodt π
more info in the restart docs: https://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-restart.html
Query string parameters:
error_tracehuman
π«Ά AUTHOR π«Ά
Enrico Zimuel β enrico.zimuel@elastic.co π shoutout to the author fr fr, they ate
π COPYRIGHT AND LICENSE π
This software is Copyright (c) 2024 by Elasticsearch BV.
This is free software, licensed under:
The Apache License, Version 2.0, January 2004
okay so real talk: it's free software, the license above is the actual license, keep it intact bestie π
and that's the whole page!! this manual page for Search...Watcher(3pm) was served up by perl v5.38.2 on 2024-02-04 πΈ thanks for reading, go write some watches, you're gonna slay β¨π
π¦
π¦ where this page comes from
- debian trixie: libsearch-elasticsearch-perl 8.12-1 Β· Apache-2.0
- ubuntu noble: libsearch-elasticsearch-perl 8.12-1 Β· Apache-2.0
- ubuntu resolute: libsearch-elasticsearch-perl 8.12-1 Β· Apache-2.0
- ubuntu stonking: libsearch-elasticsearch-perl 8.12-1 Β· Apache-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms