Files
elasticsearch-js/docs/reference-watcher-put_watch.asciidoc
2024-12-05 14:46:46 -06:00

78 lines
4.5 KiB
Plaintext

[[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 <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<WatcherPutWatchResponse>
----
[discrete]
===== `WatcherPutWatchRequest`
[source,ts]
----
interface WatcherPutWatchRequest extends <<shared-type-request-base, RequestBase>> {
id: <<shared-type-id, Id>>
active?: boolean
if_primary_term?: <<shared-type-long, long>>
if_seq_no?: <<shared-type-sequence-number, SequenceNumber>>
version?: <<shared-type-version-number, VersionNumber>>
actions?: Record<string, WatcherAction>
condition?: WatcherConditionContainer
input?: WatcherInputContainer
metadata?: <<shared-type-metadata, Metadata>>
throttle_period?: string
transform?: <<shared-type-transform-container, TransformContainer>>
trigger?: WatcherTriggerContainer
}
----
[discrete]
===== `WatcherPutWatchResponse`
[source,ts]
----
interface WatcherPutWatchResponse {
created: boolean
_id: <<shared-type-id, Id>>
_primary_term: <<shared-type-long, long>>
_seq_no: <<shared-type-sequence-number, SequenceNumber>>
_version: <<shared-type-version-number, VersionNumber>>
}
----