[[reference-watcher-put_watch]] //////// =========================================================================================================================== || || || || || || || ██████╗ ███████╗ █████╗ ██████╗ ███╗ ███╗███████╗ || || ██╔══██╗██╔════╝██╔══██╗██╔══██╗████╗ ████║██╔════╝ || || ██████╔╝█████╗ ███████║██║ ██║██╔████╔██║█████╗ || || ██╔══██╗██╔══╝ ██╔══██║██║ ██║██║╚██╔╝██║██╔══╝ || || ██║ ██║███████╗██║ ██║██████╔╝██║ ╚═╝ ██║███████╗ || || ╚═╝ ╚═╝╚══════╝╚═╝ ╚═╝╚═════╝ ╚═╝ ╚═╝╚══════╝ || || || || || || This file is autogenerated, DO NOT send pull requests that changes this file directly. || || You should update the script that does the generation, which can be found in: || || https://github.com/elastic/elastic-client-generator-js || || || || You can run the script with the following command: || || npm run elasticsearch -- --version || || || || || || || =========================================================================================================================== //////// [discrete] === client.watcher.putWatch Creates a new watch, or updates an existing one. {ref}/watcher-api-put-watch.html[{es} documentation] [discrete] ==== Function signature [source,ts] ---- (WatcherPutWatchRequest, options?): Promise ---- [discrete] ===== `WatcherPutWatchRequest` [source,ts] ---- interface WatcherPutWatchRequest extends <> { id: <> active?: boolean if_primary_term?: <> if_seq_no?: <> version?: <> actions?: Record condition?: WatcherConditionContainer input?: WatcherInputContainer metadata?: <> throttle_period?: string transform?: <> trigger?: WatcherTriggerContainer } ---- [discrete] ===== `WatcherPutWatchResponse` [source,ts] ---- interface WatcherPutWatchResponse { created: boolean _id: <> _primary_term: <> _seq_no: <> _version: <> } ----