Hi,
I am writing java API code to take the snapshot of es. I am unable to find the maven repo for that.
public CreateSnapshotResponse createSnapshot(Client client, String repositoryName,
String snapshotName, String indexName){
CreateSnapshotResponse createSnapshotResponse = null;
try {
if(isSnapshotExist(client, repositoryName, snapshotName))
logger.info(snapshotName + " snapshot already exists");
else {
createSnapshotResponse = client.admin().cluster()
.prepareCreateSnapshot(repositoryName, snapshotName)
.setWaitForCompletion(true)
.setIndices(indexName).get();
logger.info("Snapshot was created.");
}
} catch (Exception ex){
logger.error("Exception in createSnapshot method: " + ex.toString());
} finally {
return createSnapshotResponse;
}
}