
co.elastic.clients.elasticsearch.indices.ElasticsearchIndicesClient Maven / Gradle / Ivy
/*
* Licensed to Elasticsearch B.V. under one or more contributor
* license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright
* ownership. Elasticsearch B.V. licenses this file to you under
* the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package co.elastic.clients.elasticsearch.indices;
import co.elastic.clients.ApiClient;
import co.elastic.clients.elasticsearch._types.ElasticsearchException;
import co.elastic.clients.elasticsearch._types.ErrorResponse;
import co.elastic.clients.transport.ElasticsearchTransport;
import co.elastic.clients.transport.Endpoint;
import co.elastic.clients.transport.JsonEndpoint;
import co.elastic.clients.transport.Transport;
import co.elastic.clients.transport.TransportOptions;
import co.elastic.clients.transport.endpoints.BooleanResponse;
import co.elastic.clients.util.ObjectBuilder;
import java.io.IOException;
import java.util.function.Function;
import javax.annotation.Nullable;
//----------------------------------------------------------------
// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST.
//----------------------------------------------------------------
//
// This code is generated from the Elasticsearch API specification
// at https://github.com/elastic/elasticsearch-specification
//
// Manual updates to this file will be lost when the code is
// re-generated.
//
// If you find a property that is missing or wrongly typed, please
// open an issue or a PR on the API specification repository.
//
//----------------------------------------------------------------
/**
* Client for the indices namespace.
*/
public class ElasticsearchIndicesClient extends ApiClient {
public ElasticsearchIndicesClient(ElasticsearchTransport transport) {
super(transport, null);
}
public ElasticsearchIndicesClient(ElasticsearchTransport transport, @Nullable TransportOptions transportOptions) {
super(transport, transportOptions);
}
@Override
public ElasticsearchIndicesClient withTransportOptions(@Nullable TransportOptions transportOptions) {
return new ElasticsearchIndicesClient(this.transport, transportOptions);
}
// ----- Endpoint: indices.add_block
/**
* Adds a block to an index.
*
* @see Documentation
* on elastic.co
*/
public AddBlockResponse addBlock(AddBlockRequest request) throws IOException, ElasticsearchException {
@SuppressWarnings("unchecked")
JsonEndpoint endpoint = (JsonEndpoint) AddBlockRequest._ENDPOINT;
return this.transport.performRequest(request, endpoint, this.transportOptions);
}
/**
* Adds a block to an index.
*
* @param fn
* a function that initializes a builder to create the
* {@link AddBlockRequest}
* @see Documentation
* on elastic.co
*/
public final AddBlockResponse addBlock(Function> fn)
throws IOException, ElasticsearchException {
return addBlock(fn.apply(new AddBlockRequest.Builder()).build());
}
// ----- Endpoint: indices.analyze
/**
* Performs analysis on a text string and returns the resulting tokens.
*
* @see Documentation
* on elastic.co
*/
public AnalyzeResponse analyze(AnalyzeRequest request) throws IOException, ElasticsearchException {
@SuppressWarnings("unchecked")
JsonEndpoint endpoint = (JsonEndpoint) AnalyzeRequest._ENDPOINT;
return this.transport.performRequest(request, endpoint, this.transportOptions);
}
/**
* Performs analysis on a text string and returns the resulting tokens.
*
* @param fn
* a function that initializes a builder to create the
* {@link AnalyzeRequest}
* @see Documentation
* on elastic.co
*/
public final AnalyzeResponse analyze(Function> fn)
throws IOException, ElasticsearchException {
return analyze(fn.apply(new AnalyzeRequest.Builder()).build());
}
/**
* Performs analysis on a text string and returns the resulting tokens.
*
* @see Documentation
* on elastic.co
*/
public AnalyzeResponse analyze() throws IOException, ElasticsearchException {
return this.transport.performRequest(new AnalyzeRequest.Builder().build(), AnalyzeRequest._ENDPOINT,
this.transportOptions);
}
// ----- Endpoint: indices.clear_cache
/**
* Clears the caches of one or more indices. For data streams, the API clears
* the caches of the stream’s backing indices.
*
* @see Documentation
* on elastic.co
*/
public ClearCacheResponse clearCache(ClearCacheRequest request) throws IOException, ElasticsearchException {
@SuppressWarnings("unchecked")
JsonEndpoint endpoint = (JsonEndpoint) ClearCacheRequest._ENDPOINT;
return this.transport.performRequest(request, endpoint, this.transportOptions);
}
/**
* Clears the caches of one or more indices. For data streams, the API clears
* the caches of the stream’s backing indices.
*
* @param fn
* a function that initializes a builder to create the
* {@link ClearCacheRequest}
* @see Documentation
* on elastic.co
*/
public final ClearCacheResponse clearCache(Function> fn)
throws IOException, ElasticsearchException {
return clearCache(fn.apply(new ClearCacheRequest.Builder()).build());
}
/**
* Clears the caches of one or more indices. For data streams, the API clears
* the caches of the stream’s backing indices.
*
* @see Documentation
* on elastic.co
*/
public ClearCacheResponse clearCache() throws IOException, ElasticsearchException {
return this.transport.performRequest(new ClearCacheRequest.Builder().build(), ClearCacheRequest._ENDPOINT,
this.transportOptions);
}
// ----- Endpoint: indices.clone
/**
* Clones an existing index.
*
* @see Documentation
* on elastic.co
*/
public CloneIndexResponse clone(CloneIndexRequest request) throws IOException, ElasticsearchException {
@SuppressWarnings("unchecked")
JsonEndpoint endpoint = (JsonEndpoint) CloneIndexRequest._ENDPOINT;
return this.transport.performRequest(request, endpoint, this.transportOptions);
}
/**
* Clones an existing index.
*
* @param fn
* a function that initializes a builder to create the
* {@link CloneIndexRequest}
* @see Documentation
* on elastic.co
*/
public final CloneIndexResponse clone(Function> fn)
throws IOException, ElasticsearchException {
return clone(fn.apply(new CloneIndexRequest.Builder()).build());
}
// ----- Endpoint: indices.close
/**
* Closes an index.
*
* @see Documentation
* on elastic.co
*/
public CloseIndexResponse close(CloseIndexRequest request) throws IOException, ElasticsearchException {
@SuppressWarnings("unchecked")
JsonEndpoint endpoint = (JsonEndpoint) CloseIndexRequest._ENDPOINT;
return this.transport.performRequest(request, endpoint, this.transportOptions);
}
/**
* Closes an index.
*
* @param fn
* a function that initializes a builder to create the
* {@link CloseIndexRequest}
* @see Documentation
* on elastic.co
*/
public final CloseIndexResponse close(Function> fn)
throws IOException, ElasticsearchException {
return close(fn.apply(new CloseIndexRequest.Builder()).build());
}
// ----- Endpoint: indices.create
/**
* Creates a new index.
*
* @see Documentation
* on elastic.co
*/
public CreateIndexResponse create(CreateIndexRequest request) throws IOException, ElasticsearchException {
@SuppressWarnings("unchecked")
JsonEndpoint endpoint = (JsonEndpoint) CreateIndexRequest._ENDPOINT;
return this.transport.performRequest(request, endpoint, this.transportOptions);
}
/**
* Creates a new index.
*
* @param fn
* a function that initializes a builder to create the
* {@link CreateIndexRequest}
* @see Documentation
* on elastic.co
*/
public final CreateIndexResponse create(Function> fn)
throws IOException, ElasticsearchException {
return create(fn.apply(new CreateIndexRequest.Builder()).build());
}
// ----- Endpoint: indices.create_data_stream
/**
* Creates a data stream. You must have a matching index template with data
* stream enabled.
*
* @see Documentation
* on elastic.co
*/
public CreateDataStreamResponse createDataStream(CreateDataStreamRequest request)
throws IOException, ElasticsearchException {
@SuppressWarnings("unchecked")
JsonEndpoint endpoint = (JsonEndpoint) CreateDataStreamRequest._ENDPOINT;
return this.transport.performRequest(request, endpoint, this.transportOptions);
}
/**
* Creates a data stream. You must have a matching index template with data
* stream enabled.
*
* @param fn
* a function that initializes a builder to create the
* {@link CreateDataStreamRequest}
* @see Documentation
* on elastic.co
*/
public final CreateDataStreamResponse createDataStream(
Function> fn)
throws IOException, ElasticsearchException {
return createDataStream(fn.apply(new CreateDataStreamRequest.Builder()).build());
}
// ----- Endpoint: indices.data_streams_stats
/**
* Retrieves statistics for one or more data streams.
*
* @see Documentation
* on elastic.co
*/
public DataStreamsStatsResponse dataStreamsStats(DataStreamsStatsRequest request)
throws IOException, ElasticsearchException {
@SuppressWarnings("unchecked")
JsonEndpoint endpoint = (JsonEndpoint) DataStreamsStatsRequest._ENDPOINT;
return this.transport.performRequest(request, endpoint, this.transportOptions);
}
/**
* Retrieves statistics for one or more data streams.
*
* @param fn
* a function that initializes a builder to create the
* {@link DataStreamsStatsRequest}
* @see Documentation
* on elastic.co
*/
public final DataStreamsStatsResponse dataStreamsStats(
Function> fn)
throws IOException, ElasticsearchException {
return dataStreamsStats(fn.apply(new DataStreamsStatsRequest.Builder()).build());
}
/**
* Retrieves statistics for one or more data streams.
*
* @see Documentation
* on elastic.co
*/
public DataStreamsStatsResponse dataStreamsStats() throws IOException, ElasticsearchException {
return this.transport.performRequest(new DataStreamsStatsRequest.Builder().build(),
DataStreamsStatsRequest._ENDPOINT, this.transportOptions);
}
// ----- Endpoint: indices.delete
/**
* Deletes one or more indices.
*
* @see Documentation
* on elastic.co
*/
public DeleteIndexResponse delete(DeleteIndexRequest request) throws IOException, ElasticsearchException {
@SuppressWarnings("unchecked")
JsonEndpoint endpoint = (JsonEndpoint) DeleteIndexRequest._ENDPOINT;
return this.transport.performRequest(request, endpoint, this.transportOptions);
}
/**
* Deletes one or more indices.
*
* @param fn
* a function that initializes a builder to create the
* {@link DeleteIndexRequest}
* @see Documentation
* on elastic.co
*/
public final DeleteIndexResponse delete(Function> fn)
throws IOException, ElasticsearchException {
return delete(fn.apply(new DeleteIndexRequest.Builder()).build());
}
// ----- Endpoint: indices.delete_alias
/**
* Removes a data stream or index from an alias.
*
* @see Documentation
* on elastic.co
*/
public DeleteAliasResponse deleteAlias(DeleteAliasRequest request) throws IOException, ElasticsearchException {
@SuppressWarnings("unchecked")
JsonEndpoint endpoint = (JsonEndpoint) DeleteAliasRequest._ENDPOINT;
return this.transport.performRequest(request, endpoint, this.transportOptions);
}
/**
* Removes a data stream or index from an alias.
*
* @param fn
* a function that initializes a builder to create the
* {@link DeleteAliasRequest}
* @see Documentation
* on elastic.co
*/
public final DeleteAliasResponse deleteAlias(
Function> fn)
throws IOException, ElasticsearchException {
return deleteAlias(fn.apply(new DeleteAliasRequest.Builder()).build());
}
// ----- Endpoint: indices.delete_data_lifecycle
/**
* Removes the data lifecycle from a data stream rendering it not managed by the
* data stream lifecycle
*
* @see Documentation
* on elastic.co
*/
public DeleteDataLifecycleResponse deleteDataLifecycle(DeleteDataLifecycleRequest request)
throws IOException, ElasticsearchException {
@SuppressWarnings("unchecked")
JsonEndpoint endpoint = (JsonEndpoint) DeleteDataLifecycleRequest._ENDPOINT;
return this.transport.performRequest(request, endpoint, this.transportOptions);
}
/**
* Removes the data lifecycle from a data stream rendering it not managed by the
* data stream lifecycle
*
* @param fn
* a function that initializes a builder to create the
* {@link DeleteDataLifecycleRequest}
* @see Documentation
* on elastic.co
*/
public final DeleteDataLifecycleResponse deleteDataLifecycle(
Function> fn)
throws IOException, ElasticsearchException {
return deleteDataLifecycle(fn.apply(new DeleteDataLifecycleRequest.Builder()).build());
}
// ----- Endpoint: indices.delete_data_stream
/**
* Deletes one or more data streams and their backing indices.
*
* @see Documentation
* on elastic.co
*/
public DeleteDataStreamResponse deleteDataStream(DeleteDataStreamRequest request)
throws IOException, ElasticsearchException {
@SuppressWarnings("unchecked")
JsonEndpoint endpoint = (JsonEndpoint) DeleteDataStreamRequest._ENDPOINT;
return this.transport.performRequest(request, endpoint, this.transportOptions);
}
/**
* Deletes one or more data streams and their backing indices.
*
* @param fn
* a function that initializes a builder to create the
* {@link DeleteDataStreamRequest}
* @see Documentation
* on elastic.co
*/
public final DeleteDataStreamResponse deleteDataStream(
Function> fn)
throws IOException, ElasticsearchException {
return deleteDataStream(fn.apply(new DeleteDataStreamRequest.Builder()).build());
}
// ----- Endpoint: indices.delete_index_template
/**
* Delete an index template. The provided <index-template> may contain
* multiple template names separated by a comma. If multiple template names are
* specified then there is no wildcard support and the provided names should
* match completely with existing templates.
*
* @see Documentation
* on elastic.co
*/
public DeleteIndexTemplateResponse deleteIndexTemplate(DeleteIndexTemplateRequest request)
throws IOException, ElasticsearchException {
@SuppressWarnings("unchecked")
JsonEndpoint endpoint = (JsonEndpoint) DeleteIndexTemplateRequest._ENDPOINT;
return this.transport.performRequest(request, endpoint, this.transportOptions);
}
/**
* Delete an index template. The provided <index-template> may contain
* multiple template names separated by a comma. If multiple template names are
* specified then there is no wildcard support and the provided names should
* match completely with existing templates.
*
* @param fn
* a function that initializes a builder to create the
* {@link DeleteIndexTemplateRequest}
* @see Documentation
* on elastic.co
*/
public final DeleteIndexTemplateResponse deleteIndexTemplate(
Function> fn)
throws IOException, ElasticsearchException {
return deleteIndexTemplate(fn.apply(new DeleteIndexTemplateRequest.Builder()).build());
}
// ----- Endpoint: indices.delete_template
/**
* Deletes a legacy index template.
*
* @see Documentation
* on elastic.co
*/
public DeleteTemplateResponse deleteTemplate(DeleteTemplateRequest request)
throws IOException, ElasticsearchException {
@SuppressWarnings("unchecked")
JsonEndpoint endpoint = (JsonEndpoint) DeleteTemplateRequest._ENDPOINT;
return this.transport.performRequest(request, endpoint, this.transportOptions);
}
/**
* Deletes a legacy index template.
*
* @param fn
* a function that initializes a builder to create the
* {@link DeleteTemplateRequest}
* @see Documentation
* on elastic.co
*/
public final DeleteTemplateResponse deleteTemplate(
Function> fn)
throws IOException, ElasticsearchException {
return deleteTemplate(fn.apply(new DeleteTemplateRequest.Builder()).build());
}
// ----- Endpoint: indices.disk_usage
/**
* Analyzes the disk usage of each field of an index or data stream.
*
* @see Documentation
* on elastic.co
*/
public DiskUsageResponse diskUsage(DiskUsageRequest request) throws IOException, ElasticsearchException {
@SuppressWarnings("unchecked")
JsonEndpoint endpoint = (JsonEndpoint) DiskUsageRequest._ENDPOINT;
return this.transport.performRequest(request, endpoint, this.transportOptions);
}
/**
* Analyzes the disk usage of each field of an index or data stream.
*
* @param fn
* a function that initializes a builder to create the
* {@link DiskUsageRequest}
* @see Documentation
* on elastic.co
*/
public final DiskUsageResponse diskUsage(Function> fn)
throws IOException, ElasticsearchException {
return diskUsage(fn.apply(new DiskUsageRequest.Builder()).build());
}
// ----- Endpoint: indices.downsample
/**
* Aggregates a time series (TSDS) index and stores pre-computed statistical
* summaries (min
, max
, sum
,
* value_count
and avg
) for each metric field grouped
* by a configured time interval.
*
* @see Documentation
* on elastic.co
*/
public DownsampleResponse downsample(DownsampleRequest request) throws IOException, ElasticsearchException {
@SuppressWarnings("unchecked")
JsonEndpoint endpoint = (JsonEndpoint) DownsampleRequest._ENDPOINT;
return this.transport.performRequest(request, endpoint, this.transportOptions);
}
/**
* Aggregates a time series (TSDS) index and stores pre-computed statistical
* summaries (min
, max
, sum
,
* value_count
and avg
) for each metric field grouped
* by a configured time interval.
*
* @param fn
* a function that initializes a builder to create the
* {@link DownsampleRequest}
* @see Documentation
* on elastic.co
*/
public final DownsampleResponse downsample(Function> fn)
throws IOException, ElasticsearchException {
return downsample(fn.apply(new DownsampleRequest.Builder()).build());
}
// ----- Endpoint: indices.exists
/**
* Checks if a data stream, index, or alias exists.
*
* @see Documentation
* on elastic.co
*/
public BooleanResponse exists(ExistsRequest request) throws IOException, ElasticsearchException {
@SuppressWarnings("unchecked")
Endpoint endpoint = (Endpoint) ExistsRequest._ENDPOINT;
return this.transport.performRequest(request, endpoint, this.transportOptions);
}
/**
* Checks if a data stream, index, or alias exists.
*
* @param fn
* a function that initializes a builder to create the
* {@link ExistsRequest}
* @see Documentation
* on elastic.co
*/
public final BooleanResponse exists(Function> fn)
throws IOException, ElasticsearchException {
return exists(fn.apply(new ExistsRequest.Builder()).build());
}
// ----- Endpoint: indices.exists_alias
/**
* Checks if an alias exists.
*
* @see Documentation
* on elastic.co
*/
public BooleanResponse existsAlias(ExistsAliasRequest request) throws IOException, ElasticsearchException {
@SuppressWarnings("unchecked")
Endpoint endpoint = (Endpoint) ExistsAliasRequest._ENDPOINT;
return this.transport.performRequest(request, endpoint, this.transportOptions);
}
/**
* Checks if an alias exists.
*
* @param fn
* a function that initializes a builder to create the
* {@link ExistsAliasRequest}
* @see Documentation
* on elastic.co
*/
public final BooleanResponse existsAlias(Function> fn)
throws IOException, ElasticsearchException {
return existsAlias(fn.apply(new ExistsAliasRequest.Builder()).build());
}
// ----- Endpoint: indices.exists_index_template
/**
* Returns information about whether a particular index template exists.
*
* @see Documentation
* on elastic.co
*/
public BooleanResponse existsIndexTemplate(ExistsIndexTemplateRequest request)
throws IOException, ElasticsearchException {
@SuppressWarnings("unchecked")
Endpoint endpoint = (Endpoint) ExistsIndexTemplateRequest._ENDPOINT;
return this.transport.performRequest(request, endpoint, this.transportOptions);
}
/**
* Returns information about whether a particular index template exists.
*
* @param fn
* a function that initializes a builder to create the
* {@link ExistsIndexTemplateRequest}
* @see Documentation
* on elastic.co
*/
public final BooleanResponse existsIndexTemplate(
Function> fn)
throws IOException, ElasticsearchException {
return existsIndexTemplate(fn.apply(new ExistsIndexTemplateRequest.Builder()).build());
}
// ----- Endpoint: indices.exists_template
/**
* Check existence of index templates. Returns information about whether a
* particular index template exists.
*
* @see Documentation
* on elastic.co
*/
public BooleanResponse existsTemplate(ExistsTemplateRequest request) throws IOException, ElasticsearchException {
@SuppressWarnings("unchecked")
Endpoint endpoint = (Endpoint) ExistsTemplateRequest._ENDPOINT;
return this.transport.performRequest(request, endpoint, this.transportOptions);
}
/**
* Check existence of index templates. Returns information about whether a
* particular index template exists.
*
* @param fn
* a function that initializes a builder to create the
* {@link ExistsTemplateRequest}
* @see Documentation
* on elastic.co
*/
public final BooleanResponse existsTemplate(
Function> fn)
throws IOException, ElasticsearchException {
return existsTemplate(fn.apply(new ExistsTemplateRequest.Builder()).build());
}
// ----- Endpoint: indices.explain_data_lifecycle
/**
* Retrieves information about the index's current data stream lifecycle, such
* as any potential encountered error, time since creation etc.
*
* @see Documentation
* on elastic.co
*/
public ExplainDataLifecycleResponse explainDataLifecycle(ExplainDataLifecycleRequest request)
throws IOException, ElasticsearchException {
@SuppressWarnings("unchecked")
JsonEndpoint endpoint = (JsonEndpoint) ExplainDataLifecycleRequest._ENDPOINT;
return this.transport.performRequest(request, endpoint, this.transportOptions);
}
/**
* Retrieves information about the index's current data stream lifecycle, such
* as any potential encountered error, time since creation etc.
*
* @param fn
* a function that initializes a builder to create the
* {@link ExplainDataLifecycleRequest}
* @see Documentation
* on elastic.co
*/
public final ExplainDataLifecycleResponse explainDataLifecycle(
Function> fn)
throws IOException, ElasticsearchException {
return explainDataLifecycle(fn.apply(new ExplainDataLifecycleRequest.Builder()).build());
}
// ----- Endpoint: indices.field_usage_stats
/**
* Returns field usage information for each shard and field of an index.
*
* @see Documentation
* on elastic.co
*/
public FieldUsageStatsResponse fieldUsageStats(FieldUsageStatsRequest request)
throws IOException, ElasticsearchException {
@SuppressWarnings("unchecked")
JsonEndpoint endpoint = (JsonEndpoint) FieldUsageStatsRequest._ENDPOINT;
return this.transport.performRequest(request, endpoint, this.transportOptions);
}
/**
* Returns field usage information for each shard and field of an index.
*
* @param fn
* a function that initializes a builder to create the
* {@link FieldUsageStatsRequest}
* @see Documentation
* on elastic.co
*/
public final FieldUsageStatsResponse fieldUsageStats(
Function> fn)
throws IOException, ElasticsearchException {
return fieldUsageStats(fn.apply(new FieldUsageStatsRequest.Builder()).build());
}
// ----- Endpoint: indices.flush
/**
* Flushes one or more data streams or indices.
*
* @see Documentation
* on elastic.co
*/
public FlushResponse flush(FlushRequest request) throws IOException, ElasticsearchException {
@SuppressWarnings("unchecked")
JsonEndpoint endpoint = (JsonEndpoint) FlushRequest._ENDPOINT;
return this.transport.performRequest(request, endpoint, this.transportOptions);
}
/**
* Flushes one or more data streams or indices.
*
* @param fn
* a function that initializes a builder to create the
* {@link FlushRequest}
* @see Documentation
* on elastic.co
*/
public final FlushResponse flush(Function> fn)
throws IOException, ElasticsearchException {
return flush(fn.apply(new FlushRequest.Builder()).build());
}
/**
* Flushes one or more data streams or indices.
*
* @see Documentation
* on elastic.co
*/
public FlushResponse flush() throws IOException, ElasticsearchException {
return this.transport.performRequest(new FlushRequest.Builder().build(), FlushRequest._ENDPOINT,
this.transportOptions);
}
// ----- Endpoint: indices.forcemerge
/**
* Performs the force merge operation on one or more indices.
*
* @see Documentation
* on elastic.co
*/
public ForcemergeResponse forcemerge(ForcemergeRequest request) throws IOException, ElasticsearchException {
@SuppressWarnings("unchecked")
JsonEndpoint endpoint = (JsonEndpoint) ForcemergeRequest._ENDPOINT;
return this.transport.performRequest(request, endpoint, this.transportOptions);
}
/**
* Performs the force merge operation on one or more indices.
*
* @param fn
* a function that initializes a builder to create the
* {@link ForcemergeRequest}
* @see Documentation
* on elastic.co
*/
public final ForcemergeResponse forcemerge(Function> fn)
throws IOException, ElasticsearchException {
return forcemerge(fn.apply(new ForcemergeRequest.Builder()).build());
}
/**
* Performs the force merge operation on one or more indices.
*
* @see Documentation
* on elastic.co
*/
public ForcemergeResponse forcemerge() throws IOException, ElasticsearchException {
return this.transport.performRequest(new ForcemergeRequest.Builder().build(), ForcemergeRequest._ENDPOINT,
this.transportOptions);
}
// ----- Endpoint: indices.get
/**
* Returns information about one or more indices. For data streams, the API
* returns information about the stream’s backing indices.
*
* @see Documentation
* on elastic.co
*/
public GetIndexResponse get(GetIndexRequest request) throws IOException, ElasticsearchException {
@SuppressWarnings("unchecked")
JsonEndpoint endpoint = (JsonEndpoint) GetIndexRequest._ENDPOINT;
return this.transport.performRequest(request, endpoint, this.transportOptions);
}
/**
* Returns information about one or more indices. For data streams, the API
* returns information about the stream’s backing indices.
*
* @param fn
* a function that initializes a builder to create the
* {@link GetIndexRequest}
* @see Documentation
* on elastic.co
*/
public final GetIndexResponse get(Function> fn)
throws IOException, ElasticsearchException {
return get(fn.apply(new GetIndexRequest.Builder()).build());
}
// ----- Endpoint: indices.get_alias
/**
* Retrieves information for one or more aliases.
*
* @see Documentation
* on elastic.co
*/
public GetAliasResponse getAlias(GetAliasRequest request) throws IOException, ElasticsearchException {
@SuppressWarnings("unchecked")
JsonEndpoint endpoint = (JsonEndpoint) GetAliasRequest._ENDPOINT;
return this.transport.performRequest(request, endpoint, this.transportOptions);
}
/**
* Retrieves information for one or more aliases.
*
* @param fn
* a function that initializes a builder to create the
* {@link GetAliasRequest}
* @see Documentation
* on elastic.co
*/
public final GetAliasResponse getAlias(Function> fn)
throws IOException, ElasticsearchException {
return getAlias(fn.apply(new GetAliasRequest.Builder()).build());
}
/**
* Retrieves information for one or more aliases.
*
* @see Documentation
* on elastic.co
*/
public GetAliasResponse getAlias() throws IOException, ElasticsearchException {
return this.transport.performRequest(new GetAliasRequest.Builder().build(), GetAliasRequest._ENDPOINT,
this.transportOptions);
}
// ----- Endpoint: indices.get_data_lifecycle
/**
* Retrieves the data stream lifecycle configuration of one or more data
* streams.
*
* @see Documentation
* on elastic.co
*/
public GetDataLifecycleResponse getDataLifecycle(GetDataLifecycleRequest request)
throws IOException, ElasticsearchException {
@SuppressWarnings("unchecked")
JsonEndpoint endpoint = (JsonEndpoint) GetDataLifecycleRequest._ENDPOINT;
return this.transport.performRequest(request, endpoint, this.transportOptions);
}
/**
* Retrieves the data stream lifecycle configuration of one or more data
* streams.
*
* @param fn
* a function that initializes a builder to create the
* {@link GetDataLifecycleRequest}
* @see Documentation
* on elastic.co
*/
public final GetDataLifecycleResponse getDataLifecycle(
Function> fn)
throws IOException, ElasticsearchException {
return getDataLifecycle(fn.apply(new GetDataLifecycleRequest.Builder()).build());
}
// ----- Endpoint: indices.get_data_stream
/**
* Retrieves information about one or more data streams.
*
* @see Documentation
* on elastic.co
*/
public GetDataStreamResponse getDataStream(GetDataStreamRequest request)
throws IOException, ElasticsearchException {
@SuppressWarnings("unchecked")
JsonEndpoint endpoint = (JsonEndpoint) GetDataStreamRequest._ENDPOINT;
return this.transport.performRequest(request, endpoint, this.transportOptions);
}
/**
* Retrieves information about one or more data streams.
*
* @param fn
* a function that initializes a builder to create the
* {@link GetDataStreamRequest}
* @see Documentation
* on elastic.co
*/
public final GetDataStreamResponse getDataStream(
Function> fn)
throws IOException, ElasticsearchException {
return getDataStream(fn.apply(new GetDataStreamRequest.Builder()).build());
}
/**
* Retrieves information about one or more data streams.
*
* @see Documentation
* on elastic.co
*/
public GetDataStreamResponse getDataStream() throws IOException, ElasticsearchException {
return this.transport.performRequest(new GetDataStreamRequest.Builder().build(), GetDataStreamRequest._ENDPOINT,
this.transportOptions);
}
// ----- Endpoint: indices.get_field_mapping
/**
* Retrieves mapping definitions for one or more fields. For data streams, the
* API retrieves field mappings for the stream’s backing indices.
*
* @see Documentation
* on elastic.co
*/
public GetFieldMappingResponse getFieldMapping(GetFieldMappingRequest request)
throws IOException, ElasticsearchException {
@SuppressWarnings("unchecked")
JsonEndpoint endpoint = (JsonEndpoint) GetFieldMappingRequest._ENDPOINT;
return this.transport.performRequest(request, endpoint, this.transportOptions);
}
/**
* Retrieves mapping definitions for one or more fields. For data streams, the
* API retrieves field mappings for the stream’s backing indices.
*
* @param fn
* a function that initializes a builder to create the
* {@link GetFieldMappingRequest}
* @see Documentation
* on elastic.co
*/
public final GetFieldMappingResponse getFieldMapping(
Function> fn)
throws IOException, ElasticsearchException {
return getFieldMapping(fn.apply(new GetFieldMappingRequest.Builder()).build());
}
// ----- Endpoint: indices.get_index_template
/**
* Get index templates. Returns information about one or more index templates.
*
* @see Documentation
* on elastic.co
*/
public GetIndexTemplateResponse getIndexTemplate(GetIndexTemplateRequest request)
throws IOException, ElasticsearchException {
@SuppressWarnings("unchecked")
JsonEndpoint endpoint = (JsonEndpoint) GetIndexTemplateRequest._ENDPOINT;
return this.transport.performRequest(request, endpoint, this.transportOptions);
}
/**
* Get index templates. Returns information about one or more index templates.
*
* @param fn
* a function that initializes a builder to create the
* {@link GetIndexTemplateRequest}
* @see Documentation
* on elastic.co
*/
public final GetIndexTemplateResponse getIndexTemplate(
Function> fn)
throws IOException, ElasticsearchException {
return getIndexTemplate(fn.apply(new GetIndexTemplateRequest.Builder()).build());
}
/**
* Get index templates. Returns information about one or more index templates.
*
* @see Documentation
* on elastic.co
*/
public GetIndexTemplateResponse getIndexTemplate() throws IOException, ElasticsearchException {
return this.transport.performRequest(new GetIndexTemplateRequest.Builder().build(),
GetIndexTemplateRequest._ENDPOINT, this.transportOptions);
}
// ----- Endpoint: indices.get_mapping
/**
* Retrieves mapping definitions for one or more indices. For data streams, the
* API retrieves mappings for the stream’s backing indices.
*
* @see Documentation
* on elastic.co
*/
public GetMappingResponse getMapping(GetMappingRequest request) throws IOException, ElasticsearchException {
@SuppressWarnings("unchecked")
JsonEndpoint endpoint = (JsonEndpoint) GetMappingRequest._ENDPOINT;
return this.transport.performRequest(request, endpoint, this.transportOptions);
}
/**
* Retrieves mapping definitions for one or more indices. For data streams, the
* API retrieves mappings for the stream’s backing indices.
*
* @param fn
* a function that initializes a builder to create the
* {@link GetMappingRequest}
* @see Documentation
* on elastic.co
*/
public final GetMappingResponse getMapping(Function> fn)
throws IOException, ElasticsearchException {
return getMapping(fn.apply(new GetMappingRequest.Builder()).build());
}
/**
* Retrieves mapping definitions for one or more indices. For data streams, the
* API retrieves mappings for the stream’s backing indices.
*
* @see Documentation
* on elastic.co
*/
public GetMappingResponse getMapping() throws IOException, ElasticsearchException {
return this.transport.performRequest(new GetMappingRequest.Builder().build(), GetMappingRequest._ENDPOINT,
this.transportOptions);
}
// ----- Endpoint: indices.get_settings
/**
* Returns setting information for one or more indices. For data streams,
* returns setting information for the stream’s backing indices.
*
* @see Documentation
* on elastic.co
*/
public GetIndicesSettingsResponse getSettings(GetIndicesSettingsRequest request)
throws IOException, ElasticsearchException {
@SuppressWarnings("unchecked")
JsonEndpoint endpoint = (JsonEndpoint) GetIndicesSettingsRequest._ENDPOINT;
return this.transport.performRequest(request, endpoint, this.transportOptions);
}
/**
* Returns setting information for one or more indices. For data streams,
* returns setting information for the stream’s backing indices.
*
* @param fn
* a function that initializes a builder to create the
* {@link GetIndicesSettingsRequest}
* @see Documentation
* on elastic.co
*/
public final GetIndicesSettingsResponse getSettings(
Function> fn)
throws IOException, ElasticsearchException {
return getSettings(fn.apply(new GetIndicesSettingsRequest.Builder()).build());
}
/**
* Returns setting information for one or more indices. For data streams,
* returns setting information for the stream’s backing indices.
*
* @see Documentation
* on elastic.co
*/
public GetIndicesSettingsResponse getSettings() throws IOException, ElasticsearchException {
return this.transport.performRequest(new GetIndicesSettingsRequest.Builder().build(),
GetIndicesSettingsRequest._ENDPOINT, this.transportOptions);
}
// ----- Endpoint: indices.get_template
/**
* Get index templates. Retrieves information about one or more index templates.
*
* @see Documentation
* on elastic.co
*/
public GetTemplateResponse getTemplate(GetTemplateRequest request) throws IOException, ElasticsearchException {
@SuppressWarnings("unchecked")
JsonEndpoint endpoint = (JsonEndpoint) GetTemplateRequest._ENDPOINT;
return this.transport.performRequest(request, endpoint, this.transportOptions);
}
/**
* Get index templates. Retrieves information about one or more index templates.
*
* @param fn
* a function that initializes a builder to create the
* {@link GetTemplateRequest}
* @see Documentation
* on elastic.co
*/
public final GetTemplateResponse getTemplate(
Function> fn)
throws IOException, ElasticsearchException {
return getTemplate(fn.apply(new GetTemplateRequest.Builder()).build());
}
/**
* Get index templates. Retrieves information about one or more index templates.
*
* @see Documentation
* on elastic.co
*/
public GetTemplateResponse getTemplate() throws IOException, ElasticsearchException {
return this.transport.performRequest(new GetTemplateRequest.Builder().build(), GetTemplateRequest._ENDPOINT,
this.transportOptions);
}
// ----- Endpoint: indices.migrate_to_data_stream
/**
* Converts an index alias to a data stream. You must have a matching index
* template that is data stream enabled. The alias must meet the following
* criteria: The alias must have a write index; All indices for the alias must
* have a @timestamp
field mapping of a date
or
* date_nanos
field type; The alias must not have any filters; The
* alias must not use custom routing. If successful, the request removes the
* alias and creates a data stream with the same name. The indices for the alias
* become hidden backing indices for the stream. The write index for the alias
* becomes the write index for the stream.
*
* @see Documentation
* on elastic.co
*/
public MigrateToDataStreamResponse migrateToDataStream(MigrateToDataStreamRequest request)
throws IOException, ElasticsearchException {
@SuppressWarnings("unchecked")
JsonEndpoint endpoint = (JsonEndpoint) MigrateToDataStreamRequest._ENDPOINT;
return this.transport.performRequest(request, endpoint, this.transportOptions);
}
/**
* Converts an index alias to a data stream. You must have a matching index
* template that is data stream enabled. The alias must meet the following
* criteria: The alias must have a write index; All indices for the alias must
* have a @timestamp
field mapping of a date
or
* date_nanos
field type; The alias must not have any filters; The
* alias must not use custom routing. If successful, the request removes the
* alias and creates a data stream with the same name. The indices for the alias
* become hidden backing indices for the stream. The write index for the alias
* becomes the write index for the stream.
*
* @param fn
* a function that initializes a builder to create the
* {@link MigrateToDataStreamRequest}
* @see Documentation
* on elastic.co
*/
public final MigrateToDataStreamResponse migrateToDataStream(
Function> fn)
throws IOException, ElasticsearchException {
return migrateToDataStream(fn.apply(new MigrateToDataStreamRequest.Builder()).build());
}
// ----- Endpoint: indices.modify_data_stream
/**
* Performs one or more data stream modification actions in a single atomic
* operation.
*
* @see Documentation
* on elastic.co
*/
public ModifyDataStreamResponse modifyDataStream(ModifyDataStreamRequest request)
throws IOException, ElasticsearchException {
@SuppressWarnings("unchecked")
JsonEndpoint endpoint = (JsonEndpoint) ModifyDataStreamRequest._ENDPOINT;
return this.transport.performRequest(request, endpoint, this.transportOptions);
}
/**
* Performs one or more data stream modification actions in a single atomic
* operation.
*
* @param fn
* a function that initializes a builder to create the
* {@link ModifyDataStreamRequest}
* @see Documentation
* on elastic.co
*/
public final ModifyDataStreamResponse modifyDataStream(
Function> fn)
throws IOException, ElasticsearchException {
return modifyDataStream(fn.apply(new ModifyDataStreamRequest.Builder()).build());
}
// ----- Endpoint: indices.open
/**
* Opens a closed index. For data streams, the API opens any closed backing
* indices.
*
* @see Documentation
* on elastic.co
*/
public OpenResponse open(OpenRequest request) throws IOException, ElasticsearchException {
@SuppressWarnings("unchecked")
JsonEndpoint endpoint = (JsonEndpoint) OpenRequest._ENDPOINT;
return this.transport.performRequest(request, endpoint, this.transportOptions);
}
/**
* Opens a closed index. For data streams, the API opens any closed backing
* indices.
*
* @param fn
* a function that initializes a builder to create the
* {@link OpenRequest}
* @see Documentation
* on elastic.co
*/
public final OpenResponse open(Function> fn)
throws IOException, ElasticsearchException {
return open(fn.apply(new OpenRequest.Builder()).build());
}
// ----- Endpoint: indices.promote_data_stream
/**
* Promotes a data stream from a replicated data stream managed by CCR to a
* regular data stream
*
* @see Documentation
* on elastic.co
*/
public PromoteDataStreamResponse promoteDataStream(PromoteDataStreamRequest request)
throws IOException, ElasticsearchException {
@SuppressWarnings("unchecked")
JsonEndpoint endpoint = (JsonEndpoint) PromoteDataStreamRequest._ENDPOINT;
return this.transport.performRequest(request, endpoint, this.transportOptions);
}
/**
* Promotes a data stream from a replicated data stream managed by CCR to a
* regular data stream
*
* @param fn
* a function that initializes a builder to create the
* {@link PromoteDataStreamRequest}
* @see Documentation
* on elastic.co
*/
public final PromoteDataStreamResponse promoteDataStream(
Function> fn)
throws IOException, ElasticsearchException {
return promoteDataStream(fn.apply(new PromoteDataStreamRequest.Builder()).build());
}
// ----- Endpoint: indices.put_alias
/**
* Adds a data stream or index to an alias.
*
* @see Documentation
* on elastic.co
*/
public PutAliasResponse putAlias(PutAliasRequest request) throws IOException, ElasticsearchException {
@SuppressWarnings("unchecked")
JsonEndpoint endpoint = (JsonEndpoint) PutAliasRequest._ENDPOINT;
return this.transport.performRequest(request, endpoint, this.transportOptions);
}
/**
* Adds a data stream or index to an alias.
*
* @param fn
* a function that initializes a builder to create the
* {@link PutAliasRequest}
* @see Documentation
* on elastic.co
*/
public final PutAliasResponse putAlias(Function> fn)
throws IOException, ElasticsearchException {
return putAlias(fn.apply(new PutAliasRequest.Builder()).build());
}
// ----- Endpoint: indices.put_data_lifecycle
/**
* Update the data lifecycle of the specified data streams.
*
* @see Documentation
* on elastic.co
*/
public PutDataLifecycleResponse putDataLifecycle(PutDataLifecycleRequest request)
throws IOException, ElasticsearchException {
@SuppressWarnings("unchecked")
JsonEndpoint endpoint = (JsonEndpoint) PutDataLifecycleRequest._ENDPOINT;
return this.transport.performRequest(request, endpoint, this.transportOptions);
}
/**
* Update the data lifecycle of the specified data streams.
*
* @param fn
* a function that initializes a builder to create the
* {@link PutDataLifecycleRequest}
* @see Documentation
* on elastic.co
*/
public final PutDataLifecycleResponse putDataLifecycle(
Function> fn)
throws IOException, ElasticsearchException {
return putDataLifecycle(fn.apply(new PutDataLifecycleRequest.Builder()).build());
}
// ----- Endpoint: indices.put_index_template
/**
* Create or update an index template. Index templates define settings,
* mappings, and aliases that can be applied automatically to new indices.
*
* @see Documentation
* on elastic.co
*/
public PutIndexTemplateResponse putIndexTemplate(PutIndexTemplateRequest request)
throws IOException, ElasticsearchException {
@SuppressWarnings("unchecked")
JsonEndpoint endpoint = (JsonEndpoint) PutIndexTemplateRequest._ENDPOINT;
return this.transport.performRequest(request, endpoint, this.transportOptions);
}
/**
* Create or update an index template. Index templates define settings,
* mappings, and aliases that can be applied automatically to new indices.
*
* @param fn
* a function that initializes a builder to create the
* {@link PutIndexTemplateRequest}
* @see Documentation
* on elastic.co
*/
public final PutIndexTemplateResponse putIndexTemplate(
Function> fn)
throws IOException, ElasticsearchException {
return putIndexTemplate(fn.apply(new PutIndexTemplateRequest.Builder()).build());
}
// ----- Endpoint: indices.put_mapping
/**
* Adds new fields to an existing data stream or index. You can also use this
* API to change the search settings of existing fields. For data streams, these
* changes are applied to all backing indices by default.
*
* @see Documentation
* on elastic.co
*/
public PutMappingResponse putMapping(PutMappingRequest request) throws IOException, ElasticsearchException {
@SuppressWarnings("unchecked")
JsonEndpoint endpoint = (JsonEndpoint) PutMappingRequest._ENDPOINT;
return this.transport.performRequest(request, endpoint, this.transportOptions);
}
/**
* Adds new fields to an existing data stream or index. You can also use this
* API to change the search settings of existing fields. For data streams, these
* changes are applied to all backing indices by default.
*
* @param fn
* a function that initializes a builder to create the
* {@link PutMappingRequest}
* @see Documentation
* on elastic.co
*/
public final PutMappingResponse putMapping(Function> fn)
throws IOException, ElasticsearchException {
return putMapping(fn.apply(new PutMappingRequest.Builder()).build());
}
// ----- Endpoint: indices.put_settings
/**
* Changes a dynamic index setting in real time. For data streams, index setting
* changes are applied to all backing indices by default.
*
* @see Documentation
* on elastic.co
*/
public PutIndicesSettingsResponse putSettings(PutIndicesSettingsRequest request)
throws IOException, ElasticsearchException {
@SuppressWarnings("unchecked")
JsonEndpoint endpoint = (JsonEndpoint) PutIndicesSettingsRequest._ENDPOINT;
return this.transport.performRequest(request, endpoint, this.transportOptions);
}
/**
* Changes a dynamic index setting in real time. For data streams, index setting
* changes are applied to all backing indices by default.
*
* @param fn
* a function that initializes a builder to create the
* {@link PutIndicesSettingsRequest}
* @see Documentation
* on elastic.co
*/
public final PutIndicesSettingsResponse putSettings(
Function> fn)
throws IOException, ElasticsearchException {
return putSettings(fn.apply(new PutIndicesSettingsRequest.Builder()).build());
}
/**
* Changes a dynamic index setting in real time. For data streams, index setting
* changes are applied to all backing indices by default.
*
* @see Documentation
* on elastic.co
*/
public PutIndicesSettingsResponse putSettings() throws IOException, ElasticsearchException {
return this.transport.performRequest(new PutIndicesSettingsRequest.Builder().build(),
PutIndicesSettingsRequest._ENDPOINT, this.transportOptions);
}
// ----- Endpoint: indices.put_template
/**
* Create or update an index template. Index templates define settings,
* mappings, and aliases that can be applied automatically to new indices.
*
* @see Documentation
* on elastic.co
*/
public PutTemplateResponse putTemplate(PutTemplateRequest request) throws IOException, ElasticsearchException {
@SuppressWarnings("unchecked")
JsonEndpoint endpoint = (JsonEndpoint) PutTemplateRequest._ENDPOINT;
return this.transport.performRequest(request, endpoint, this.transportOptions);
}
/**
* Create or update an index template. Index templates define settings,
* mappings, and aliases that can be applied automatically to new indices.
*
* @param fn
* a function that initializes a builder to create the
* {@link PutTemplateRequest}
* @see Documentation
* on elastic.co
*/
public final PutTemplateResponse putTemplate(
Function> fn)
throws IOException, ElasticsearchException {
return putTemplate(fn.apply(new PutTemplateRequest.Builder()).build());
}
// ----- Endpoint: indices.recovery
/**
* Returns information about ongoing and completed shard recoveries for one or
* more indices. For data streams, the API returns information for the stream’s
* backing indices.
*
* @see Documentation
* on elastic.co
*/
public RecoveryResponse recovery(RecoveryRequest request) throws IOException, ElasticsearchException {
@SuppressWarnings("unchecked")
JsonEndpoint endpoint = (JsonEndpoint) RecoveryRequest._ENDPOINT;
return this.transport.performRequest(request, endpoint, this.transportOptions);
}
/**
* Returns information about ongoing and completed shard recoveries for one or
* more indices. For data streams, the API returns information for the stream’s
* backing indices.
*
* @param fn
* a function that initializes a builder to create the
* {@link RecoveryRequest}
* @see Documentation
* on elastic.co
*/
public final RecoveryResponse recovery(Function> fn)
throws IOException, ElasticsearchException {
return recovery(fn.apply(new RecoveryRequest.Builder()).build());
}
/**
* Returns information about ongoing and completed shard recoveries for one or
* more indices. For data streams, the API returns information for the stream’s
* backing indices.
*
* @see Documentation
* on elastic.co
*/
public RecoveryResponse recovery() throws IOException, ElasticsearchException {
return this.transport.performRequest(new RecoveryRequest.Builder().build(), RecoveryRequest._ENDPOINT,
this.transportOptions);
}
// ----- Endpoint: indices.refresh
/**
* A refresh makes recent operations performed on one or more indices available
* for search. For data streams, the API runs the refresh operation on the
* stream’s backing indices.
*
* @see Documentation
* on elastic.co
*/
public RefreshResponse refresh(RefreshRequest request) throws IOException, ElasticsearchException {
@SuppressWarnings("unchecked")
JsonEndpoint endpoint = (JsonEndpoint) RefreshRequest._ENDPOINT;
return this.transport.performRequest(request, endpoint, this.transportOptions);
}
/**
* A refresh makes recent operations performed on one or more indices available
* for search. For data streams, the API runs the refresh operation on the
* stream’s backing indices.
*
* @param fn
* a function that initializes a builder to create the
* {@link RefreshRequest}
* @see Documentation
* on elastic.co
*/
public final RefreshResponse refresh(Function> fn)
throws IOException, ElasticsearchException {
return refresh(fn.apply(new RefreshRequest.Builder()).build());
}
/**
* A refresh makes recent operations performed on one or more indices available
* for search. For data streams, the API runs the refresh operation on the
* stream’s backing indices.
*
* @see Documentation
* on elastic.co
*/
public RefreshResponse refresh() throws IOException, ElasticsearchException {
return this.transport.performRequest(new RefreshRequest.Builder().build(), RefreshRequest._ENDPOINT,
this.transportOptions);
}
// ----- Endpoint: indices.reload_search_analyzers
/**
* Reloads an index's search analyzers and their resources.
*
* @see Documentation
* on elastic.co
*/
public ReloadSearchAnalyzersResponse reloadSearchAnalyzers(ReloadSearchAnalyzersRequest request)
throws IOException, ElasticsearchException {
@SuppressWarnings("unchecked")
JsonEndpoint endpoint = (JsonEndpoint) ReloadSearchAnalyzersRequest._ENDPOINT;
return this.transport.performRequest(request, endpoint, this.transportOptions);
}
/**
* Reloads an index's search analyzers and their resources.
*
* @param fn
* a function that initializes a builder to create the
* {@link ReloadSearchAnalyzersRequest}
* @see Documentation
* on elastic.co
*/
public final ReloadSearchAnalyzersResponse reloadSearchAnalyzers(
Function> fn)
throws IOException, ElasticsearchException {
return reloadSearchAnalyzers(fn.apply(new ReloadSearchAnalyzersRequest.Builder()).build());
}
// ----- Endpoint: indices.resolve_cluster
/**
* Resolves the specified index expressions to return information about each
* cluster, including the local cluster, if included. Multiple patterns and
* remote clusters are supported.
*
* @see Documentation
* on elastic.co
*/
public ResolveClusterResponse resolveCluster(ResolveClusterRequest request)
throws IOException, ElasticsearchException {
@SuppressWarnings("unchecked")
JsonEndpoint endpoint = (JsonEndpoint) ResolveClusterRequest._ENDPOINT;
return this.transport.performRequest(request, endpoint, this.transportOptions);
}
/**
* Resolves the specified index expressions to return information about each
* cluster, including the local cluster, if included. Multiple patterns and
* remote clusters are supported.
*
* @param fn
* a function that initializes a builder to create the
* {@link ResolveClusterRequest}
* @see Documentation
* on elastic.co
*/
public final ResolveClusterResponse resolveCluster(
Function> fn)
throws IOException, ElasticsearchException {
return resolveCluster(fn.apply(new ResolveClusterRequest.Builder()).build());
}
// ----- Endpoint: indices.resolve_index
/**
* Resolves the specified name(s) and/or index patterns for indices, aliases,
* and data streams. Multiple patterns and remote clusters are supported.
*
* @see Documentation
* on elastic.co
*/
public ResolveIndexResponse resolveIndex(ResolveIndexRequest request) throws IOException, ElasticsearchException {
@SuppressWarnings("unchecked")
JsonEndpoint endpoint = (JsonEndpoint) ResolveIndexRequest._ENDPOINT;
return this.transport.performRequest(request, endpoint, this.transportOptions);
}
/**
* Resolves the specified name(s) and/or index patterns for indices, aliases,
* and data streams. Multiple patterns and remote clusters are supported.
*
* @param fn
* a function that initializes a builder to create the
* {@link ResolveIndexRequest}
* @see Documentation
* on elastic.co
*/
public final ResolveIndexResponse resolveIndex(
Function> fn)
throws IOException, ElasticsearchException {
return resolveIndex(fn.apply(new ResolveIndexRequest.Builder()).build());
}
// ----- Endpoint: indices.rollover
/**
* Creates a new index for a data stream or index alias.
*
* @see Documentation
* on elastic.co
*/
public RolloverResponse rollover(RolloverRequest request) throws IOException, ElasticsearchException {
@SuppressWarnings("unchecked")
JsonEndpoint endpoint = (JsonEndpoint) RolloverRequest._ENDPOINT;
return this.transport.performRequest(request, endpoint, this.transportOptions);
}
/**
* Creates a new index for a data stream or index alias.
*
* @param fn
* a function that initializes a builder to create the
* {@link RolloverRequest}
* @see Documentation
* on elastic.co
*/
public final RolloverResponse rollover(Function> fn)
throws IOException, ElasticsearchException {
return rollover(fn.apply(new RolloverRequest.Builder()).build());
}
// ----- Endpoint: indices.segments
/**
* Returns low-level information about the Lucene segments in index shards. For
* data streams, the API returns information about the stream’s backing indices.
*
* @see Documentation
* on elastic.co
*/
public SegmentsResponse segments(SegmentsRequest request) throws IOException, ElasticsearchException {
@SuppressWarnings("unchecked")
JsonEndpoint endpoint = (JsonEndpoint) SegmentsRequest._ENDPOINT;
return this.transport.performRequest(request, endpoint, this.transportOptions);
}
/**
* Returns low-level information about the Lucene segments in index shards. For
* data streams, the API returns information about the stream’s backing indices.
*
* @param fn
* a function that initializes a builder to create the
* {@link SegmentsRequest}
* @see Documentation
* on elastic.co
*/
public final SegmentsResponse segments(Function> fn)
throws IOException, ElasticsearchException {
return segments(fn.apply(new SegmentsRequest.Builder()).build());
}
/**
* Returns low-level information about the Lucene segments in index shards. For
* data streams, the API returns information about the stream’s backing indices.
*
* @see Documentation
* on elastic.co
*/
public SegmentsResponse segments() throws IOException, ElasticsearchException {
return this.transport.performRequest(new SegmentsRequest.Builder().build(), SegmentsRequest._ENDPOINT,
this.transportOptions);
}
// ----- Endpoint: indices.shard_stores
/**
* Retrieves store information about replica shards in one or more indices. For
* data streams, the API retrieves store information for the stream’s backing
* indices.
*
* @see Documentation
* on elastic.co
*/
public ShardStoresResponse shardStores(ShardStoresRequest request) throws IOException, ElasticsearchException {
@SuppressWarnings("unchecked")
JsonEndpoint endpoint = (JsonEndpoint) ShardStoresRequest._ENDPOINT;
return this.transport.performRequest(request, endpoint, this.transportOptions);
}
/**
* Retrieves store information about replica shards in one or more indices. For
* data streams, the API retrieves store information for the stream’s backing
* indices.
*
* @param fn
* a function that initializes a builder to create the
* {@link ShardStoresRequest}
* @see Documentation
* on elastic.co
*/
public final ShardStoresResponse shardStores(
Function> fn)
throws IOException, ElasticsearchException {
return shardStores(fn.apply(new ShardStoresRequest.Builder()).build());
}
/**
* Retrieves store information about replica shards in one or more indices. For
* data streams, the API retrieves store information for the stream’s backing
* indices.
*
* @see Documentation
* on elastic.co
*/
public ShardStoresResponse shardStores() throws IOException, ElasticsearchException {
return this.transport.performRequest(new ShardStoresRequest.Builder().build(), ShardStoresRequest._ENDPOINT,
this.transportOptions);
}
// ----- Endpoint: indices.shrink
/**
* Shrinks an existing index into a new index with fewer primary shards.
*
* @see Documentation
* on elastic.co
*/
public ShrinkResponse shrink(ShrinkRequest request) throws IOException, ElasticsearchException {
@SuppressWarnings("unchecked")
JsonEndpoint endpoint = (JsonEndpoint) ShrinkRequest._ENDPOINT;
return this.transport.performRequest(request, endpoint, this.transportOptions);
}
/**
* Shrinks an existing index into a new index with fewer primary shards.
*
* @param fn
* a function that initializes a builder to create the
* {@link ShrinkRequest}
* @see Documentation
* on elastic.co
*/
public final ShrinkResponse shrink(Function> fn)
throws IOException, ElasticsearchException {
return shrink(fn.apply(new ShrinkRequest.Builder()).build());
}
// ----- Endpoint: indices.simulate_index_template
/**
* Simulate an index. Returns the index configuration that would be applied to
* the specified index from an existing index template.
*
* @see Documentation
* on elastic.co
*/
public SimulateIndexTemplateResponse simulateIndexTemplate(SimulateIndexTemplateRequest request)
throws IOException, ElasticsearchException {
@SuppressWarnings("unchecked")
JsonEndpoint endpoint = (JsonEndpoint) SimulateIndexTemplateRequest._ENDPOINT;
return this.transport.performRequest(request, endpoint, this.transportOptions);
}
/**
* Simulate an index. Returns the index configuration that would be applied to
* the specified index from an existing index template.
*
* @param fn
* a function that initializes a builder to create the
* {@link SimulateIndexTemplateRequest}
* @see Documentation
* on elastic.co
*/
public final SimulateIndexTemplateResponse simulateIndexTemplate(
Function> fn)
throws IOException, ElasticsearchException {
return simulateIndexTemplate(fn.apply(new SimulateIndexTemplateRequest.Builder()).build());
}
// ----- Endpoint: indices.simulate_template
/**
* Simulate an index template. Returns the index configuration that would be
* applied by a particular index template.
*
* @see Documentation
* on elastic.co
*/
public SimulateTemplateResponse simulateTemplate(SimulateTemplateRequest request)
throws IOException, ElasticsearchException {
@SuppressWarnings("unchecked")
JsonEndpoint endpoint = (JsonEndpoint) SimulateTemplateRequest._ENDPOINT;
return this.transport.performRequest(request, endpoint, this.transportOptions);
}
/**
* Simulate an index template. Returns the index configuration that would be
* applied by a particular index template.
*
* @param fn
* a function that initializes a builder to create the
* {@link SimulateTemplateRequest}
* @see Documentation
* on elastic.co
*/
public final SimulateTemplateResponse simulateTemplate(
Function> fn)
throws IOException, ElasticsearchException {
return simulateTemplate(fn.apply(new SimulateTemplateRequest.Builder()).build());
}
/**
* Simulate an index template. Returns the index configuration that would be
* applied by a particular index template.
*
* @see Documentation
* on elastic.co
*/
public SimulateTemplateResponse simulateTemplate() throws IOException, ElasticsearchException {
return this.transport.performRequest(new SimulateTemplateRequest.Builder().build(),
SimulateTemplateRequest._ENDPOINT, this.transportOptions);
}
// ----- Endpoint: indices.split
/**
* Splits an existing index into a new index with more primary shards.
*
* @see Documentation
* on elastic.co
*/
public SplitResponse split(SplitRequest request) throws IOException, ElasticsearchException {
@SuppressWarnings("unchecked")
JsonEndpoint endpoint = (JsonEndpoint) SplitRequest._ENDPOINT;
return this.transport.performRequest(request, endpoint, this.transportOptions);
}
/**
* Splits an existing index into a new index with more primary shards.
*
* @param fn
* a function that initializes a builder to create the
* {@link SplitRequest}
* @see Documentation
* on elastic.co
*/
public final SplitResponse split(Function> fn)
throws IOException, ElasticsearchException {
return split(fn.apply(new SplitRequest.Builder()).build());
}
// ----- Endpoint: indices.stats
/**
* Returns statistics for one or more indices. For data streams, the API
* retrieves statistics for the stream’s backing indices.
*
* @see Documentation
* on elastic.co
*/
public IndicesStatsResponse stats(IndicesStatsRequest request) throws IOException, ElasticsearchException {
@SuppressWarnings("unchecked")
JsonEndpoint endpoint = (JsonEndpoint) IndicesStatsRequest._ENDPOINT;
return this.transport.performRequest(request, endpoint, this.transportOptions);
}
/**
* Returns statistics for one or more indices. For data streams, the API
* retrieves statistics for the stream’s backing indices.
*
* @param fn
* a function that initializes a builder to create the
* {@link IndicesStatsRequest}
* @see Documentation
* on elastic.co
*/
public final IndicesStatsResponse stats(
Function> fn)
throws IOException, ElasticsearchException {
return stats(fn.apply(new IndicesStatsRequest.Builder()).build());
}
/**
* Returns statistics for one or more indices. For data streams, the API
* retrieves statistics for the stream’s backing indices.
*
* @see Documentation
* on elastic.co
*/
public IndicesStatsResponse stats() throws IOException, ElasticsearchException {
return this.transport.performRequest(new IndicesStatsRequest.Builder().build(), IndicesStatsRequest._ENDPOINT,
this.transportOptions);
}
// ----- Endpoint: indices.unfreeze
/**
* Unfreezes an index.
*
* @see Documentation
* on elastic.co
*/
public UnfreezeResponse unfreeze(UnfreezeRequest request) throws IOException, ElasticsearchException {
@SuppressWarnings("unchecked")
JsonEndpoint endpoint = (JsonEndpoint) UnfreezeRequest._ENDPOINT;
return this.transport.performRequest(request, endpoint, this.transportOptions);
}
/**
* Unfreezes an index.
*
* @param fn
* a function that initializes a builder to create the
* {@link UnfreezeRequest}
* @see Documentation
* on elastic.co
*/
public final UnfreezeResponse unfreeze(Function> fn)
throws IOException, ElasticsearchException {
return unfreeze(fn.apply(new UnfreezeRequest.Builder()).build());
}
// ----- Endpoint: indices.update_aliases
/**
* Adds a data stream or index to an alias.
*
* @see Documentation
* on elastic.co
*/
public UpdateAliasesResponse updateAliases(UpdateAliasesRequest request)
throws IOException, ElasticsearchException {
@SuppressWarnings("unchecked")
JsonEndpoint endpoint = (JsonEndpoint) UpdateAliasesRequest._ENDPOINT;
return this.transport.performRequest(request, endpoint, this.transportOptions);
}
/**
* Adds a data stream or index to an alias.
*
* @param fn
* a function that initializes a builder to create the
* {@link UpdateAliasesRequest}
* @see Documentation
* on elastic.co
*/
public final UpdateAliasesResponse updateAliases(
Function> fn)
throws IOException, ElasticsearchException {
return updateAliases(fn.apply(new UpdateAliasesRequest.Builder()).build());
}
/**
* Adds a data stream or index to an alias.
*
* @see Documentation
* on elastic.co
*/
public UpdateAliasesResponse updateAliases() throws IOException, ElasticsearchException {
return this.transport.performRequest(new UpdateAliasesRequest.Builder().build(), UpdateAliasesRequest._ENDPOINT,
this.transportOptions);
}
// ----- Endpoint: indices.validate_query
/**
* Validates a potentially expensive query without executing it.
*
* @see Documentation
* on elastic.co
*/
public ValidateQueryResponse validateQuery(ValidateQueryRequest request)
throws IOException, ElasticsearchException {
@SuppressWarnings("unchecked")
JsonEndpoint endpoint = (JsonEndpoint) ValidateQueryRequest._ENDPOINT;
return this.transport.performRequest(request, endpoint, this.transportOptions);
}
/**
* Validates a potentially expensive query without executing it.
*
* @param fn
* a function that initializes a builder to create the
* {@link ValidateQueryRequest}
* @see Documentation
* on elastic.co
*/
public final ValidateQueryResponse validateQuery(
Function> fn)
throws IOException, ElasticsearchException {
return validateQuery(fn.apply(new ValidateQueryRequest.Builder()).build());
}
/**
* Validates a potentially expensive query without executing it.
*
* @see Documentation
* on elastic.co
*/
public ValidateQueryResponse validateQuery() throws IOException, ElasticsearchException {
return this.transport.performRequest(new ValidateQueryRequest.Builder().build(), ValidateQueryRequest._ENDPOINT,
this.transportOptions);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy