Class ExecuteWatchRequest
- All Implemented Interfaces:
JsonpSerializable
For testing and debugging purposes, you also have fine-grained control on how the watch runs. You can run the watch without running all of its actions or alternatively by simulating them. You can also force execution by ignoring the watch condition and control whether a watch record would be written to the watch history after it runs.
You can use the run watch API to run watches that are not yet registered by specifying the watch definition inline. This serves as great tool for testing and debugging your watches prior to adding them to Watcher.
When Elasticsearch security features are enabled on your cluster, watches are
run with the privileges of the user that stored the watches. If your user is
allowed to read index a
, but not index b
, then the
exact same set of rules will apply during execution of a watch.
When using the run watch API, the authorization data of the user that called the API will be used as a base, instead of the information who stored the watch.
- 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<ExecuteWatchRequest>
Json deserializer forExecuteWatchRequest
static final Endpoint<ExecuteWatchRequest,
ExecuteWatchResponse, ErrorResponse> Endpoint "watcher.execute_watch
". -
Method Summary
Modifier and TypeMethodDescriptionfinal Map<String,
ActionExecutionMode> Determines how to handle the watch actions as part of the watch execution.When present, the watch uses this object as a payload instead of executing its own input.final Boolean
debug()
Defines whether the watch runs in debug mode.final String
id()
The watch identifier.final Boolean
When set totrue
, the watch execution uses the always condition.static ExecuteWatchRequest
final Boolean
When set totrue
, the watch record representing the watch execution result is persisted to the.watcher-history
index for the current time.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 SimulatedActions
API name:simulated_actions
final ScheduleTriggerEvent
This structure is parsed as the data of the trigger event that will be used during the watch execution.final Watch
watch()
When present, this watch is used instead of the one specified in the request.Methods inherited from class co.elastic.clients.elasticsearch._types.RequestBase
toString
-
Field Details
-
_DESERIALIZER
Json deserializer forExecuteWatchRequest
-
_ENDPOINT
Endpoint "watcher.execute_watch
".
-
-
Method Details
-
of
public static ExecuteWatchRequest of(Function<ExecuteWatchRequest.Builder, ObjectBuilder<ExecuteWatchRequest>> fn) -
actionModes
Determines how to handle the watch actions as part of the watch execution.API name:
action_modes
-
alternativeInput
When present, the watch uses this object as a payload instead of executing its own input.API name:
alternative_input
-
debug
Defines whether the watch runs in debug mode.API name:
debug
-
id
The watch identifier.API name:
id
-
ignoreCondition
When set totrue
, the watch execution uses the always condition. This can also be specified as an HTTP parameter.API name:
ignore_condition
-
recordExecution
When set totrue
, the watch record representing the watch execution result is persisted to the.watcher-history
index for the current time. In addition, the status of the watch is updated, possibly throttling subsequent runs. This can also be specified as an HTTP parameter.API name:
record_execution
-
simulatedActions
API name:simulated_actions
-
triggerData
This structure is parsed as the data of the trigger event that will be used during the watch execution.API name:
trigger_data
-
watch
When present, this watch is used instead of the one specified in the request. This watch is not persisted to the index andrecord_execution
cannot be set.API name:
watch
-
serialize
Serialize this object to JSON.- Specified by:
serialize
in interfaceJsonpSerializable
-
serializeInternal
-
setupExecuteWatchRequestDeserializer
protected static void setupExecuteWatchRequestDeserializer(ObjectDeserializer<ExecuteWatchRequest.Builder> op)
-