Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@
import co.elastic.clients.elasticsearch.connector.ElasticsearchConnectorAsyncClient;
import co.elastic.clients.elasticsearch.core.BulkRequest;
import co.elastic.clients.elasticsearch.core.BulkResponse;
import co.elastic.clients.elasticsearch.core.CancelReindexRequest;
import co.elastic.clients.elasticsearch.core.CancelReindexResponse;
import co.elastic.clients.elasticsearch.core.ClearScrollRequest;
import co.elastic.clients.elasticsearch.core.ClearScrollResponse;
import co.elastic.clients.elasticsearch.core.ClosePointInTimeRequest;
Expand All @@ -51,6 +53,8 @@
import co.elastic.clients.elasticsearch.core.ExplainResponse;
import co.elastic.clients.elasticsearch.core.FieldCapsRequest;
import co.elastic.clients.elasticsearch.core.FieldCapsResponse;
import co.elastic.clients.elasticsearch.core.GetReindexRequest;
import co.elastic.clients.elasticsearch.core.GetReindexResponse;
import co.elastic.clients.elasticsearch.core.GetRequest;
import co.elastic.clients.elasticsearch.core.GetResponse;
import co.elastic.clients.elasticsearch.core.GetScriptContextRequest;
Expand All @@ -67,6 +71,8 @@
import co.elastic.clients.elasticsearch.core.IndexResponse;
import co.elastic.clients.elasticsearch.core.InfoRequest;
import co.elastic.clients.elasticsearch.core.InfoResponse;
import co.elastic.clients.elasticsearch.core.ListReindexRequest;
import co.elastic.clients.elasticsearch.core.ListReindexResponse;
import co.elastic.clients.elasticsearch.core.MgetRequest;
import co.elastic.clients.elasticsearch.core.MgetResponse;
import co.elastic.clients.elasticsearch.core.MsearchRequest;
Expand Down Expand Up @@ -926,6 +932,51 @@ public CompletableFuture<BulkResponse> bulk() {
this.transportOptions);
}

// ----- Endpoint: cancel_reindex

/**
* Cancel a reindex task.
* <p>
* Cancel an ongoing reindex task. If <code>wait_for_completion</code> is
* <code>true</code> (the default), the response contains the final task state
* after cancellation. If <code>wait_for_completion</code> is
* <code>false</code>, the response contains only
* <code>acknowledged: true</code>.
*
* @see <a href=
* "https://www.elastic.co/docs/api/doc/elasticsearch#TODO">Documentation
* on elastic.co</a>
*/

public CompletableFuture<CancelReindexResponse> cancelReindex(CancelReindexRequest request) {
@SuppressWarnings("unchecked")
JsonEndpoint<CancelReindexRequest, CancelReindexResponse, ErrorResponse> endpoint = (JsonEndpoint<CancelReindexRequest, CancelReindexResponse, ErrorResponse>) CancelReindexRequest._ENDPOINT;

return this.transport.performRequestAsync(request, endpoint, this.transportOptions);
}

/**
* Cancel a reindex task.
* <p>
* Cancel an ongoing reindex task. If <code>wait_for_completion</code> is
* <code>true</code> (the default), the response contains the final task state
* after cancellation. If <code>wait_for_completion</code> is
* <code>false</code>, the response contains only
* <code>acknowledged: true</code>.
*
* @param fn
* a function that initializes a builder to create the
* {@link CancelReindexRequest}
* @see <a href=
* "https://www.elastic.co/docs/api/doc/elasticsearch#TODO">Documentation
* on elastic.co</a>
*/

public final CompletableFuture<CancelReindexResponse> cancelReindex(
Function<CancelReindexRequest.Builder, ObjectBuilder<CancelReindexRequest>> fn) {
return cancelReindex(fn.apply(new CancelReindexRequest.Builder()).build());
}

// ----- Endpoint: clear_scroll

/**
Expand Down Expand Up @@ -2566,6 +2617,43 @@ public final <TDocument> CompletableFuture<GetResponse<TDocument>> get(
return get(fn.apply(new GetRequest.Builder()).build(), tDocumentType);
}

// ----- Endpoint: get_reindex

/**
* Get a reindex task.
* <p>
* Get the status and progress of a specific reindex task.
*
* @see <a href=
* "https://www.elastic.co/docs/api/doc/elasticsearch#TODO">Documentation
* on elastic.co</a>
*/

public CompletableFuture<GetReindexResponse> getReindex(GetReindexRequest request) {
@SuppressWarnings("unchecked")
JsonEndpoint<GetReindexRequest, GetReindexResponse, ErrorResponse> endpoint = (JsonEndpoint<GetReindexRequest, GetReindexResponse, ErrorResponse>) GetReindexRequest._ENDPOINT;

return this.transport.performRequestAsync(request, endpoint, this.transportOptions);
}

/**
* Get a reindex task.
* <p>
* Get the status and progress of a specific reindex task.
*
* @param fn
* a function that initializes a builder to create the
* {@link GetReindexRequest}
* @see <a href=
* "https://www.elastic.co/docs/api/doc/elasticsearch#TODO">Documentation
* on elastic.co</a>
*/

