Pārlūkot izejas kodu

AMBARI-18214. Restify Log Search endpoints (oleewere)

oleewere 9 gadi atpakaļ
vecāks
revīzija
cf0a71d184
45 mainītis faili ar 290 papildinājumiem un 326 dzēšanām
  1. 1 1
      ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/dao/SolrDaoBase.java
  2. 1 0
      ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/doc/DocConstants.java
  3. 1 1
      ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/manager/AuditMgr.java
  4. 58 61
      ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/manager/LogsMgr.java
  5. 16 45
      ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/rest/AuditLogsREST.java
  6. 3 2
      ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/rest/LogFileREST.java
  7. 1 1
      ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/rest/PublicREST.java
  8. 28 25
      ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/rest/ServiceLogsREST.java
  9. 7 10
      ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/rest/UserConfigREST.java
  10. 14 14
      ambari-logsearch/ambari-logsearch-portal/src/main/webapp/login.html
  11. 7 9
      ambari-logsearch/ambari-logsearch-portal/src/main/webapp/scripts/collection_bases/VAuditLogListBase.js
  12. 7 7
      ambari-logsearch/ambari-logsearch-portal/src/main/webapp/scripts/collection_bases/VEventHistoryListBase.js
  13. 7 9
      ambari-logsearch/ambari-logsearch-portal/src/main/webapp/scripts/collection_bases/VGroupListBase.js
  14. 1 1
      ambari-logsearch/ambari-logsearch-portal/src/main/webapp/scripts/collection_bases/VLogLevelListBase.js
  15. 5 5
      ambari-logsearch/ambari-logsearch-portal/src/main/webapp/scripts/collection_bases/VLogListBase.js
  16. 6 8
      ambari-logsearch/ambari-logsearch-portal/src/main/webapp/scripts/collection_bases/VNameValueListBase.js
  17. 2 2
      ambari-logsearch/ambari-logsearch-portal/src/main/webapp/scripts/collection_bases/VNodeListBase.js
  18. 1 1
      ambari-logsearch/ambari-logsearch-portal/src/main/webapp/scripts/model_bases/VAuditLogBase.js
  19. 1 1
      ambari-logsearch/ambari-logsearch-portal/src/main/webapp/scripts/model_bases/VCommonModelBase.js
  20. 1 1
      ambari-logsearch/ambari-logsearch-portal/src/main/webapp/scripts/model_bases/VEventHistoryBase.js
  21. 1 1
      ambari-logsearch/ambari-logsearch-portal/src/main/webapp/scripts/model_bases/VGraphInfoBase.js
  22. 1 1
      ambari-logsearch/ambari-logsearch-portal/src/main/webapp/scripts/model_bases/VLogLevelBase.js
  23. 1 1
      ambari-logsearch/ambari-logsearch-portal/src/main/webapp/scripts/model_bases/VUserFilterBase.js
  24. 1 1
      ambari-logsearch/ambari-logsearch-portal/src/main/webapp/scripts/utils/ViewUtils.js
  25. 3 3
      ambari-logsearch/ambari-logsearch-portal/src/main/webapp/scripts/views/audit/AuditAggregatedView.js
  26. 11 11
      ambari-logsearch/ambari-logsearch-portal/src/main/webapp/scripts/views/audit/AuditTabLayoutView.js
  27. 15 15
      ambari-logsearch/ambari-logsearch-portal/src/main/webapp/scripts/views/dashboard/BubbleGraphTableLayoutView.js
  28. 2 2
      ambari-logsearch/ambari-logsearch-portal/src/main/webapp/scripts/views/dashboard/ComponentListView.js
  29. 1 1
      ambari-logsearch/ambari-logsearch-portal/src/main/webapp/scripts/views/dashboard/ComponentsView.js
  30. 6 6
      ambari-logsearch/ambari-logsearch-portal/src/main/webapp/scripts/views/dashboard/DashboardView.js
  31. 1 1
      ambari-logsearch/ambari-logsearch-portal/src/main/webapp/scripts/views/dashboard/GridTableLayoutView.js
  32. 1 1
      ambari-logsearch/ambari-logsearch-portal/src/main/webapp/scripts/views/dashboard/HostsView.js
  33. 1 1
      ambari-logsearch/ambari-logsearch-portal/src/main/webapp/scripts/views/dashboard/LogLevelBoxView.js
  34. 22 22
      ambari-logsearch/ambari-logsearch-portal/src/main/webapp/scripts/views/dashboard/MainLayoutView.js
  35. 1 1
      ambari-logsearch/ambari-logsearch-portal/src/main/webapp/scripts/views/dialog/GlobalExclusionCompositeView.js
  36. 10 10
      ambari-logsearch/ambari-logsearch-portal/src/main/webapp/scripts/views/filter/CreateLogfeederFilterView.js
  37. 6 6
      ambari-logsearch/ambari-logsearch-portal/src/main/webapp/scripts/views/graphs/GraphLayoutView.js
  38. 1 1
      ambari-logsearch/ambari-logsearch-portal/src/main/webapp/scripts/views/graphs/GridGraphLayoutView.js
  39. 1 1
      ambari-logsearch/ambari-logsearch-portal/src/main/webapp/scripts/views/tabs/ComparisonView.js
  40. 18 18
      ambari-logsearch/ambari-logsearch-portal/src/main/webapp/scripts/views/tabs/HierarchyTabLayoutView.js
  41. 6 6
      ambari-logsearch/ambari-logsearch-portal/src/main/webapp/scripts/views/tabs/LogFileView.js
  42. 1 1
      ambari-logsearch/ambari-logsearch-portal/src/main/webapp/scripts/views/tabs/TreeView.js
  43. 3 3
      ambari-logsearch/ambari-logsearch-portal/src/main/webapp/scripts/views/troubleshoot/TroubleShootLayoutView.js
  44. 6 6
      ambari-logsearch/ambari-logsearch-portal/src/main/webapp/templates/graphs/backup.js
  45. 2 2
      ambari-server/src/main/java/org/apache/ambari/server/controller/logging/LoggingRequestHelperImpl.java

+ 1 - 1
ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/dao/SolrDaoBase.java

@@ -547,7 +547,7 @@ public abstract class SolrDaoBase {
       QueryResponse queryResponse = solrClient.query(solrQuery,
         METHOD.POST);
 
-      if (event != null && !"/getLiveLogsCount".equalsIgnoreCase(event)) {
+      if (event != null && !"/audit/logs/live/count".equalsIgnoreCase(event)) {
         logPerformance.info("\n Username :- "
           + LogsearchContextUtil.getCurrentUsername()
           + " Event :- " + event + " SolrQuery :- " + solrQuery

+ 1 - 0
ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/doc/DocConstants.java

@@ -105,6 +105,7 @@ public class DocConstants {
     public static final String HOST_D = "";
     public static final String COMPONENT_D = "";
     public static final String LOG_TYPE_D = "";
+    public static final String TAIL_SIZE_D = "";
   }
 
   public class LogFileOperationDescriptions {

+ 1 - 1
ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/manager/AuditMgr.java

@@ -258,7 +258,7 @@ public class AuditMgr extends MgrBase {
   public String getLiveLogCounts() {
     VNameValueList nameValueList = new VNameValueList();
     SolrQuery solrQuery = new SolrQuery();
-    solrQuery.setParam("event", "/getLiveLogsCount");
+    solrQuery.setParam("event", "/audit/logs/live/count");
     try {
       String startDate = dateUtil
         .convertGivenDateFormatToSolrDateFormat(ManageStartEndTime.startDate);

+ 58 - 61
ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/manager/LogsMgr.java

@@ -6,9 +6,9 @@
  * to you 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
@@ -88,7 +88,7 @@ public class LogsMgr extends MgrBase {
   public static List<String> cancelByDate = new CopyOnWriteArrayList<String>();
 
   public static Map<String, String> mapUniqueId = new ConcurrentHashMap<String, String>();
-  
+
   public static enum CONDITION {
     OR, AND
   }
@@ -140,7 +140,7 @@ public class LogsMgr extends MgrBase {
       SolrQuery solrQuery = queryGenerator
           .commonServiceFilterQuery(searchCriteria);
 
-      solrQuery.setParam("event", "/solr/logs_search");
+      solrQuery.setParam("event", "/service/logs");
 
       VSolrLogList collection = getLogAsPaginationProvided(solrQuery,
           serviceLogsSolrDao);
@@ -151,7 +151,7 @@ public class LogsMgr extends MgrBase {
   public String getHosts(SearchCriteria searchCriteria) {
     return getFields(searchCriteria, LogSearchConstants.SOLR_HOST);
   }
-  
+
   public String getFields(SearchCriteria searchCriteria,String field){
 
     SolrQuery solrQuery = new SolrQuery();
@@ -185,7 +185,7 @@ public class LogsMgr extends MgrBase {
         solrDoc.put(field, temp);
         docList.add(solrDoc);
       }
-      
+
       collection.setGroupDocuments(docList);
       if(!docList.isEmpty()){
         collection.setStartIndex((int) docList.getStart());
@@ -197,7 +197,7 @@ public class LogsMgr extends MgrBase {
       throw restErrorUtil.createRESTException(MessageEnums.SOLR_ERROR
           .getMessage().getMessage(), MessageEnums.ERROR_SYSTEM);
     }
-  
+
   }
 
   public String getComponents(SearchCriteria searchCriteria) {
@@ -274,11 +274,11 @@ public class LogsMgr extends MgrBase {
         return collection;
       }
       List<Count> fieldList = facetFields.getValues();
-      
+
       if(fieldList == null){
         return collection;
       }
-      
+
       for (Count cnt : fieldList) {
         if (cnt != null) {
           VCount vCount = new VCount();
@@ -293,11 +293,11 @@ public class LogsMgr extends MgrBase {
       throw restErrorUtil.createRESTException(MessageEnums.SOLR_ERROR
           .getMessage().getMessage(), MessageEnums.ERROR_SYSTEM);
     }
-    
+
     collection.setCounts(vCounts);
     return collection;
   }
-  
+
   public VCountList getLogLevelCount(SearchCriteria searchCriteria) {
     return getFieldCount(searchCriteria, LogSearchConstants.SOLR_LEVEL);
   }
@@ -331,7 +331,7 @@ public class LogsMgr extends MgrBase {
           if(!stringUtil.isEmpty(firstPriority)){
             hostNode.setType(firstPriority);
           }
-          
+
           hostNode.setParent(true);
           hostNode.setRoot(true);
           PivotField hostPivot = null;
@@ -467,7 +467,7 @@ public class LogsMgr extends MgrBase {
 
   public String getHostListByComponent(SearchCriteria searchCriteria) {
     SolrQuery solrQuery = queryGenerator.commonServiceFilterQuery(searchCriteria);
-    solrQuery.setParam("event", "/getHostListByComponent");
+    solrQuery.setParam("event", "/service/hosts/component");
 
     VNodeList list = new VNodeList();
     if (searchCriteria.getSortBy() == null) {
@@ -484,10 +484,10 @@ public class LogsMgr extends MgrBase {
     } else {
       return convertObjToString(list);
     }
-    
+
     String firstHirarchy = "type,host,level";
     String secondHirarchy = "type,level";
-   
+
     try {
       queryGenerator.setFacetPivot(solrQuery, 1, firstHirarchy,
         secondHirarchy);
@@ -528,7 +528,7 @@ public class LogsMgr extends MgrBase {
   public VNameValueList getLogsLevelCount(SearchCriteria sc) {
     VNameValueList nameValueList = new VNameValueList();
     SolrQuery query = queryGenerator.commonServiceFilterQuery(sc);
-    query.setParam("event", "/getLogLevelCounts");
+    query.setParam("event", "/service/logs/levels/counts/namevalues");
     List<VNameValue> logsCounts = getLogLevelFacets(query);
     nameValueList.setVNameValues(logsCounts);
 
@@ -628,40 +628,40 @@ public class LogsMgr extends MgrBase {
   public List<Count> getFacetCounts(SolrQuery solrQuery, String facetField)
     throws SolrServerException, IOException, SolrException {
     List<Count> list = new ArrayList<FacetField.Count>();
-    
+
     QueryResponse response = serviceLogsSolrDao.process(solrQuery);
     if(response == null){
       return list;
     }
-    
+
     FacetField field = response.getFacetField(facetField);
     if (field == null) {
       return list;
     }
     list = field.getValues();
-    
-    
+
+
     return list;
   }
 
   public String getPageByKeyword(SearchCriteria searchCriteria)
     throws SolrServerException {
     String defaultChoice = "0";
-    
+
     String key = (String) searchCriteria.getParamValue("keyword");
     if(stringUtil.isEmpty(key)){
       throw restErrorUtil.createRESTException("Keyword was not given",
           MessageEnums.DATA_NOT_FOUND);
     }
-    
+
     String keyword = solrUtil.escapeForStandardTokenizer(key);
-    
+
     if(keyword.startsWith("\"") && keyword.endsWith("\"")){
       keyword = keyword.substring(1);
       keyword = keyword.substring(0, keyword.length()-1);
     }
     keyword = "*" + keyword + "*";
-   
+
 
     String keyType = (String) searchCriteria.getParamValue("keywordType");
     QueryResponse queryResponse = null;
@@ -684,7 +684,7 @@ public class LogsMgr extends MgrBase {
         nextPageLogTimeQuery.remove("rows");
         nextPageLogTimeQuery.setStart(lastLogIndexNumber);
         nextPageLogTimeQuery.setRows(1);
-        
+
         queryResponse = serviceLogsSolrDao.process(
             nextPageLogTimeQuery);
         if(queryResponse == null){
@@ -697,7 +697,7 @@ public class LogsMgr extends MgrBase {
           throw restErrorUtil.createRESTException("The keyword "+"\""+key+"\""+" was not found",
               MessageEnums.ERROR_SYSTEM);
         }
-        
+
         SolrDocument solrDoc = docList.get(0);
 
         Date logDate = (Date) solrDoc.get(LogSearchConstants.LOGTIME);
@@ -765,7 +765,7 @@ public class LogsMgr extends MgrBase {
 
         if (!stringUtil.isEmpty(sortByType) && sortByType
           .equalsIgnoreCase(LogSearchConstants.ASCENDING_ORDER)) {
-          
+
           queryGenerator.setSingleRangeFilter(logTimeThroughRangeQuery,
             LogSearchConstants.LOGTIME, nextPageLogTime,
             endTime);
@@ -774,7 +774,7 @@ public class LogsMgr extends MgrBase {
               + LogSearchConstants.ASCENDING_ORDER);
 
         } else {
-          
+
           queryGenerator.setSingleRangeFilter(logTimeThroughRangeQuery,
             LogSearchConstants.LOGTIME, startTime,
             nextPageLogTime);
@@ -803,7 +803,7 @@ public class LogsMgr extends MgrBase {
         if (!documentList.isEmpty()){
           solrDocument = documentList.get(0);
         }
-        
+
         Date keywordLogDate = (Date) solrDocument.get(LogSearchConstants.LOGTIME);
         if(keywordLogDate == null){
           throw restErrorUtil.createRESTException("The keyword "+"\""+key+"\""+" was not found",
@@ -837,9 +837,9 @@ public class LogsMgr extends MgrBase {
 
 
         long countNumberLogs = countQuery(rangeLogQuery,serviceLogsSolrDao) - 1;
-      
 
-        //Adding numbers on 
+
+        //Adding numbers on
 
 
         try {
@@ -854,7 +854,7 @@ public class LogsMgr extends MgrBase {
             String id = (String) solrDocumenent
               .getFieldValue(LogSearchConstants.ID);
             countNumberLogs++;
-           
+
             if (stringUtil.isEmpty(id) && id.equals(keywordId)){
               break;
             }
@@ -980,8 +980,8 @@ public class LogsMgr extends MgrBase {
           logTimeThroughRangeQuery.set(LogSearchConstants.SORT,
             LogSearchConstants.LOGTIME + " "
               + LogSearchConstants.DESCENDING_ORDER);
-          
-          
+
+
           queryGenerator.setSingleRangeFilter(
             logTimeThroughRangeQuery,
             LogSearchConstants.LOGTIME, startTime,
@@ -993,7 +993,7 @@ public class LogsMgr extends MgrBase {
           logTimeThroughRangeQuery.set(LogSearchConstants.SORT,
             LogSearchConstants.LOGTIME + " "
               + LogSearchConstants.ASCENDING_ORDER);
-          
+
 
           queryGenerator.setSingleRangeFilter(logTimeThroughRangeQuery,
             LogSearchConstants.LOGTIME, lastLogsLogTime, endTime);
@@ -1054,7 +1054,7 @@ public class LogsMgr extends MgrBase {
 
 
         long countNumberLogs = countQuery(rangeLogQuery,serviceLogsSolrDao) - 1;
-        
+
         //Adding numbers on
         try {
           SolrQuery sameIdQuery = queryGenerator
@@ -1123,9 +1123,9 @@ public class LogsMgr extends MgrBase {
           .process(logTimeByIdQuery);
 
       if(queryResponse == null){
-        return convertObjToString(new VSolrLogList()); 
+        return convertObjToString(new VSolrLogList());
       }
-      
+
       SolrDocumentList docList = queryResponse.getResults();
       Date dateOfLogId = null;
       if (docList != null && !docList.isEmpty()) {
@@ -1162,10 +1162,10 @@ public class LogsMgr extends MgrBase {
       queryGenerator.setSingleIncludeFilter(sameIdQuery,
           LogSearchConstants.LOGTIME, "\"" + logTime + "\"");
       sameIdQuery.set("fl", LogSearchConstants.ID);
-      
+
       QueryResponse sameIdResponse = serviceLogsSolrDao.process(sameIdQuery);
       SolrDocumentList docList = sameIdResponse.getResults();
-      
+
       for (SolrDocument solrDocumenent : docList) {
         String id = (String) solrDocumenent
             .getFieldValue(LogSearchConstants.ID);
@@ -1216,14 +1216,14 @@ public class LogsMgr extends MgrBase {
         return logsCounts;
 
       }
-      
+
       @SuppressWarnings("rawtypes")
       RangeFacet rangeFacet=rangeFacetList.get(0);
       if (rangeFacet == null) {
         return logsCounts;
       }
       logLevelCounts = rangeFacet.getCounts();
-      
+
       if(logLevelCounts == null){
         return logsCounts;
       }
@@ -1254,7 +1254,7 @@ public class LogsMgr extends MgrBase {
     String deafalutValue = "0";
     VBarDataList dataList = new VBarDataList();
     SolrQuery solrQuery = queryGenerator.commonServiceFilterQuery(searchCriteria);
-    solrQuery.set("event", "/getHistogramData");
+    solrQuery.set("event", "/audit/logs/histogram");
     String from = getFrom((String) searchCriteria.getParamValue("from"));
     String to = getTo((String) searchCriteria.getParamValue("to"));
     String unit = getUnit((String) searchCriteria.getParamValue("unit"));
@@ -1339,10 +1339,7 @@ public class LogsMgr extends MgrBase {
     }
   }
 
-  public String cancelFindRequestByDate(HttpServletRequest request) {
-    String uniqueId = null;
-
-    uniqueId = (String) request.getParameter("token");
+  public String cancelFindRequestByDate(String uniqueId) {
     if (stringUtil.isEmpty(uniqueId)) {
       logger.error("Unique id is Empty");
       throw restErrorUtil.createRESTException("Unique id is Empty",
@@ -1377,21 +1374,21 @@ public class LogsMgr extends MgrBase {
     String to = (String) searchCriteria.getParamValue("to");
     String utcOffset = (String) searchCriteria.getParamValue("utcOffset");
     String format = (String) searchCriteria.getParamValue("format");
-    
+
     format = defaultFormat.equalsIgnoreCase(format) && format != null ? ".txt"
         : ".json";
-    
+
     if(stringUtil.isEmpty(utcOffset)){
       utcOffset = "0";
     }
-    
+
     if (!dateUtil.isDateValid(from) || !dateUtil.isDateValid(to)) {
       logger.error("Not valid date format. Valid format should be"
           + LogSearchConstants.SOLR_DATE_FORMAT_PREFIX_Z);
       throw restErrorUtil.createRESTException("Not valid date format. Valid format should be"
           + LogSearchConstants.SOLR_DATE_FORMAT_PREFIX_Z,
           MessageEnums.INVALID_INPUT_DATA);
-      
+
     } else {
       from = from.replace("T", " ");
       from = from.replace(".", ",");
@@ -1411,7 +1408,7 @@ public class LogsMgr extends MgrBase {
       fileName = searchCriteria.getParamValue("hostLogFile") + "_"
         + searchCriteria.getParamValue("compLogFile");
     }
-    
+
     String textToSave = "";
     try {
       QueryResponse response = serviceLogsSolrDao.process(solrQuery);
@@ -1516,7 +1513,7 @@ public class LogsMgr extends MgrBase {
 
   public String getComponentListWithLevelCounts(SearchCriteria searchCriteria) {
     SolrQuery solrQuery = queryGenerator.commonServiceFilterQuery(searchCriteria);
-    solrQuery.setParam("event", "/getComponentListWithLevelCounts");
+    solrQuery.setParam("event", "/service/logs/components/level/counts");
 
     if (searchCriteria.getSortBy() == null) {
       searchCriteria.setSortBy(LogSearchConstants.SOLR_COMPONENT);
@@ -1586,10 +1583,10 @@ public class LogsMgr extends MgrBase {
       queryGenerator.setMainQuery(solrQuery, null);
       solrQuery.setSort(LogSearchConstants.LOGTIME, SolrQuery.ORDER.asc);
       queryGenerator.setRowCount(solrQuery, 1);
-     
+
       List<VNameValue> vNameValues = new ArrayList<VNameValue>();
       QueryResponse response = serviceLogsSolrDao.process(solrQuery);
-      
+
       if(response == null){
         return convertObjToString(nameValueList);
       }
@@ -1635,7 +1632,7 @@ public class LogsMgr extends MgrBase {
         }
       }
       nameValueList.setVNameValues(vNameValues);
-      
+
 
     } catch (SolrServerException | SolrException | IOException e) {
       logger.error(e.getMessage() + "SolrQuery"+solrQuery);
@@ -1789,7 +1786,7 @@ public class LogsMgr extends MgrBase {
     if(stringUtil.isEmpty(scrollType)){
       scrollType = "";
     }
-    
+
     String logTime = null;
     String sequenceId = null;
     try {
@@ -1827,7 +1824,7 @@ public class LogsMgr extends MgrBase {
       }
       vSolrLogList.setSolrDocuments(solrDocList);
         return convertObjToString(vSolrLogList);
-     
+
     } else if (LogSearchConstants.SCROLL_TYPE_AFTER.equals(scrollType)) {
       SolrDocumentList solrDocList = new SolrDocumentList();
       vSolrLogList = new VSolrLogList();
@@ -1859,9 +1856,9 @@ public class LogsMgr extends MgrBase {
       }
 
       vSolrLogList.setSolrDocuments(initial);
-     
+
         return convertObjToString(vSolrLogList);
-      
+
     }
   }
 
@@ -1964,4 +1961,4 @@ public class LogsMgr extends MgrBase {
   }
 
 
-}
+}

+ 16 - 45
ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/rest/AuditREST.java → ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/rest/AuditLogsREST.java

@@ -6,9 +6,9 @@
  * to you 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
@@ -23,6 +23,7 @@ import javax.servlet.http.HttpServletRequest;
 import javax.ws.rs.GET;
 import javax.ws.rs.Path;
 import javax.ws.rs.Produces;
+import javax.ws.rs.QueryParam;
 import javax.ws.rs.core.Context;
 import javax.ws.rs.core.Response;
 
@@ -39,17 +40,17 @@ import org.springframework.stereotype.Component;
 import static org.apache.ambari.logsearch.doc.DocConstants.CommonDescriptions.*;
 import static org.apache.ambari.logsearch.doc.DocConstants.AuditOperationDescriptions.*;
 
-@Api(value = "audit", description = "Audit operations")
-@Path("audit")
+@Api(value = "audit/logs", description = "Audit log operations")
+@Path("audit/logs")
 @Component
 @Scope("request")
-public class AuditREST {
+public class AuditLogsREST {
 
   @Autowired
   AuditMgr auditMgr;
 
   @GET
-  @Path("/getAuditSchemaFieldsName")
+  @Path("/schema/fields")
   @Produces({"application/json"})
   @ApiOperation(GET_AUDIT_SCHEMA_FIELD_LIST_OD)
   public String getSolrFieldList(@Context HttpServletRequest request) {
@@ -57,7 +58,6 @@ public class AuditREST {
   }
 
   @GET
-  @Path("/getAuditLogs")
   @Produces({"application/json"})
   @ApiOperation(GET_AUDIT_LOGS_OD)
   @ApiImplicitParams(value = {
@@ -82,7 +82,7 @@ public class AuditREST {
   }
 
   @GET
-  @Path("/getAuditComponents")
+  @Path("/components")
   @Produces({"application/json"})
   @ApiOperation(GET_AUDIT_COMPONENTS_OD)
   @ApiImplicitParams(value = {
@@ -96,7 +96,7 @@ public class AuditREST {
   }
 
   @GET
-  @Path("/getAuditLineGraphData")
+  @Path("/linegraph")
   @Produces({"application/json"})
   @ApiOperation(GET_AUDIT_LINE_GRAPH_DATA_OD)
   @ApiImplicitParams(value = {
@@ -121,7 +121,7 @@ public class AuditREST {
   }
 
   @GET
-  @Path("/getTopAuditUsers")
+  @Path("/users")
   @Produces({"application/json"})
   @ApiOperation(GET_TOP_AUDIT_USERS_OD)
   @ApiImplicitParams(value = {
@@ -146,7 +146,7 @@ public class AuditREST {
   }
 
   @GET
-  @Path("/getTopAuditResources")
+  @Path("/resources")
   @Produces({"application/json"})
   @ApiOperation(GET_TOP_AUDIT_RESOURCES_OD)
   @ApiImplicitParams(value = {
@@ -170,38 +170,10 @@ public class AuditREST {
     //return auditMgr.getTopAuditFieldCount(searchCriteria);
     return auditMgr.topTenResources(searchCriteria);
 
-
-  }
-
-  @GET
-  @Path("/getTopAuditComponents")
-  @Produces({"application/json"})
-  @ApiOperation(GET_TOP_AUDIT_COMPONENTS_OD)
-  @ApiImplicitParams(value = {
-    @ApiImplicitParam(value = QUERY_D, name = "q", dataType = "string", paramType = "query"),
-    @ApiImplicitParam(value = COLUMN_QUERY_D, name = "columnQuery", dataType = "string", paramType = "query"),
-    @ApiImplicitParam(value = I_MESSAGE_D, name = "iMessage", dataType = "string", paramType = "query"),
-    @ApiImplicitParam(value = G_E_MESSAGE_D, name = "gEMessage", dataType = "string", paramType = "query"),
-    @ApiImplicitParam(value = E_MESSAGE_D, name = "eMessage", dataType = "string", paramType = "query"),
-    @ApiImplicitParam(value = MUST_BE_D, name = "mustBe", dataType = "string", paramType = "query"),
-    @ApiImplicitParam(value = MUST_NOT_D, name = "mustNot", dataType = "string", paramType = "query"),
-    @ApiImplicitParam(value = EXCLUDE_QUERY_D, name = "excludeQuery", dataType = "string", paramType = "query"),
-    @ApiImplicitParam(value = INCLUDE_QUERY_D, name = "includeQuery", dataType = "string", paramType = "query"),
-    @ApiImplicitParam(value = FROM_D, name = "from", dataType = "string", paramType = "query"),
-    @ApiImplicitParam(value = TO_D, name = "to", dataType = "string", paramType = "query"),
-    @ApiImplicitParam(value = FIELD_D, name = "field", dataType = "string", paramType = "query"),
-    @ApiImplicitParam(value = UNIT_D, name = "unit", dataType = "string", paramType = "query")
-  })
-  public String getTopAuditComponents(@Context HttpServletRequest request) {
-    SearchCriteria searchCriteria = new SearchCriteria(request);
-    searchCriteria.addRequiredAuditLogsParams(request);
-    searchCriteria.addParam("field", request.getParameter("field"));
-    searchCriteria.addParam("unit", request.getParameter("unit"));
-    return auditMgr.getTopAuditFieldCount(searchCriteria);
   }
 
   @GET
-  @Path("/getLiveLogsCount")
+  @Path("/live/count")
   @Produces({"application/json"})
   @ApiOperation(GET_LIVE_LOGS_COUNT_OD)
   public String getLiveLogsCount() {
@@ -209,7 +181,7 @@ public class AuditREST {
   }
 
   @GET
-  @Path("/getRequestUserLineGraph")
+  @Path("/request/user/linegraph")
   @Produces({"application/json"})
   @ApiOperation(GET_REQUEST_USER_LINE_GRAPH_OD)
   @ApiImplicitParams(value = {
@@ -236,7 +208,7 @@ public class AuditREST {
   }
 
   @GET
-  @Path("/getAnyGraphData")
+  @Path("/anygraph")
   @Produces({"application/json"})
   @ApiOperation(GET_ANY_GRAPH_DATA_OD)
   @ApiImplicitParams(value = {
@@ -259,7 +231,7 @@ public class AuditREST {
   }
 
   @GET
-  @Path("/exportUserTableToTextFile")
+  @Path("/users/export")
   @Produces({"application/json"})
   @ApiOperation(EXPORT_USER_TALBE_TO_TEXT_FILE_OD)
   @ApiImplicitParams(value = {
@@ -286,7 +258,7 @@ public class AuditREST {
   }
 
   @GET
-  @Path("/getServiceLoad")
+  @Path("/serviceload")
   @Produces({"application/json"})
   @ApiOperation(GET_SERVICE_LOAD_OD)
   @ApiImplicitParams(value = {
@@ -309,4 +281,3 @@ public class AuditREST {
   }
 
 }
- 

+ 3 - 2
ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/rest/LogFileREST.java

@@ -63,13 +63,14 @@ public class LogFileREST {
   }
 
   @GET
-  @Path("/getLogFileTail")
+  @Path("/tail")
   @Produces({"application/json"})
   @ApiOperation(GET_LOG_FILE_TAIL_OD)
   @ApiImplicitParams(value = {
     @ApiImplicitParam(value = COMPONENT_D, name = "component", dataType = "string", paramType = "query"),
     @ApiImplicitParam(value = HOST_D, name = "host", dataType = "string", paramType = "query"),
-    @ApiImplicitParam(value = LOG_TYPE_D, name = "logType", dataType = "string", paramType = "query")
+    @ApiImplicitParam(value = LOG_TYPE_D, name = "logType", dataType = "string", paramType = "query"),
+    @ApiImplicitParam(value = TAIL_SIZE_D, name = "tailSize", dataType = "string", paramType = "query")
   })
   public String getLogFileTail(@Context HttpServletRequest request) {
     SearchCriteria searchCriteria = new SearchCriteria();

+ 1 - 1
ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/rest/PublicREST.java

@@ -40,7 +40,7 @@ public class PublicREST {
   PublicMgr generalMgr;
 
   @GET
-  @Path("/getGeneralConfig")
+  @Path("/config")
   @ApiOperation(OBTAIN_GENERAL_CONFIG_OD)
   public String getGeneralConfig() {
     return generalMgr.getGeneralConfig();

+ 28 - 25
ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/rest/DashboardREST.java → ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/rest/ServiceLogsREST.java

@@ -6,9 +6,9 @@
  * to you 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
@@ -45,11 +45,11 @@ import static org.apache.ambari.logsearch.doc.DocConstants.CommonDescriptions.*;
 import static org.apache.ambari.logsearch.doc.DocConstants.ServiceDescriptions.*;
 import static org.apache.ambari.logsearch.doc.DocConstants.ServiceOperationDescriptions.*;
 
-@Api(value = "dashboard", description = "Dashboard operations")
-@Path("dashboard")
+@Api(value = "service/logs", description = "Service log operations")
+@Path("service/logs")
 @Component
 @Scope("request")
-public class DashboardREST {
+public class ServiceLogsREST {
 
   @Autowired
   LogsMgr logMgr;
@@ -58,7 +58,6 @@ public class DashboardREST {
   RESTErrorUtil restErrorUtil;
 
   @GET
-  @Path("/solr/logs_search")
   @Produces({"application/json"})
   @ApiOperation(SEARCH_LOGS_OD)
   @ApiImplicitParams(value = {
@@ -131,7 +130,7 @@ public class DashboardREST {
   }
 
   @GET
-  @Path("/aggregatedData")
+  @Path("/aggregated")
   @Produces({"application/json"})
   @ApiOperation(GET_AGGREGATED_INFO_OD)
   @ApiImplicitParams(value = {
@@ -161,7 +160,7 @@ public class DashboardREST {
   }
 
   @GET
-  @Path("/levels_count")
+  @Path("/levels/count")
   @Produces({"application/json"})
   @ApiOperation(GET_LOG_LEVELS_COUNT_OD)
   @ApiImplicitParams(value = {
@@ -179,7 +178,7 @@ public class DashboardREST {
   }
 
   @GET
-  @Path("/components_count")
+  @Path("/components/count")
   @Produces({"application/json"})
   @ApiOperation(GET_COMPONENTS_COUNT_OD)
   @ApiImplicitParams(value = {
@@ -197,7 +196,7 @@ public class DashboardREST {
   }
 
   @GET
-  @Path("/hosts_count")
+  @Path("/hosts/count")
   @Produces({"application/json"})
   @ApiOperation(GET_HOSTS_COUNT_OD)
   @ApiImplicitParams(value = {
@@ -221,7 +220,7 @@ public class DashboardREST {
   }
 
   @GET
-  @Path("/getTreeExtension")
+  @Path("/tree")
   @Produces({"application/json"})
   @ApiOperation(GET_TREE_EXTENSION_OD)
   @ApiImplicitParams(value = {
@@ -257,7 +256,7 @@ public class DashboardREST {
   }
 
   @GET
-  @Path("/getLogLevelCounts")
+  @Path("/levels/counts/namevalues")
   @Produces({"application/json"})
   @ApiOperation(GET_LOG_LEVELS_COUNT_OD)
   @ApiImplicitParams(value = {
@@ -292,7 +291,7 @@ public class DashboardREST {
   }
 
   @GET
-  @Path("/getHistogramData")
+  @Path("/histogram")
   @Produces({"application/json"})
   @ApiOperation(GET_HISTOGRAM_DATA_OD)
   @ApiImplicitParams(value = {
@@ -329,15 +328,19 @@ public class DashboardREST {
   }
 
   @GET
-  @Path("/cancelFindRequest")
+  @Path("/request/cancel")
   @Produces({"application/json"})
   @ApiOperation(CANCEL_FIND_REQUEST_OD)
+  @ApiImplicitParams(value = {
+    @ApiImplicitParam(value = TOKEN_D, name = "token", dataType = "string", paramType = "query"),
+  })
   public String cancelFindRequest(@Context HttpServletRequest request) {
-    return logMgr.cancelFindRequestByDate(request);
+    String uniqueId = request.getParameter("token");
+    return logMgr.cancelFindRequestByDate(uniqueId);
   }
 
   @GET
-  @Path("/exportToTextFile")
+  @Path("/export")
   @Produces({"application/json"})
   @ApiOperation(EXPORT_TO_TEXT_FILE_OD)
   @ApiImplicitParams(value = {
@@ -378,7 +381,7 @@ public class DashboardREST {
   }
 
   @GET
-  @Path("/getHostListByComponent")
+  @Path("/hosts/components")
   @Produces({"application/json"})
   @ApiOperation(GET_HOST_LIST_BY_COMPONENT_OD)
   @ApiImplicitParams(value = {
@@ -415,7 +418,7 @@ public class DashboardREST {
   }
 
   @GET
-  @Path("/getComponentListWithLevelCounts")
+  @Path("/components/level/counts")
   @Produces({"application/json"})
   @ApiOperation(GET_COMPONENT_LIST_WITH_LEVEL_COUNT_OD)
   @ApiImplicitParams(value = {
@@ -451,7 +454,7 @@ public class DashboardREST {
   }
 
   @GET
-  @Path("/solr/getBundleIdBoundaryDates")
+  @Path("/solr/boundarydates")
   @Produces({"application/json"})
   @ApiOperation(GET_EXTREME_DATES_FOR_BUNDLE_ID_OD)
   public String getExtremeDatesForBundelId(@Context HttpServletRequest request) {
@@ -465,7 +468,7 @@ public class DashboardREST {
   }
 
   @GET
-  @Path("/getServiceLogsFieldsName")
+  @Path("/fields")
   @Produces({"application/json"})
   @ApiOperation(GET_SERVICE_LOGS_FIELD_NAME_OD)
   public String getServiceLogsFieldsName() {
@@ -473,7 +476,7 @@ public class DashboardREST {
   }
 
   @GET
-  @Path("/getServiceLogsSchemaFieldsName")
+  @Path("/schema/fields")
   @Produces({"application/json"})
   @ApiOperation(GET_SERVICE_LOGS_SCHEMA_FIELD_NAME_OD)
   public String getServiceLogsSchemaFieldsName() {
@@ -481,7 +484,7 @@ public class DashboardREST {
   }
 
   @GET
-  @Path("/getAnyGraphData")
+  @Path("/anygraph")
   @Produces({"application/json"})
   @ApiOperation(GET_ANY_GRAPH_DATA_OD)
   @ApiImplicitParams(value = {
@@ -523,7 +526,7 @@ public class DashboardREST {
   }
 
   @GET
-  @Path("/getAfterBeforeLogs")
+  @Path("/truncated")
   @Produces({"application/json"})
   @ApiOperation(GET_AFTER_BEFORE_LOGS_OD)
   @ApiImplicitParams(value = {
@@ -566,10 +569,10 @@ public class DashboardREST {
   }
 
   @GET
-  @Path("/getHadoopServiceConfigJSON")
+  @Path("/serviceconfig")
   @Produces({"application/json"})
   @ApiOperation(GET_HADOOP_SERVICE_CONFIG_JSON_OD)
   public String getHadoopServiceConfigJSON() {
     return logMgr.getHadoopServiceConfigJSON();
   }
-}
+}

+ 7 - 10
ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/rest/UserConfigREST.java

@@ -6,9 +6,9 @@
  * to you 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
@@ -58,7 +58,6 @@ public class UserConfigREST {
   UserConfigMgr userConfigMgr;
 
   @POST
-  @Path("/saveUserConfig")
   @Produces({"application/json"})
   @ApiOperation(SAVE_USER_CONFIG_OD)
   public String saveUserConfig(VUserConfig vhist) {
@@ -66,7 +65,6 @@ public class UserConfigREST {
   }
 
   @PUT
-  @Path("/updateUserConfig")
   @Produces({"application/json"})
   @ApiOperation(UPDATE_USER_CONFIG_OD)
   public String updateUserConfig(VUserConfig vhist) {
@@ -74,14 +72,13 @@ public class UserConfigREST {
   }
 
   @DELETE
-  @Path("/deleteUserConfig/{id}")
+  @Path("/{id}")
   @ApiOperation(DELETE_USER_CONFIG_OD)
   public void deleteUserConfig(@PathParam("id") String id) {
     userConfigMgr.deleteUserConfig(id);
   }
 
   @GET
-  @Path("/getUserConfig")
   @Produces({"application/json"})
   @ApiOperation(GET_USER_CONFIG_OD)
   @ApiImplicitParams(value = {
@@ -101,7 +98,7 @@ public class UserConfigREST {
   }
 
   @GET
-  @Path("/user_filter")
+  @Path("/users/filter")
   @Produces({"application/json"})
   @ApiOperation(GET_USER_FILTER_OD)
   public String getUserFilter(@Context HttpServletRequest request) {
@@ -109,7 +106,7 @@ public class UserConfigREST {
   }
 
   @POST
-  @Path("/user_filter")
+  @Path("/users/filter")
   @Produces({"application/json"})
   @ApiOperation(UPDATE_USER_FILTER_OD)
   public String createUserFilter(String json) {
@@ -117,7 +114,7 @@ public class UserConfigREST {
   }
 
   @PUT
-  @Path("/user_filter/{id}")
+  @Path("/users/filter/{id}")
   @Produces({"application/json"})
   @ApiOperation(GET_USER_FILTER_BY_ID_OD)
   public String updateUserFilter(String json) {
@@ -125,7 +122,7 @@ public class UserConfigREST {
   }
 
   @GET
-  @Path("/getAllUserName")
+  @Path("/users/names")
   @Produces({"application/json"})
   @ApiOperation(GET_ALL_USER_NAMES_OD)
   public String getAllUserName() {

+ 14 - 14
ambari-logsearch/ambari-logsearch-portal/src/main/webapp/login.html

@@ -1,4 +1,4 @@
-<!-- 
+<!--
   Licensed to the Apache Software Foundation (ASF) under one or more
   contributor license agreements.  See the NOTICE file distributed with
   this work for additional information regarding copyright ownership.
@@ -35,27 +35,27 @@
 				var passDiv = $('#passCont');
 
 		        $.ajax({
-					url : "/api/v1/public/getGeneralConfig",
+					url : "/api/v1/public/config",
 					type: "GET",
 					async: true,
 					dataType: 'json',
-						success:function(results,status) 
+						success:function(results,status)
 						{
 							for(var i in results.vNameValues){
 								if ((results.vNameValues[i].name === "simpleAuth") && (results.vNameValues[i].value === "true")){
 									$("#password").val("");
 									passDiv.hide();
-								}	
+								}
 								if (passDiv.is(':hidden'))
 								   $("#password").prop('required',false);
 							}
 						},
-						error: function(errorThrown) 
+						error: function(errorThrown)
 						{
 						    passDiv.show();
 						},
 			            complete : function(){
-			                $('[data-id="loader"]').hide();            
+			                $('[data-id="loader"]').hide();
 			            }
 				});
 			});
@@ -105,7 +105,7 @@
 						</div>
 						<div data-id="loader" class="loading"></div>
 					</div>
-					</div>			
+					</div>
 		</div>
 
 		<script type="text/javascript">
@@ -116,20 +116,20 @@
 				    var postData = {};
 				    var formURL = ($(this).attr("action")) ? $(this).attr("action") : "/login";
 				    postData = {"username" : $("#username").val() , "password" : $("#password").val()};
-				 
+
 					$.ajax({
 						url : formURL,
 						type: "POST",
 						data : postData,
-							success:function(results,status) 
+							success:function(results,status)
 							{
 							    window.location = 'index.html'+window.location.search;
 							},
-							error: function(errorThrown) 
+							error: function(errorThrown)
 							{
 							    showError(errorThrown);
 							}
-						});				    
+						});
 				 		return false;
 				});
 
@@ -139,11 +139,11 @@
 
 				function showError(errorThrown){
 					var errorMsg = errorThrown.status;
-					
+
 				    switch(errorMsg){
-		                case 401: $('.errorBox').show(); 
+		                case 401: $('.errorBox').show();
 		                        break;
-		              
+
 		                default: $('.errorBox').hide();
 				    }
 				}

+ 7 - 9
ambari-logsearch/ambari-logsearch-portal/src/main/webapp/scripts/collection_bases/VAuditLogListBase.js

@@ -6,9 +6,9 @@
  * to you 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
@@ -17,18 +17,18 @@
  * under the License.
  */
 
- 
+
 define(['require',
 	'collections/BaseCollection',
 	'utils/Globals',
 	'models/VAuditLog'
 ],function(require,BaseCollection,Globals,VAuditLog){
-	'use strict';	
+	'use strict';
 
 	var VAuditLogListBase = BaseCollection.extend(
 	/** @lends VAuditLogListBase.prototype */
 	{
-		url: Globals.baseURL + 'audit/getAuditLogs',
+		url: Globals.baseURL + 'audit/logs',
 
 		model : VAuditLog,
 
@@ -49,8 +49,8 @@ define(['require',
 		 *************************/
 
 		getAuditSchemaFieldsName : function(token, options){
-			var url = Globals.baseURL  + 'audit/getAuditSchemaFieldsName';
-			
+			var url = Globals.baseURL  + 'audit/logs/schema/fields';
+
 			options = _.extend({
 				data : $.param(token),
 				contentType : 'application/json',
@@ -71,5 +71,3 @@ define(['require',
 
     return VAuditLogListBase;
 });
-
-

+ 7 - 7
ambari-logsearch/ambari-logsearch-portal/src/main/webapp/scripts/collection_bases/VEventHistoryListBase.js

@@ -6,9 +6,9 @@
  * to you 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
@@ -24,11 +24,11 @@ define(['require',
     'models/VEventHistory'
 ],function(require,BaseCollection,Globals,VEventHistory) {
     'use strict';
-    
+
     var VEventHistoryListBase = BaseCollection.extend(
         /** @lends VEventHistoryListBase.prototype */
         {
-            url: Globals.baseURL + 'userconfig/getUserConfig',
+            url: Globals.baseURL + 'userconfig',
 
             model: VEventHistory,
 
@@ -48,7 +48,7 @@ define(['require',
              *************************/
 
             saveEventHistory: function(postData, options) {
-                var url = Globals.baseURL + 'userconfig/saveUserConfig';
+                var url = Globals.baseURL + 'userconfig';
 
                 options = _.extend({
                     data: JSON.stringify(postData),
@@ -59,7 +59,7 @@ define(['require',
                 return this.constructor.nonCrudOperation.call(this, url, 'POST', options);
             },
             saveDashboard: function(postData, options) {
-                var url = Globals.baseURL + 'userconfig/saveUserConfig';
+                var url = Globals.baseURL + 'userconfig';
 
                 options = _.extend({
                     data: JSON.stringify(postData),
@@ -70,7 +70,7 @@ define(['require',
                 return this.constructor.nonCrudOperation.call(this, url, 'POST', options);
             },
             deleteEventHistory: function(postData, options) {
-                var url = Globals.baseURL + 'userconfig/deleteUserConfig/' + postData.id;
+                var url = Globals.baseURL + 'userconfig/' + postData.id;
 
                 options = _.extend({
                     contentType: 'application/json',

+ 7 - 9
ambari-logsearch/ambari-logsearch-portal/src/main/webapp/scripts/collection_bases/VGroupListBase.js

@@ -6,9 +6,9 @@
  * to you 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
@@ -17,18 +17,18 @@
  * under the License.
  */
 
- 
+
 define(['require',
 	'collections/BaseCollection',
 	'utils/Globals',
 	'models/VGroup'
 ],function(require,BaseCollection,Globals,VGroup){
-	'use strict';	
+	'use strict';
 
 	var VGroupListBase = BaseCollection.extend(
 	/** @lends VGroupListBase.prototype */
 	{
-		url: Globals.baseURL + 'dashboard/hosts',
+		url: Globals.baseURL + 'service/logs/hosts',
 
 		model : VGroup,
 
@@ -44,7 +44,7 @@ define(['require',
             this._changes = { };
 			this.on('change', this._onChange);
 		},
-		
+
 		_onChange : function(m){
             this._changes[m.id] = m;
 		},
@@ -59,7 +59,7 @@ define(['require',
 
 		getUsersOfGroup : function(groupId, options){
 			var url = Globals.baseURL  + 'xusers/'  + groupId + '/users';
-			
+
 			options = _.extend({
 				//data : JSON.stringify(postData),
 				contentType : 'application/json',
@@ -80,5 +80,3 @@ define(['require',
 
     return VGroupListBase;
 });
-
-

+ 1 - 1
ambari-logsearch/ambari-logsearch-portal/src/main/webapp/scripts/collection_bases/VLogLevelListBase.js

@@ -28,7 +28,7 @@ define(['require',
 	var VLogLevelListBase = BaseCollection.extend(
 	/** @lends VLogLevelListBase.prototype */
 	{
-		url: Globals.baseURL + 'dashboard/levels_count',
+		url: Globals.baseURL + 'service/logs/levels/count',
 
 		model : VLogLevel,
 

+ 5 - 5
ambari-logsearch/ambari-logsearch-portal/src/main/webapp/scripts/collection_bases/VLogListBase.js

@@ -58,7 +58,7 @@ define(['require',
 		 *************************/
 
 		cancelFindRequest : function(token, options){
-			var url = Globals.baseURL  + 'dashboard/cancelFindRequest';
+			var url = Globals.baseURL  + 'service/logs/request/cancel';
 			
 			options = _.extend({
 				data : $.param(token),
@@ -69,7 +69,7 @@ define(['require',
 			return this.constructor.nonCrudOperation.call(this, url, 'GET', options);
 		},
 		getServiceLogFields : function(token, options){
-			var url = Globals.baseURL  + 'dashboard/getServiceLogsFieldsName';
+			var url = Globals.baseURL  + 'service/logs/fields';
 			
 			options = _.extend({
 				data : $.param(token),
@@ -80,7 +80,7 @@ define(['require',
 			return this.constructor.nonCrudOperation.call(this, url, 'GET', options);
 		},
 		getServiceLogSchemaFields : function(token, options){
-			var url = Globals.baseURL  + 'dashboard/getServiceLogsSchemaFieldsName';
+			var url = Globals.baseURL  + 'service/logs/schema/fields';
 			
 			options = _.extend({
 				data : $.param(token),
@@ -91,7 +91,7 @@ define(['require',
 			return this.constructor.nonCrudOperation.call(this, url, 'GET', options);
 		},
 		getTruncatedLogs : function(token, options){
-			var url = Globals.baseURL  + 'dashboard/getAfterBeforeLogs';
+			var url = Globals.baseURL  + 'service/logs/truncated';
 			
 			options = _.extend({
 				data : $.param(token),
@@ -102,7 +102,7 @@ define(['require',
 			return this.constructor.nonCrudOperation.call(this, url, 'GET', options);
 		},
 		getServicesInfo : function(options){
-			var url = Globals.baseURL  + 'dashboard/getHadoopServiceConfigJSON';
+			var url = Globals.baseURL  + 'service/logs/serviceconfig';
 			
 			options = _.extend({
 				//data : $.param(token),

+ 6 - 8
ambari-logsearch/ambari-logsearch-portal/src/main/webapp/scripts/collection_bases/VNameValueListBase.js

@@ -6,9 +6,9 @@
  * to you 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
@@ -17,18 +17,18 @@
  * under the License.
  */
 
- 
+
 define(['require',
 	'collections/BaseCollection',
 	'utils/Globals',
 	'models/VNameValue'
 ],function(require,BaseCollection,Globals,VNameValue){
-	'use strict';	
+	'use strict';
 
 	var VNameValueListBase = BaseCollection.extend(
 	/** @lends VNameValueListBase.prototype */
 	{
-		url: Globals.baseURL + 'dashboard/hosts',
+		url: Globals.baseURL + 'service/logs/hosts',
 
 		model : VNameValue,
 
@@ -42,7 +42,7 @@ define(['require',
 			this.modelAttrName = 'vnameValues';
 			this.bindErrorEvents();
 		}
-		
+
 	},{
 	/**
 	* Table Cols to be passed to Backgrid
@@ -55,5 +55,3 @@ define(['require',
 
     return VNameValueListBase;
 });
-
-

+ 2 - 2
ambari-logsearch/ambari-logsearch-portal/src/main/webapp/scripts/collection_bases/VNodeListBase.js

@@ -28,7 +28,7 @@ define(['require',
 	var VNodeListBase = BaseCollection.extend(
 	/** @lends VNodeListBase.prototype */
 	{
-		url: Globals.baseURL + 'dashboard/getTreeExtension',
+		url: Globals.baseURL + 'service/logs/tree',
 
 		model : VNode,
 
@@ -48,7 +48,7 @@ define(['require',
 		 *************************/
 
 		cancelFindRequest : function(token, options){
-			var url = Globals.baseURL  + 'dashboard/cancelFindRequest';
+			var url = Globals.baseURL  + 'service/logs/request/cancel';
 			
 			options = _.extend({
 				data : $.param(token),

+ 1 - 1
ambari-logsearch/ambari-logsearch-portal/src/main/webapp/scripts/model_bases/VAuditLogBase.js

@@ -42,7 +42,7 @@ define(['require',
 			this.modelName = 'VAuditLogBase';
 		},
 		auditLiveFeed : function(token, options){
-			var url = Globals.baseURL  + 'audit/getLiveLogsCount';
+			var url = Globals.baseURL  + 'audit/logs/live/count';
 			
 			options = _.extend({
 				data : $.param(token),

+ 1 - 1
ambari-logsearch/ambari-logsearch-portal/src/main/webapp/scripts/model_bases/VCommonModelBase.js

@@ -27,7 +27,7 @@ define(['require',
 	var VCommonModelBase = BaseModel.extend(
 	/** @lends VCommonModelBase.prototype */
 	{
-		urlRoot: Globals.baseURL + 'dashboard/getTreeExtension',
+		urlRoot: Globals.baseURL + 'service/logs/tree',
 		
 		defaults: {},
 		

+ 1 - 1
ambari-logsearch/ambari-logsearch-portal/src/main/webapp/scripts/model_bases/VEventHistoryBase.js

@@ -27,7 +27,7 @@ define(['require',
     var VEventHistory = BaseModel.extend(
         /** @lends VEventHistory.prototype */
         {
-            urlRoot: Globals.baseURL + 'dashboard/aggregatedData',
+            urlRoot: Globals.baseURL + 'service/logs/aggregated',
 
             defaults: {},
 

+ 1 - 1
ambari-logsearch/ambari-logsearch-portal/src/main/webapp/scripts/model_bases/VGraphInfoBase.js

@@ -27,7 +27,7 @@ define(['require',
 	var VLogBase = BaseModel.extend(
 	/** @lends VLogBase.prototype */
 	{
-		urlRoot: Globals.baseURL + 'dashboard/aggregatedData',
+		urlRoot: Globals.baseURL + 'service/logs/aggregated',
 		
 		defaults: {},
 		

+ 1 - 1
ambari-logsearch/ambari-logsearch-portal/src/main/webapp/scripts/model_bases/VLogLevelBase.js

@@ -27,7 +27,7 @@ define(['require',
 	var VLogLevelBase = BaseModel.extend(
 	/** @lends VLogLevelBase.prototype */
 	{
-		urlRoot: Globals.baseURL + 'dashboard/levels_count',
+		urlRoot: Globals.baseURL + 'service/logs/levels/count',
 		
 		defaults: {},
 		

+ 1 - 1
ambari-logsearch/ambari-logsearch-portal/src/main/webapp/scripts/model_bases/VUserFilterBase.js

@@ -27,7 +27,7 @@ define(['require',
 	var VUserFilterBase = BaseModel.extend(
 	/** @lends VUserFilterBase.prototype */
 	{
-		urlRoot: Globals.baseURL + 'userconfig/user_filter',
+		urlRoot: Globals.baseURL + 'userconfig/users/filter',
 
 		defaults: {},
 

+ 1 - 1
ambari-logsearch/ambari-logsearch-portal/src/main/webapp/scripts/utils/ViewUtils.js

@@ -58,7 +58,7 @@ define(['require',
         if (params.bundle_id && !params.start_time && !params.end_time) {
             var collection = new VNameValueList();
 
-            collection.url = Globals.baseURL + "dashboard/solr/getBundleIdBoundaryDates";
+            collection.url = Globals.baseURL + "service/logs/solr/boundarydates";
             collection.modelAttrName = "vNameValues";
             _.extend(collection.queryParams, {
                 "bundle_id": params.bundle_id

+ 3 - 3
ambari-logsearch/ambari-logsearch-portal/src/main/webapp/scripts/views/audit/AuditAggregatedView.js

@@ -98,7 +98,7 @@ define(['require',
                     pageSize: 9999
                 }
 			});
-			this.topUsers.url = Globals.baseURL + "audit/getTopAuditUsers";
+			this.topUsers.url = Globals.baseURL + "audit/logs/users";
 			this.topUsers.modelAttrName = "graphData";
 			this.topResources = new VNameValueList([],{
 				state: {
@@ -106,7 +106,7 @@ define(['require',
                     pageSize: 9999
                 }
 			});
-			this.topResources.url = Globals.baseURL + "audit/getTopAuditResources";
+			this.topResources.url = Globals.baseURL + "audit/logs/resources";
 			this.topResources.modelAttrName = "graphData";		
 			//initialize colors
 			this.colors = (new d3.scale.category20c().range().slice().reverse()).concat(new d3.scale.category20b().range().slice().reverse());
@@ -408,7 +408,7 @@ define(['require',
 			obj.utcOffset = moment().utcOffset();
 			obj.startIndex =  this.topUsers.state.currentPage * this.topUsers.state.pageSize;
 			var params = $.param(_.extend({},this.topUsers.queryParams,obj));
-			var url = "api/v1/audit/exportUserTableToTextFile?"+ params;
+			var url = "api/v1/audit/logs/users/export?"+ params;
 			window.open(url);
 			this.onDialogClosed();
 		}

+ 11 - 11
ambari-logsearch/ambari-logsearch-portal/src/main/webapp/scripts/views/audit/AuditTabLayoutView.js

@@ -27,9 +27,9 @@ define(['require',
 	'hbs!tmpl/audit/AuditTabLayoutView_tmpl',
 	'moment'
 ],function(require,Backbone,Globals,Utils,ViewUtils,VGroupList,VAuditLogList,VAuditLog,AuditTabLayoutViewTmpl,moment){
-    
+
     'use strict';
-    
+
     return Backbone.Marionette.Layout.extend(
 	/** @lends LogLevelView */
 	{
@@ -91,14 +91,14 @@ define(['require',
                     pageSize: 25
                 }
 			});
-			
+
 			this.componentsList = new VGroupList([],{
 				state: {
                     firstPage: 0,
                     pageSize: 99999
                 }
 			});
-			this.componentsList.url = Globals.baseURL + "audit/getAuditComponents";
+			this.componentsList.url = Globals.baseURL + "audit/logs/components";
 		},
 		bindEvents : function(){
 			this.listenTo(this.componentsList, "reset", function(col, abc){
@@ -115,13 +115,13 @@ define(['require',
 			this.listenTo(this.vent,"reinitialize:filter:mustNot",function(value){
             	this.reinitializeFilterMustNot(value);
             },this);
-			
+
 			this.listenTo(this.globalVent,"reinitialize:auditLogs",function(options){
             	this.vent.trigger("reinitialize:filter:mustNot reinitialize:filter:mustBe reinitialize:filter:logtime "+
             			"reinitialize:TopTenGraph",options);
             	this.fetchAuditLogs(options);
             },this);
-			
+
 		},
 		onRender : function(){
 			this.renderHistogram();
@@ -154,7 +154,7 @@ define(['require',
 					params : that.defaultParams
 				}));
 			})
-			
+
 		},
 		fetchAuditColumns : function(){
 			var that =this;
@@ -184,7 +184,7 @@ define(['require',
 		renderVSSearch : function(){
 			var that = this;
 			require(['views/tabs/VisualSearchView'], function(VisualSearchView){
-				
+
 				_.each(that.columns,function(v,i){
 					if(v.toLowerCase().indexOf("time") > 0 ){
 						//that.columns.splice(i, 1);
@@ -421,7 +421,7 @@ define(['require',
 					that.$("#loaderFeed").show();
 				},
 				success : function(data){
-					var dd=[]; 
+					var dd=[];
 					that.$("#spark").parent().show();
 					_.each(data.vnameValues,function(d){
 						dd.push(d.value);
@@ -452,8 +452,8 @@ define(['require',
 			if(values.mustNot){
 				this.ui.excludeComponents.select2('val',values.mustNot.split(","));
 			}else{
-				this.ui.excludeComponents.select2('val',[]);	
+				this.ui.excludeComponents.select2('val',[]);
 			}
 		}
 	});
-});
+});

+ 15 - 15
ambari-logsearch/ambari-logsearch-portal/src/main/webapp/scripts/views/dashboard/BubbleGraphTableLayoutView.js

@@ -31,7 +31,7 @@ define(['require',
 	'select2'
 ],function(require,Backbone,moment,Globals,Utils,ViewUtils,tip,VLogLevel,VLogList,VGraphInfo,BubbleGraphTableLayoutViewTmpl,JBDialog){
 	'use strict';
-	
+
 	return Backbone.Marionette.Layout.extend(
 	/** @lends BubbleGraphTableLayoutView */
 	{
@@ -96,7 +96,7 @@ define(['require',
                     pageSize: 25
                 }
             });
-			this.collection.url = Globals.baseURL + "dashboard/solr/logs_search";
+			this.collection.url = Globals.baseURL + "service/logs";
 			this.graphModel = new VGraphInfo();
 			this.bindEvents();
 			this.graphParams = this.params;
@@ -257,7 +257,7 @@ define(['require',
 					filterOpts : {},
 					paginatorOpts : {}
 				}));
-			});	
+			});
 		},
 		renderComponentList : function(){
 			var that = this;
@@ -416,7 +416,7 @@ define(['require',
 						displayOrder :6,
 						width : 6
 					}
-					
+
 			};
 			_.each(cols,function(c,k){
 				if(columns[k] == undefined){
@@ -502,7 +502,7 @@ define(['require',
 				this.ui.hostList.show();
 			}else
 				this.ui.componentList.show();
-				
+
 		},
 		bindContextMenuClick : function(){
 			var that = this;
@@ -543,13 +543,13 @@ define(['require',
 		        	that.selectionCallBack(selection,e)
 		        },1);
 
-		        
+
 		    });
 		},
 		selectionCallBack : function(selection,e){
 			this.RLogTable.currentView.$el.removeHighlight(true);
 			if(this.selectionText != selection.toString()){
-				this.selectionText = selection.toString(); 
+				this.selectionText = selection.toString();
 			}else{
 				$(".contextMenuBody [data-id='F']").show();
 				$(".contextMenuBody").hide();
@@ -561,8 +561,8 @@ define(['require',
 				$(".contextMenuBody").show();
 				$(".contextMenuBody").css({
 					'top':e.pageY - 40,
-					'left':e.pageX 
-				});  
+					'left':e.pageX
+				});
 			}else{
 				this.RLogTable.currentView.$el.removeHighlight(true);
 				$(".contextMenuBody [data-id='F']").show();
@@ -607,7 +607,7 @@ define(['require',
 			}else if ($el.data("id") === "C_M"){
 				this.globalVent.trigger("add:compare",$el.find('a'));
 			}
-			
+
 		},
 		renderDetailLogFileView : function(view){
 			var that = this;
@@ -655,12 +655,12 @@ define(['require',
 				this.ui.graph.text("no data");
 				return
 			}
-				
+
 			var root = {
 				name : "",
 				dataList : this.graphModel.get("graphData")
 			};
-			
+
 			var margin = 20;
 			this.ui.graph.empty();
 			//		var color = d3.scale.linear()
@@ -813,6 +813,6 @@ define(['require',
 			$('body').unbind("mouseup.contextMenu");
 		}
 	});
-	
-	
-});
+
+
+});

+ 2 - 2
ambari-logsearch/ambari-logsearch-portal/src/main/webapp/scripts/views/dashboard/ComponentListView.js

@@ -68,14 +68,14 @@ define(['require',
 		                    pageSize: 99999
 		                }
 					});
-					this.componentsList.url = Globals.baseURL + "dashboard/getComponentListWithLevelCounts";
+					this.componentsList.url = Globals.baseURL + "service/logs/components/level/counts";
 					this.hostList = new VNodeList([],{
 						state: {
 		                    firstPage: 0,
 		                    pageSize: 99999
 		                }
 					});
-					this.hostList.url = Globals.baseURL + "dashboard/getHostListByComponent";
+					this.hostList.url = Globals.baseURL + "service/logs/hosts/components";
 				},
 				/** all events binding here */
 				bindEvents : function(){

+ 1 - 1
ambari-logsearch/ambari-logsearch-portal/src/main/webapp/scripts/views/dashboard/ComponentsView.js

@@ -53,7 +53,7 @@ define(['require',
 		initialize: function(options) {
 			_.extend(this, _.pick(options,'vent'));
 			this.collection = new VLogLevel();
-			this.collection.url = Globals.baseURL+"dashboard/components_count";
+			this.collection.url = Globals.baseURL+"service/logs/components/count";
 			this.bindEvents();
 		},
 		onRender : function(){

+ 6 - 6
ambari-logsearch/ambari-logsearch-portal/src/main/webapp/scripts/views/dashboard/DashboardView.js

@@ -26,7 +26,7 @@ define(['require',
 ],function(require,Backbone,Globals,DashboardviewTmpl,VGroupList){
     'use strict';
 
-	
+
 	var DashboardView = Backbone.Marionette.Layout.extend(
 	/** @lends DashboardView */
 	{
@@ -69,7 +69,7 @@ define(['require',
 			this.logRegions = new Backbone.Collection();
 			this.hostCollection = new VGroupList([],{});
 			this.cComponents = new VGroupList([],{});
-			this.cComponents.url = Globals.baseURL + "dashboard/components";
+			this.cComponents.url = Globals.baseURL + "service/logs/components";
 			this.cTime = new VGroupList(Globals.timeQueryLOV,{});
 		},
 		/** all events binding here */
@@ -115,7 +115,7 @@ define(['require',
 		},
 		onSearchLogClick : function(e){
 			var searchParams = this.getSearchparams();
-			
+
 			if(this.logRegions.length == 0){
 				var model = new Backbone.Model({
 					id : 1,
@@ -123,7 +123,7 @@ define(['require',
 				});
 				this.generateView(model);
 			}else{
-				
+
 				var existsMod = this.logRegions.find(function(m){
 					return JSON.stringify(searchParams) === JSON.stringify(m.get('params'))
 				});
@@ -159,7 +159,7 @@ define(['require',
 			require(['views/dashboard/LogDetailView'],function(LogDetailView){
 				region.show(new LogDetailView({model: model}));
 			})
-			
+
 		},
 		getSearchparams : function(){
 			var obj={hosts : null, components : null, time:null};
@@ -176,7 +176,7 @@ define(['require',
 					obj.time = this.ui.time.select2("val");
 			}
 			return obj;
-				
+
 		},
 		/** on close */
 		onClose: function(){

+ 1 - 1
ambari-logsearch/ambari-logsearch-portal/src/main/webapp/scripts/views/dashboard/GridTableLayoutView.js

@@ -78,7 +78,7 @@ define(['require',
                 this.graphParams = {};
                 this.unit = (this.model.params && this.model.params.unit) ? this.model.params.unit : "+1HOUR";
                 this.firstRender = true;
-                this.collection.url = Globals.baseURL + "audit/getAnyGraphData";
+                this.collection.url = Globals.baseURL + "audit/logs/anygraph";
                 this.collection.modelAttrName = "graphData";
 
             },

+ 1 - 1
ambari-logsearch/ambari-logsearch-portal/src/main/webapp/scripts/views/dashboard/HostsView.js

@@ -53,7 +53,7 @@ define(['require',
 		initialize: function(options) {
 			_.extend(this, _.pick(options,'vent'));
 			this.collection = new VLogLevel();
-			this.collection.url = Globals.baseURL+"dashboard/hosts_count";
+			this.collection.url = Globals.baseURL+"service/logs/hosts/count";
 			this.bindEvents();
 		},
 		onRender : function(){

+ 1 - 1
ambari-logsearch/ambari-logsearch-portal/src/main/webapp/scripts/views/dashboard/LogLevelBoxView.js

@@ -61,7 +61,7 @@ define(['require',
 		initialize: function(options) {
 			_.extend(this, _.pick(options,'vent','globalVent','params'));
 			this.logLevelList = new VLogLevelList();
-			this.logLevelList.url = Globals.baseURL + "dashboard/getLogLevelCounts";
+			this.logLevelList.url = Globals.baseURL + "service/logs/levels/counts/namevalues";
 			this.logLevelList.modelAttrName = "vNameValues";
 			this.bindEvents();
 		},

+ 22 - 22
ambari-logsearch/ambari-logsearch-portal/src/main/webapp/scripts/views/dashboard/MainLayoutView.js

@@ -27,7 +27,7 @@ define(['require',
 	'd3.tip'
 ],function(require,Backbone,Utils,ViewUtils,Globals,MainLayoutViewTmpl){
     'use strict';
-	
+
 	var MainLayoutView = Backbone.Marionette.Layout.extend(
 	/** @lends MainLayoutView */
 	{
@@ -93,7 +93,7 @@ define(['require',
 //                    pageSize: 50
 //                }
 //            });
-//			this.collection.url = Globals.baseURL + "dashboard/solr/logs_search";
+//			this.collection.url = Globals.baseURL + "service/logs";
 			this.vent = new Backbone.Wreqr.EventAggregator();
 			this.dateUtil = Utils.dateUtil;
 			this.bindEvents();
@@ -107,7 +107,7 @@ define(['require',
             	setTimeout(function(){
             		that.reAdjustTab()
             	},1000);
-            	
+
             },this);
             this.listenTo(this.globalVent,"render:comparison:tab",function(options){
 				this.hideContextMenu();
@@ -211,7 +211,7 @@ define(['require',
 				$("html, body").animate({ scrollTop: 0 }, 500);
 				that.showTab(tabName);
 			});
-		
+
 		},
 		showTab : function(tabId){
 			this.$(".nav.nav-tabs li").removeClass("active");
@@ -242,7 +242,7 @@ define(['require',
 					globalVent:that.globalVent
 				}));
 			})
-			
+
 		},
 		renderComponents : function(){
 			var that = this;
@@ -274,7 +274,7 @@ define(['require',
 		renderTroubleShootTab:function(){
 			var that = this;
 			require(['views/troubleshoot/TroubleShootLayoutView'], function(TroubleShootLayoutView){
-				
+
 				that.RTroubleShoot.show(new TroubleShootLayoutView({
 					globalVent:that.globalVent
 				}));
@@ -345,7 +345,7 @@ define(['require',
 		var pack = d3.layout.pack()
 		    .padding(2)
 		    .size([diameter - margin, diameter - margin])
-		    .value(function(d) { 
+		    .value(function(d) {
 		    	return d.count; })
 		    .children(function(d){
 		    	return d.dataList;
@@ -381,9 +381,9 @@ define(['require',
 		  var circle = svg.selectAll("circle")
 		      .data(nodes)
 		    .enter().append("circle")
-		      .attr("class", function(d) { 
+		      .attr("class", function(d) {
 		    	  return d.parent ? d.children ? "node" : "node node--leaf "+d.name : "node node--root"; })
-		      .style("fill", function(d) { 
+		      .style("fill", function(d) {
 		    	  return d.children ? color(d.depth) : null; })
 		      .on("click", function(d) {
 		    	  if(d3.event.shiftKey){
@@ -391,7 +391,7 @@ define(['require',
 		    	  }else{
 		    		  if (focus !== d) zoom(d), d3.event.stopPropagation();
 		    	  }
-		    		   
+
 		      })
 		      .on('mouseover', function (d,i) {
                     if (d.x) {
@@ -403,7 +403,7 @@ define(['require',
                         tipCirclePack.hide(d);
                     }
                 });
-		  
+
 		  var text = svg.selectAll("text")
 		      .data(nodes)
 		    .enter().append("text")
@@ -418,7 +418,7 @@ define(['require',
 		    			  return "";
 		    	  }else
 		    		  return d.name;
-		    	   
+
 		      });
 
 		  var node = svg.selectAll("circle,text");
@@ -472,7 +472,7 @@ define(['require',
 			    		el.find('i').removeClass('fa-square-o').addClass('fa-check-square-o');
 			    		this.quickMenuCompare = false;
 			    		this.onCompareLink(el);
-			    	}        
+			    	}
 			    }else{
 			    	el.find('i').removeClass('fa-square-o').addClass('fa-check-square-o');
 			    }
@@ -643,7 +643,7 @@ define(['require',
 			  else {
 			    that.$('.scroller-right').hide();
 			  }
-			  
+
 			  if (getLeftPosi()<0) {
 			    that.$('.scroller-left').show();
 			  }
@@ -655,7 +655,7 @@ define(['require',
 
 
 			this.$('.scroller-right').click(function(e) {
-			  
+
 			 /* that.$('.scroller-left').fadeIn('slow');
 			  that.$('.scroller-right').fadeOut('slow');*/
 			  //console.log(widthOfHidden())
@@ -664,23 +664,23 @@ define(['require',
 			  		that.reAdjustTab();
 			 	 });
 			  }
-			 
+
 			});
 
 			this.$('.scroller-left').click(function() {
-			  
+
 				/*that.$('.scroller-right').fadeIn('slow');
 				that.$('.scroller-left').fadeOut('slow');*/
 			  	//console.log(getLeftPosi())
 			  	if(getLeftPosi() < 0){
 			  		that.$('.list').animate({left:"-="+(-40)+"px"},0,function(){
 			  		that.reAdjustTab();
-			  	});	
+			  	});
 			  	}
-			  	
-			});    
+
+			});
 		},
 	});
 	return MainLayoutView;
-	
-});
+
+});

+ 1 - 1
ambari-logsearch/ambari-logsearch-portal/src/main/webapp/scripts/views/dialog/GlobalExclusionCompositeView.js

@@ -50,7 +50,7 @@ define(['require',
                         pageSize: 1000
                     }
                 });
-                this.componentsList.url = Globals.baseURL + "dashboard/components";
+                this.componentsList.url = Globals.baseURL + "service/logs/components";
 
                 this.collection = this.exclusionObj.logMessageCollection;
                 if (this.collection.length == 0) {

+ 10 - 10
ambari-logsearch/ambari-logsearch-portal/src/main/webapp/scripts/views/filter/CreateLogfeederFilterView.js

@@ -52,7 +52,7 @@ define(['require',
                 events["click [data-value]"] = 'onLogLevelHeaderClick';
                 events["click #filterContent input[type='checkbox']"] = 'onAnyCheckboxClick';
                 events["click .overrideRow a"] = 'onEditHost';
-                
+
                 return events;
             },
 
@@ -76,8 +76,8 @@ define(['require',
                     }
                 });
 
-                this.componentsList.url = Globals.baseURL + "dashboard/components";
-                this.hostList.url = Globals.baseURL + "dashboard/hosts";
+                this.componentsList.url = Globals.baseURL + "service/logs/components";
+                this.hostList.url = Globals.baseURL + "service/logs/hosts";
                 this.model = new VUserFilter();
 
                 this.levelCollection = new Backbone.Collection();
@@ -100,7 +100,7 @@ define(['require',
             onRender: function() {
                 var that = this;
                 // this.setupSelect2Fields(this.levelCollection, "type", "type", "levelSelect2", 'Select Level');
-                
+
                 $.when(this.hostList.fetch({ reset: true }), this.componentsList.fetch({ reset: true }), this.model.fetch({})).then(function(c1, c2, m1) {
                     // if (!_.isUndefined(that.model.get('components'))) {
                     //     that.ui.componentSelect2.select2('val', that.model.get('components'));
@@ -116,7 +116,7 @@ define(['require',
 
                     //that.dataLevels = [];
                     //that.dataLevels = _.pluck(that.levelCollection.models, 'attributes');
-                    
+
                     //that.dataList = [];
                     //that.dataList = _.pluck(that.componentsList.models, 'attributes');
                     that.renderComponents();
@@ -148,13 +148,13 @@ define(['require',
             		var components = this.model.get("filter");
             		_.each(components,function(value,key){
             			var obj = components[key];
-            			
-            			if((_.isArray(obj.overrideLevels) && obj.overrideLevels.length) || 
+
+            			if((_.isArray(obj.overrideLevels) && obj.overrideLevels.length) ||
             					(_.isArray(obj.hosts) && obj.hosts.length) || obj.expiryTime){
             				var $el = that.$("input[data-name='"+key+"']").filter("[data-override]");
         					$el.click();
             			}
-            			
+
             			//setting override data
             			if(_.isArray(obj.overrideLevels)){
             				if(obj.overrideLevels.length){
@@ -202,7 +202,7 @@ define(['require',
             	_.each(this.levelCollection.models,function(model){
             		that.setCheckAllValue(model.get("type"));
             	});
-            	
+
             },
             onAnyCheckboxClick : function(e){
             	var $el = $(e.currentTarget);
@@ -363,4 +363,4 @@ define(['require',
             }
         });
 
-});
+});

+ 6 - 6
ambari-logsearch/ambari-logsearch-portal/src/main/webapp/scripts/views/graphs/GraphLayoutView.js

@@ -81,10 +81,10 @@ define(['require',
                 this.firstRender = true;
                 if (!this.viewType || this.viewType == Globals.graphType.HISTOGRAM.value) {
                     this.histogramView = true;
-                    this.collection.url = Globals.baseURL + "dashboard/getHistogramData";
+                    this.collection.url = Globals.baseURL + "service/logs/histogram";
                     this.collection.modelAttrName = "graphData";
                 } else {
-                    this.collection.url = Globals.baseURL + "audit/getAuditLineGraphData";
+                    this.collection.url = Globals.baseURL + "audit/logs/linegraph";
                     this.collection.modelAttrName = "graphData";
                     this.lineView = true;
                 }
@@ -246,7 +246,7 @@ define(['require',
                                                  }
                                 }
                         }
-                        Obj.values = newObj;                      
+                        Obj.values = newObj;
                     }
 
                     if (that.histogramView) {
@@ -282,7 +282,7 @@ define(['require',
                     generate: function() {
                         /* var parentWidth = (that.ui.histoGraph.find('svg').parent().width()),
                              parentHeight = (that.ui.histoGraph.find('svg').parent().height())
-                             width = ((parentWidth === 0) ? (891) : (parentWidth)), // -15 because  parent has 15 padding 
+                             width = ((parentWidth === 0) ? (891) : (parentWidth)), // -15 because  parent has 15 padding
                               height = ((parentHeight === 0) ? (640) : (parentHeight)) // -15 because  parent has 15 padding */
                         if (that.histogramView) {
                             that.chart = nv.models.multiBarChart()
@@ -290,7 +290,7 @@ define(['require',
                                  .height(height)*/
                                 .stacked(true)
                                 .showControls(false);
-                            that.chart.groupSpacing(0.6) // for bar width and aspace 
+                            that.chart.groupSpacing(0.6) // for bar width and aspace
                         } else {
                             that.chart = nv.models.lineChart().options({
                                 transitionDuration: 300,
@@ -484,7 +484,7 @@ define(['require',
                         that.vent.trigger("date:setDate", {
                                 'from': that.dateUtil.getMomentObject(that.brushValue[0]),
                                 'to': that.dateUtil.getMomentObject(that.brushValue[1])
-                          });          
+                          });
                      }
                     /*}*/
 

+ 1 - 1
ambari-logsearch/ambari-logsearch-portal/src/main/webapp/scripts/views/graphs/GridGraphLayoutView.js

@@ -72,7 +72,7 @@ define(['require',
 
                         }
                     });
-                	this.collection.url = Globals.baseURL + "audit/getAnyGraphData";
+                	this.collection.url = Globals.baseURL + "audit/logs/anygraph";
                     this.collection.modelAttrName = "graphData";
                 }
                 this.dateUtil = Utils.dateUtil;

+ 1 - 1
ambari-logsearch/ambari-logsearch-portal/src/main/webapp/scripts/views/tabs/ComparisonView.js

@@ -65,7 +65,7 @@ define(['require',
                     }
                 });
                 this.dateUtil = Utils.dateUtil;
-                this.collection.url = Globals.baseURL + "dashboard/solr/logs_search";
+                this.collection.url = Globals.baseURL + "service/logs";
                 this.bindEvents();
                 this.dateRangeLabel = "Last 1 Hour"
             },

+ 18 - 18
ambari-logsearch/ambari-logsearch-portal/src/main/webapp/scripts/views/tabs/HierarchyTabLayoutView.js

@@ -79,7 +79,7 @@ define(['require',
 		initialize: function(options) {
 			_.extend(this, _.pick(options,'globalVent'));
 //			this.logLevelList = new VLogLevelList();
-//			this.logLevelList.url = Globals.baseURL + "dashboard/getLogLevelCounts";
+//			this.logLevelList.url = Globals.baseURL + "service/logs/levels/counts/namevalues";
 //			this.logLevelList.modelAttrName = "vNameValues";
 			this.columnCollection = new VLogList([],{
 				state: {
@@ -93,15 +93,15 @@ define(['require',
                     pageSize: 99999
                 }
 			});
-			this.componentsList.url = Globals.baseURL + "dashboard/components";
+			this.componentsList.url = Globals.baseURL + "service/logs/components";
 			this.vent = new Backbone.Wreqr.EventAggregator();
-			
+
 			this.defaultParams = ViewUtils.getDefaultParamsForHierarchy();
 			this.bindEvents();
 		},
 		applyParamsDate:function(date){
 			if (date) {
-				var dateString  = date.split(','); 
+				var dateString  = date.split(',');
 				 if(dateString.length){
 				 	var checkDate = Utils.dateUtil.getMomentUTC(dateString[0]);
 				 	if(checkDate.isValid()){
@@ -112,7 +112,7 @@ define(['require',
 				 		}
 				 		return  checkDate.toJSON();
 				 	}
-				 }	
+				 }
 			}
 		},
 		bindEvents : function(){
@@ -144,7 +144,7 @@ define(['require',
 			this.listenTo(this.vent,"tab:refresh",function(params){
 				this.reRenderComponents(params);
 			},this);
-			
+
 			this.listenTo(this.globalVent,"reinitialize:serviceLogs",function(options){
             	this.vent.trigger("reinitialize:filter:tree reinitialize:filter:include:exclude reinitialize:filter:bubbleTable"+
             			" reinitialize:filter:mustNot reinitialize:filter:mustBe reinitialize:filter:level reinitialize:filter:logtime",options);
@@ -163,7 +163,7 @@ define(['require',
 			this.componentsList.fetch({reset:true});
 		},
 		onShow:function(){
-			
+
 			//this.REventHistory.currentView.genrateTimeline();
 
 		},
@@ -267,7 +267,7 @@ define(['require',
 					params : that.defaultParams,
 				}));
             });
-		
+
 
 		},
 		renderVSSearch : function(){
@@ -294,7 +294,7 @@ define(['require',
 								query : query
 							};
 						}
-					
+
 				}));
             });
 		},
@@ -309,7 +309,7 @@ define(['require',
 					placeholder : "Include Search",
 					vent : that.vent,
 					globalVent:that.globalVent,
-					customOptions : columns,  
+					customOptions : columns,
 					eventName : Globals.eventName.serviceLogsIncludeColumns,
 					myFormatData : function(query,searchCollection){
 						var obj=[];
@@ -431,7 +431,7 @@ define(['require',
 				this.ui.excludeComponents.select2('val',values.mustNot.split(","));
 			else
 				this.ui.excludeComponents.select2('val',[]);
-				
+
 		},
 		reRenderComponents : function(params){
 			var iComponents = this.ui.includeComponents.val(),eComponents = this.ui.excludeComponents.val(),that=this;
@@ -455,20 +455,20 @@ define(['require',
 			} else{
 				this.ui.advanceSearch.hide();
 				this.ui.applySearch.hide();
-				this.ui.basicSearch.show();	
+				this.ui.basicSearch.show();
 				obj = this.getIncludeExcludeColValues();
 				obj.advanceSearch = null;
 			}
-			
+
 			this.vent.trigger('main:search',obj);
-			
+
 		},
 		applySearchBtn : function(){
 			var obj = {}
 			obj.advanceSearch = this.RAdvanceSearch.currentView.ui.searchArea.val();
 
 				this.vent.trigger('main:search',obj);
-			
+
 		},
 		getIncludeExcludeColValues : function(){
 			return _.extend(this.RVisualSearchIncCol.currentView.formatData(this.RVisualSearchIncCol.currentView.visualSearch.searchBox.value(),this.RVisualSearchIncCol.currentView.visualSearch.searchQuery),
@@ -483,6 +483,6 @@ define(['require',
 			}
 		}
 	});
-	
-	
-});
+
+
+});

+ 6 - 6
ambari-logsearch/ambari-logsearch-portal/src/main/webapp/scripts/views/tabs/LogFileView.js

@@ -99,7 +99,7 @@ define(['require',
                         pageSize: 25
                     }
                 });
-                this.logFileCollection.url = Globals.baseURL + "dashboard/solr/logs_search";
+                this.logFileCollection.url = Globals.baseURL + "service/logs";
                 this.vent = new Backbone.Wreqr.EventAggregator();
                 this.bindEvents();
                 this.commonTableOptions = {
@@ -203,7 +203,7 @@ define(['require',
                 //				{startIndex : this.logFileCollection.state.currentPage * this.logFileCollection.state.pageSize},obj),
                 //				'component','from','to','host','level','unit','startIndex','pageSize','format','utcOffset'));
                 var params = $.param(_.extend({}, this.logFileCollection.queryParams, obj));
-                var url = "api/v1/dashboard/exportToTextFile?" + params;
+                var url = "api/v1/service/logs/export?" + params;
                 window.open(url);
                 this.onDialogClosed();
             },
@@ -256,7 +256,7 @@ define(['require',
                             var top = element.offset().top;
                             element.addClass('highlightLog');
                             $("html, body").animate({ scrollTop: (top - 200) }, 1);
-                            /*setTimeout(function(){ 
+                            /*setTimeout(function(){
                             	element.addClass('fadeOutColor')
                             	setTimeout(function(){element.removeClass('fadeOutColor highlightLog');},4000)
                             },6000);*/
@@ -599,7 +599,7 @@ define(['require',
             },
             initializeContextMenu: function() {
                 var that = this;
-                
+
                 $('body').on("mouseup.contextMenuLogFile", function(e) {
                     var selection;
                     if (window.getSelection) {
@@ -657,7 +657,7 @@ define(['require',
                     }else if(type === "IA" || type === "EA"){
     					this.vent.trigger("toggle:facet",{viewName:((type === "IA") ? "include" : "exclude") +"ServiceColumns",
     						key:Globals.serviceLogsColumns["log_message"],value:"*"+this.selectionText+"*"});
-    				} 
+    				}
                     else {
                         //this.vent.trigger("add:include:exclude",{type:type,value:this.selectionText});
                         this.vent.trigger("toggle:facet", { viewName: ((type === "I") ? "include" : "exclude") + "ServiceColumns", key: Globals.serviceLogsColumns["log_message"], value: this.selectionText });
@@ -892,4 +892,4 @@ define(['require',
                 $('body').unbind("mouseup.contextMenuLogFile");
             }
         });
-});
+});

+ 1 - 1
ambari-logsearch/ambari-logsearch-portal/src/main/webapp/scripts/views/tabs/TreeView.js

@@ -80,7 +80,7 @@ define(['require',
 		initialize: function(options) {
 			_.extend(this, _.pick(options,'vent','globalVent','params'));
 //			this.collection = new VLogLevel();
-//			this.collection.url = Globals.baseURL+"dashboard/components_count";
+//			this.collection.url = Globals.baseURL+"service/logs/components/count";
 			this.treeModel = new VCommonModel();
 			this.searchParams = (this.params)? this.params :{};
 			this.bindEvents();

+ 3 - 3
ambari-logsearch/ambari-logsearch-portal/src/main/webapp/scripts/views/troubleshoot/TroubleShootLayoutView.js

@@ -82,7 +82,7 @@ define(['backbone',
 
                     }
                 });
-                this.serviceLogsCollection.url = Globals.baseURL + "dashboard/getAnyGraphData";
+                this.serviceLogsCollection.url = Globals.baseURL + "service/logs/anygraph";
                 this.serviceLogsCollection.modelAttrName = "graphData";
                 
             	this.topUsers = new VNameValueList([],{
@@ -91,7 +91,7 @@ define(['backbone',
                         pageSize: 9999
                     }
     			});
-    			this.topUsers.url = Globals.baseURL + "audit/getTopAuditUsers";
+    			this.topUsers.url = Globals.baseURL + "audit/logs/users";
     			this.topUsers.modelAttrName = "graphData";
     			
     			this.serviceLoadCollection = new VLogList([], {
@@ -101,7 +101,7 @@ define(['backbone',
 
                     }
                 });
-            	this.serviceLoadCollection.url = Globals.baseURL + "audit/getServiceLoad";
+            	this.serviceLoadCollection.url = Globals.baseURL + "audit/logs/serviceload";
                 this.serviceLoadCollection.modelAttrName = "graphData";
             },
             bindEvents : function(){

+ 6 - 6
ambari-logsearch/ambari-logsearch-portal/src/main/webapp/templates/graphs/backup.js

@@ -78,10 +78,10 @@ define(['require',
                 this.firstRender = true;
                 if (!this.viewType || this.viewType == Globals.graphType.HISTOGRAM.value) {
                     this.histogramView = true;
-                    this.collection.url = Globals.baseURL + "dashboard/getHistogramData";
+                    this.collection.url = Globals.baseURL + "service/logs/histogram";
                     this.collection.modelAttrName = "graphData";
                 } else {
-                    this.collection.url = Globals.baseURL + "audit/getAuditLineGraphData";
+                    this.collection.url = Globals.baseURL + "audit/logs/linegraph";
                     this.collection.modelAttrName = "graphData";
                     this.lineView = true;
                 }
@@ -323,7 +323,7 @@ define(['require',
                     generate: function() {
                         /* var parentWidth = (that.ui.histoGraph.find('svg').parent().width()),
                              parentHeight = (that.ui.histoGraph.find('svg').parent().height())
-                             width = ((parentWidth === 0) ? (891) : (parentWidth)), // -15 because  parent has 15 padding 
+                             width = ((parentWidth === 0) ? (891) : (parentWidth)), // -15 because  parent has 15 padding
                               height = ((parentHeight === 0) ? (640) : (parentHeight)) // -15 because  parent has 15 padding */
                         if (that.histogramView) {
                             that.chart = nv.models.multiBarChart()
@@ -331,7 +331,7 @@ define(['require',
                                  .height(height)*/
                                 .stacked(true)
                                 .showControls(false);
-                            that.chart.groupSpacing(0.6) // for bar width and aspace 
+                            that.chart.groupSpacing(0.6) // for bar width and aspace
                         } else {
                             that.chart = nv.models.lineChart().options({
                                 transitionDuration: 300,
@@ -444,8 +444,8 @@ define(['require',
                         that.$(".box").resize(function() {
                             //                             var parentWidth = (that.ui.histoGraph.find('svg').parent().width()),
                             //                                 parentHeight = (that.ui.histoGraph.find('svg').parent().height()),
-                            //                                 width = ((parentWidth === 0) ? (891) : (parentWidth)), // -15 because  parent has 15 padding 
-                            //                                 height = ((parentHeight === 0) ? (240) : (parentHeight)) // -15 because  parent has 15 padding 
+                            //                                 width = ((parentWidth === 0) ? (891) : (parentWidth)), // -15 because  parent has 15 padding
+                            //                                 height = ((parentHeight === 0) ? (240) : (parentHeight)) // -15 because  parent has 15 padding
                             //                             graph.width(width).height(height);
                             //                          if (that.parentView) {
                             //                                  var elem = that.parentView.$el.find('[data-id="rHistogramGraph"] svg');

+ 2 - 2
ambari-server/src/main/java/org/apache/ambari/server/controller/logging/LoggingRequestHelperImpl.java

@@ -62,9 +62,9 @@ public class LoggingRequestHelperImpl implements LoggingRequestHelper {
 
   private static final String LOGSEARCH_ADMIN_PASSWORD_PROPERTY_NAME = "logsearch_admin_password";
 
-  private static final String LOGSEARCH_QUERY_PATH = "/service/dashboard/solr/logs_search";
+  private static final String LOGSEARCH_QUERY_PATH = "/api/v1/service/logs";
 
-  private static final String LOGSEARCH_GET_LOG_LEVELS_PATH = "/service/dashboard/getLogLevelCounts";
+  private static final String LOGSEARCH_GET_LOG_LEVELS_PATH = "/api/v1/service/logs/levels/counts/namevalues";
 
   private static final String LOGSEARCH_ADMIN_CREDENTIAL_NAME = "logsearch.admin.credential";