
co.elastic.clients.elasticsearch.ingest.ElasticsearchIngestAsyncClient Maven / Gradle / Ivy
Show all versions of org.apache.servicemix.bundles.elasticsearch-java
/*
* 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.ingest;
import co.elastic.clients.ApiClient;
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.util.ObjectBuilder;
import java.util.concurrent.CompletableFuture;
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 ingest namespace.
*/
public class ElasticsearchIngestAsyncClient extends ApiClient {
public ElasticsearchIngestAsyncClient(ElasticsearchTransport transport) {
super(transport, null);
}
public ElasticsearchIngestAsyncClient(ElasticsearchTransport transport,
@Nullable TransportOptions transportOptions) {
super(transport, transportOptions);
}
@Override
public ElasticsearchIngestAsyncClient withTransportOptions(@Nullable TransportOptions transportOptions) {
return new ElasticsearchIngestAsyncClient(this.transport, transportOptions);
}
// ----- Endpoint: ingest.delete_geoip_database
/**
* Delete GeoIP database configurations.
*
* Delete one or more IP geolocation database configurations.
*
* @see Documentation
* on elastic.co
*/
public CompletableFuture deleteGeoipDatabase(DeleteGeoipDatabaseRequest request) {
@SuppressWarnings("unchecked")
JsonEndpoint endpoint = (JsonEndpoint) DeleteGeoipDatabaseRequest._ENDPOINT;
return this.transport.performRequestAsync(request, endpoint, this.transportOptions);
}
/**
* Delete GeoIP database configurations.
*
* Delete one or more IP geolocation database configurations.
*
* @param fn
* a function that initializes a builder to create the
* {@link DeleteGeoipDatabaseRequest}
* @see Documentation
* on elastic.co
*/
public final CompletableFuture deleteGeoipDatabase(
Function> fn) {
return deleteGeoipDatabase(fn.apply(new DeleteGeoipDatabaseRequest.Builder()).build());
}
// ----- Endpoint: ingest.delete_ip_location_database
/**
* Delete IP geolocation database configurations.
*
* @see Documentation
* on elastic.co
*/
public CompletableFuture deleteIpLocationDatabase(
DeleteIpLocationDatabaseRequest request) {
@SuppressWarnings("unchecked")
JsonEndpoint endpoint = (JsonEndpoint) DeleteIpLocationDatabaseRequest._ENDPOINT;
return this.transport.performRequestAsync(request, endpoint, this.transportOptions);
}
/**
* Delete IP geolocation database configurations.
*
* @param fn
* a function that initializes a builder to create the
* {@link DeleteIpLocationDatabaseRequest}
* @see Documentation
* on elastic.co
*/
public final CompletableFuture deleteIpLocationDatabase(
Function> fn) {
return deleteIpLocationDatabase(fn.apply(new DeleteIpLocationDatabaseRequest.Builder()).build());
}
// ----- Endpoint: ingest.delete_pipeline
/**
* Delete pipelines. Delete one or more ingest pipelines.
*
* @see Documentation
* on elastic.co
*/
public CompletableFuture deletePipeline(DeletePipelineRequest request) {
@SuppressWarnings("unchecked")
JsonEndpoint endpoint = (JsonEndpoint) DeletePipelineRequest._ENDPOINT;
return this.transport.performRequestAsync(request, endpoint, this.transportOptions);
}
/**
* Delete pipelines. Delete one or more ingest pipelines.
*
* @param fn
* a function that initializes a builder to create the
* {@link DeletePipelineRequest}
* @see Documentation
* on elastic.co
*/
public final CompletableFuture deletePipeline(
Function> fn) {
return deletePipeline(fn.apply(new DeletePipelineRequest.Builder()).build());
}
// ----- Endpoint: ingest.geo_ip_stats
/**
* Get GeoIP statistics. Get download statistics for GeoIP2 databases that are
* used with the GeoIP processor.
*
* @see Documentation
* on elastic.co
*/
public CompletableFuture geoIpStats() {
return this.transport.performRequestAsync(GeoIpStatsRequest._INSTANCE, GeoIpStatsRequest._ENDPOINT,
this.transportOptions);
}
// ----- Endpoint: ingest.get_geoip_database
/**
* Get GeoIP database configurations.
*
* Get information about one or more IP geolocation database configurations.
*
* @see Documentation
* on elastic.co
*/
public CompletableFuture getGeoipDatabase(GetGeoipDatabaseRequest request) {
@SuppressWarnings("unchecked")
JsonEndpoint endpoint = (JsonEndpoint) GetGeoipDatabaseRequest._ENDPOINT;
return this.transport.performRequestAsync(request, endpoint, this.transportOptions);
}
/**
* Get GeoIP database configurations.
*
* Get information about one or more IP geolocation database configurations.
*
* @param fn
* a function that initializes a builder to create the
* {@link GetGeoipDatabaseRequest}
* @see Documentation
* on elastic.co
*/
public final CompletableFuture getGeoipDatabase(
Function> fn) {
return getGeoipDatabase(fn.apply(new GetGeoipDatabaseRequest.Builder()).build());
}
/**
* Get GeoIP database configurations.
*
* Get information about one or more IP geolocation database configurations.
*
* @see Documentation
* on elastic.co
*/
public CompletableFuture getGeoipDatabase() {
return this.transport.performRequestAsync(new GetGeoipDatabaseRequest.Builder().build(),
GetGeoipDatabaseRequest._ENDPOINT, this.transportOptions);
}
// ----- Endpoint: ingest.get_ip_location_database
/**
* Get IP geolocation database configurations.
*
* @see Documentation
* on elastic.co
*/
public CompletableFuture getIpLocationDatabase(
GetIpLocationDatabaseRequest request) {
@SuppressWarnings("unchecked")
JsonEndpoint endpoint = (JsonEndpoint) GetIpLocationDatabaseRequest._ENDPOINT;
return this.transport.performRequestAsync(request, endpoint, this.transportOptions);
}
/**
* Get IP geolocation database configurations.
*
* @param fn
* a function that initializes a builder to create the
* {@link GetIpLocationDatabaseRequest}
* @see Documentation
* on elastic.co
*/
public final CompletableFuture getIpLocationDatabase(
Function> fn) {
return getIpLocationDatabase(fn.apply(new GetIpLocationDatabaseRequest.Builder()).build());
}
/**
* Get IP geolocation database configurations.
*
* @see Documentation
* on elastic.co
*/
public CompletableFuture getIpLocationDatabase() {
return this.transport.performRequestAsync(new GetIpLocationDatabaseRequest.Builder().build(),
GetIpLocationDatabaseRequest._ENDPOINT, this.transportOptions);
}
// ----- Endpoint: ingest.get_pipeline
/**
* Get pipelines.
*
* Get information about one or more ingest pipelines. This API returns a local
* reference of the pipeline.
*
* @see Documentation
* on elastic.co
*/
public CompletableFuture getPipeline(GetPipelineRequest request) {
@SuppressWarnings("unchecked")
JsonEndpoint endpoint = (JsonEndpoint) GetPipelineRequest._ENDPOINT;
return this.transport.performRequestAsync(request, endpoint, this.transportOptions);
}
/**
* Get pipelines.
*
* Get information about one or more ingest pipelines. This API returns a local
* reference of the pipeline.
*
* @param fn
* a function that initializes a builder to create the
* {@link GetPipelineRequest}
* @see Documentation
* on elastic.co
*/
public final CompletableFuture getPipeline(
Function> fn) {
return getPipeline(fn.apply(new GetPipelineRequest.Builder()).build());
}
/**
* Get pipelines.
*
* Get information about one or more ingest pipelines. This API returns a local
* reference of the pipeline.
*
* @see Documentation
* on elastic.co
*/
public CompletableFuture getPipeline() {
return this.transport.performRequestAsync(new GetPipelineRequest.Builder().build(),
GetPipelineRequest._ENDPOINT, this.transportOptions);
}
// ----- Endpoint: ingest.processor_grok
/**
* Run a grok processor. Extract structured fields out of a single text field
* within a document. You must choose which field to extract matched fields
* from, as well as the grok pattern you expect will match. A grok pattern is
* like a regular expression that supports aliased expressions that can be
* reused.
*
* @see Documentation
* on elastic.co
*/
public CompletableFuture processorGrok() {
return this.transport.performRequestAsync(ProcessorGrokRequest._INSTANCE, ProcessorGrokRequest._ENDPOINT,
this.transportOptions);
}
// ----- Endpoint: ingest.put_geoip_database
/**
* Create or update a GeoIP database configuration.
*
* Refer to the create or update IP geolocation database configuration API.
*
* @see Documentation
* on elastic.co
*/
public CompletableFuture putGeoipDatabase(PutGeoipDatabaseRequest request) {
@SuppressWarnings("unchecked")
JsonEndpoint endpoint = (JsonEndpoint) PutGeoipDatabaseRequest._ENDPOINT;
return this.transport.performRequestAsync(request, endpoint, this.transportOptions);
}
/**
* Create or update a GeoIP database configuration.
*
* Refer to the create or update IP geolocation database configuration API.
*
* @param fn
* a function that initializes a builder to create the
* {@link PutGeoipDatabaseRequest}
* @see Documentation
* on elastic.co
*/
public final CompletableFuture putGeoipDatabase(
Function> fn) {
return putGeoipDatabase(fn.apply(new PutGeoipDatabaseRequest.Builder()).build());
}
// ----- Endpoint: ingest.put_ip_location_database
/**
* Create or update an IP geolocation database configuration.
*
* @see Documentation
* on elastic.co
*/
public CompletableFuture putIpLocationDatabase(
PutIpLocationDatabaseRequest request) {
@SuppressWarnings("unchecked")
JsonEndpoint endpoint = (JsonEndpoint) PutIpLocationDatabaseRequest._ENDPOINT;
return this.transport.performRequestAsync(request, endpoint, this.transportOptions);
}
/**
* Create or update an IP geolocation database configuration.
*
* @param fn
* a function that initializes a builder to create the
* {@link PutIpLocationDatabaseRequest}
* @see Documentation
* on elastic.co
*/
public final CompletableFuture putIpLocationDatabase(
Function> fn) {
return putIpLocationDatabase(fn.apply(new PutIpLocationDatabaseRequest.Builder()).build());
}
// ----- Endpoint: ingest.put_pipeline
/**
* Create or update a pipeline. Changes made using this API take effect
* immediately.
*
* @see Documentation
* on elastic.co
*/
public CompletableFuture putPipeline(PutPipelineRequest request) {
@SuppressWarnings("unchecked")
JsonEndpoint endpoint = (JsonEndpoint) PutPipelineRequest._ENDPOINT;
return this.transport.performRequestAsync(request, endpoint, this.transportOptions);
}
/**
* Create or update a pipeline. Changes made using this API take effect
* immediately.
*
* @param fn
* a function that initializes a builder to create the
* {@link PutPipelineRequest}
* @see Documentation
* on elastic.co
*/
public final CompletableFuture putPipeline(
Function> fn) {
return putPipeline(fn.apply(new PutPipelineRequest.Builder()).build());
}
// ----- Endpoint: ingest.simulate
/**
* Simulate a pipeline.
*
* Run an ingest pipeline against a set of provided documents. You can either
* specify an existing pipeline to use with the provided documents or supply a
* pipeline definition in the body of the request.
*
* @see Documentation
* on elastic.co
*/
public CompletableFuture simulate(SimulateRequest request) {
@SuppressWarnings("unchecked")
JsonEndpoint endpoint = (JsonEndpoint) SimulateRequest._ENDPOINT;
return this.transport.performRequestAsync(request, endpoint, this.transportOptions);
}
/**
* Simulate a pipeline.
*
* Run an ingest pipeline against a set of provided documents. You can either
* specify an existing pipeline to use with the provided documents or supply a
* pipeline definition in the body of the request.
*
* @param fn
* a function that initializes a builder to create the
* {@link SimulateRequest}
* @see Documentation
* on elastic.co
*/
public final CompletableFuture simulate(
Function> fn) {
return simulate(fn.apply(new SimulateRequest.Builder()).build());
}
}