class AssetDetailController {

    @RequestMapping(path = "/v1/{assetGroup}/ec2/{resourceId}/aws-notifications/summary", method = RequestMethod.GET)
    public ResponseEntity<Object> getAwsNotificationSummary(
            @PathVariable(name = "resourceId", required = true) String instanceId) {
        if (Strings.isNullOrEmpty(instanceId)) {
            return ResponseUtils.buildFailureResponse(new Exception(AssetConstants.ERROR_INSTANCEID));
        }

        Map<String, Object> summaryInfo = new LinkedHashMap<>();

        List<Map<String, Object>> sevList;
        try {
            sevList = assetService.getNotificationSummary(instanceId);

            summaryInfo.put("distribution", sevList);

            String total = assetService.getNotificationSummaryTotal(sevList);
            summaryInfo.put("total", total);

        } catch (Exception e) {
            LOGGER.error("Exception in getAwsNotificationSummary ",e);
            summaryInfo = new HashMap<>();
        }

        return ResponseUtils.buildSucessResponse(summaryInfo);
    }

}