public final CompletableFuture<GetReindexResponse> getReindex(
Function<GetReindexRequest.Builder, ObjectBuilder<GetReindexRequest>> fn) {
return getReindex(fn.apply(new GetReindexRequest.Builder()).build());
}

// ----- Endpoint: get_script

/**
Expand Down Expand Up @@ -3344,9 +3432,13 @@ public final <TDocument> CompletableFuture<IndexResponse> index(
/**
* Get cluster info.
* <p>
* Get basic build, version, and cluster information. ::: In Serverless, this
* API is retained for backward compatibility only. Some response fields, such
* as the version number, should be ignored.
* Get basic build, version, and cluster information. ::: In Serverless,
* <code>version.number</code> always reports the next target Elasticsearch
* release version at the time of the request. Serverless does not track to a
* traditional release versioning model; it is continuously updated. The version
* number is provided to maintain compatibility with existing clients, but it is
* not meaningful for assessing feature availability. Clients should detect a
* Serverless environment by checking for <code>build_flavor: serverless</code>.
*
* @see <a href=
* "https://www.elastic.co/docs/api/doc/elasticsearch/group/endpoint-info">Documentation
Expand All @@ -3356,6 +3448,58 @@ public CompletableFuture<InfoResponse> info() {
return this.transport.performRequestAsync(InfoRequest._INSTANCE, InfoRequest._ENDPOINT, this.transportOptions);
}

// ----- Endpoint: list_reindex

/**
* List active reindex tasks.
* <p>
* Get information about all currently running reindex tasks.
*
* @see <a href=
* "https://www.elastic.co/docs/api/doc/elasticsearch#TODO">Documentation
* on elastic.co</a>
*/

public CompletableFuture<ListReindexResponse> listReindex(ListReindexRequest request) {
@SuppressWarnings("unchecked")
JsonEndpoint<ListReindexRequest, ListReindexResponse, ErrorResponse> endpoint = (JsonEndpoint<ListReindexRequest, ListReindexResponse, ErrorResponse>) ListReindexRequest._ENDPOINT;

return this.transport.performRequestAsync(request, endpoint, this.transportOptions);
}

/**
* List active reindex tasks.
* <p>
* Get information about all currently running reindex tasks.
*
* @param fn
* a function that initializes a builder to create the
* {@link ListReindexRequest}
* @see <a href=
* "https://www.elastic.co/docs/api/doc/elasticsearch#TODO">Documentation
* on elastic.co</a>
*/

public final CompletableFuture<ListReindexResponse> listReindex(
Function<ListReindexRequest.Builder, ObjectBuilder<ListReindexRequest>> fn) {
return listReindex(fn.apply(new ListReindexRequest.Builder()).build());
}

/**
* List active reindex tasks.
* <p>
* Get information about all currently running reindex tasks.
*
* @see <a href=
* "https://www.elastic.co/docs/api/doc/elasticsearch#TODO">Documentation
* on elastic.co</a>
*/

public CompletableFuture<ListReindexResponse> listReindex() {
return this.transport.performRequestAsync(new ListReindexRequest.Builder().build(),
ListReindexRequest._ENDPOINT, this.transportOptions);
}

// ----- Endpoint: mget

/**
Expand Down Expand Up @@ -4220,9 +4364,10 @@ public final CompletableFuture<RankEvalResponse> rankEval(
* must explicitly allow the remote host using the
* <code>reindex.remote.whitelist</code> node setting on the destination
* cluster. If reindexing from a remote cluster into an Elastic Cloud Serverless
* project, only remote hosts from Elastic Cloud Hosted are allowed. Automatic
* data stream creation requires a matching index template with data stream
* enabled.
* project, only remote hosts from <a href=
* "https://cloud.elastic.co/registration?page=docs&amp;placement=docs-body">Elastic
* Cloud Hosted and Elastic Cloud Serverless</a> are allowed. Automatic data
* stream creation requires a matching index template with data stream enabled.
* <p>
* The <code>dest</code> element can be configured like the index API to control
* optimistic concurrency control. Omitting <code>version_type</code> or setting
Expand Down Expand Up @@ -4316,9 +4461,10 @@ public CompletableFuture<ReindexResponse> reindex(ReindexRequest request) {
* must explicitly allow the remote host using the
* <code>reindex.remote.whitelist</code> node setting on the destination
* cluster. If reindexing from a remote cluster into an Elastic Cloud Serverless
* project, only remote hosts from Elastic Cloud Hosted are allowed. Automatic
* data stream creation requires a matching index template with data stream
* enabled.
* project, only remote hosts from <a href=
* "https://cloud.elastic.co/registration?page=docs&amp;placement=docs-body">Elastic
* Cloud Hosted and Elastic Cloud Serverless</a> are allowed. Automatic data
* stream creation requires a matching index template with data stream enabled.
* <p>
* The <code>dest</code> element can be configured like the index API to control
* optimistic concurrency control. Omitting <code>version_type</code> or setting
Expand Down
Loading
Loading