Class PutWatchRequest
- All Implemented Interfaces:
JsonpSerializable
.watches
index and its
trigger is immediately registered with the relevant trigger engine. Typically
for the schedule
trigger, the scheduler is the trigger engine.
IMPORTANT: You must use Kibana or this API to create a watch. Do not add a
watch directly to the .watches
index by using the Elasticsearch
index API. If Elasticsearch security features are enabled, do not give users
write privileges on the .watches
index.
When you add a watch you can also define its initial active state by setting the active parameter.
When Elasticsearch security features are enabled, your watch can index or
search only on indices for which the user that stored the watch has
privileges. If the user is able to read index a
, but not index
b
, the same will apply when the watch runs.
- See Also:
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class co.elastic.clients.elasticsearch._types.RequestBase
RequestBase.AbstractBuilder<BuilderT extends RequestBase.AbstractBuilder<BuilderT>>
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final JsonpDeserializer<PutWatchRequest>
Json deserializer forPutWatchRequest
static final Endpoint<PutWatchRequest,
PutWatchResponse, ErrorResponse> Endpoint "watcher.put_watch
". -
Method Summary
Modifier and TypeMethodDescriptionactions()
The list of actions that will be run if the condition matches.final Boolean
active()
The initial state of the watch.final Condition
The condition that defines if the actions should be run.final String
id()
Required - The identifier for the watch.final Long
only update the watch if the last operation that has changed the watch has the specified primary termfinal Long
ifSeqNo()
only update the watch if the last operation that has changed the watch has the specified sequence numberfinal Input
input()
The input that defines the input that loads the data for the watch.metadata()
Metadata JSON that will be copied into the history entries.static PutWatchRequest
void
serialize
(jakarta.json.stream.JsonGenerator generator, JsonpMapper mapper) Serialize this object to JSON.protected void
serializeInternal
(jakarta.json.stream.JsonGenerator generator, JsonpMapper mapper) protected static void
final Time
The minimum time between actions being run.final Long
Minimum time in milliseconds between actions being run.final Transform
The transform that processes the watch payload to prepare it for the watch actions.final Trigger
trigger()
The trigger that defines when the watch should run.final Long
version()
Explicit version number for concurrency controlMethods inherited from class co.elastic.clients.elasticsearch._types.RequestBase
toString
-
Field Details
-
_DESERIALIZER
Json deserializer forPutWatchRequest
-
_ENDPOINT
Endpoint "watcher.put_watch
".
-
-
Method Details
-
of
public static PutWatchRequest of(Function<PutWatchRequest.Builder, ObjectBuilder<PutWatchRequest>> fn) -
actions
The list of actions that will be run if the condition matches.API name:
actions
-
active
The initial state of the watch. The default value istrue
, which means the watch is active by default.API name:
active
-
condition
The condition that defines if the actions should be run.API name:
condition
-
id
Required - The identifier for the watch.API name:
id
-
ifPrimaryTerm
only update the watch if the last operation that has changed the watch has the specified primary termAPI name:
if_primary_term
-
ifSeqNo
only update the watch if the last operation that has changed the watch has the specified sequence numberAPI name:
if_seq_no
-
input
The input that defines the input that loads the data for the watch.API name:
input
-
metadata
Metadata JSON that will be copied into the history entries.API name:
metadata
-
throttlePeriod
The minimum time between actions being run. The default is 5 seconds. This default can be changed in the config file with the settingxpack.watcher.throttle.period.default_period
. If both this value and thethrottle_period_in_millis
parameter are specified, Watcher uses the last parameter included in the request.API name:
throttle_period
-
throttlePeriodInMillis
Minimum time in milliseconds between actions being run. Defaults to 5000. If both this value and the throttle_period parameter are specified, Watcher uses the last parameter included in the request.API name:
throttle_period_in_millis
-
transform
The transform that processes the watch payload to prepare it for the watch actions.API name:
transform
-
trigger
The trigger that defines when the watch should run.API name:
trigger
-
version
Explicit version number for concurrency controlAPI name:
version
-
serialize
Serialize this object to JSON.- Specified by:
serialize
in interfaceJsonpSerializable
-
serializeInternal
-
setupPutWatchRequestDeserializer
protected static void setupPutWatchRequestDeserializer(ObjectDeserializer<PutWatchRequest.Builder> op)
-