Metricbeat index archival/purging 81/4181/1
authorAMIT M <am00474504@techmahindra.com>
Thu, 18 Apr 2019 14:31:57 +0000 (20:01 +0530)
committerAMIT M <am00474504@techmahindra.com>
Thu, 18 Apr 2019 14:33:12 +0000 (20:03 +0530)
 Issue-ID: ACUMOS-2065, ACUMOS-2004, ACUMOS-2686
- Includes Platform maintenance support
- Acumos Platform > Logstash to send model usage logs to "model-usage-logs" index instead of "logstash" index
`

Change-Id: I49393740da2f26bbb6d0a086cb5b35aa163a6781
Signed-off-by: AMIT M <am00474504@techmahindra.com>
22 files changed:
docs/release-notes.rst
elk-client/pom.xml
elk-client/src/main/java/org/acumos/elk/client/ElkLogSnapshotTaskSchedular.java
elk-client/src/main/java/org/acumos/elk/client/controller/ElasticSearchServiceController.java
elk-client/src/main/java/org/acumos/elk/client/service/ISnapshotService.java
elk-client/src/main/java/org/acumos/elk/client/service/SnapshotRepositoryServiceImpl.java
elk-client/src/main/java/org/acumos/elk/client/service/SnapshotServiceImpl.java
elk-client/src/main/java/org/acumos/elk/client/transport/CreateSnapshot.java
elk-client/src/main/java/org/acumos/elk/client/transport/DeleteSnapshot.java
elk-client/src/main/java/org/acumos/elk/client/transport/ElasticStackIndiceResponse.java [new file with mode: 0644]
elk-client/src/main/java/org/acumos/elk/client/transport/ElasticStackIndices.java [new file with mode: 0644]
elk-client/src/main/java/org/acumos/elk/client/transport/ElkCreateSnapshotRequest.java
elk-client/src/main/java/org/acumos/elk/client/transport/ElkGetSnapshotMetaData.java
elk-client/src/main/java/org/acumos/elk/client/transport/ElkRepositoriesRequest.java
elk-client/src/main/java/org/acumos/elk/client/utils/ElkClientConstants.java
elk-stack/acumos-elk-env.sh
elk-stack/elasticsearch/pom.xml
elk-stack/kibana/pom.xml
elk-stack/logstash/pipeline/logstash.conf
elk-stack/logstash/pom.xml
filebeat/pom.xml
metricbeat/pom.xml

index ec25e2a..c4dd224 100644 (file)
 Platform Operations, Administration, and Management (OA&M) Release Notes
 ========================================================================
 
+Version 2.2.2, 18 April 2019
+-------------------------------
+* Metricbeat index archival/purging (`ACUMOS-2065 <https://jira.acumos.org/browse/ACUMOS-2065>`_)
+* Platform maintenance support (`ACUMOS-2004 <https://jira.acumos.org/browse/ACUMOS-2004>`_)
+* Acumos Platform > Logstash to send model usage logs to "model-usage-logs" index instead of "logstash" index (`ACUMOS-2686 <https://jira.acumos.org/browse/ACUMOS-2686>`_)
+
 Version 2.2.1, 17 April 2019
 -------------------------------
 * Update logstash queries for CDS version 2.2.1 (`ACUMOS-2765 <https://jira.acumos.org/browse/ACUMOS-2765>`_)
index a09baf7..c9c961f 100644 (file)
@@ -16,7 +16,7 @@
 
        <groupId>elk-client</groupId>
        <artifactId>elk-client</artifactId>
-       <version>0.0.1-SNAPSHOT</version>
+       <version>0.0.2-SNAPSHOT</version>
        <packaging>jar</packaging>
 
        <name>elk-client</name>
