Added logic to delete repository name 45/5245/1
authorAMIT M <am00474504@techmahindra.com>
Thu, 12 Sep 2019 13:38:52 +0000 (19:08 +0530)
committerAMIT M <am00474504@techmahindra.com>
Thu, 12 Sep 2019 13:45:04 +0000 (19:15 +0530)
Issue-ID: ACUMOS-3378
-Added logic to delete repository name for archive action delete

Change-Id: I021f642a09dc7a12a517679898e1dcbe2220b841
Signed-off-by: AMIT M <am00474504@techmahindra.com>
elk-client/src/main/java/org/acumos/elk/client/service/SnapshotRepositoryServiceImpl.java

index a861d5c..3b09eb0 100644 (file)
@@ -242,6 +242,12 @@ public class SnapshotRepositoryServiceImpl extends AbstractELKClientConnection i
                                for (String repoName : archiveRequest.getRepositoryName()) {
                                        result = ElkServiceUtils.executeScript(action, repoName);
                                        resultList.add(result.trim());
+                                       if (action.equalsIgnoreCase("delete")) {
+                                       ElkRepositoriesRequest elkDeleteRepositoriesRequest= new ElkRepositoriesRequest();
+                                       elkDeleteRepositoriesRequest.setNodeTimeout(ElkClientConstants.TIME_ONE_MINT_OUT);
+                                       elkDeleteRepositoriesRequest.setRepositoryName(repoName);
+                                       deleteElkRepository(elkDeleteRepositoriesRequest);
+                                       }
                                }
                        } catch (Exception ex) {
                                logger.debug("Exception:", ex);