diff --git a/api/pacman-api-admin/pom.xml b/api/pacman-api-admin/pom.xml
index 249650cfa..47a062940 100644
--- a/api/pacman-api-admin/pom.xml
+++ b/api/pacman-api-admin/pom.xml
@@ -64,16 +64,7 @@
2.7.0
-
- org.springframework.cloud
- spring-cloud-starter-netflix-hystrix
-
-
-
- org.springframework.cloud
- spring-cloud-starter-netflix-hystrix-dashboard
-
-
+
org.springframework.boot
spring-boot-starter-data-rest
diff --git a/api/pacman-api-admin/src/main/java/com/tmobile/pacman/api/admin/AdminApplication.java b/api/pacman-api-admin/src/main/java/com/tmobile/pacman/api/admin/AdminApplication.java
index fae05457a..863484158 100644
--- a/api/pacman-api-admin/src/main/java/com/tmobile/pacman/api/admin/AdminApplication.java
+++ b/api/pacman-api-admin/src/main/java/com/tmobile/pacman/api/admin/AdminApplication.java
@@ -28,8 +28,6 @@
* AdminApplication Main Class
*/
@SpringBootApplication
-/*@EnableHystrix
-@EnableHystrixDashboard*/
@EnableFeignClients
@EnableConfigurationProperties
@Configuration
diff --git a/api/pacman-api-admin/src/main/java/com/tmobile/pacman/api/admin/controller/AssetGroupController.java b/api/pacman-api-admin/src/main/java/com/tmobile/pacman/api/admin/controller/AssetGroupController.java
index 08a678eff..de92b600b 100644
--- a/api/pacman-api-admin/src/main/java/com/tmobile/pacman/api/admin/controller/AssetGroupController.java
+++ b/api/pacman-api-admin/src/main/java/com/tmobile/pacman/api/admin/controller/AssetGroupController.java
@@ -24,15 +24,14 @@
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
+import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.security.core.annotation.AuthenticationPrincipal;
import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
-import com.netflix.hystrix.contrib.javanica.annotation.HystrixCommand;
import com.tmobile.pacman.api.admin.domain.CreateUpdateAssetGroupDetails;
import com.tmobile.pacman.api.admin.domain.DeleteAssetGroupRequest;
import com.tmobile.pacman.api.admin.domain.Response;
@@ -65,7 +64,7 @@ public class AssetGroupController {
* @return The asset group names
*/
@ApiOperation(httpMethod = "GET", value = "API to get all asset group names", response = Response.class, produces = MediaType.APPLICATION_JSON_VALUE)
- @HystrixCommand
+
@RequestMapping(path = "/list-names", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
public ResponseEntity
-
- org.springframework.cloud
- spring-cloud-starter-netflix-hystrix
-
-
-
- org.springframework.cloud
- spring-cloud-starter-netflix-hystrix-dashboard
-
-
org.powermock
powermock-api-mockito
diff --git a/api/pacman-api-asset/src/main/java/com/tmobile/pacman/api/asset/AssetApplication.java b/api/pacman-api-asset/src/main/java/com/tmobile/pacman/api/asset/AssetApplication.java
index a3ab4644a..f3571b9a2 100644
--- a/api/pacman-api-asset/src/main/java/com/tmobile/pacman/api/asset/AssetApplication.java
+++ b/api/pacman-api-asset/src/main/java/com/tmobile/pacman/api/asset/AssetApplication.java
@@ -34,8 +34,6 @@
@EnableFeignClients
@EnableConfigurationProperties
@Configuration
-/*@EnableHystrix
-@EnableHystrixDashboard*/
@EnableCaching
@ComponentScan(basePackages = "com.tmobile.pacman")
@EnableResourceServer
diff --git a/api/pacman-api-asset/src/main/java/com/tmobile/pacman/api/asset/controller/AssetController.java b/api/pacman-api-asset/src/main/java/com/tmobile/pacman/api/asset/controller/AssetController.java
index 5edb4eeed..56cdcbf21 100644
--- a/api/pacman-api-asset/src/main/java/com/tmobile/pacman/api/asset/controller/AssetController.java
+++ b/api/pacman-api-asset/src/main/java/com/tmobile/pacman/api/asset/controller/AssetController.java
@@ -15,9 +15,6 @@
******************************************************************************/
package com.tmobile.pacman.api.asset.controller;
-import io.swagger.annotations.ApiOperation;
-import io.swagger.annotations.ApiParam;
-
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@@ -39,7 +36,6 @@
import org.springframework.web.bind.annotation.RestController;
import com.google.common.base.Strings;
-import com.netflix.hystrix.contrib.javanica.annotation.HystrixCommand;
import com.tmobile.pacman.api.asset.domain.AssetUpdateRequest;
import com.tmobile.pacman.api.asset.domain.Response;
import com.tmobile.pacman.api.asset.model.DefaultUserAssetGroup;
@@ -47,6 +43,9 @@
import com.tmobile.pacman.api.commons.exception.DataException;
import com.tmobile.pacman.api.commons.utils.ResponseUtils;
+import io.swagger.annotations.ApiOperation;
+import io.swagger.annotations.ApiParam;
+
/**
* The controller layer for Assets which has methods to fetch the asset related info.
*/
@@ -68,7 +67,6 @@ public class AssetController {
*
* @return list of target types.
*/
- @HystrixCommand
@GetMapping(value = "/v1/list/targettype")
public ResponseEntity getListOfTargetTypes(@RequestParam(name = "ag", required = true) String assetGroup,
@RequestParam(name = "domain", required = false) String domain) {
@@ -119,7 +117,6 @@ public ResponseEntity getListOfApplications(@RequestParam(name = "ag", r
*
* @return list of environments.
*/
- @HystrixCommand
@GetMapping(value = "/v1/list/environment")
public ResponseEntity getListOfEnvironments(@RequestParam(name = "ag", required = true) String assetGroup,
@RequestParam(name = "application", required = false) String application,
@@ -147,7 +144,6 @@ public ResponseEntity getListOfEnvironments(@RequestParam(name = "ag", r
*
* @return list of asset group details.
*/
- @HystrixCommand
@GetMapping(value = "/v1/list/assetgroup")
public ResponseEntity getAllAssetGroups() {
try {
@@ -167,7 +163,6 @@ public ResponseEntity getAllAssetGroups() {
*
* @return asset group info.
*/
- @HystrixCommand
@GetMapping(value = "/v1/assetgroup")
public ResponseEntity getAssetGroupInfo(@RequestParam(name = "ag", required = true) String assetGroup) {
Map assetGroupInfo = assetService.getAssetGroupInfo(assetGroup);
@@ -187,7 +182,6 @@ public ResponseEntity getAssetGroupInfo(@RequestParam(name = "ag", requi
*
* @return asset group name.
*/
- @HystrixCommand
@ApiOperation(httpMethod = "GET", value = "Get User Default Asset Group")
@GetMapping(value = "/v1/list/user-default-assetgroup")
public ResponseEntity getUserDefaultAssetGroup(
@@ -208,7 +202,6 @@ public ResponseEntity getUserDefaultAssetGroup(
*
* @return boolean as updated status.
*/
- @HystrixCommand
@ApiOperation(httpMethod = "POST", value = "Save or Update User Asset Groups")
@PostMapping(value = "/v1/save-or-update/assetgroup")
public ResponseEntity saveOrUpdateAssetGroup(
@@ -230,7 +223,6 @@ public ResponseEntity saveOrUpdateAssetGroup(
*
* @return updated list of asset group for the userId.
*/
- @HystrixCommand
@ApiOperation(httpMethod = "POST", value = "Save or Append User Recently Viewed Asset Groups")
@PostMapping(value = "/v1/appendToRecentlyViewedAG")
public ResponseEntity appendToRecentlyViewedAG(
@@ -257,7 +249,6 @@ public ResponseEntity appendToRecentlyViewedAG(
*
* @return config details as string.
*/
- @HystrixCommand
@ApiOperation(httpMethod = "GET", value = "Retrieve Asset Config for the given resourceId and configType")
@GetMapping(value = "/v1/retrieve-asset-config")
public ResponseEntity retrieveAssetConfig(
@@ -283,7 +274,6 @@ public ResponseEntity retrieveAssetConfig(
*
* @return ResponseEntity.
*/
- @HystrixCommand
@ApiOperation(httpMethod = "POST", value = "Save Asset Configuration")
@PostMapping(value = "/v1/save-asset-config")
public ResponseEntity saveAssetConfig(
@@ -307,7 +297,6 @@ public ResponseEntity saveAssetConfig(
* @throws DataException when the update fails.
*/
- @HystrixCommand
@ApiOperation(httpMethod = "POST", value = "Update Asset values")
@PostMapping(value = "/v1/update-asset")
public ResponseEntity updateAsset(@RequestBody(required = true) AssetUpdateRequest request)
@@ -343,7 +332,6 @@ public ResponseEntity updateAsset(@RequestBody(required = true) AssetUpd
*
* @return created date as string
*/
- @HystrixCommand
@ApiOperation(httpMethod = "GET", value = "Get Resource Created Date")
@RequestMapping(path = "/v1/get-resource-created-date", method = RequestMethod.GET)
@ResponseBody
diff --git a/api/pacman-api-asset/src/main/java/com/tmobile/pacman/api/asset/controller/AssetCountController.java b/api/pacman-api-asset/src/main/java/com/tmobile/pacman/api/asset/controller/AssetCountController.java
index e17a58081..d02d28605 100644
--- a/api/pacman-api-asset/src/main/java/com/tmobile/pacman/api/asset/controller/AssetCountController.java
+++ b/api/pacman-api-asset/src/main/java/com/tmobile/pacman/api/asset/controller/AssetCountController.java
@@ -28,7 +28,6 @@
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
-import com.netflix.hystrix.contrib.javanica.annotation.HystrixCommand;
import com.tmobile.pacman.api.asset.AssetConstants;
import com.tmobile.pacman.api.asset.service.AssetService;
import com.tmobile.pacman.api.commons.utils.ResponseUtils;
@@ -56,7 +55,6 @@ public class AssetCountController {
*
* @return list of type and its asset count.
*/
- @HystrixCommand
@GetMapping(value = "/v1/count")
public ResponseEntity geAssetCount(@RequestParam(name = "ag", required = true) String assetGroup,
@RequestParam(name = "type", required = false) String type,
@@ -86,7 +84,6 @@ public ResponseEntity geAssetCount(@RequestParam(name = "ag", required =
*
* @return list of applications and its asset count.
*/
- @HystrixCommand
@GetMapping(value = "/v1/count/byapplication")
public ResponseEntity geAssetCountByTypeAndApplication(
@RequestParam(name = "ag", required = true) String assetGroup,
@@ -121,7 +118,6 @@ public ResponseEntity geAssetCountByTypeAndApplication(
*
* @return list of environment and its asset count.
*/
- @HystrixCommand
@GetMapping(value = "/v1/count/byenvironment")
public ResponseEntity geAssetCountByTypeEnvironment(
@RequestParam(name = "ag", required = true) String assetGroup,
diff --git a/api/pacman-api-asset/src/main/java/com/tmobile/pacman/api/asset/controller/AssetDetailController.java b/api/pacman-api-asset/src/main/java/com/tmobile/pacman/api/asset/controller/AssetDetailController.java
index ac04cf40b..c60b5c01a 100644
--- a/api/pacman-api-asset/src/main/java/com/tmobile/pacman/api/asset/controller/AssetDetailController.java
+++ b/api/pacman-api-asset/src/main/java/com/tmobile/pacman/api/asset/controller/AssetDetailController.java
@@ -37,7 +37,6 @@
import org.springframework.web.bind.annotation.RestController;
import com.google.common.base.Strings;
-import com.netflix.hystrix.contrib.javanica.annotation.HystrixCommand;
import com.tmobile.pacman.api.asset.AssetConstants;
import com.tmobile.pacman.api.asset.client.ComplianceServiceClient;
import com.tmobile.pacman.api.asset.domain.PageFilterRequest;
@@ -80,7 +79,7 @@ public class AssetDetailController {
*
* @return list of date and its CPU utilization of the instance id.
*/
- @HystrixCommand
+
@GetMapping(value = "/v1/{assetGroup}/ec2/{resourceId}/cpu-utilization")
public ResponseEntity getCPUUtilizationByInstanceId(
@PathVariable(name = "resourceId", required = true) String instanceId) {
@@ -104,7 +103,6 @@ public ResponseEntity getCPUUtilizationByInstanceId(
*
* @return list of disk name, size and free space of the instance id.
*/
- @HystrixCommand
@RequestMapping(path = "/v1/{assetGroup}/ec2/{resourceId}/disk-utilization", method = RequestMethod.GET)
public ResponseEntity getDiskUtilizationByInstanceId(
@PathVariable(name = "resourceId", required = true) String instanceId) {
@@ -134,7 +132,6 @@ public ResponseEntity getDiskUtilizationByInstanceId(
*
* @return list of software name and its version installed on the instance id.
*/
- @HystrixCommand
@RequestMapping(path = "/v1/{assetGroup}/ec2/{resourceId}/installed-softwares", method = RequestMethod.GET)
public ResponseEntity getInstalledSoftwareDetailsByInstanceId(
@PathVariable(name = "resourceId", required = true) String instanceId,
@@ -197,7 +194,6 @@ public ResponseEntity getInstalledSoftwareDetailsByInstanceId(
*
* @return list of open ports.
*/
- @HystrixCommand
@RequestMapping(path = "/v1/{assetGroup}/ec2/{resourceId}/open-ports", method = RequestMethod.GET)
public ResponseEntity getOpenPortsByInstanceId(
@PathVariable(name = "resourceId", required = true) String instanceId,
@@ -254,7 +250,7 @@ public ResponseEntity getOpenPortsByInstanceId(
*
* @return list of assets with open,closed and upcoming count.
*/
- @HystrixCommand
+
@RequestMapping(path = "/v1/{assetGroup}/ec2/{resourceId}/aws-notifications/summary", method = RequestMethod.GET)
public ResponseEntity getAwsNotificationSummary(
@PathVariable(name = "resourceId", required = true) String instanceId) {
@@ -289,7 +285,7 @@ public ResponseEntity getAwsNotificationSummary(
*
* @return list of notification details.
*/
- @HystrixCommand
+
@RequestMapping(path = "/v1/{assetGroup}/ec2/{resourceId}/aws-notifications/details", method = RequestMethod.POST)
public ResponseEntity getAwsNotificationDetails(@RequestBody(required = true) PageFilterRequest request,
@PathVariable(name = "resourceId", required = true) String instanceId) {
@@ -354,7 +350,6 @@ public ResponseEntity getAwsNotificationDetails(@RequestBody(required =
*
* @return created by, creation date and email.
*/
- @HystrixCommand
@ApiOperation(httpMethod = "GET", value = "Get the creator details for a particular resource")
@GetMapping(value = "/v1/{assetGroup}/{resourceType}/{resourceId}/creatordetails")
public ResponseEntity getEc2CreatorDetail(
@@ -381,7 +376,7 @@ public ResponseEntity getEc2CreatorDetail(
*
* @return list of AD group details.
*/
- @HystrixCommand
+
@ApiOperation(httpMethod = "GET", value = "Get the ad group details for a ec2 instance")
@GetMapping(value = "/v1/{assetGroup}/ec2/{resourceId}/ad-groups")
public ResponseEntity getAdGroupsDetail(@PathVariable(name = "assetGroup", required = true) String ag,
@@ -407,7 +402,7 @@ public ResponseEntity getAdGroupsDetail(@PathVariable(name = "assetGroup
*
* @return details of ec2 resource
*/
- @HystrixCommand
+
@ApiOperation(httpMethod = "GET", value = "Get the details from a particular data source for a particular resource")
@GetMapping(value = "v1/{assetGroup}/{resourceType}/{resourceId}/details")
public ResponseEntity getEc2ResourceDetail(@PathVariable(name = "assetGroup", required = true) String ag,
@@ -437,7 +432,7 @@ public ResponseEntity getEc2ResourceDetail(@PathVariable(name = "assetGr
* @return average last week cost and total cost of ec2.
* @throws DataException when fetching data from ES.
*/
- @HystrixCommand
+
@ApiOperation(httpMethod = "GET", value = "Get the average cost and total cost for an EC2 resource")
@GetMapping(value = "v1/{assetGroup}/ec2/{resourceId}/cost")
public ResponseEntity getEc2ResourceSummary(
@@ -462,7 +457,7 @@ public ResponseEntity getEc2ResourceSummary(
*
* @return compliance, statename and attributes
*/
- @HystrixCommand
+
@ApiOperation(httpMethod = "GET", value = "Get the summary from AWS for a particular resource")
@GetMapping(value = "v1/{assetGroup}/{resourceType}/{resourceId}/summary")
public ResponseEntity getEc2ResourceSummary(@PathVariable(name = "assetGroup", required = true) String ag,
diff --git a/api/pacman-api-asset/src/main/java/com/tmobile/pacman/api/asset/controller/AssetListController.java b/api/pacman-api-asset/src/main/java/com/tmobile/pacman/api/asset/controller/AssetListController.java
index 0287c7459..b6c1757ac 100644
--- a/api/pacman-api-asset/src/main/java/com/tmobile/pacman/api/asset/controller/AssetListController.java
+++ b/api/pacman-api-asset/src/main/java/com/tmobile/pacman/api/asset/controller/AssetListController.java
@@ -15,8 +15,6 @@
******************************************************************************/
package com.tmobile.pacman.api.asset.controller;
-import io.swagger.annotations.ApiOperation;
-
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
@@ -39,7 +37,6 @@
import org.springframework.web.bind.annotation.RestController;
import com.google.common.base.Strings;
-import com.netflix.hystrix.contrib.javanica.annotation.HystrixCommand;
import com.tmobile.pacman.api.asset.AssetConstants;
import com.tmobile.pacman.api.asset.domain.Request;
import com.tmobile.pacman.api.asset.domain.ResponseWithCount;
@@ -50,6 +47,8 @@
import com.tmobile.pacman.api.commons.utils.CommonUtils;
import com.tmobile.pacman.api.commons.utils.ResponseUtils;
+import io.swagger.annotations.ApiOperation;
+
/**
* The controller layer which has methods to return list of assets.
*/
@@ -77,7 +76,7 @@ public class AssetListController {
*
* @return list of assets and its some details.
*/
- @HystrixCommand
+
@ApiOperation(httpMethod = "POST", value = "Get the list of assets in an asset group. Optional filters -'application','environment','resourceType' ")
@PostMapping(value = "/v1/list/assets")
public ResponseEntity listAssets(@RequestBody(required = true) Request request,
@@ -134,7 +133,7 @@ public ResponseEntity listAssets(@RequestBody(required = true) Request r
*
* @return list of assets tagged/untagged.
*/
- @HystrixCommand
+
@ApiOperation(httpMethod = "POST", value = "Get the list of taggble assets in an asset group. Optional filters -'application','environment','resourceType','tagged'{true/false} ,'tagName' {Application/Environment/Stack/Role}")
@PostMapping(value = "/v1/list/assets/taggable")
public ResponseEntity listTaggableAssets(@RequestBody(required = true) Request request) {
@@ -194,7 +193,7 @@ public ResponseEntity listTaggableAssets(@RequestBody(required = true) R
*
* @return list of assets patched/unpatched.
*/
- @HystrixCommand
+
@ApiOperation(httpMethod = "POST", value = "Get the list of patchable assets in an asset group. Optional filters -'application', 'environment', 'resourceType', 'patched'{true/false}, 'executiveSponsor' and 'director'.")
@PostMapping(value = "/v1/list/assets/patchable")
public ResponseEntity listPatchableAssets(@RequestBody(required = true) Request request) {
@@ -255,7 +254,7 @@ public ResponseEntity listPatchableAssets(@RequestBody(required = true)
*
* @return list of vulnerable assets.
*/
- @HystrixCommand
+
@ApiOperation(httpMethod = "POST", value = "Get the list of vulnerable assets in an asset group for a particualr qid. Mandatory Filter -'qid'. Optional filters -'application','environment','resourceType' ")
@PostMapping(value = "/v1/list/assets/vulnerable")
public ResponseEntity listVulnerableAssets(@RequestBody(required = true) Request request) {
@@ -314,7 +313,7 @@ public ResponseEntity listVulnerableAssets(@RequestBody(required = true)
*
* @return list of assets with open issue status.
*/
- @HystrixCommand
+
@ApiOperation(httpMethod = "POST", value = "Get the list of assets scanned by a ruleid in an asset group . Mandatory Filter -'ruleId'. Optional filters -'application','environment','resourceType','compliant'{true/false}")
@PostMapping(value = "/v1/list/assets/scanned")
public ResponseEntity listScannedAssets(@RequestBody(required = true) Request request,
@@ -372,7 +371,7 @@ public ResponseEntity listScannedAssets(@RequestBody(required = true) Re
*
* @return list of complete asset details.
*/
- @HystrixCommand
+
@ApiOperation(httpMethod = "POST", value = "Get the complete details assets")
@PostMapping(value = "/v1/listing/assets")
public ResponseEntity getAssetLists(@RequestBody(required = true) Request request) {
@@ -438,7 +437,7 @@ public ResponseEntity getAssetLists(@RequestBody(required = true) Reques
*
* @return list of editable fields
*/
- @HystrixCommand
+
@RequestMapping(path = "/v1/updateFieldsbyresourceType", method = RequestMethod.GET)
public ResponseEntity getEditableFieldsByTargetType(
@RequestParam(name = "ag", required = true) String assetGroup,
diff --git a/api/pacman-api-asset/src/main/java/com/tmobile/pacman/api/asset/controller/AssetTrendController.java b/api/pacman-api-asset/src/main/java/com/tmobile/pacman/api/asset/controller/AssetTrendController.java
index 2a99b172d..5ae64e429 100644
--- a/api/pacman-api-asset/src/main/java/com/tmobile/pacman/api/asset/controller/AssetTrendController.java
+++ b/api/pacman-api-asset/src/main/java/com/tmobile/pacman/api/asset/controller/AssetTrendController.java
@@ -31,7 +31,6 @@
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
-import com.netflix.hystrix.contrib.javanica.annotation.HystrixCommand;
import com.tmobile.pacman.api.asset.service.AssetService;
import com.tmobile.pacman.api.commons.Constants;
import com.tmobile.pacman.api.commons.utils.ResponseUtils;
@@ -62,7 +61,7 @@ public class AssetTrendController {
*
* @return list of days with its min/max asset count.
*/
- @HystrixCommand
+
@ApiOperation(value = "View the asset trends(daily min/max) over the period of last 1 month", response = Iterable.class)
@GetMapping(path = "/v1/trend/minmax")
public ResponseEntity getMinMaxAssetCount(@RequestParam(name = "ag", required = true) String assetGroup,
diff --git a/api/pacman-api-asset/src/main/java/com/tmobile/pacman/api/asset/controller/SearchController.java b/api/pacman-api-asset/src/main/java/com/tmobile/pacman/api/asset/controller/SearchController.java
index 14426520d..834700d91 100644
--- a/api/pacman-api-asset/src/main/java/com/tmobile/pacman/api/asset/controller/SearchController.java
+++ b/api/pacman-api-asset/src/main/java/com/tmobile/pacman/api/asset/controller/SearchController.java
@@ -30,7 +30,6 @@
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
-import com.netflix.hystrix.contrib.javanica.annotation.HystrixCommand;
import com.tmobile.pacman.api.asset.domain.SearchCriteria;
import com.tmobile.pacman.api.asset.domain.SearchException;
import com.tmobile.pacman.api.asset.domain.SearchResult;
@@ -58,7 +57,7 @@ public class SearchController {
* @param criteria the criteria
* @return the response entity
*/
- @HystrixCommand
+
@PostMapping(value = "/v1/search")
public ResponseEntity search(@RequestBody SearchCriteria criteria) {
long start = System.currentTimeMillis();
@@ -101,7 +100,7 @@ public ResponseEntity search(@RequestBody SearchCriteria criteria) {
* @param domain the domain
* @return the search categories
*/
- @HystrixCommand
+
@GetMapping(value = "/v1/search/categories")
public ResponseEntity getSearchCategories(@RequestParam(name = "domain", required = false) String domain) {
diff --git a/api/pacman-api-asset/src/main/java/com/tmobile/pacman/api/asset/repository/AssetRepositoryImpl.java b/api/pacman-api-asset/src/main/java/com/tmobile/pacman/api/asset/repository/AssetRepositoryImpl.java
index d1b185c6c..e0f8755e7 100644
--- a/api/pacman-api-asset/src/main/java/com/tmobile/pacman/api/asset/repository/AssetRepositoryImpl.java
+++ b/api/pacman-api-asset/src/main/java/com/tmobile/pacman/api/asset/repository/AssetRepositoryImpl.java
@@ -1,2359 +1,2361 @@
-/*******************************************************************************
- * Copyright 2018 T Mobile, Inc. or its affiliates. All Rights Reserved.
- *
- * Licensed 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.
- ******************************************************************************/
-package com.tmobile.pacman.api.asset.repository;
-
-import java.io.IOException;
-import java.lang.reflect.Type;
-import java.text.SimpleDateFormat;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.Date;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.LinkedHashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Map.Entry;
-import java.util.Set;
-import java.util.concurrent.CopyOnWriteArrayList;
-import java.util.stream.Collectors;
-
-import javax.annotation.PostConstruct;
-
-import org.apache.commons.lang.StringUtils;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.apache.http.HttpEntity;
-import org.apache.http.HttpHost;
-import org.apache.http.entity.ContentType;
-import org.apache.http.nio.entity.NStringEntity;
-import org.apache.http.util.EntityUtils;
-import org.elasticsearch.client.Response;
-import org.elasticsearch.client.RestClient;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.beans.factory.annotation.Value;
-import org.springframework.boot.context.properties.ConfigurationProperties;
-import org.springframework.stereotype.Repository;
-import org.springframework.util.CollectionUtils;
-
-import com.fasterxml.jackson.core.JsonProcessingException;
-import com.fasterxml.jackson.databind.ObjectMapper;
-import com.google.common.base.Strings;
-import com.google.common.collect.HashMultimap;
-import com.google.gson.Gson;
-import com.google.gson.GsonBuilder;
-import com.google.gson.JsonArray;
-import com.google.gson.JsonElement;
-import com.google.gson.JsonObject;
-import com.google.gson.JsonParser;
-import com.google.gson.reflect.TypeToken;
-import com.tmobile.pacman.api.asset.AssetConstants;
-import com.tmobile.pacman.api.asset.domain.ResourceResponse;
-import com.tmobile.pacman.api.asset.domain.ResourceResponse.Source;
-import com.tmobile.pacman.api.asset.model.DefaultUserAssetGroup;
-import com.tmobile.pacman.api.commons.Constants;
-import com.tmobile.pacman.api.commons.exception.DataException;
-import com.tmobile.pacman.api.commons.exception.NoDataFoundException;
-import com.tmobile.pacman.api.commons.repo.ElasticSearchRepository;
-import com.tmobile.pacman.api.commons.repo.PacmanRdsRepository;
-import com.tmobile.pacman.api.commons.utils.CommonUtils;
-import com.tmobile.pacman.api.commons.utils.PacHttpUtils;
-
-/**
- * Implemented class for AssetRepository and all its method
- */
-@Repository
-@ConfigurationProperties(prefix = "resource")
-public class AssetRepositoryImpl implements AssetRepository {
-
- private Map events;
-
- @Value("${tagging.mandatoryTags}")
- private String mandatoryTags;
-
- @Value("${elastic-search.host}")
- private String esHost;
- @Value("${elastic-search.port}")
- private int esPort;
- @Value("${elastic-search.update-host}")
- private String updateESHost;
- @Value("${elastic-search.update-port}")
- private int updateESPort;
- @Value("${elastic-search.host-heimdall}")
- private String heimdallEsHost;
- @Value("${elastic-search.port-heimdall}")
- private int heimdallEsPort;
-
- private static final String PROTOCOL = "http";
- private String esUrl;
- private String heimdallEsesUrl;
-
- @Value("${vulnerability.types}")
- private String vulnTypes;
-
- @Value("${features.vulnerability.enabled:false}")
- private boolean qualysEnabled;
-
- private static final Log LOGGER = LogFactory.getLog(AssetRepositoryImpl.class);
- private RestClient restClient;
-
- @Autowired
- ElasticSearchRepository esRepository;
- @Autowired
- PacmanRdsRepository rdsRepository;
- @Autowired
- PacmanRedshiftRepository redshiftRepository;
-
- @PostConstruct
- void init() {
- esUrl = PROTOCOL + "://" + esHost + ":" + esPort;
- heimdallEsesUrl = PROTOCOL + "://" + heimdallEsHost + ":" + heimdallEsPort;
- }
-
- @Override
- public Map getAssetCountByAssetGroup(String aseetGroupName, String type) {
-
- Map filter = new HashMap<>();
- filter.put(Constants.LATEST, Constants.TRUE);
- filter.put(AssetConstants.UNDERSCORE_ENTITY, Constants.TRUE);
- HashMultimap shouldFilter = HashMultimap.create();
- if (Constants.EC2.equals(type) || AssetConstants.ALL.equals(type)) {
- shouldFilter.put(Constants.STATE_NAME, Constants.RUNNING);
- shouldFilter.put(Constants.STATE_NAME, AssetConstants.STOPPED);
- shouldFilter.put(Constants.STATE_NAME, AssetConstants.STOPPING);
- }
- Map countMap = new HashMap<>();
- try {
- if (AssetConstants.ALL.equals(type)) {
- try {
- countMap = esRepository.getTotalDistributionForIndexAndType(aseetGroupName, null, filter, null,
- null, AssetConstants.UNDERSCORE_TYPE, Constants.THOUSAND, null);
- } catch (Exception e) {
- LOGGER.error("Exception in getAssetCountByAssetGroup :" , e);
- }
- if (!countMap.isEmpty()) {
- countMap.put(Constants.EC2, esRepository.getTotalDocumentCountForIndexAndType(aseetGroupName,
- Constants.EC2, filter, null, shouldFilter, null, null));
- }
- } else {
- long count = esRepository.getTotalDocumentCountForIndexAndType(aseetGroupName, type, filter, null,
- shouldFilter, null, null);
- countMap.put(type, count);
- }
- } catch (Exception e) {
- LOGGER.error("Exception in getAssetCountByAssetGroup :" , e);
- }
-
- return countMap;
- }
-
- @Override
- public List