index 1f1bfb0..26d3c91 100644 (file)
@@ -70,7 +70,6 @@ public class ElkLogSnapshotTaskSchedular {
                                ElkCreateSnapshotRequest createDeleteSnapshotRequest = new ElkCreateSnapshotRequest();
                                List<CreateSnapshot> createSnapshots = new ArrayList<>();
                                CreateSnapshot createSnapshot = new CreateSnapshot();
-                               createSnapshot.setCreate(ElkClientConstants.TRUE);
                                createSnapshot.setRepositoryName(eLkRepositoryMetaData.getName());
                                createSnapshots.add(createSnapshot);
                                createDeleteSnapshotRequest.setCreateSnapshots(createSnapshots);
index e5b7469..b5be7a0 100644 (file)
@@ -27,6 +27,8 @@ import org.acumos.elk.client.service.ISnapshotService;
 import org.acumos.elk.client.transport.ElkCreateSnapshotRequest;
 import org.acumos.elk.client.transport.ElkDeleteSnapshotRequest;
 import org.acumos.elk.client.transport.ElkGetRepositoriesResponse;
+import org.acumos.elk.client.transport.ElasticStackIndiceResponse;
+import org.acumos.elk.client.transport.ElasticStackIndices;
 import org.acumos.elk.client.transport.ElkRepositoriesRequest;
 import org.acumos.elk.client.transport.ElkRestoreSnapshotRequest;
 import org.acumos.elk.client.transport.ElkSnapshotsResponse;
@@ -52,7 +54,8 @@ import org.springframework.web.context.request.WebRequest;
 import io.swagger.annotations.ApiOperation;
 
 /**
- * Operation related to Acumos elastic stack platform. Create, Delete, List repository and snapshot are operation provide.
+ * Operation related to Acumos elastic stack platform. Create, Delete, List
+ * repository and snapshot are operation provide.
  */
 @RestController
 public class ElasticSearchServiceController extends AbstractController {
@@ -65,10 +68,34 @@ public class ElasticSearchServiceController extends AbstractController {
        @Autowired
        ISnapshotRepositoryService snapshotGetRepositoryService;
 
+       @ApiOperation(value = "Get all the indices of Elasticstack.")
+       @RequestMapping(value = ElkClientConstants.GET_ALL_INDICES, method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
+       public ResponseEntity<ElasticStackIndices> getElkIndices() throws Exception {
+               LogConfig.setEnteringMDCs("elk-client", ElkClientConstants.GET_ALL_INDICES);
+               logger.debug("Inside getElkIndices Service");
+               ElasticStackIndices response = snapshotService.getAllElasticSearchIndices();
+               logger.debug("method call ended.");
+               LogConfig.clearMDCDetails();
+               return new ResponseEntity<ElasticStackIndices>(response, null, HttpStatus.OK);
+       }
+
+       @ApiOperation(value = "Delete elasticstack Indices.")
+       @RequestMapping(value = ElkClientConstants.DELETE_INDICES, method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_VALUE, consumes = MediaType.APPLICATION_JSON_VALUE)
+       public ResponseEntity<ElasticStackIndiceResponse> deleteElkSnapshot(
+                       @RequestBody ElasticStackIndices elasticStackIndices) throws Exception {
+               LogConfig.setEnteringMDCs("elk-client", ElkClientConstants.DELETE_INDICES);
+               logger.debug("Inside delete elasticstack indices");
+               ElasticStackIndiceResponse elasticStackIndiceResponse = snapshotService
+                               .deleteElasticSearchIndices(elasticStackIndices);
+               logger.debug("method call ended.");
+               LogConfig.clearMDCDetails();
+               return new ResponseEntity<ElasticStackIndiceResponse>(elasticStackIndiceResponse, null, HttpStatus.OK);
+       }
+
        @ApiOperation(value = "Get all the elasticsearch repositories details of Elasticstack.")
        @RequestMapping(value = ElkClientConstants.GET_ALL_REPOSITORIES, method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
        public ResponseEntity<ElkGetRepositoriesResponse> getElkRepository() throws Exception {
-               LogConfig.setEnteringMDCs("elk-client",ElkClientConstants.GET_ALL_REPOSITORIES);
+               LogConfig.setEnteringMDCs("elk-client", ElkClientConstants.GET_ALL_REPOSITORIES);
                logger.debug("Inside getElkRepository Service");
                ElkGetRepositoriesResponse response = snapshotGetRepositoryService.getAllElkRepository();
                logger.debug("method call ended.");
@@ -80,7 +107,7 @@ public class ElasticSearchServiceController extends AbstractController {
        @RequestMapping(value = ElkClientConstants.SNAPSHOT_CREATE_REPOSITORY, method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_VALUE, consumes = MediaType.APPLICATION_JSON_VALUE)
        public ResponseEntity<String> createElkRepository(@RequestBody ElkRepositoriesRequest elkCreateRepositoriesRequest)
                        throws Exception {
-               LogConfig.setEnteringMDCs("elk-client",ElkClientConstants.SNAPSHOT_CREATE_REPOSITORY);
+               LogConfig.setEnteringMDCs("elk-client", ElkClientConstants.SNAPSHOT_CREATE_REPOSITORY);
                logger.debug("Inside create elasticstack repository");
                String repositoryStatus = snapshotGetRepositoryService.createElkRepository(elkCreateRepositoriesRequest);
                logger.debug("method call ended.");
@@ -92,7 +119,7 @@ public class ElasticSearchServiceController extends AbstractController {
        @RequestMapping(value = ElkClientConstants.SNAPSHOT_DELETE_REPOSITORY_REQUEST, method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_VALUE, consumes = MediaType.APPLICATION_JSON_VALUE)
        public ResponseEntity<String> deleteElkRepository(@RequestBody ElkRepositoriesRequest elkDeleteRepositoriesRequest)
                        throws Exception {
-               LogConfig.setEnteringMDCs("elk-client",ElkClientConstants.SNAPSHOT_DELETE_REPOSITORY_REQUEST);
+               LogConfig.setEnteringMDCs("elk-client", ElkClientConstants.SNAPSHOT_DELETE_REPOSITORY_REQUEST);
                logger.debug("Inside delete elasticstack repository");
                String repositoryStatus = snapshotGetRepositoryService.deleteElkRepository(elkDeleteRepositoriesRequest);
                logger.debug("method call ended.");
@@ -103,7 +130,7 @@ public class ElasticSearchServiceController extends AbstractController {
        @ApiOperation(value = "Get all the elasticsearch snapshot.", response = ElkSnapshotsResponse.class)
        @RequestMapping(value = ElkClientConstants.GET_ALL_SNAPSHOTS, method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
        public ElkSnapshotsResponse getElkSnapshot() throws Exception {
-               LogConfig.setEnteringMDCs("elk-client",ElkClientConstants.GET_ALL_SNAPSHOTS);
+               LogConfig.setEnteringMDCs("elk-client", ElkClientConstants.GET_ALL_SNAPSHOTS);
                logger.debug("Inside get elasticstack snapshot");
                ElkRepositoriesRequest elkRepositoriesRequest = new ElkRepositoriesRequest();
                ElkSnapshotsResponse response = snapshotService.getAllElasticSearchSnapshot(elkRepositoriesRequest);
@@ -115,10 +142,10 @@ public class ElasticSearchServiceController extends AbstractController {
        @ApiOperation(value = "Create elasticstack snapshot.")
        @RequestMapping(value = ElkClientConstants.CREATE_SNAPSHOT_REQUEST, method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_VALUE, consumes = MediaType.APPLICATION_JSON_VALUE)
        public ResponseEntity<ElkSnapshotsResponse> createElkSnapshot(
-                       @RequestBody ElkCreateSnapshotRequest createDeleteSnapshotRequest) throws Exception {
-               LogConfig.setEnteringMDCs("elk-client",ElkClientConstants.CREATE_SNAPSHOT_REQUEST);
+                       @RequestBody ElkCreateSnapshotRequest createSnapshotRequest) throws Exception {
+               LogConfig.setEnteringMDCs("elk-client", ElkClientConstants.CREATE_SNAPSHOT_REQUEST);
                logger.debug("Inside create elasticstack repository");
-               ElkSnapshotsResponse response = snapshotService.createElasticSearchSnapshot(createDeleteSnapshotRequest);
+               ElkSnapshotsResponse response = snapshotService.createElasticSearchSnapshot(createSnapshotRequest);
                logger.debug("method call ended.");
                LogConfig.clearMDCDetails();
                return new ResponseEntity<ElkSnapshotsResponse>(response, null, HttpStatus.OK);
@@ -128,7 +155,7 @@ public class ElasticSearchServiceController extends AbstractController {
        @RequestMapping(value = ElkClientConstants.DELETE_SNAPSHOT_REQUEST, method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_VALUE, consumes = MediaType.APPLICATION_JSON_VALUE)
        public ResponseEntity<ElkSnapshotsResponse> deleteElkSnapshot(
                        @RequestBody ElkDeleteSnapshotRequest elkDeleteSnapshotRequest) throws Exception {
-               LogConfig.setEnteringMDCs("elk-client",ElkClientConstants.DELETE_SNAPSHOT_REQUEST);
+               LogConfig.setEnteringMDCs("elk-client", ElkClientConstants.DELETE_SNAPSHOT_REQUEST);
                logger.debug("Inside create elasticstack repository");
                ElkSnapshotsResponse response = snapshotService.deleteElasticSearchSnapshot(elkDeleteSnapshotRequest);
                logger.debug("method call ended.");
@@ -138,14 +165,15 @@ public class ElasticSearchServiceController extends AbstractController {
 
        @ApiOperation(value = "Restore elasticstack snapshot.")
        @RequestMapping(value = ElkClientConstants.RESTORE_SNAPSHOT_REQUEST, method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_VALUE, consumes = MediaType.APPLICATION_JSON_VALUE)
-       public ResponseEntity<ElkSnapshotsResponse> restoreElkSnapshot(
+       public ResponseEntity<ElasticStackIndiceResponse> restoreElkSnapshot(
                        @RequestBody ElkRestoreSnapshotRequest elkRestoreSnapshotRequest) throws Exception {
-               LogConfig.setEnteringMDCs("elk-client",ElkClientConstants.RESTORE_SNAPSHOT_REQUEST);
+               LogConfig.setEnteringMDCs("elk-client", ElkClientConstants.RESTORE_SNAPSHOT_REQUEST);
                logger.debug("Inside restore elasticstack snapshot");
-               snapshotService.restoreElasticSearchSnapshot(elkRestoreSnapshotRequest);
+               ElasticStackIndiceResponse elasticStackIndiceResponse = snapshotService
+                               .restoreElasticSearchSnapshot(elkRestoreSnapshotRequest);
                logger.debug("restore method call ended.");
                LogConfig.clearMDCDetails();
-               return new ResponseEntity<ElkSnapshotsResponse>(new ElkSnapshotsResponse(), null, HttpStatus.OK);
+               return new ResponseEntity<ElasticStackIndiceResponse>(elasticStackIndiceResponse, null, HttpStatus.OK);
        }
 
        @ResponseStatus(HttpStatus.NOT_FOUND)
index ded22f0..4448df6 100644 (file)
@@ -23,6 +23,8 @@ import java.io.IOException;
 
 import org.acumos.elk.client.transport.ElkCreateSnapshotRequest;
 import org.acumos.elk.client.transport.ElkDeleteSnapshotRequest;
+import org.acumos.elk.client.transport.ElasticStackIndiceResponse;
+import org.acumos.elk.client.transport.ElasticStackIndices;
 import org.acumos.elk.client.transport.ElkRepositoriesRequest;
 import org.acumos.elk.client.transport.ElkRestoreSnapshotRequest;
 import org.acumos.elk.client.transport.ElkSnapshotsResponse;
@@ -42,12 +44,12 @@ public interface ISnapshotService {
        /**
         * This method is used to create Snapshot.
         * 
-        * @param createDeleteSnapshotRequest
+        * @param createSnapshotRequest
         *            takes as request parameter
         * @return ElkSnapshotsResponse contains snapshot creation status
         * @throws Exception
         */
-       public ElkSnapshotsResponse createElasticSearchSnapshot(ElkCreateSnapshotRequest createDeleteSnapshotRequest)
+       public ElkSnapshotsResponse createElasticSearchSnapshot(ElkCreateSnapshotRequest createSnapshotRequest)
                        throws Exception;
 
        /**
@@ -61,12 +63,28 @@ public interface ISnapshotService {
 
        /**
         * This method is used to restore Snapshot.
-        * 
         * @param elkRestoreSnapshotRequest
-        *            takes as request parameter
         * @return contains snapshot restore status
+        * @throws IOException
+        */
+       public ElasticStackIndiceResponse restoreElasticSearchSnapshot(ElkRestoreSnapshotRequest elkRestoreSnapshotRequest) throws IOException;
+
+       /**
+        * This method will return all the indices present in elastic stack.
+        * 
+        * @param elkRepositoriesRequest
+        *            takes repository details.
+        * @return ElkIndicesResponse contains all the indices details.
         * @throws IOException 
         */
-       public ElkSnapshotsResponse restoreElasticSearchSnapshot(ElkRestoreSnapshotRequest elkRestoreSnapshotRequest) throws IOException;
+       public ElasticStackIndices getAllElasticSearchIndices() throws IOException;
+       
+       /**
+        * This method will delete the indices present in elastic stack.
+        * @param elasticStackIndices
+        * @return  delete status
+        * @throws IOException
+        */
+       public ElasticStackIndiceResponse deleteElasticSearchIndices(ElasticStackIndices elasticStackIndices) throws IOException;
 
 }
index d9b6d1c..78c6d9c 100644 (file)
@@ -71,15 +71,11 @@ public class SnapshotRepositoryServiceImpl extends AbstractELKClientConnection i
                        ElkGetRepositoriesResponse elkRepositoriesResponse = new ElkGetRepositoriesResponse();
                        List<ELkRepositoryMetaData> repositories = new ArrayList<>();
                        for (RepositoryMetaData snapshotStatusResponse : repositoryMetaDataResponse) {
-
-                               logger.debug("\nNAME: {}", snapshotStatusResponse.name());
-                               logger.debug("TYPE: {}", snapshotStatusResponse.type());
-                               logger.debug("SETTINGS: {}", snapshotStatusResponse.settings());
-
+                               logger.debug("\nNAME: {} \n TYPE: {} \n SETTINGS: {}", snapshotStatusResponse.name(),
+                                               snapshotStatusResponse.type(), snapshotStatusResponse.settings());
                                ELkRepositoryMetaData repositoryMetaData = new ELkRepositoryMetaData();
                                repositoryMetaData.setName(snapshotStatusResponse.name());
                                repositoryMetaData.setType(snapshotStatusResponse.type());
-
                                JSONObject settings = new JSONObject();
                                for (String key : snapshotStatusResponse.settings().keySet()) {
                                        settings.put(key, snapshotStatusResponse.settings().get(key));
@@ -136,6 +132,7 @@ public class SnapshotRepositoryServiceImpl extends AbstractELKClientConnection i
                DeleteRepositoryRequest deleteRepositoryRequest = new DeleteRepositoryRequest(
                                elkDeleteRepositoriesRequest.getRepositoryName());
                deleteRepositoryRequest.masterNodeTimeout(elkDeleteRepositoriesRequest.getNodeTimeout());
+               
                AcknowledgedResponse deleteAcknowledgedResponse;
                try {
                        deleteAcknowledgedResponse = client.snapshot().deleteRepository(deleteRepositoryRequest,
index 3b13156..8ab5c4e 100644 (file)
@@ -32,6 +32,8 @@ import java.util.List;
 import org.acumos.elk.client.transport.CreateSnapshot;
 import org.acumos.elk.client.transport.DeleteSnapshot;
 import org.acumos.elk.client.transport.ELkRepositoryMetaData;
+import org.acumos.elk.client.transport.ElasticStackIndiceResponse;
+import org.acumos.elk.client.transport.ElasticStackIndices;
 import org.acumos.elk.client.transport.ElasticsearchSnapshotsResponse;
 import org.acumos.elk.client.transport.ElkCreateSnapshotRequest;
 import org.acumos.elk.client.transport.ElkDeleteSnapshotRequest;
@@ -51,9 +53,16 @@ import org.elasticsearch.action.admin.cluster.snapshots.get.GetSnapshotsRequest;
 import org.elasticsearch.action.admin.cluster.snapshots.get.GetSnapshotsResponse;
 import org.elasticsearch.action.admin.cluster.snapshots.restore.RestoreSnapshotRequest;
 import org.elasticsearch.action.admin.cluster.snapshots.restore.RestoreSnapshotResponse;
+import org.elasticsearch.action.admin.indices.delete.DeleteIndexRequest;
+import org.elasticsearch.action.admin.indices.settings.get.GetSettingsRequest;
+import org.elasticsearch.action.admin.indices.settings.get.GetSettingsResponse;
+import org.elasticsearch.action.support.IndicesOptions;
 import org.elasticsearch.action.support.master.AcknowledgedResponse;
+import org.elasticsearch.client.IndicesClient;
 import org.elasticsearch.client.RequestOptions;
 import org.elasticsearch.client.RestHighLevelClient;
+import org.elasticsearch.common.collect.ImmutableOpenMap;
+import org.elasticsearch.common.settings.Settings;
 import org.elasticsearch.common.unit.TimeValue;
 import org.elasticsearch.rest.RestStatus;
 import org.elasticsearch.snapshots.SnapshotInfo;
@@ -62,6 +71,8 @@ import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
+import com.carrotsearch.hppc.cursors.ObjectCursor;
+
 /**
  * Implementation of operation related to elastic stack snapshot. 
  *
@@ -70,13 +81,12 @@ import org.springframework.stereotype.Service;
 public class SnapshotServiceImpl  extends AbstractELKClientConnection implements ISnapshotService {
 
        private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
-       
+
        @Autowired
        SnapshotRepositoryServiceImpl snapshotRepositoryServiceImpl;
        
        @Override
        public ElkSnapshotsResponse getAllElasticSearchSnapshot(ElkRepositoriesRequest elkRepositoriesRequest) {
-
                logger.debug("inside getAllElasticSearchSnapshot method ");
                ElkSnapshotsResponse elkSnapshotsResponse = new ElkSnapshotsResponse();
                List<ElasticsearchSnapshotsResponse> elasticsearchSnapshotsResponseList = new ArrayList<>();
@@ -87,51 +97,54 @@ public class SnapshotServiceImpl  extends AbstractELKClientConnection implements
                                        elkRepositoriesRequest, eLkRepositoryMetaData.getName());
                        elasticsearchSnapshotsResponse.setRepositoryName(eLkRepositoryMetaData.getName());
                        elasticsearchSnapshotsResponseList.add(elasticsearchSnapshotsResponse);
-
                }
                elkSnapshotsResponse.setElasticsearchSnapshots(elasticsearchSnapshotsResponseList);
-
                return elkSnapshotsResponse;
        }
 
        @Override
-       public ElkSnapshotsResponse createElasticSearchSnapshot(ElkCreateSnapshotRequest createDeleteSnapshotRequest)
+       public ElkSnapshotsResponse createElasticSearchSnapshot(ElkCreateSnapshotRequest createSnapshotUserRequest)
                        throws Exception {
-
                logger.debug("Inside createElasticSearchSnapshot service method");
                ElkSnapshotsResponse elkSnapshotsResponse = new ElkSnapshotsResponse();
-               if (createDeleteSnapshotRequest.getCreateSnapshots() != null
-                               && !createDeleteSnapshotRequest.getCreateSnapshots().isEmpty()) {
+               if (createSnapshotUserRequest.getCreateSnapshots() != null
+                               && !createSnapshotUserRequest.getCreateSnapshots().isEmpty()) {
                        String snapshotName = null;
                        ElasticsearchSnapshotsResponse snapshotResponse = new ElasticsearchSnapshotsResponse();
-                       List<CreateSnapshot> createSnapshots = createDeleteSnapshotRequest.getCreateSnapshots();
+                       List<CreateSnapshot> createSnapshots = createSnapshotUserRequest.getCreateSnapshots();
                        for (CreateSnapshot createSnapshot : createSnapshots) {
                                CreateSnapshotRequest createSnapshotRequest = new CreateSnapshotRequest();
-                               if (createDeleteSnapshotRequest.getNodeTimeout() != null
-                                               && Long.parseLong(createDeleteSnapshotRequest.getNodeTimeout()) > 2) {
+                               if (createSnapshotUserRequest.getNodeTimeout() != null
+                                               && Long.parseLong(createSnapshotUserRequest.getNodeTimeout()) > 2) {
                                        createSnapshotRequest.masterNodeTimeout(
-                                                       TimeValue.timeValueMinutes(Long.parseLong(createDeleteSnapshotRequest.getNodeTimeout())));
+                                                       TimeValue.timeValueMinutes(Long.parseLong(createSnapshotUserRequest.getNodeTimeout())));
                                } else {
                                        createSnapshotRequest.masterNodeTimeout(ElkClientConstants.TIME_TWO_MINT_OUT);
                                }
                                createSnapshotRequest.repository(createSnapshot.getRepositoryName());
-                               if (createSnapshot.getCreate() != null && createSnapshot.getCreate().equalsIgnoreCase(ElkClientConstants.TRUE)) {
-                                       LocalDateTime dateTime = LocalDateTime.ofInstant(new Date().toInstant(), ZoneId.systemDefault());
-                                       String dateWithTime = dateTime.toString().replaceAll(":", "-")
-                                                       .substring(0, dateTime.toString().length() - 4).toLowerCase();
-                                       snapshotName = "snapshot-" + dateWithTime;
-                                       createSnapshotRequest.snapshot(snapshotName);
-                               }
+                               LocalDateTime dateTime = LocalDateTime.ofInstant(new Date().toInstant(), ZoneId.systemDefault());
+                               String dateWithTime = dateTime.toString().replaceAll(":", "-")
+                                               .substring(0, dateTime.toString().length() - 4).toLowerCase();
+                               snapshotName = "snapshot-" + dateWithTime;
+                               createSnapshotRequest.snapshot(snapshotName);
 
                                RestHighLevelClient client = restHighLevelClientConnection();
                                CreateSnapshotResponse createSnapshotResponse;
                                try {
-                                       logger.debug("Before snapshot create");
+                                       logger.debug("createSnapshot getIndices size: {}", createSnapshot.getIndices().size());
+                                       if (createSnapshot.getIndices() != null && createSnapshot.getIndices().size() > 0) {
+                                               List<String> indices = createSnapshot.getIndices();
+                                               createSnapshotRequest.indices(indices);
+                                       } else {
+                                               ElasticStackIndices elkIndicesResponse = getAllElasticSearchIndices();
+                                               List<String> indices = elkIndicesResponse.getIndices();
+                                               createSnapshotRequest.indices(indices);
+                                       }
                                        createSnapshotResponse = client.snapshot().create(createSnapshotRequest, RequestOptions.DEFAULT);
                                } catch (ElasticsearchException ex) {
                                        logger.debug("ElasticsearchException:", ex);
                                        throw ex;
-                               }catch (Exception ex) {
+                               } catch (Exception ex) {
                                        logger.debug("Exception:", ex);
                                        throw ex;
                                } finally {
@@ -142,14 +155,11 @@ public class SnapshotServiceImpl  extends AbstractELKClientConnection implements
                                if (createSnapshotResponse != null && createSnapshotResponse.getSnapshotInfo() != null) {
                                        SnapshotInfo snapshotInfo = createSnapshotResponse.getSnapshotInfo();
                                        RestStatus status = createSnapshotResponse.status();
-                                       logger.debug("\nSnapshotInfo \n snapshotId: {}", snapshotInfo.snapshotId());
-                                       logger.debug("status: {}", snapshotInfo.status());
-                                       logger.debug("state: {}", snapshotInfo.state());
-                                       logger.debug("startTime: {}", snapshotInfo.startTime());
-                                       logger.debug("endTime: {}", snapshotInfo.endTime());
-                                       logger.debug("successfulShards: {}", snapshotInfo.successfulShards());
-                                       logger.debug("RestStatus: " + status.getStatus());
-
+                                       logger.debug(
+                                                       "\\nSnapshotInfo \n snapshotId: {} \n status: {} \n state: {} \n startTime: {} \n endTime: {} \n successfulShards: {} \n RestStatus: {}",
+                                                       snapshotInfo.snapshotId(), snapshotInfo.status(), snapshotInfo.state(),
+                                                       snapshotInfo.startTime(), convertTime(snapshotInfo.endTime()),
+                                                       convertTime(snapshotInfo.successfulShards()), status.getStatus());
                                        List<ElasticsearchSnapshotsResponse> elasticsearchSnapshotsResponseList = new ArrayList<>();
                                        List<ElkGetSnapshotMetaData> snapshotMetaDatas = new ArrayList<>();
                                        ElkGetSnapshotMetaData elkGetSnapshotMetaData = new ElkGetSnapshotMetaData();
@@ -162,7 +172,6 @@ public class SnapshotServiceImpl  extends AbstractELKClientConnection implements
                                        snapshotResponse.setSnapshots(snapshotMetaDatas);
                                        snapshotResponse.setRepositoryName(createSnapshot.getRepositoryName());
                                        elasticsearchSnapshotsResponseList.add(snapshotResponse);
-
                                        elkSnapshotsResponse.setElasticsearchSnapshots(elasticsearchSnapshotsResponseList);
                                } else {
                                        List<ElasticsearchSnapshotsResponse> elasticsearchSnapshotsResponseList = new ArrayList<>();
@@ -175,45 +184,29 @@ public class SnapshotServiceImpl  extends AbstractELKClientConnection implements
                                        snapshotResponse.setSnapshots(snapshotMetaDatas);
                                        snapshotResponse.setRepositoryName(createSnapshot.getRepositoryName());
                                        elasticsearchSnapshotsResponseList.add(snapshotResponse);
-
                                        elkSnapshotsResponse.setElasticsearchSnapshots(elasticsearchSnapshotsResponseList);
                                }
                        }
-
                }
-
                logger.debug("Snapshot is created(true for created)");
                return elkSnapshotsResponse;
        }
 
-
        @Override
        public ElkSnapshotsResponse deleteElasticSearchSnapshot(ElkDeleteSnapshotRequest elkDeleteSnapshotRequest) {
-
                logger.debug("Inside deleteElasticSearchSnapshot service method");
-
                List<DeleteSnapshot> deleteSnapshots = elkDeleteSnapshotRequest.getDeleteSnapshots();
-
                RestHighLevelClient client = restHighLevelClientConnection();
                if (deleteSnapshots != null && !deleteSnapshots.isEmpty()) {
-
                        ElkSnapshotsResponse elkSnapshotsResponse = new ElkSnapshotsResponse();
                        List<ElasticsearchSnapshotsResponse> elasticsearchSnapshotsResponseList = new ArrayList<>();
                        for (DeleteSnapshot deleteSnapshot : deleteSnapshots) {
 
-                               if (deleteSnapshot.getDelete() != null && deleteSnapshot.getDelete().equalsIgnoreCase("true")
-                                               && deleteSnapshot.getSnapShotId() != null) {
-
+                               if (deleteSnapshot.getSnapShotId() != null) {
                                        DeleteSnapshotRequest deleteSnapshotRequest = new DeleteSnapshotRequest(
                                                        deleteSnapshot.getRepositoryName());
-
-                                       String[] snapshotNameId = deleteSnapshot.getSnapShotId().split("/");
-                                       String snapshotName = snapshotNameId[0];
-                                       String snapshotId = snapshotNameId[1];
-                                       logger.debug("snapshotName {}", snapshotName);
-                                       logger.debug("snapshotId {}",snapshotId);
-
-                                       deleteSnapshotRequest.snapshot(snapshotName);
+                                       logger.debug("snapshotId: {}", deleteSnapshot.getSnapShotId());
+                                       deleteSnapshotRequest.snapshot(deleteSnapshot.getSnapShotId());
                                        deleteSnapshotRequest.masterNodeTimeout(ElkClientConstants.TIME_ONE_MINT_OUT);
                                        AcknowledgedResponse deleteSnapshotAcknowledgedResponse;
                                        try {
@@ -242,48 +235,106 @@ public class SnapshotServiceImpl  extends AbstractELKClientConnection implements
                }
 
                return null;
-       }       
-       
-       
-       @Override
-       public ElkSnapshotsResponse restoreElasticSearchSnapshot(ElkRestoreSnapshotRequest elkRestoreSnapshotRequest) throws IOException {
+       }
 
+       @Override
+       public ElasticStackIndiceResponse restoreElasticSearchSnapshot(ElkRestoreSnapshotRequest elkRestoreSnapshotRequest)
+                       throws IOException {
                logger.debug("Inside restoreElasticSearchSnapshot service ");
+               ElasticStackIndiceResponse elasticStackIndiceResponse = new ElasticStackIndiceResponse();
                RestHighLevelClient client = restHighLevelClientConnection();
-               logger.debug("Inside restoreElasticSearchSnapshot service 1111");
                for (RestoreSnapshot restoreSnapshot : elkRestoreSnapshotRequest.getRestoreSnapshots()) {
-
                        try {
                                RestoreSnapshotRequest restoreSnapshotRequest = new RestoreSnapshotRequest(
                                                elkRestoreSnapshotRequest.getRepositoryName(), restoreSnapshot.getSnapshotName());
-                               RestoreSnapshotResponse restoreSnapshotResponse = client.snapshot().restore(restoreSnapshotRequest, RequestOptions.DEFAULT);
-                               logger.debug("Inside restoreElasticSearchSnapshot service 5555 {}", restoreSnapshotResponse);
-                               logger.debug("Inside restoreElasticSearchSnapshot service 6666 {}", restoreSnapshotResponse.getRestoreInfo());
-                               
+                               RestoreSnapshotResponse restoreSnapshotResponse = client.snapshot().restore(restoreSnapshotRequest,
+                                               RequestOptions.DEFAULT);
+                               elasticStackIndiceResponse.setMessage(
+                                               "ElasticStack Snapshot restore is in progress, depending size it will take some time");
+                               elasticStackIndiceResponse.setStatus(ElkClientConstants.SUCCESS);
+                               logger.debug("RestoreSnapshotResponse : {}", elasticStackIndiceResponse.getMessage());
                        } catch (IOException e) {
-                               logger.error("IOException ",e);
-                               throw e;
+                               logger.error("IOException: ", e);
+                               throw new ErrorTransport("Unable to connect Elasticserach");
                        }
                }
+               return elasticStackIndiceResponse;
+       }
 
-               return null;
+       @Override
+       public ElasticStackIndices getAllElasticSearchIndices() throws IOException {
+
+               logger.debug("Inside getAllElasticSearchIndices");
+               RestHighLevelClient client = restHighLevelClientConnection();
+
+               ElasticStackIndices elkIndicesResponse = new ElasticStackIndices();
+               List<String> indices = new ArrayList<>();
+               try {
+                       IndicesClient indicesAdminClient = client.indices();
+                       GetSettingsRequest request = new GetSettingsRequest();
+                       request.includeDefaults(true);
+                       request.indicesOptions(IndicesOptions.lenientExpandOpen());
+                       GetSettingsResponse getSettingsResponse = indicesAdminClient.getSettings(request, RequestOptions.DEFAULT);
+                       ImmutableOpenMap<String, Settings> indexMap = getSettingsResponse.getIndexToDefaultSettings();
+                       for (ObjectCursor<String> key : indexMap.keys()) {
+                               logger.debug("key.value: {}", key.value);
+                               indices.add(key.value);
+                       }
+                       elkIndicesResponse.setIndices(indices);
+               } catch (IOException e1) {
+                       logger.debug("IOException: {}", e1);
+                       throw new ErrorTransport("Unable to connect Elasticserach");
+               }
+
+               return elkIndicesResponse;
        }
-       
+
+       public ElasticStackIndiceResponse deleteElasticSearchIndices(ElasticStackIndices elasticStackIndices)
+                       throws IOException {
+               logger.debug("Inside deleteElasticSearchIndices");
+               String response = null;
+               ElasticStackIndiceResponse elasticStackIndiceResponse = new ElasticStackIndiceResponse();
+               RestHighLevelClient client = restHighLevelClientConnection();
+               try {
+                       IndicesClient indicesAdminClient = client.indices();
+                       List<String> indices = elasticStackIndices.getIndices();
+                       for (String indiceName : indices) {
+                               DeleteIndexRequest deleteIndexRequest = new DeleteIndexRequest();
+                               deleteIndexRequest.indices(indiceName);
+                               AcknowledgedResponse acknowledgedResponse = indicesAdminClient.delete(deleteIndexRequest,
+                                               RequestOptions.DEFAULT);
+                               if (acknowledgedResponse.isAcknowledged()) {
+                                       elasticStackIndiceResponse
+                                                       .setMessage("Indices delete is in progress, depending size it will take some time");
+                                       elasticStackIndiceResponse.setStatus(ElkClientConstants.SUCCESS);
+                               } else {
+                                       elasticStackIndiceResponse.setMessage("Indices is not deleted yet");
+                                       elasticStackIndiceResponse.setStatus(ElkClientConstants.FAIL);
+                               }
+                               logger.debug("{} ,Indice Name: {}", elasticStackIndiceResponse.getMessage(), indiceName);
+                       }
+               } catch (IOException e) {
+                       logger.debug("IOException: {}", e);
+                       throw new ErrorTransport("Unable to connect Elasticserach");
+               }
+               return elasticStackIndiceResponse;
+       }
+
        private ElasticsearchSnapshotsResponse getElasticsearchSnapshotDetails(
                        ElkRepositoriesRequest elkRepositoriesRequest, String repositoryName) {
-               
+
                RestHighLevelClient client = restHighLevelClientConnection();
                GetSnapshotsRequest getSnapshotsRequest = new GetSnapshotsRequest();
                if (elkRepositoriesRequest.getRepositoryName() != null
                                && !elkRepositoriesRequest.getRepositoryName().isEmpty()) {
                        getSnapshotsRequest.repository(elkRepositoriesRequest.getRepositoryName());
-               }else {
+               } else {
                        getSnapshotsRequest.repository(repositoryName);
                }
-                       
+
                String[] snapshots = { "_all" };
                getSnapshotsRequest.snapshots(snapshots);
-                getSnapshotsRequest.masterNodeTimeout(ElkClientConstants.TIME_ONE_MINT_OUT);
+               getSnapshotsRequest.masterNodeTimeout(ElkClientConstants.TIME_ONE_MINT_OUT);
                getSnapshotsRequest.verbose(true);
                getSnapshotsRequest.ignoreUnavailable(false);
                GetSnapshotsResponse response;
@@ -299,30 +350,32 @@ public class SnapshotServiceImpl  extends AbstractELKClientConnection implements
 
                List<ElkGetSnapshotMetaData> snapshotMetaDatas = new ArrayList<>();
                for (SnapshotInfo snapshotInfo : response.getSnapshots()) {
-                       logger.debug("\nsnapshotId: {}", snapshotInfo.snapshotId());
-                       logger.debug("status: {}", snapshotInfo.status());
-                       logger.debug("state: {}", snapshotInfo.state());
-                       logger.debug("startTime: {}", snapshotInfo.startTime());
-                       logger.debug("endTime: {}", snapshotInfo.endTime());
-                       logger.debug("successfulShards: {}", snapshotInfo.successfulShards());
+                       logger.debug(
+                                       "\nsnapshotId: {} \n status: {} \n state: {} \n startTime: {} \n endTime: {} \n successfulShards: {}",
+                                       snapshotInfo.snapshotId(), snapshotInfo.status(), snapshotInfo.state(), snapshotInfo.startTime(),
+                                       convertTime(snapshotInfo.endTime()), convertTime(snapshotInfo.successfulShards()));
                        ElkGetSnapshotMetaData elkGetSnapshotMetaData = new ElkGetSnapshotMetaData();
-                       elkGetSnapshotMetaData.setSnapShotId(snapshotInfo.snapshotId().toString());
+                       String[] snapShotName = snapshotInfo.snapshotId().toString().split("/");
+                       elkGetSnapshotMetaData.setSnapShotId(snapShotName[0]);
                        elkGetSnapshotMetaData.setStatus(snapshotInfo.status().toString());
                        elkGetSnapshotMetaData.setState(snapshotInfo.state().toString());
                        elkGetSnapshotMetaData.setStartTime(convertTime(snapshotInfo.startTime()));
                        elkGetSnapshotMetaData.setEndTime(convertTime(snapshotInfo.endTime()));
+                       List<String> indices = snapshotInfo.indices();
+                       for (String indice : indices) {
+                               logger.debug("indices: {}", indice);
+                       }
+                       elkGetSnapshotMetaData.setIndices(indices);
                        snapshotMetaDatas.add(elkGetSnapshotMetaData);
                }
                snapshotResponse.setSnapshots(snapshotMetaDatas);
                return snapshotResponse;
        }
 
-       
-       public String convertTime(long time){
-           Date date = new Date(time);
-           Format format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
-           return format.format(date);
+       public String convertTime(long time) {
+               Date date = new Date(time);
+               Format format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+               return format.format(date);
        }
 
-
 }
index 9ccbf55..e3ef26d 100644 (file)
  */
 package org.acumos.elk.client.transport;
 
+import java.util.List;
+
 import io.swagger.annotations.ApiModelProperty;
 
 public class CreateSnapshot {
 
-       @ApiModelProperty(required = true, value = "ElasticStack repository name", example = "logstash")
+       @ApiModelProperty(required = true, value = "ElasticStack repository name", example = "logstashBackup")
        private String repositoryName;
 
-       @ApiModelProperty(required = true, value = "Value ture/false is allowed", example = "true")
-       private String create;
+       @ApiModelProperty(value = "indices names")
+       private List<String> indices;
 
        public String getRepositoryName() {
                return repositoryName;
@@ -37,19 +39,19 @@ public class CreateSnapshot {
                this.repositoryName = repositoryName;
        }
 
-       public String getCreate() {
-               return create;
+       public List<String> getIndices() {
+               return indices;
        }
 
-       public void setCreate(String create) {
-               this.create = create;
+       public void setIndices(List<String> indices) {
+               this.indices = indices;
        }
 
        @Override
        public int hashCode() {
                final int prime = 31;
                int result = 1;
-               result = prime * result + ((create == null) ? 0 : create.hashCode());
+               result = prime * result + ((indices == null) ? 0 : indices.hashCode());
                result = prime * result + ((repositoryName == null) ? 0 : repositoryName.hashCode());
                return result;
        }
@@ -63,10 +65,10 @@ public class CreateSnapshot {
                if (getClass() != obj.getClass())
                        return false;
                CreateSnapshot other = (CreateSnapshot) obj;
-               if (create == null) {
-                       if (other.create != null)
+               if (indices == null) {
+                       if (other.indices != null)
                                return false;
-               } else if (!create.equals(other.create))
+               } else if (!indices.equals(other.indices))
                        return false;
                if (repositoryName == null) {
                        if (other.repositoryName != null)
@@ -75,7 +77,5 @@ public class CreateSnapshot {
                        return false;
                return true;
        }
-       
-       
 
-}
+}
\ No newline at end of file
index 9cbe9eb..b603fc0 100644 (file)
@@ -27,8 +27,6 @@ public class DeleteSnapshot {
        private String repositoryName;
        @ApiModelProperty(value = "snapshot-2019-03-28t08-53-41", example = "snapshot-2019-03-28t08-53-41")
        private String snapShotId;
-       @ApiModelProperty(required = true, value = "Value ture/false is allowed", example = "true")
-       private String delete;
 
        public String getRepositoryName() {
                return repositoryName;
@@ -46,19 +44,10 @@ public class DeleteSnapshot {
                this.snapShotId = snapShotId;
        }
 
-       public String getDelete() {
-               return delete;
-       }
-
-       public void setDelete(String delete) {
-               this.delete = delete;
-       }
-
        @Override
        public int hashCode() {
                final int prime = 31;
                int result = 1;
-               result = prime * result + ((delete == null) ? 0 : delete.hashCode());
                result = prime * result + ((repositoryName == null) ? 0 : repositoryName.hashCode());
                result = prime * result + ((snapShotId == null) ? 0 : snapShotId.hashCode());
                return result;
@@ -73,11 +62,6 @@ public class DeleteSnapshot {
                if (getClass() != obj.getClass())
                        return false;
                DeleteSnapshot other = (DeleteSnapshot) obj;
-               if (delete == null) {
-                       if (other.delete != null)
-                               return false;
-               } else if (!delete.equals(other.delete))
-                       return false;
                if (repositoryName == null) {
                        if (other.repositoryName != null)
                                return false;
@@ -91,4 +75,4 @@ public class DeleteSnapshot {
                return true;
        }
 
-}
+}
\ No newline at end of file
diff --git a/elk-client/src/main/java/org/acumos/elk/client/transport/ElasticStackIndiceResponse.java b/elk-client/src/main/java/org/acumos/elk/client/transport/ElasticStackIndiceResponse.java
new file mode 100644 (file)
index 0000000..714fed8
--- /dev/null
@@ -0,0 +1,40 @@
+/*-
+ * ===============LICENSE_START=======================================================
+ * Acumos
+ * ===================================================================================
+ * Copyright (C) 2019 AT&T Intellectual Property & Tech Mahindra. All rights reserved.
+ * ===================================================================================
+ * This Acumos software file is distributed by AT&T and Tech Mahindra
+ * 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
+ *  
+ * This file 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.
+ * ===============LICENSE_END=========================================================
+ */
+package org.acumos.elk.client.transport;
+
+public class ElasticStackIndiceResponse {
+
+       private String message;
+       private String status;
+       
+       public String getMessage() {
+               return message;
+       }
+       public void setMessage(String message) {
+               this.message = message;
+       }
+       public String getStatus() {
+               return status;
+       }
+       public void setStatus(String status) {
+               this.status = status;
+       }
+       
+}
diff --git a/elk-client/src/main/java/org/acumos/elk/client/transport/ElasticStackIndices.java b/elk-client/src/main/java/org/acumos/elk/client/transport/ElasticStackIndices.java
new file mode 100644 (file)
index 0000000..9172b68
--- /dev/null
@@ -0,0 +1,39 @@
+/*-
+ * ===============LICENSE_START=======================================================
+ * Acumos
+ * ===================================================================================
+ * Copyright (C) 2019 AT&T Intellectual Property & Tech Mahindra. All rights reserved.
+ * ===================================================================================
+ * This Acumos software file is distributed by AT&T and Tech Mahindra
+ * 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
+ *  
+ * This file 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.
+ * ===============LICENSE_END=========================================================
+ */
+package org.acumos.elk.client.transport;
+
+import java.util.List;
+
+import io.swagger.annotations.ApiModelProperty;
+
+public class ElasticStackIndices {
+
+       @ApiModelProperty(value = "metricbeat-6.2.4-2019.04.04")
+       private List<String> indices;
+
+       public List<String> getIndices() {
+               return indices;
+       }
+
+       public void setIndices(List<String> indices) {
+               this.indices = indices;
+       }
+
+}
index 8685352..784f4ff 100644 (file)
@@ -19,6 +19,8 @@
  */
 package org.acumos.elk.client.transport;
 
+import java.util.List;
+
 import com.fasterxml.jackson.annotation.JsonInclude;
 
 import io.swagger.annotations.ApiModelProperty;
@@ -36,6 +38,8 @@ public class ElkGetSnapshotMetaData {
        private String startTime;
        @ApiModelProperty(value = "2019-03-28 08-53-41", example = "2019-03-28 08-53-41")
        private String endTime;
+       @ApiModelProperty(value = "metricbeat-6.2.4-2019.04.04", example = "metricbeat-6.2.4-2019.04.04")
+       private List<String> indices;
 
        public String getSnapShotId() {
                return snapShotId;
@@ -77,6 +81,14 @@ public class ElkGetSnapshotMetaData {
                this.endTime = endTime;
        }
 
+       public List<String> getIndices() {
+               return indices;
+       }
+
+       public void setIndices(List<String> indices) {
+               this.indices = indices;
+       }
+
        @Override
        public int hashCode() {
                final int prime = 31;
index 38ad0d9..236342c 100644 (file)
@@ -26,7 +26,7 @@ public class ElkRepositoriesRequest {
        @ApiModelProperty(required = true, value = "ElasticStack repository name", example = "logstash")
        private String repositoryName;
 
-       @ApiModelProperty(required = true, value = "Value numeric values, ideal value is between 1 to 3", example = "1")
+       @ApiModelProperty(required = true, value = "Time taken by service 1 minute or more", example = "1m")
        private String NodeTimeout;
 
        public String getRepositoryName() {
index c233ad7..b22d254 100644 (file)
@@ -24,6 +24,8 @@ public final class ElkClientConstants {
        public static final String APPLICATION_JSON = "application/json";
        public static final String ELASTICSEARCH_GET_ALL_SNAPSHOT = "/all/snapshot";
 
+       public static final String GET_ALL_INDICES = "/all/indices";
+       public static final String DELETE_INDICES = "/delete/indices";
        public static final String GET_ALL_REPOSITORIES = "/all/repositories";
        public static final String SNAPSHOT_CREATE_REPOSITORY = "/create/repositories";
        public static final String SNAPSHOT_DELETE_REPOSITORY_REQUEST = "/delete/repositories";
@@ -36,5 +38,7 @@ public final class ElkClientConstants {
        public static final String TRUE = "true";
        public static final String TIME_ONE_MINT_OUT = "1m";
        public static final String TIME_TWO_MINT_OUT = "2m";
-
+       public static final String SUCCESS = "success";
+       public static final String FAIL = "fail";
+       
 }
index 96f3573..62ba825 100644 (file)
@@ -33,7 +33,7 @@ export ACUMOS_ELK_KIBANA_PORT=5601
 export ACUMOS_ELK_CLIENT_PORT=9600
 
 #Elk client schedule cron job for snapshot creation.
-export ELK_CLIENT_CRONSCHEDULE_CREATESNAPSHOT_TIME="* 1 * * * *"
+export ELK_CLIENT_CRONSCHEDULE_CREATESNAPSHOT_TIME="0 0 * * * *"
 
 # Java heap size
 export ACUMOS_ELK_ES_JAVA_HEAP_MIN_SIZE=4g
@@ -51,7 +51,7 @@ export NEXUS3_STAGING_REGISTRY_LF=nexus3.acumos.org:10004
 export NEXUS3_RELEASE_REGISTRY_LF=nexus3.acumos.org:10002
 
 # Images
-export ELASTICSEARCH_IMAGE=acumos-elasticsearch:2.0.9
-export LOGSTASH_IMAGE=acumos-logstash:2.0.9
-export KIBANA_IMAGE=acumos-kibana:2.0.9
-export ELK_CLIENT=elk-client:0.0.1
+export ELASTICSEARCH_IMAGE=acumos-elasticsearch:2.2.2
+export LOGSTASH_IMAGE=acumos-logstash:2.2.2
+export KIBANA_IMAGE=acumos-kibana:2.2.2
+export ELK_CLIENT=elk-client:0.0.2
index ef8a85a..50b0f94 100644 (file)
@@ -25,7 +25,7 @@
         <!-- docker image name -->
         <artifactId>acumos-elasticsearch</artifactId>
         <!-- docker tag -->
-        <version>2.2.1-SNAPSHOT</version>
+        <version>2.2.2-SNAPSHOT</version>
 </project>
 
 
index b2638d7..bd832c4 100644 (file)
@@ -25,7 +25,7 @@
         <!-- docker image name -->
         <artifactId>acumos-kibana</artifactId>
         <!-- docker tag -->
-        <version>2.2.1-SNAPSHOT</version>
+        <version>2.2.2-SNAPSHOT</version>
 </project>
 
 
index 788fcf7..5b37450 100644 (file)
@@ -134,6 +134,12 @@ output {
        index => "testdb"       
        }
       }
+         else if "acumos-model-usage-logs" in [tags]{
+        elasticsearch {
+            hosts => ["elasticsearch:9200"]
+            index => "acumos-model-usage-logs"
+        }
+    }
     else {
      elasticsearch {
        hosts => ["elasticsearch:9200"]
index b23fc6c..a710757 100644 (file)
@@ -25,5 +25,5 @@
         <!-- docker image name -->
         <artifactId>acumos-logstash</artifactId>
         <!-- docker tag -->
-        <version>2.2.1-SNAPSHOT</version>
+        <version>2.2.2-SNAPSHOT</version>
 </project>
index 5b1ef70..b55c407 100644 (file)
@@ -25,7 +25,7 @@
         <!-- docker image name -->
         <artifactId>acumos-filebeat</artifactId>
         <!-- docker tag -->
-        <version>2.2.1-SNAPSHOT</version>
+        <version>2.2.2-SNAPSHOT</version>
 </project>
 
 
index edfe0da..6a1a751 100644 (file)
@@ -25,7 +25,7 @@
         <!-- docker image name -->
         <artifactId>acumos-metricbeat</artifactId>
         <!-- docker tag -->
-        <version>2.2.1-SNAPSHOT</version>
+        <version>2.2.2-SNAPSHOT</version>
 </project>