|
|
@@ -45,25 +45,29 @@ import org.elasticsearch.client.indices.AnalyzeRequest;
|
|
|
import org.elasticsearch.client.indices.AnalyzeResponse;
|
|
|
import org.elasticsearch.client.indices.CloseIndexRequest;
|
|
|
import org.elasticsearch.client.indices.CloseIndexResponse;
|
|
|
+import org.elasticsearch.client.indices.ComposableIndexTemplateExistRequest;
|
|
|
+import org.elasticsearch.client.indices.CreateDataStreamRequest;
|
|
|
import org.elasticsearch.client.indices.CreateIndexRequest;
|
|
|
import org.elasticsearch.client.indices.CreateIndexResponse;
|
|
|
import org.elasticsearch.client.indices.DeleteAliasRequest;
|
|
|
import org.elasticsearch.client.indices.DeleteComposableIndexTemplateRequest;
|
|
|
+import org.elasticsearch.client.indices.DeleteDataStreamRequest;
|
|
|
import org.elasticsearch.client.indices.FreezeIndexRequest;
|
|
|
+import org.elasticsearch.client.indices.GetComposableIndexTemplateRequest;
|
|
|
+import org.elasticsearch.client.indices.GetComposableIndexTemplatesResponse;
|
|
|
+import org.elasticsearch.client.indices.GetDataStreamRequest;
|
|
|
+import org.elasticsearch.client.indices.GetDataStreamResponse;
|
|
|
import org.elasticsearch.client.indices.GetFieldMappingsRequest;
|
|
|
import org.elasticsearch.client.indices.GetFieldMappingsResponse;
|
|
|
import org.elasticsearch.client.indices.GetIndexRequest;
|
|
|
import org.elasticsearch.client.indices.GetIndexResponse;
|
|
|
-import org.elasticsearch.client.indices.GetComposableIndexTemplateRequest;
|
|
|
import org.elasticsearch.client.indices.GetIndexTemplatesRequest;
|
|
|
import org.elasticsearch.client.indices.GetIndexTemplatesResponse;
|
|
|
-import org.elasticsearch.client.indices.GetComposableIndexTemplatesResponse;
|
|
|
import org.elasticsearch.client.indices.GetMappingsRequest;
|
|
|
import org.elasticsearch.client.indices.GetMappingsResponse;
|
|
|
-import org.elasticsearch.client.indices.ComposableIndexTemplateExistRequest;
|
|
|
import org.elasticsearch.client.indices.IndexTemplatesExistRequest;
|
|
|
-import org.elasticsearch.client.indices.PutIndexTemplateRequest;
|
|
|
import org.elasticsearch.client.indices.PutComposableIndexTemplateRequest;
|
|
|
+import org.elasticsearch.client.indices.PutIndexTemplateRequest;
|
|
|
import org.elasticsearch.client.indices.PutMappingRequest;
|
|
|
import org.elasticsearch.client.indices.ReloadAnalyzersRequest;
|
|
|
import org.elasticsearch.client.indices.ReloadAnalyzersResponse;
|
|
|
@@ -155,6 +159,106 @@ public final class IndicesClient {
|
|
|
CreateIndexResponse::fromXContent, listener, emptySet());
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * Creates a data stream using the Create Data Stream API.
|
|
|
+ * See <a href="https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-data-streams.html">
|
|
|
+ * Data Streams API on elastic.co</a>
|
|
|
+ *
|
|
|
+ * @param createDataStreamRequest the request
|
|
|
+ * @param options the request options (e.g. headers), use {@link RequestOptions#DEFAULT} if nothing needs to be
|
|
|
+ * customized
|
|
|
+ * @return the response
|
|
|
+ * @throws IOException in case there is a problem sending the request or parsing back the response
|
|
|
+ */
|
|
|
+ public AcknowledgedResponse createDataStream(CreateDataStreamRequest createDataStreamRequest,
|
|
|
+ RequestOptions options) throws IOException {
|
|
|
+ return restHighLevelClient.performRequestAndParseEntity(createDataStreamRequest, IndicesRequestConverters::putDataStream, options,
|
|
|
+ AcknowledgedResponse::fromXContent, emptySet());
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Asynchronously creates a data stream using the Create Data Stream API.
|
|
|
+ * See <a href="https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-data-streams.html">
|
|
|
+ * Data Streams API on elastic.co</a>
|
|
|
+ *
|
|
|
+ * @param createDataStreamRequest the request
|
|
|
+ * @param options the request options (e.g. headers), use {@link RequestOptions#DEFAULT} if nothing needs to be
|
|
|
+ * customized
|
|
|
+ * @param listener the listener to be notified upon request completion
|
|
|
+ * @return cancellable that may be used to cancel the request
|
|
|
+ */
|
|
|
+ public Cancellable createDataStreamAsync(CreateDataStreamRequest createDataStreamRequest,
|
|
|
+ RequestOptions options,
|
|
|
+ ActionListener<AcknowledgedResponse> listener) {
|
|
|
+ return restHighLevelClient.performRequestAsyncAndParseEntity(createDataStreamRequest, IndicesRequestConverters::putDataStream,
|
|
|
+ options, AcknowledgedResponse::fromXContent, listener, emptySet());
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Deletes a data stream using the Delete Data Stream API.
|
|
|
+ * See <a href="https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-data-streams.html">
|
|
|
+ * Data Streams API on elastic.co</a>
|
|
|
+ *
|
|
|
+ * @param deleteDataStreamRequest the request
|
|
|
+ * @param options the request options (e.g. headers), use {@link RequestOptions#DEFAULT} if nothing needs to be
|
|
|
+ * customized
|
|
|
+ * @return the response
|
|
|
+ * @throws IOException in case there is a problem sending the request or parsing back the response
|
|
|
+ */
|
|
|
+ public AcknowledgedResponse deleteDataStream(DeleteDataStreamRequest deleteDataStreamRequest,
|
|
|
+ RequestOptions options) throws IOException {
|
|
|
+ return restHighLevelClient.performRequestAndParseEntity(deleteDataStreamRequest, IndicesRequestConverters::deleteDataStream,
|
|
|
+ options, AcknowledgedResponse::fromXContent, emptySet());
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Asynchronously deletes a data stream using the Delete Data Stream API.
|
|
|
+ * See <a href="https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-data-streams.html">
|
|
|
+ * Data Streams API on elastic.co</a>
|
|
|
+ *
|
|
|
+ * @param deleteDataStreamRequest the request
|
|
|
+ * @param options the request options (e.g. headers), use {@link RequestOptions#DEFAULT} if nothing needs to be
|
|
|
+ * customized
|
|
|
+ * @param listener the listener to be notified upon request completion
|
|
|
+ * @return cancellable that may be used to cancel the request
|
|
|
+ */
|
|
|
+ public Cancellable deleteDataStreamAsync(DeleteDataStreamRequest deleteDataStreamRequest, RequestOptions options,
|
|
|
+ ActionListener<AcknowledgedResponse> listener) {
|
|
|
+ return restHighLevelClient.performRequestAsyncAndParseEntity(deleteDataStreamRequest, IndicesRequestConverters::deleteDataStream,
|
|
|
+ options, AcknowledgedResponse::fromXContent, listener, emptySet());
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Gets one or more data streams using the Get Data Stream API.
|
|
|
+ * See <a href="https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-aliases.html"> Data Streams API on
|
|
|
+ * elastic.co</a>
|
|
|
+ *
|
|
|
+ * @param dataStreamRequest the request
|
|
|
+ * @param options the request options (e.g. headers), use {@link RequestOptions#DEFAULT} if nothing needs to be customized
|
|
|
+ * @return the response
|
|
|
+ * @throws IOException in case there is a problem sending the request or parsing back the response
|
|
|
+ */
|
|
|
+ public GetDataStreamResponse getDataStream(GetDataStreamRequest dataStreamRequest, RequestOptions options) throws IOException {
|
|
|
+ return restHighLevelClient.performRequestAndParseEntity(dataStreamRequest, IndicesRequestConverters::getDataStreams, options,
|
|
|
+ GetDataStreamResponse::fromXContent, emptySet());
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Asynchronously gets one or more data streams using the Get Data Stream API.
|
|
|
+ * See <a href="https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-aliases.html"> Data Streams API on
|
|
|
+ * elastic.co</a>
|
|
|
+ *
|
|
|
+ * @param dataStreamRequest the request
|
|
|
+ * @param options the request options (e.g. headers), use {@link RequestOptions#DEFAULT} if nothing needs to be customized
|
|
|
+ * @param listener the listener to be notified upon request completion
|
|
|
+ * @return cancellable that may be used to cancel the request
|
|
|
+ */
|
|
|
+ public Cancellable getDataStreamAsync(GetDataStreamRequest dataStreamRequest, RequestOptions options,
|
|
|
+ ActionListener<GetDataStreamResponse> listener) {
|
|
|
+ return restHighLevelClient.performRequestAsyncAndParseEntity(dataStreamRequest, IndicesRequestConverters::getDataStreams, options,
|
|
|
+ GetDataStreamResponse::fromXContent, listener, emptySet());
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* Updates the mappings on an index using the Put Mapping API.
|
|
|
* See <a href="https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-put-mapping.html">
|