co.elastic.clients.elasticsearch.snapshot.ElasticsearchSnapshotAsyncClient 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.snapshot;
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 snapshot namespace.
*/
public class ElasticsearchSnapshotAsyncClient
extends
ApiClient {
public ElasticsearchSnapshotAsyncClient(ElasticsearchTransport transport) {
super(transport, null);
}
public ElasticsearchSnapshotAsyncClient(ElasticsearchTransport transport,
@Nullable TransportOptions transportOptions) {
super(transport, transportOptions);
}
@Override
public ElasticsearchSnapshotAsyncClient withTransportOptions(@Nullable TransportOptions transportOptions) {
return new ElasticsearchSnapshotAsyncClient(this.transport, transportOptions);
}
// ----- Endpoint: snapshot.cleanup_repository
/**
* Triggers the review of a snapshot repository’s contents and deletes any stale
* data not referenced by existing snapshots.
*
* @see Documentation
* on elastic.co
*/
public CompletableFuture cleanupRepository(CleanupRepositoryRequest request) {
@SuppressWarnings("unchecked")
JsonEndpoint endpoint = (JsonEndpoint) CleanupRepositoryRequest._ENDPOINT;
return this.transport.performRequestAsync(request, endpoint, this.transportOptions);
}
/**
* Triggers the review of a snapshot repository’s contents and deletes any stale
* data not referenced by existing snapshots.
*
* @param fn
* a function that initializes a builder to create the
* {@link CleanupRepositoryRequest}
* @see Documentation
* on elastic.co
*/
public final CompletableFuture cleanupRepository(
Function> fn) {
return cleanupRepository(fn.apply(new CleanupRepositoryRequest.Builder()).build());
}
// ----- Endpoint: snapshot.clone
/**
* Clones indices from one snapshot into another snapshot in the same
* repository.
*
* @see Documentation
* on elastic.co
*/
public CompletableFuture clone(CloneSnapshotRequest request) {
@SuppressWarnings("unchecked")
JsonEndpoint endpoint = (JsonEndpoint) CloneSnapshotRequest._ENDPOINT;
return this.transport.performRequestAsync(request, endpoint, this.transportOptions);
}
/**
* Clones indices from one snapshot into another snapshot in the same
* repository.
*
* @param fn
* a function that initializes a builder to create the
* {@link CloneSnapshotRequest}
* @see Documentation
* on elastic.co
*/
public final CompletableFuture clone(
Function> fn) {
return clone(fn.apply(new CloneSnapshotRequest.Builder()).build());
}
// ----- Endpoint: snapshot.create
/**
* Creates a snapshot in a repository.
*
* @see Documentation
* on elastic.co
*/
public CompletableFuture create(CreateSnapshotRequest request) {
@SuppressWarnings("unchecked")
JsonEndpoint endpoint = (JsonEndpoint) CreateSnapshotRequest._ENDPOINT;
return this.transport.performRequestAsync(request, endpoint, this.transportOptions);
}
/**
* Creates a snapshot in a repository.
*
* @param fn
* a function that initializes a builder to create the
* {@link CreateSnapshotRequest}
* @see Documentation
* on elastic.co
*/
public final CompletableFuture create(
Function> fn) {
return create(fn.apply(new CreateSnapshotRequest.Builder()).build());
}
// ----- Endpoint: snapshot.create_repository
/**
* Creates a repository.
*
* @see Documentation
* on elastic.co
*/
public CompletableFuture createRepository(CreateRepositoryRequest request) {
@SuppressWarnings("unchecked")
JsonEndpoint endpoint = (JsonEndpoint) CreateRepositoryRequest._ENDPOINT;
return this.transport.performRequestAsync(request, endpoint, this.transportOptions);
}
/**
* Creates a repository.
*
* @param fn
* a function that initializes a builder to create the
* {@link CreateRepositoryRequest}
* @see Documentation
* on elastic.co
*/
public final CompletableFuture createRepository(
Function> fn) {
return createRepository(fn.apply(new CreateRepositoryRequest.Builder()).build());
}
// ----- Endpoint: snapshot.delete
/**
* Deletes one or more snapshots.
*
* @see Documentation
* on elastic.co
*/
public CompletableFuture delete(DeleteSnapshotRequest request) {
@SuppressWarnings("unchecked")
JsonEndpoint endpoint = (JsonEndpoint) DeleteSnapshotRequest._ENDPOINT;
return this.transport.performRequestAsync(request, endpoint, this.transportOptions);
}
/**
* Deletes one or more snapshots.
*
* @param fn
* a function that initializes a builder to create the
* {@link DeleteSnapshotRequest}
* @see Documentation
* on elastic.co
*/
public final CompletableFuture delete(
Function> fn) {
return delete(fn.apply(new DeleteSnapshotRequest.Builder()).build());
}
// ----- Endpoint: snapshot.delete_repository
/**
* Deletes a repository.
*
* @see Documentation
* on elastic.co
*/
public CompletableFuture deleteRepository(DeleteRepositoryRequest request) {
@SuppressWarnings("unchecked")
JsonEndpoint endpoint = (JsonEndpoint) DeleteRepositoryRequest._ENDPOINT;
return this.transport.performRequestAsync(request, endpoint, this.transportOptions);
}
/**
* Deletes a repository.
*
* @param fn
* a function that initializes a builder to create the
* {@link DeleteRepositoryRequest}
* @see Documentation
* on elastic.co
*/
public final CompletableFuture deleteRepository(
Function> fn) {
return deleteRepository(fn.apply(new DeleteRepositoryRequest.Builder()).build());
}
// ----- Endpoint: snapshot.get
/**
* Returns information about a snapshot.
*
* @see Documentation
* on elastic.co
*/
public CompletableFuture get(GetSnapshotRequest request) {
@SuppressWarnings("unchecked")
JsonEndpoint endpoint = (JsonEndpoint) GetSnapshotRequest._ENDPOINT;
return this.transport.performRequestAsync(request, endpoint, this.transportOptions);
}
/**
* Returns information about a snapshot.
*
* @param fn
* a function that initializes a builder to create the
* {@link GetSnapshotRequest}
* @see Documentation
* on elastic.co
*/
public final CompletableFuture get(
Function> fn) {
return get(fn.apply(new GetSnapshotRequest.Builder()).build());
}
// ----- Endpoint: snapshot.get_repository
/**
* Returns information about a repository.
*
* @see Documentation
* on elastic.co
*/
public CompletableFuture getRepository(GetRepositoryRequest request) {
@SuppressWarnings("unchecked")
JsonEndpoint endpoint = (JsonEndpoint) GetRepositoryRequest._ENDPOINT;
return this.transport.performRequestAsync(request, endpoint, this.transportOptions);
}
/**
* Returns information about a repository.
*
* @param fn
* a function that initializes a builder to create the
* {@link GetRepositoryRequest}
* @see Documentation
* on elastic.co
*/
public final CompletableFuture getRepository(
Function> fn) {
return getRepository(fn.apply(new GetRepositoryRequest.Builder()).build());
}
/**
* Returns information about a repository.
*
* @see Documentation
* on elastic.co
*/
public CompletableFuture getRepository() {
return this.transport.performRequestAsync(new GetRepositoryRequest.Builder().build(),
GetRepositoryRequest._ENDPOINT, this.transportOptions);
}
// ----- Endpoint: snapshot.restore
/**
* Restores a snapshot.
*
* @see Documentation
* on elastic.co
*/
public CompletableFuture restore(RestoreRequest request) {
@SuppressWarnings("unchecked")
JsonEndpoint endpoint = (JsonEndpoint) RestoreRequest._ENDPOINT;
return this.transport.performRequestAsync(request, endpoint, this.transportOptions);
}
/**
* Restores a snapshot.
*
* @param fn
* a function that initializes a builder to create the
* {@link RestoreRequest}
* @see Documentation
* on elastic.co
*/
public final CompletableFuture restore(
Function> fn) {
return restore(fn.apply(new RestoreRequest.Builder()).build());
}
// ----- Endpoint: snapshot.status
/**
* Returns information about the status of a snapshot.
*
* @see Documentation
* on elastic.co
*/
public CompletableFuture status(SnapshotStatusRequest request) {
@SuppressWarnings("unchecked")
JsonEndpoint endpoint = (JsonEndpoint) SnapshotStatusRequest._ENDPOINT;
return this.transport.performRequestAsync(request, endpoint, this.transportOptions);
}
/**
* Returns information about the status of a snapshot.
*
* @param fn
* a function that initializes a builder to create the
* {@link SnapshotStatusRequest}
* @see Documentation
* on elastic.co
*/
public final CompletableFuture status(
Function> fn) {
return status(fn.apply(new SnapshotStatusRequest.Builder()).build());
}
/**
* Returns information about the status of a snapshot.
*
* @see Documentation
* on elastic.co
*/
public CompletableFuture status() {
return this.transport.performRequestAsync(new SnapshotStatusRequest.Builder().build(),
SnapshotStatusRequest._ENDPOINT, this.transportOptions);
}
// ----- Endpoint: snapshot.verify_repository
/**
* Verifies a repository.
*
* @see Documentation
* on elastic.co
*/
public CompletableFuture verifyRepository(VerifyRepositoryRequest request) {
@SuppressWarnings("unchecked")
JsonEndpoint endpoint = (JsonEndpoint) VerifyRepositoryRequest._ENDPOINT;
return this.transport.performRequestAsync(request, endpoint, this.transportOptions);
}
/**
* Verifies a repository.
*
* @param fn
* a function that initializes a builder to create the
* {@link VerifyRepositoryRequest}
* @see Documentation
* on elastic.co
*/
public final CompletableFuture verifyRepository(
Function> fn) {
return verifyRepository(fn.apply(new VerifyRepositoryRequest.Builder()).build());
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy