Class ElasticsearchSnapshotAsyncClient
- All Implemented Interfaces:
Closeable
,AutoCloseable
-
Field Summary
Fields inherited from class co.elastic.clients.ApiClient
transport, transportOptions
-
Constructor Summary
ConstructorsConstructorDescriptionElasticsearchSnapshotAsyncClient
(ElasticsearchTransport transport, TransportOptions transportOptions) -
Method Summary
Modifier and TypeMethodDescriptionClean up the snapshot repository.cleanupRepository
(Function<CleanupRepositoryRequest.Builder, ObjectBuilder<CleanupRepositoryRequest>> fn) Clean up the snapshot repository.clone
(CloneSnapshotRequest request) Clone a snapshot.Clone a snapshot.create
(CreateSnapshotRequest request) Create a snapshot.Create a snapshot.createRepository
(CreateRepositoryRequest request) Create or update a snapshot repository.createRepository
(Function<CreateRepositoryRequest.Builder, ObjectBuilder<CreateRepositoryRequest>> fn) Create or update a snapshot repository.delete
(DeleteSnapshotRequest request) Delete snapshots.Delete snapshots.deleteRepository
(DeleteRepositoryRequest request) Delete snapshot repositories.deleteRepository
(Function<DeleteRepositoryRequest.Builder, ObjectBuilder<DeleteRepositoryRequest>> fn) Delete snapshot repositories.get
(GetSnapshotRequest request) Get snapshot information.Get snapshot information.Get snapshot repository information.getRepository
(GetRepositoryRequest request) Get snapshot repository information.Get snapshot repository information.Verify the repository integrity.repositoryVerifyIntegrity
(Function<RepositoryVerifyIntegrityRequest.Builder, ObjectBuilder<RepositoryVerifyIntegrityRequest>> fn) Verify the repository integrity.restore
(RestoreRequest request) Restore a snapshot.final CompletableFuture<RestoreResponse>
Restore a snapshot.status()
Get the snapshot status.status
(SnapshotStatusRequest request) Get the snapshot status.Get the snapshot status.verifyRepository
(VerifyRepositoryRequest request) Verify a snapshot repository.verifyRepository
(Function<VerifyRepositoryRequest.Builder, ObjectBuilder<VerifyRepositoryRequest>> fn) Verify a snapshot repository.withTransportOptions
(TransportOptions transportOptions) Creates a new client with some request optionsMethods inherited from class co.elastic.clients.ApiClient
_jsonpMapper, _transport, _transportOptions, close, getDeserializer, withTransportOptions
-
Constructor Details
-
ElasticsearchSnapshotAsyncClient
-
ElasticsearchSnapshotAsyncClient
public ElasticsearchSnapshotAsyncClient(ElasticsearchTransport transport, @Nullable TransportOptions transportOptions)
-
-
Method Details
-
withTransportOptions
public ElasticsearchSnapshotAsyncClient withTransportOptions(@Nullable TransportOptions transportOptions) Description copied from class:ApiClient
Creates a new client with some request options- Specified by:
withTransportOptions
in classApiClient<ElasticsearchTransport,
ElasticsearchSnapshotAsyncClient>
-
cleanupRepository
public CompletableFuture<CleanupRepositoryResponse> cleanupRepository(CleanupRepositoryRequest request) Clean up the snapshot repository. Trigger the review of the contents of a snapshot repository and delete any stale data not referenced by existing snapshots.- See Also:
-
cleanupRepository
public final CompletableFuture<CleanupRepositoryResponse> cleanupRepository(Function<CleanupRepositoryRequest.Builder, ObjectBuilder<CleanupRepositoryRequest>> fn) Clean up the snapshot repository. Trigger the review of the contents of a snapshot repository and delete any stale data not referenced by existing snapshots.- Parameters:
fn
- a function that initializes a builder to create theCleanupRepositoryRequest
- See Also:
-
clone
Clone a snapshot. Clone part of all of a snapshot into another snapshot in the same repository.- See Also:
-
clone
public final CompletableFuture<CloneSnapshotResponse> clone(Function<CloneSnapshotRequest.Builder, ObjectBuilder<CloneSnapshotRequest>> fn) Clone a snapshot. Clone part of all of a snapshot into another snapshot in the same repository.- Parameters:
fn
- a function that initializes a builder to create theCloneSnapshotRequest
- See Also:
-
create
Create a snapshot. Take a snapshot of a cluster or of data streams and indices.- See Also:
-
create
public final CompletableFuture<CreateSnapshotResponse> create(Function<CreateSnapshotRequest.Builder, ObjectBuilder<CreateSnapshotRequest>> fn) Create a snapshot. Take a snapshot of a cluster or of data streams and indices.- Parameters:
fn
- a function that initializes a builder to create theCreateSnapshotRequest
- See Also:
-
createRepository
public CompletableFuture<CreateRepositoryResponse> createRepository(CreateRepositoryRequest request) Create or update a snapshot repository. IMPORTANT: If you are migrating searchable snapshots, the repository name must be identical in the source and destination clusters. To register a snapshot repository, the cluster's global metadata must be writeable. Ensure there are no cluster blocks (for example,cluster.blocks.read_only
andclsuter.blocks.read_only_allow_delete
settings) that prevent write access.- See Also:
-
createRepository
public final CompletableFuture<CreateRepositoryResponse> createRepository(Function<CreateRepositoryRequest.Builder, ObjectBuilder<CreateRepositoryRequest>> fn) Create or update a snapshot repository. IMPORTANT: If you are migrating searchable snapshots, the repository name must be identical in the source and destination clusters. To register a snapshot repository, the cluster's global metadata must be writeable. Ensure there are no cluster blocks (for example,cluster.blocks.read_only
andclsuter.blocks.read_only_allow_delete
settings) that prevent write access.- Parameters:
fn
- a function that initializes a builder to create theCreateRepositoryRequest
- See Also:
-
delete
Delete snapshots.- See Also:
-
delete
public final CompletableFuture<DeleteSnapshotResponse> delete(Function<DeleteSnapshotRequest.Builder, ObjectBuilder<DeleteSnapshotRequest>> fn) Delete snapshots.- Parameters:
fn
- a function that initializes a builder to create theDeleteSnapshotRequest
- See Also:
-
deleteRepository
public CompletableFuture<DeleteRepositoryResponse> deleteRepository(DeleteRepositoryRequest request) Delete snapshot repositories. When a repository is unregistered, Elasticsearch removes only the reference to the location where the repository is storing the snapshots. The snapshots themselves are left untouched and in place.- See Also:
-
deleteRepository
public final CompletableFuture<DeleteRepositoryResponse> deleteRepository(Function<DeleteRepositoryRequest.Builder, ObjectBuilder<DeleteRepositoryRequest>> fn) Delete snapshot repositories. When a repository is unregistered, Elasticsearch removes only the reference to the location where the repository is storing the snapshots. The snapshots themselves are left untouched and in place.- Parameters:
fn
- a function that initializes a builder to create theDeleteRepositoryRequest
- See Also:
-
get
Get snapshot information.- See Also:
-
get
public final CompletableFuture<GetSnapshotResponse> get(Function<GetSnapshotRequest.Builder, ObjectBuilder<GetSnapshotRequest>> fn) Get snapshot information.- Parameters:
fn
- a function that initializes a builder to create theGetSnapshotRequest
- See Also:
-
getRepository
Get snapshot repository information.- See Also:
-
getRepository
public final CompletableFuture<GetRepositoryResponse> getRepository(Function<GetRepositoryRequest.Builder, ObjectBuilder<GetRepositoryRequest>> fn) Get snapshot repository information.- Parameters:
fn
- a function that initializes a builder to create theGetRepositoryRequest
- See Also:
-
getRepository
Get snapshot repository information.- See Also:
-
repositoryVerifyIntegrity
public CompletableFuture<RepositoryVerifyIntegrityResponse> repositoryVerifyIntegrity(RepositoryVerifyIntegrityRequest request) Verify the repository integrity. Verify the integrity of the contents of a snapshot repository.This API enables you to perform a comprehensive check of the contents of a repository, looking for any anomalies in its data or metadata which might prevent you from restoring snapshots from the repository or which might cause future snapshot create or delete operations to fail.
If you suspect the integrity of the contents of one of your snapshot repositories, cease all write activity to this repository immediately, set its
read_only
option totrue
, and use this API to verify its integrity. Until you do so:- It may not be possible to restore some snapshots from this repository.
- Searchable snapshots may report errors when searched or may have unassigned shards.
- Taking snapshots into this repository may fail or may appear to succeed but have created a snapshot which cannot be restored.
- Deleting snapshots from this repository may fail or may appear to succeed but leave the underlying data on disk.
- Continuing to write to the repository while it is in an invalid state may causing additional damage to its contents.
If the API finds any problems with the integrity of the contents of your repository, Elasticsearch will not be able to repair the damage. The only way to bring the repository back into a fully working state after its contents have been damaged is by restoring its contents from a repository backup which was taken before the damage occurred. You must also identify what caused the damage and take action to prevent it from happening again.
If you cannot restore a repository backup, register a new repository and use this for all future snapshot operations. In some cases it may be possible to recover some of the contents of a damaged repository, either by restoring as many of its snapshots as needed and taking new snapshots of the restored data, or by using the reindex API to copy data from any searchable snapshots mounted from the damaged repository.
Avoid all operations which write to the repository while the verify repository integrity API is running. If something changes the repository contents while an integrity verification is running then Elasticsearch may incorrectly report having detected some anomalies in its contents due to the concurrent writes. It may also incorrectly fail to report some anomalies that the concurrent writes prevented it from detecting.
NOTE: This API is intended for exploratory use by humans. You should expect the request parameters and the response format to vary in future versions.
NOTE: This API may not work correctly in a mixed-version cluster.
- See Also:
-
repositoryVerifyIntegrity
public final CompletableFuture<RepositoryVerifyIntegrityResponse> repositoryVerifyIntegrity(Function<RepositoryVerifyIntegrityRequest.Builder, ObjectBuilder<RepositoryVerifyIntegrityRequest>> fn) Verify the repository integrity. Verify the integrity of the contents of a snapshot repository.This API enables you to perform a comprehensive check of the contents of a repository, looking for any anomalies in its data or metadata which might prevent you from restoring snapshots from the repository or which might cause future snapshot create or delete operations to fail.
If you suspect the integrity of the contents of one of your snapshot repositories, cease all write activity to this repository immediately, set its
read_only
option totrue
, and use this API to verify its integrity. Until you do so:- It may not be possible to restore some snapshots from this repository.
- Searchable snapshots may report errors when searched or may have unassigned shards.
- Taking snapshots into this repository may fail or may appear to succeed but have created a snapshot which cannot be restored.
- Deleting snapshots from this repository may fail or may appear to succeed but leave the underlying data on disk.
- Continuing to write to the repository while it is in an invalid state may causing additional damage to its contents.
If the API finds any problems with the integrity of the contents of your repository, Elasticsearch will not be able to repair the damage. The only way to bring the repository back into a fully working state after its contents have been damaged is by restoring its contents from a repository backup which was taken before the damage occurred. You must also identify what caused the damage and take action to prevent it from happening again.
If you cannot restore a repository backup, register a new repository and use this for all future snapshot operations. In some cases it may be possible to recover some of the contents of a damaged repository, either by restoring as many of its snapshots as needed and taking new snapshots of the restored data, or by using the reindex API to copy data from any searchable snapshots mounted from the damaged repository.
Avoid all operations which write to the repository while the verify repository integrity API is running. If something changes the repository contents while an integrity verification is running then Elasticsearch may incorrectly report having detected some anomalies in its contents due to the concurrent writes. It may also incorrectly fail to report some anomalies that the concurrent writes prevented it from detecting.
NOTE: This API is intended for exploratory use by humans. You should expect the request parameters and the response format to vary in future versions.
NOTE: This API may not work correctly in a mixed-version cluster.
- Parameters:
fn
- a function that initializes a builder to create theRepositoryVerifyIntegrityRequest
- See Also:
-
restore
Restore a snapshot. Restore a snapshot of a cluster or data streams and indices.You can restore a snapshot only to a running cluster with an elected master node. The snapshot repository must be registered and available to the cluster. The snapshot and cluster versions must be compatible.
To restore a snapshot, the cluster's global metadata must be writable. Ensure there are't any cluster blocks that prevent writes. The restore operation ignores index blocks.
Before you restore a data stream, ensure the cluster contains a matching index template with data streams enabled. To check, use the index management feature in Kibana or the get index template API:
GET _index_template/*?filter_path=index_templates.name,index_templates.index_template.index_patterns,index_templates.index_template.data_stream
If no such template exists, you can create one or restore a cluster state that contains one. Without a matching index template, a data stream can't roll over or create backing indices.
If your snapshot contains data from App Search or Workplace Search, you must restore the Enterprise Search encryption key before you restore the snapshot.
- See Also:
-
restore
public final CompletableFuture<RestoreResponse> restore(Function<RestoreRequest.Builder, ObjectBuilder<RestoreRequest>> fn) Restore a snapshot. Restore a snapshot of a cluster or data streams and indices.You can restore a snapshot only to a running cluster with an elected master node. The snapshot repository must be registered and available to the cluster. The snapshot and cluster versions must be compatible.
To restore a snapshot, the cluster's global metadata must be writable. Ensure there are't any cluster blocks that prevent writes. The restore operation ignores index blocks.
Before you restore a data stream, ensure the cluster contains a matching index template with data streams enabled. To check, use the index management feature in Kibana or the get index template API:
GET _index_template/*?filter_path=index_templates.name,index_templates.index_template.index_patterns,index_templates.index_template.data_stream
If no such template exists, you can create one or restore a cluster state that contains one. Without a matching index template, a data stream can't roll over or create backing indices.
If your snapshot contains data from App Search or Workplace Search, you must restore the Enterprise Search encryption key before you restore the snapshot.
- Parameters:
fn
- a function that initializes a builder to create theRestoreRequest
- See Also:
-
status
Get the snapshot status. Get a detailed description of the current state for each shard participating in the snapshot. Note that this API should be used only to obtain detailed shard-level information for ongoing snapshots. If this detail is not needed or you want to obtain information about one or more existing snapshots, use the get snapshot API.WARNING: Using the API to return the status of any snapshots other than currently running snapshots can be expensive. The API requires a read from the repository for each shard in each snapshot. For example, if you have 100 snapshots with 1,000 shards each, an API request that includes all snapshots will require 100,000 reads (100 snapshots x 1,000 shards).
Depending on the latency of your storage, such requests can take an extremely long time to return results. These requests can also tax machine resources and, when using cloud storage, incur high processing costs.
- See Also:
-
status
public final CompletableFuture<SnapshotStatusResponse> status(Function<SnapshotStatusRequest.Builder, ObjectBuilder<SnapshotStatusRequest>> fn) Get the snapshot status. Get a detailed description of the current state for each shard participating in the snapshot. Note that this API should be used only to obtain detailed shard-level information for ongoing snapshots. If this detail is not needed or you want to obtain information about one or more existing snapshots, use the get snapshot API.WARNING: Using the API to return the status of any snapshots other than currently running snapshots can be expensive. The API requires a read from the repository for each shard in each snapshot. For example, if you have 100 snapshots with 1,000 shards each, an API request that includes all snapshots will require 100,000 reads (100 snapshots x 1,000 shards).
Depending on the latency of your storage, such requests can take an extremely long time to return results. These requests can also tax machine resources and, when using cloud storage, incur high processing costs.
- Parameters:
fn
- a function that initializes a builder to create theSnapshotStatusRequest
- See Also:
-
status
Get the snapshot status. Get a detailed description of the current state for each shard participating in the snapshot. Note that this API should be used only to obtain detailed shard-level information for ongoing snapshots. If this detail is not needed or you want to obtain information about one or more existing snapshots, use the get snapshot API.WARNING: Using the API to return the status of any snapshots other than currently running snapshots can be expensive. The API requires a read from the repository for each shard in each snapshot. For example, if you have 100 snapshots with 1,000 shards each, an API request that includes all snapshots will require 100,000 reads (100 snapshots x 1,000 shards).
Depending on the latency of your storage, such requests can take an extremely long time to return results. These requests can also tax machine resources and, when using cloud storage, incur high processing costs.
- See Also:
-
verifyRepository
public CompletableFuture<VerifyRepositoryResponse> verifyRepository(VerifyRepositoryRequest request) Verify a snapshot repository. Check for common misconfigurations in a snapshot repository.- See Also:
-
verifyRepository
public final CompletableFuture<VerifyRepositoryResponse> verifyRepository(Function<VerifyRepositoryRequest.Builder, ObjectBuilder<VerifyRepositoryRequest>> fn) Verify a snapshot repository. Check for common misconfigurations in a snapshot repository.- Parameters:
fn
- a function that initializes a builder to create theVerifyRepositoryRequest
- See Also:
-