Class ElasticsearchWatcherAsyncClient
- All Implemented Interfaces:
Closeable
,AutoCloseable
-
Field Summary
Fields inherited from class co.elastic.clients.ApiClient
transport, transportOptions
-
Constructor Summary
ConstructorsConstructorDescriptionElasticsearchWatcherAsyncClient
(ElasticsearchTransport transport, TransportOptions transportOptions) -
Method Summary
Modifier and TypeMethodDescriptionackWatch
(AckWatchRequest request) Acknowledge a watch.Acknowledge a watch.activateWatch
(ActivateWatchRequest request) Activate a watch.Activate a watch.deactivateWatch
(DeactivateWatchRequest request) Deactivate a watch.Deactivate a watch.deleteWatch
(DeleteWatchRequest request) Delete a watch.Delete a watch.Run a watch.executeWatch
(ExecuteWatchRequest request) Run a watch.Run a watch.getWatch
(GetWatchRequest request) Get a watch.Get a watch.putWatch
(PutWatchRequest request) Create or update a watch.Create or update a watch.Query watches.queryWatches
(QueryWatchesRequest request) Query watches.Query watches.start()
Start the watch service.stats()
Get Watcher statistics.stats
(WatcherStatsRequest request) Get Watcher statistics.Get Watcher statistics.stop()
Stop the watch service.withTransportOptions
(TransportOptions transportOptions) Creates a new client with some request optionsMethods inherited from class co.elastic.clients.ApiClient
_jsonpMapper, _transport, _transportOptions, close, getDeserializer, withTransportOptions
-
Constructor Details
-
ElasticsearchWatcherAsyncClient
-
ElasticsearchWatcherAsyncClient
public ElasticsearchWatcherAsyncClient(ElasticsearchTransport transport, @Nullable TransportOptions transportOptions)
-
-
Method Details
-
withTransportOptions
public ElasticsearchWatcherAsyncClient withTransportOptions(@Nullable TransportOptions transportOptions) Description copied from class:ApiClient
Creates a new client with some request options- Specified by:
withTransportOptions
in classApiClient<ElasticsearchTransport,
ElasticsearchWatcherAsyncClient>
-
ackWatch
Acknowledge a watch. Acknowledging a watch enables you to manually throttle the execution of the watch's actions.The acknowledgement state of an action is stored in the
status.actions.<id>.ack.state
structure.IMPORTANT: If the specified watch is currently being executed, this API will return an error The reason for this behavior is to prevent overwriting the watch status from a watch execution.
- See Also:
-
ackWatch
public final CompletableFuture<AckWatchResponse> ackWatch(Function<AckWatchRequest.Builder, ObjectBuilder<AckWatchRequest>> fn) Acknowledge a watch. Acknowledging a watch enables you to manually throttle the execution of the watch's actions.The acknowledgement state of an action is stored in the
status.actions.<id>.ack.state
structure.IMPORTANT: If the specified watch is currently being executed, this API will return an error The reason for this behavior is to prevent overwriting the watch status from a watch execution.
- Parameters:
fn
- a function that initializes a builder to create theAckWatchRequest
- See Also:
-
activateWatch
Activate a watch. A watch can be either active or inactive.- See Also:
-
activateWatch
public final CompletableFuture<ActivateWatchResponse> activateWatch(Function<ActivateWatchRequest.Builder, ObjectBuilder<ActivateWatchRequest>> fn) Activate a watch. A watch can be either active or inactive.- Parameters:
fn
- a function that initializes a builder to create theActivateWatchRequest
- See Also:
-
deactivateWatch
Deactivate a watch. A watch can be either active or inactive.- See Also:
-
deactivateWatch
public final CompletableFuture<DeactivateWatchResponse> deactivateWatch(Function<DeactivateWatchRequest.Builder, ObjectBuilder<DeactivateWatchRequest>> fn) Deactivate a watch. A watch can be either active or inactive.- Parameters:
fn
- a function that initializes a builder to create theDeactivateWatchRequest
- See Also:
-
deleteWatch
Delete a watch. When the watch is removed, the document representing the watch in the.watches
index is gone and it will never be run again.Deleting a watch does not delete any watch execution records related to this watch from the watch history.
IMPORTANT: Deleting a watch must be done by using only this API. Do not delete the watch directly from the
.watches
index using the Elasticsearch delete document API When Elasticsearch security features are enabled, make sure no write privileges are granted to anyone for the.watches
index.- See Also:
-
deleteWatch
public final CompletableFuture<DeleteWatchResponse> deleteWatch(Function<DeleteWatchRequest.Builder, ObjectBuilder<DeleteWatchRequest>> fn) Delete a watch. When the watch is removed, the document representing the watch in the.watches
index is gone and it will never be run again.Deleting a watch does not delete any watch execution records related to this watch from the watch history.
IMPORTANT: Deleting a watch must be done by using only this API. Do not delete the watch directly from the
.watches
index using the Elasticsearch delete document API When Elasticsearch security features are enabled, make sure no write privileges are granted to anyone for the.watches
index.- Parameters:
fn
- a function that initializes a builder to create theDeleteWatchRequest
- See Also:
-
executeWatch
Run a watch. This API can be used to force execution of the watch outside of its triggering logic or to simulate the watch execution for debugging purposes.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.
- See Also:
-
executeWatch
public final CompletableFuture<ExecuteWatchResponse> executeWatch(Function<ExecuteWatchRequest.Builder, ObjectBuilder<ExecuteWatchRequest>> fn) Run a watch. This API can be used to force execution of the watch outside of its triggering logic or to simulate the watch execution for debugging purposes.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.
- Parameters:
fn
- a function that initializes a builder to create theExecuteWatchRequest
- See Also:
-
executeWatch
Run a watch. This API can be used to force execution of the watch outside of its triggering logic or to simulate the watch execution for debugging purposes.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.
- See Also:
-
getWatch
Get a watch.- See Also:
-
getWatch
public final CompletableFuture<GetWatchResponse> getWatch(Function<GetWatchRequest.Builder, ObjectBuilder<GetWatchRequest>> fn) Get a watch.- Parameters:
fn
- a function that initializes a builder to create theGetWatchRequest
- See Also:
-
putWatch
Create or update a watch. When a watch is registered, a new document that represents the watch is added to the.watches
index and its trigger is immediately registered with the relevant trigger engine. Typically for theschedule
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 indexb
, the same will apply when the watch runs.- See Also:
-
putWatch
public final CompletableFuture<PutWatchResponse> putWatch(Function<PutWatchRequest.Builder, ObjectBuilder<PutWatchRequest>> fn) Create or update a watch. When a watch is registered, a new document that represents the watch is added to the.watches
index and its trigger is immediately registered with the relevant trigger engine. Typically for theschedule
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 indexb
, the same will apply when the watch runs.- Parameters:
fn
- a function that initializes a builder to create thePutWatchRequest
- See Also:
-
queryWatches
Query watches. Get all registered watches in a paginated manner and optionally filter watches by a query.- See Also:
-
queryWatches
public final CompletableFuture<QueryWatchesResponse> queryWatches(Function<QueryWatchesRequest.Builder, ObjectBuilder<QueryWatchesRequest>> fn) Query watches. Get all registered watches in a paginated manner and optionally filter watches by a query.- Parameters:
fn
- a function that initializes a builder to create theQueryWatchesRequest
- See Also:
-
queryWatches
Query watches. Get all registered watches in a paginated manner and optionally filter watches by a query.- See Also:
-
start
Start the watch service. Start the Watcher service if it is not already running.- See Also:
-
stats
Get Watcher statistics.- See Also:
-
stats
public final CompletableFuture<WatcherStatsResponse> stats(Function<WatcherStatsRequest.Builder, ObjectBuilder<WatcherStatsRequest>> fn) Get Watcher statistics.- Parameters:
fn
- a function that initializes a builder to create theWatcherStatsRequest
- See Also:
-
stats
Get Watcher statistics.- See Also:
-
stop
Stop the watch service. Stop the Watcher service if it is running.- See Also:
-