co.elastic.clients.elasticsearch.slm.ElasticsearchSlmAsyncClient Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of elasticsearch-java Show documentation
Show all versions of elasticsearch-java Show documentation
Elasticsearch Java API Client
/*
* 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.
*/
//----------------------------------------------------
// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST.
//----------------------------------------------------
package co.elastic.clients.elasticsearch.slm;
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;
/**
* Client for the slm namespace.
*/
public class ElasticsearchSlmAsyncClient extends ApiClient {
public ElasticsearchSlmAsyncClient(ElasticsearchTransport transport) {
super(transport, null);
}
public ElasticsearchSlmAsyncClient(ElasticsearchTransport transport, @Nullable TransportOptions transportOptions) {
super(transport, transportOptions);
}
@Override
public ElasticsearchSlmAsyncClient withTransportOptions(@Nullable TransportOptions transportOptions) {
return new ElasticsearchSlmAsyncClient(this.transport, transportOptions);
}
// ----- Endpoint: slm.delete_lifecycle
/**
* Deletes an existing snapshot lifecycle policy.
*
* @see Documentation
* on elastic.co
*/
public CompletableFuture deleteLifecycle(DeleteLifecycleRequest request) {
@SuppressWarnings("unchecked")
JsonEndpoint endpoint = (JsonEndpoint) DeleteLifecycleRequest._ENDPOINT;
return this.transport.performRequestAsync(request, endpoint, this.transportOptions);
}
/**
* Deletes an existing snapshot lifecycle policy.
*
* @param fn
* a function that initializes a builder to create the
* {@link DeleteLifecycleRequest}
* @see Documentation
* on elastic.co
*/
public final CompletableFuture deleteLifecycle(
Function> fn) {
return deleteLifecycle(fn.apply(new DeleteLifecycleRequest.Builder()).build());
}
// ----- Endpoint: slm.execute_lifecycle
/**
* Immediately creates a snapshot according to the lifecycle policy, without
* waiting for the scheduled time.
*
* @see Documentation
* on elastic.co
*/
public CompletableFuture executeLifecycle(ExecuteLifecycleRequest request) {
@SuppressWarnings("unchecked")
JsonEndpoint endpoint = (JsonEndpoint) ExecuteLifecycleRequest._ENDPOINT;
return this.transport.performRequestAsync(request, endpoint, this.transportOptions);
}
/**
* Immediately creates a snapshot according to the lifecycle policy, without
* waiting for the scheduled time.
*
* @param fn
* a function that initializes a builder to create the
* {@link ExecuteLifecycleRequest}
* @see Documentation
* on elastic.co
*/
public final CompletableFuture executeLifecycle(
Function> fn) {
return executeLifecycle(fn.apply(new ExecuteLifecycleRequest.Builder()).build());
}
// ----- Endpoint: slm.execute_retention
/**
* Deletes any snapshots that are expired according to the policy's retention
* rules.
*
* @see Documentation
* on elastic.co
*/
public CompletableFuture executeRetention() {
return this.transport.performRequestAsync(ExecuteRetentionRequest._INSTANCE, ExecuteRetentionRequest._ENDPOINT,
this.transportOptions);
}
// ----- Endpoint: slm.get_lifecycle
/**
* Retrieves one or more snapshot lifecycle policy definitions and information
* about the latest snapshot attempts.
*
* @see Documentation
* on elastic.co
*/
public CompletableFuture getLifecycle(GetLifecycleRequest request) {
@SuppressWarnings("unchecked")
JsonEndpoint endpoint = (JsonEndpoint) GetLifecycleRequest._ENDPOINT;
return this.transport.performRequestAsync(request, endpoint, this.transportOptions);
}
/**
* Retrieves one or more snapshot lifecycle policy definitions and information
* about the latest snapshot attempts.
*
* @param fn
* a function that initializes a builder to create the
* {@link GetLifecycleRequest}
* @see Documentation
* on elastic.co
*/
public final CompletableFuture getLifecycle(
Function> fn) {
return getLifecycle(fn.apply(new GetLifecycleRequest.Builder()).build());
}
/**
* Retrieves one or more snapshot lifecycle policy definitions and information
* about the latest snapshot attempts.
*
* @see Documentation
* on elastic.co
*/
public CompletableFuture getLifecycle() {
return this.transport.performRequestAsync(new GetLifecycleRequest.Builder().build(),
GetLifecycleRequest._ENDPOINT, this.transportOptions);
}
// ----- Endpoint: slm.get_stats
/**
* Returns global and policy-level statistics about actions taken by snapshot
* lifecycle management.
*
* @see Documentation
* on elastic.co
*/
public CompletableFuture getStats() {
return this.transport.performRequestAsync(GetStatsRequest._INSTANCE, GetStatsRequest._ENDPOINT,
this.transportOptions);
}
// ----- Endpoint: slm.get_status
/**
* Retrieves the status of snapshot lifecycle management (SLM).
*
* @see Documentation
* on elastic.co
*/
public CompletableFuture getStatus() {
return this.transport.performRequestAsync(GetSlmStatusRequest._INSTANCE, GetSlmStatusRequest._ENDPOINT,
this.transportOptions);
}
// ----- Endpoint: slm.put_lifecycle
/**
* Creates or updates a snapshot lifecycle policy.
*
* @see Documentation
* on elastic.co
*/
public CompletableFuture putLifecycle(PutLifecycleRequest request) {
@SuppressWarnings("unchecked")
JsonEndpoint endpoint = (JsonEndpoint) PutLifecycleRequest._ENDPOINT;
return this.transport.performRequestAsync(request, endpoint, this.transportOptions);
}
/**
* Creates or updates a snapshot lifecycle policy.
*
* @param fn
* a function that initializes a builder to create the
* {@link PutLifecycleRequest}
* @see Documentation
* on elastic.co
*/
public final CompletableFuture putLifecycle(
Function> fn) {
return putLifecycle(fn.apply(new PutLifecycleRequest.Builder()).build());
}
// ----- Endpoint: slm.start
/**
* Turns on snapshot lifecycle management (SLM).
*
* @see Documentation
* on elastic.co
*/
public CompletableFuture start() {
return this.transport.performRequestAsync(StartSlmRequest._INSTANCE, StartSlmRequest._ENDPOINT,
this.transportOptions);
}
// ----- Endpoint: slm.stop
/**
* Turns off snapshot lifecycle management (SLM).
*
* @see Documentation
* on elastic.co
*/
public CompletableFuture stop() {
return this.transport.performRequestAsync(StopSlmRequest._INSTANCE, StopSlmRequest._ENDPOINT,
this.transportOptions);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy