WARNING: Version 5.5 of Elasticsearch has passed its EOL date.
This documentation is no longer being maintained and may be removed. If you are running this version, we strongly advise you to upgrade. For the latest information, see the current release documentation.
A watch can be either active or inactive. This API enables you to activate a currently inactive watch.
PUT _xpack/watcher/watch/<watch_id>/_activate
-
watch_id
(required) - (string) Identifier for the watch.
-
master_timeout
- (time) A timeout value for the connection to the master node.
You must have manage_watcher
cluster privileges to use this API. For more
information, see Security Privileges.
The status of an inactive watch is returned with the watch definition when you call the Get Watch API:
GET _xpack/watcher/watch/my_watch
{ "found": true, "_id": "my_watch", "_status": { "state" : { "active" : false, "timestamp" : "2015-08-20T12:21:32.734Z" }, "version": 1, "actions": ... }, "watch": ... }
You can activate the watch by executing the following API call:
PUT _xpack/watcher/watch/my_watch/_activate
The new state of the watch is returned as part of its overall status:
{ "_status": { "state" : { "active" : true, "timestamp" : "2015-09-04T08:39:46.816Z" }, "actions": ... } }