You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by ol...@apache.org on 2016/09/07 23:37:59 UTC
[09/50] [abbrv] ambari git commit: AMBARI-18214. Restify Log Search
endpoints (oleewere)
http://git-wip-us.apache.org/repos/asf/ambari/blob/f8cf23e4/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/rest/DashboardREST.java
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/rest/DashboardREST.java b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/rest/DashboardREST.java
deleted file mode 100644
index 0144edc..0000000
--- a/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/rest/DashboardREST.java
+++ /dev/null
@@ -1,575 +0,0 @@
-/*
- * 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. The ASF licenses this file
- * 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
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.ambari.logsearch.rest;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.ws.rs.GET;
-import javax.ws.rs.Path;
-import javax.ws.rs.Produces;
-import javax.ws.rs.core.Context;
-import javax.ws.rs.core.Response;
-
-import io.swagger.annotations.Api;
-import io.swagger.annotations.ApiImplicitParam;
-import io.swagger.annotations.ApiImplicitParams;
-import io.swagger.annotations.ApiOperation;
-import org.apache.ambari.logsearch.common.LogSearchConstants;
-import org.apache.ambari.logsearch.common.SearchCriteria;
-import org.apache.ambari.logsearch.manager.LogsMgr;
-import org.apache.ambari.logsearch.util.RESTErrorUtil;
-import org.apache.ambari.logsearch.view.VCountList;
-import org.apache.ambari.logsearch.view.VNameValueList;
-import org.apache.ambari.logsearch.view.VNodeList;
-import org.apache.commons.lang.StringEscapeUtils;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.context.annotation.Scope;
-import org.springframework.stereotype.Component;
-
-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")
-@Component
-@Scope("request")
-public class DashboardREST {
-
- @Autowired
- LogsMgr logMgr;
-
- @Autowired
- RESTErrorUtil restErrorUtil;
-
- @GET
- @Path("/solr/logs_search")
- @Produces({"application/json"})
- @ApiOperation(SEARCH_LOGS_OD)
- @ApiImplicitParams(value = {
- @ApiImplicitParam(value = HOST_D, name = "host", dataType = "string", paramType = "query"),
- @ApiImplicitParam(value = COMPONENT_D, name = "component", dataType = "string", paramType = "query"),
- @ApiImplicitParam(value = FIND_D, name = "find", dataType = "string", paramType = "query"),
- @ApiImplicitParam(value = SOURCE_LOG_ID_D, name = "sourceLogId", dataType = "string", paramType = "query"),
- @ApiImplicitParam(value = KEYWORD_TYPE_D, name = "keywordType", dataType = "string", paramType = "query"),
- @ApiImplicitParam(value = TOKEN_D, name = "token", dataType = "string", paramType = "query"),
- @ApiImplicitParam(value = IS_LAST_PAGE_D, name = "isLastPage", dataType = "boolean", paramType = "query"),
- @ApiImplicitParam(value = ADVANCED_SEARCH_D, name = "advancedSearch", dataType = "string", paramType = "query"),
- @ApiImplicitParam(value = QUERY_D,name = "q", dataType = "string", paramType = "query"),
- @ApiImplicitParam(value = LEVEL_D, name = "level", dataType = "string", paramType = "query"),
- @ApiImplicitParam(value = TREE_PARAMS_D, name = "treeParams", 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 = G_MUST_NOT_D, name = "gMustNot", 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 = HOST_NAME_D, name = "host_name", dataType = "string", paramType = "query"),
- @ApiImplicitParam(value = COMPONENT_NAME_D, name = "component_name", dataType = "string", paramType = "query"),
- @ApiImplicitParam(value = FILE_NAME_D, name = "file_name", 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 = START_TIME_D, name = "start_time", dataType = "string", paramType = "query"),
- @ApiImplicitParam(value = END_TIME_D, name = "end_time", dataType = "string", paramType = "query")
- })
- public String searchSolrData(@Context HttpServletRequest request) {
- SearchCriteria searchCriteria = new SearchCriteria(request);
- searchCriteria.addRequiredServiceLogsParams(request);
- searchCriteria.addParam("hostLogFile", request.getParameter("host"));
- searchCriteria.addParam("compLogFile",
- request.getParameter("component"));
- searchCriteria.addParam("keyword", StringEscapeUtils.unescapeXml(request.getParameter("find")));
- searchCriteria.addParam("sourceLogId", request.getParameter("sourceLogId"));
- searchCriteria.addParam("keywordType",
- request.getParameter("keywordType"));
- searchCriteria.addParam("token",
- request.getParameter("token"));
- searchCriteria.addParam("isLastPage",request.getParameter("isLastPage"));
- return logMgr.searchLogs(searchCriteria);
- }
-
- @GET
- @Path("/hosts")
- @Produces({"application/json"})
- @ApiOperation(GET_HOSTS_OD)
- @ApiImplicitParams(value = {
- @ApiImplicitParam(value = QUERY_D, name = "q", dataType = "string", paramType = "query")
- })
- public String getHosts(@Context HttpServletRequest request) {
- SearchCriteria searchCriteria = new SearchCriteria(request);
- searchCriteria.addParam("q", request.getParameter("q"));
- return logMgr.getHosts(searchCriteria);
- }
-
- @GET
- @Path("/components")
- @Produces({"application/json"})
- @ApiOperation(GET_COMPONENTS_OD)
- @ApiImplicitParams(value = {
- @ApiImplicitParam(value = QUERY_D, name = "q", dataType = "string", paramType = "query")
- })
- public String getComponents(@Context HttpServletRequest request) {
- SearchCriteria searchCriteria = new SearchCriteria(request);
- searchCriteria.addParam("q", request.getParameter("q"));
- return logMgr.getComponents(searchCriteria);
- }
-
- @GET
- @Path("/aggregatedData")
- @Produces({"application/json"})
- @ApiOperation(GET_AGGREGATED_INFO_OD)
- @ApiImplicitParams(value = {
- @ApiImplicitParam(value = ADVANCED_SEARCH_D, name = "advancedSearch", dataType = "string", paramType = "query"),
- @ApiImplicitParam(value = QUERY_D,name = "q", dataType = "string", paramType = "query"),
- @ApiImplicitParam(value = LEVEL_D, name = "level", dataType = "string", paramType = "query"),
- @ApiImplicitParam(value = TREE_PARAMS_D, name = "treeParams", 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 = G_MUST_NOT_D, name = "gMustNot", 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 = HOST_NAME_D, name = "host_name", dataType = "string", paramType = "query"),
- @ApiImplicitParam(value = COMPONENT_NAME_D, name = "component_name", dataType = "string", paramType = "query"),
- @ApiImplicitParam(value = FILE_NAME_D, name = "file_name", 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 = START_TIME_D, name = "start_time", dataType = "string", paramType = "query"),
- @ApiImplicitParam(value = END_TIME_D, name = "end_time", dataType = "string", paramType = "query")
- })
- public String getAggregatedInfo(@Context HttpServletRequest request) {
- SearchCriteria searchCriteria = new SearchCriteria();
- searchCriteria.addRequiredServiceLogsParams(request);
- return logMgr.getAggregatedInfo(searchCriteria);
- }
-
- @GET
- @Path("/levels_count")
- @Produces({"application/json"})
- @ApiOperation(GET_LOG_LEVELS_COUNT_OD)
- @ApiImplicitParams(value = {
- @ApiImplicitParam(value = QUERY_D, name = "q", dataType = "string", paramType = "query"),
- @ApiImplicitParam(value = START_TIME_D, name = "start_time", dataType = "string", paramType = "query"),
- @ApiImplicitParam(value = END_TIME_D, name = "end_time", dataType = "string", paramType = "query")
- })
- public VCountList getLogLevelsCount(@Context HttpServletRequest request) {
- SearchCriteria searchCriteria = new SearchCriteria();
- searchCriteria.addParam("q", request.getParameter("q"));
- searchCriteria
- .addParam("startDate", request.getParameter("start_time"));
- searchCriteria.addParam("endDate", request.getParameter("end_time"));
- return logMgr.getLogLevelCount(searchCriteria);
- }
-
- @GET
- @Path("/components_count")
- @Produces({"application/json"})
- @ApiOperation(GET_COMPONENTS_COUNT_OD)
- @ApiImplicitParams(value = {
- @ApiImplicitParam(value = QUERY_D, name = "q", dataType = "string", paramType = "query"),
- @ApiImplicitParam(value = START_TIME_D, name = "start_time", dataType = "string", paramType = "query"),
- @ApiImplicitParam(value = END_TIME_D, name = "end_time", dataType = "string", paramType = "query")
- })
- public VCountList getComponentsCount(@Context HttpServletRequest request) {
- SearchCriteria searchCriteria = new SearchCriteria();
- searchCriteria.addParam("q", request.getParameter("q"));
- searchCriteria
- .addParam("startDate", request.getParameter("start_time"));
- searchCriteria.addParam("endDate", request.getParameter("end_time"));
- return logMgr.getComponentsCount(searchCriteria);
- }
-
- @GET
- @Path("/hosts_count")
- @Produces({"application/json"})
- @ApiOperation(GET_HOSTS_COUNT_OD)
- @ApiImplicitParams(value = {
- @ApiImplicitParam(value = QUERY_D, name = "q", dataType = "string", paramType = "query"),
- @ApiImplicitParam(value = START_TIME_D, name = "start_time", dataType = "string", paramType = "query"),
- @ApiImplicitParam(value = END_TIME_D, name = "end_time", 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")
- })
- public VCountList getHostsCount(@Context HttpServletRequest request) {
- SearchCriteria searchCriteria = new SearchCriteria();
- searchCriteria.addParam("q", request.getParameter("q"));
- searchCriteria
- .addParam("startDate", request.getParameter("start_time"));
- searchCriteria.addParam("endDate", request.getParameter("end_time"));
- searchCriteria.addParam("excludeQuery", StringEscapeUtils
- .unescapeXml(request.getParameter("excludeQuery")));
- searchCriteria.addParam("includeQuery", StringEscapeUtils
- .unescapeXml(request.getParameter("includeQuery")));
- return logMgr.getHostsCount(searchCriteria);
- }
-
- @GET
- @Path("/getTreeExtension")
- @Produces({"application/json"})
- @ApiOperation(GET_TREE_EXTENSION_OD)
- @ApiImplicitParams(value = {
- @ApiImplicitParam(value = HOST_D, name = "host", dataType = "string", paramType = "query"),
- @ApiImplicitParam(value = COMPONENT_D, name = "component", dataType = "string", paramType = "query"),
- @ApiImplicitParam(value = ADVANCED_SEARCH_D, name = "advancedSearch", dataType = "string", paramType = "query"),
- @ApiImplicitParam(value = QUERY_D,name = "q", dataType = "string", paramType = "query"),
- @ApiImplicitParam(value = LEVEL_D, name = "level", dataType = "string", paramType = "query"),
- @ApiImplicitParam(value = TREE_PARAMS_D, name = "treeParams", 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 = G_MUST_NOT_D, name = "gMustNot", 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 = HOST_NAME_D, name = "host_name", dataType = "string", paramType = "query"),
- @ApiImplicitParam(value = COMPONENT_NAME_D, name = "component_name", dataType = "string", paramType = "query"),
- @ApiImplicitParam(value = FILE_NAME_D, name = "file_name", 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 = START_TIME_D, name = "start_time", dataType = "string", paramType = "query"),
- @ApiImplicitParam(value = END_TIME_D, name = "end_time", dataType = "string", paramType = "query")
- })
- public VNodeList getTreeExtension(@Context HttpServletRequest request) {
- SearchCriteria searchCriteria = new SearchCriteria(request);
- searchCriteria.addRequiredServiceLogsParams(request);
- searchCriteria.addParam("hostLogFile", request.getParameter("host"));
- searchCriteria.addParam("compLogFile",
- request.getParameter("component"));
- searchCriteria.addParam("hostName", request.getParameter("hostName"));
- return logMgr.getTreeExtension(searchCriteria);
- }
-
- @GET
- @Path("/getLogLevelCounts")
- @Produces({"application/json"})
- @ApiOperation(GET_LOG_LEVELS_COUNT_OD)
- @ApiImplicitParams(value = {
- @ApiImplicitParam(value = HOST_D, name = "host", dataType = "string", paramType = "query"),
- @ApiImplicitParam(value = COMPONENT_D, name = "component", dataType = "string", paramType = "query"),
- @ApiImplicitParam(value = ADVANCED_SEARCH_D, name = "advancedSearch", dataType = "string", paramType = "query"),
- @ApiImplicitParam(value = QUERY_D,name = "q", dataType = "string", paramType = "query"),
- @ApiImplicitParam(value = LEVEL_D, name = "level", dataType = "string", paramType = "query"),
- @ApiImplicitParam(value = TREE_PARAMS_D, name = "treeParams", 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 = G_MUST_NOT_D, name = "gMustNot", 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 = HOST_NAME_D, name = "host_name", dataType = "string", paramType = "query"),
- @ApiImplicitParam(value = COMPONENT_NAME_D, name = "component_name", dataType = "string", paramType = "query"),
- @ApiImplicitParam(value = FILE_NAME_D, name = "file_name", 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 = START_TIME_D, name = "start_time", dataType = "string", paramType = "query"),
- @ApiImplicitParam(value = END_TIME_D, name = "end_time", dataType = "string", paramType = "query")
- })
- public VNameValueList getLogsLevelCount(@Context HttpServletRequest request) {
- SearchCriteria searchCriteria = new SearchCriteria(request);
- searchCriteria.addRequiredServiceLogsParams(request);
- searchCriteria.addParam("hostLogFile", request.getParameter("host"));
- searchCriteria.addParam("compLogFile",
- request.getParameter("component"));
- return logMgr.getLogsLevelCount(searchCriteria);
- }
-
- @GET
- @Path("/getHistogramData")
- @Produces({"application/json"})
- @ApiOperation(GET_HISTOGRAM_DATA_OD)
- @ApiImplicitParams(value = {
- @ApiImplicitParam(value = HOST_D, name = "host", dataType = "string", paramType = "query"),
- @ApiImplicitParam(value = COMPONENT_D, name = "component", dataType = "string", paramType = "query"),
- @ApiImplicitParam(value = UNIT_D, name = "unit", dataType = "string", paramType = "query"),
- @ApiImplicitParam(value = ADVANCED_SEARCH_D, name = "advancedSearch", dataType = "string", paramType = "query"),
- @ApiImplicitParam(value = QUERY_D,name = "q", dataType = "string", paramType = "query"),
- @ApiImplicitParam(value = LEVEL_D, name = "level", dataType = "string", paramType = "query"),
- @ApiImplicitParam(value = TREE_PARAMS_D, name = "treeParams", 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 = G_MUST_NOT_D, name = "gMustNot", 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 = HOST_NAME_D, name = "host_name", dataType = "string", paramType = "query"),
- @ApiImplicitParam(value = COMPONENT_NAME_D, name = "component_name", dataType = "string", paramType = "query"),
- @ApiImplicitParam(value = FILE_NAME_D, name = "file_name", 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 = START_TIME_D, name = "start_time", dataType = "string", paramType = "query"),
- @ApiImplicitParam(value = END_TIME_D, name = "end_time", dataType = "string", paramType = "query")
- })
- public String getHistogramData(@Context HttpServletRequest request) {
- SearchCriteria searchCriteria = new SearchCriteria(request);
- searchCriteria.addRequiredServiceLogsParams(request);
- searchCriteria.addParam("hostLogFile", request.getParameter("host"));
- searchCriteria.addParam("compLogFile",
- request.getParameter("component"));
- searchCriteria.addParam("unit", request.getParameter("unit"));
- return logMgr.getHistogramData(searchCriteria);
- }
-
- @GET
- @Path("/cancelFindRequest")
- @Produces({"application/json"})
- @ApiOperation(CANCEL_FIND_REQUEST_OD)
- public String cancelFindRequest(@Context HttpServletRequest request) {
- return logMgr.cancelFindRequestByDate(request);
- }
-
- @GET
- @Path("/exportToTextFile")
- @Produces({"application/json"})
- @ApiOperation(EXPORT_TO_TEXT_FILE_OD)
- @ApiImplicitParams(value = {
- @ApiImplicitParam(value = HOST_D, name = "host", dataType = "string", paramType = "query"),
- @ApiImplicitParam(value = COMPONENT_D, name = "component", dataType = "string", paramType = "query"),
- @ApiImplicitParam(value = FORMAT_D, name = "format", dataType = "string", paramType = "query"),
- @ApiImplicitParam(value = UTC_OFFSET_D, name = "utcOffset", dataType = "string", paramType = "query"),
- @ApiImplicitParam(value = ADVANCED_SEARCH_D, name = "advancedSearch", dataType = "string", paramType = "query"),
- @ApiImplicitParam(value = QUERY_D,name = "q", dataType = "string", paramType = "query"),
- @ApiImplicitParam(value = LEVEL_D, name = "level", dataType = "string", paramType = "query"),
- @ApiImplicitParam(value = TREE_PARAMS_D, name = "treeParams", 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 = G_MUST_NOT_D, name = "gMustNot", 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 = HOST_NAME_D, name = "host_name", dataType = "string", paramType = "query"),
- @ApiImplicitParam(value = COMPONENT_NAME_D, name = "component_name", dataType = "string", paramType = "query"),
- @ApiImplicitParam(value = FILE_NAME_D, name = "file_name", 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 = START_TIME_D, name = "start_time", dataType = "string", paramType = "query"),
- @ApiImplicitParam(value = END_TIME_D, name = "end_time", dataType = "string", paramType = "query")
- })
- public Response exportToTextFile(@Context HttpServletRequest request) {
-
- SearchCriteria searchCriteria = new SearchCriteria(request);
- searchCriteria.addRequiredServiceLogsParams(request);
- searchCriteria.addParam("hostLogFile", request.getParameter("host"));
- searchCriteria.addParam("compLogFile",
- request.getParameter("component"));
- searchCriteria.addParam("format", request.getParameter("format"));
- searchCriteria.addParam("utcOffset", request.getParameter("utcOffset"));
- return logMgr.exportToTextFile(searchCriteria);
-
- }
-
- @GET
- @Path("/getHostListByComponent")
- @Produces({"application/json"})
- @ApiOperation(GET_HOST_LIST_BY_COMPONENT_OD)
- @ApiImplicitParams(value = {
- @ApiImplicitParam(value = HOST_D, name = "host", dataType = "string", paramType = "query"),
- @ApiImplicitParam(value = COMPONENT_D, name = "component", dataType = "string", paramType = "query"),
- @ApiImplicitParam(value = ADVANCED_SEARCH_D, name = "advancedSearch", dataType = "string", paramType = "query"),
- @ApiImplicitParam(value = QUERY_D,name = "q", dataType = "string", paramType = "query"),
- @ApiImplicitParam(value = LEVEL_D, name = "level", dataType = "string", paramType = "query"),
- @ApiImplicitParam(value = TREE_PARAMS_D, name = "treeParams", 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 = G_MUST_NOT_D, name = "gMustNot", 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 = HOST_NAME_D, name = "host_name", dataType = "string", paramType = "query"),
- @ApiImplicitParam(value = COMPONENT_NAME_D, name = "component_name", dataType = "string", paramType = "query"),
- @ApiImplicitParam(value = FILE_NAME_D, name = "file_name", 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 = START_TIME_D, name = "start_time", dataType = "string", paramType = "query"),
- @ApiImplicitParam(value = END_TIME_D, name = "end_time", dataType = "string", paramType = "query")
- })
- public String getHostListByComponent(@Context HttpServletRequest request) {
- SearchCriteria searchCriteria = new SearchCriteria(request);
- searchCriteria.addRequiredServiceLogsParams(request);
- searchCriteria.addParam("hostLogFile", request.getParameter("host"));
- searchCriteria.addParam("compLogFile",
- request.getParameter("component"));
- searchCriteria.addParam("componentName",
- request.getParameter("componentName"));
- return logMgr.getHostListByComponent(searchCriteria);
- }
-
- @GET
- @Path("/getComponentListWithLevelCounts")
- @Produces({"application/json"})
- @ApiOperation(GET_COMPONENT_LIST_WITH_LEVEL_COUNT_OD)
- @ApiImplicitParams(value = {
- @ApiImplicitParam(value = HOST_D, name = "host", dataType = "string", paramType = "query"),
- @ApiImplicitParam(value = COMPONENT_D, name = "component", dataType = "string", paramType = "query"),
- @ApiImplicitParam(value = ADVANCED_SEARCH_D, name = "advancedSearch", dataType = "string", paramType = "query"),
- @ApiImplicitParam(value = QUERY_D,name = "q", dataType = "string", paramType = "query"),
- @ApiImplicitParam(value = LEVEL_D, name = "level", dataType = "string", paramType = "query"),
- @ApiImplicitParam(value = TREE_PARAMS_D, name = "treeParams", 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 = G_MUST_NOT_D, name = "gMustNot", 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 = HOST_NAME_D, name = "host_name", dataType = "string", paramType = "query"),
- @ApiImplicitParam(value = COMPONENT_NAME_D, name = "component_name", dataType = "string", paramType = "query"),
- @ApiImplicitParam(value = FILE_NAME_D, name = "file_name", 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 = START_TIME_D, name = "start_time", dataType = "string", paramType = "query"),
- @ApiImplicitParam(value = END_TIME_D, name = "end_time", dataType = "string", paramType = "query")
- })
- public String getComponentListWithLevelCounts(
- @Context HttpServletRequest request) {
- SearchCriteria searchCriteria = new SearchCriteria(request);
- searchCriteria.addRequiredServiceLogsParams(request);
- searchCriteria.addParam("hostLogFile", request.getParameter("host"));
- searchCriteria.addParam("compLogFile",
- request.getParameter("component"));
- return logMgr.getComponentListWithLevelCounts(searchCriteria);
- }
-
- @GET
- @Path("/solr/getBundleIdBoundaryDates")
- @Produces({"application/json"})
- @ApiOperation(GET_EXTREME_DATES_FOR_BUNDLE_ID_OD)
- public String getExtremeDatesForBundelId(@Context HttpServletRequest request) {
-
- SearchCriteria searchCriteria = new SearchCriteria(request);
- searchCriteria.addParam(LogSearchConstants.BUNDLE_ID,
- request.getParameter("bundle_id"));
-
- return logMgr.getExtremeDatesForBundelId(searchCriteria);
-
- }
-
- @GET
- @Path("/getServiceLogsFieldsName")
- @Produces({"application/json"})
- @ApiOperation(GET_SERVICE_LOGS_FIELD_NAME_OD)
- public String getServiceLogsFieldsName() {
- return logMgr.getServiceLogsFieldsName();
- }
-
- @GET
- @Path("/getServiceLogsSchemaFieldsName")
- @Produces({"application/json"})
- @ApiOperation(GET_SERVICE_LOGS_SCHEMA_FIELD_NAME_OD)
- public String getServiceLogsSchemaFieldsName() {
- return logMgr.getServiceLogsSchemaFieldsName();
- }
-
- @GET
- @Path("/getAnyGraphData")
- @Produces({"application/json"})
- @ApiOperation(GET_ANY_GRAPH_DATA_OD)
- @ApiImplicitParams(value = {
- @ApiImplicitParam(value = X_AXIS_D, name = "xAxis", dataType = "string", paramType = "query"),
- @ApiImplicitParam(value = Y_AXIS_D, name = "yAxis", dataType = "string", paramType = "query"),
- @ApiImplicitParam(value = STACK_BY_D, name = "stackBy", 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 = UNIT_D, name = "unit", dataType = "string", paramType = "query"),
- @ApiImplicitParam(value = ADVANCED_SEARCH_D, name = "advancedSearch", dataType = "string", paramType = "query"),
- @ApiImplicitParam(value = QUERY_D,name = "q", dataType = "string", paramType = "query"),
- @ApiImplicitParam(value = LEVEL_D, name = "level", dataType = "string", paramType = "query"),
- @ApiImplicitParam(value = TREE_PARAMS_D, name = "treeParams", 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 = G_MUST_NOT_D, name = "gMustNot", 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 = HOST_NAME_D, name = "host_name", dataType = "string", paramType = "query"),
- @ApiImplicitParam(value = COMPONENT_NAME_D, name = "component_name", dataType = "string", paramType = "query"),
- @ApiImplicitParam(value = FILE_NAME_D, name = "file_name", 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 = START_TIME_D, name = "start_time", dataType = "string", paramType = "query"),
- @ApiImplicitParam(value = END_TIME_D, name = "end_time", dataType = "string", paramType = "query")
- })
- public String getAnyGraphData(@Context HttpServletRequest request) {
- SearchCriteria searchCriteria = new SearchCriteria(request);
- searchCriteria.addRequiredServiceLogsParams(request);
- searchCriteria.addParam("xAxis", request.getParameter("xAxis"));
- searchCriteria.addParam("yAxis", request.getParameter("yAxis"));
- searchCriteria.addParam("stackBy", request.getParameter("stackBy"));
- searchCriteria.addParam("from", request.getParameter("from"));
- searchCriteria.addParam("to", request.getParameter("to"));
- searchCriteria.addParam("unit", request.getParameter("unit"));
- return logMgr.getAnyGraphData(searchCriteria);
- }
-
- @GET
- @Path("/getAfterBeforeLogs")
- @Produces({"application/json"})
- @ApiOperation(GET_AFTER_BEFORE_LOGS_OD)
- @ApiImplicitParams(value = {
- @ApiImplicitParam(value = HOST_D, name = "host", dataType = "string", paramType = "query"),
- @ApiImplicitParam(value = COMPONENT_D,name = "component", dataType = "string", paramType = "query"),
- @ApiImplicitParam(value = ID_D, name = "id", dataType = "string", paramType = "query"),
- @ApiImplicitParam(value = SCROLL_TYPE_D, name = "scrollType", dataType = "string", paramType = "query"),
- @ApiImplicitParam(value = NUMBER_ROWS_D, name = "numberRows", dataType = "string", paramType = "query"),
- @ApiImplicitParam(value = ADVANCED_SEARCH_D, name = "advancedSearch", dataType = "string", paramType = "query"),
- @ApiImplicitParam(value = QUERY_D,name = "q", dataType = "string", paramType = "query"),
- @ApiImplicitParam(value = LEVEL_D, name = "level", dataType = "string", paramType = "query"),
- @ApiImplicitParam(value = TREE_PARAMS_D, name = "treeParams", 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 = G_MUST_NOT_D, name = "gMustNot", 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 = HOST_NAME_D, name = "host_name", dataType = "string", paramType = "query"),
- @ApiImplicitParam(value = COMPONENT_NAME_D, name = "component_name", dataType = "string", paramType = "query"),
- @ApiImplicitParam(value = FILE_NAME_D, name = "file_name", 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 = START_TIME_D, name = "start_time", dataType = "string", paramType = "query"),
- @ApiImplicitParam(value = END_TIME_D, name = "end_time", dataType = "string", paramType = "query")
- })
- public String getAfterBeforeLogs(@Context HttpServletRequest request) {
- SearchCriteria searchCriteria = new SearchCriteria(request);
- searchCriteria.addRequiredServiceLogsParams(request);
- searchCriteria.addParam("hostLogFile", request.getParameter("host"));
- searchCriteria.addParam("compLogFile",
- request.getParameter("component"));
- searchCriteria.addParam("id", request.getParameter("id"));
- searchCriteria.addParam("scrollType",
- request.getParameter("scrollType"));
- searchCriteria.addParam("numberRows",
- request.getParameter("numberRows"));
- return logMgr.getAfterBeforeLogs(searchCriteria);
- }
-
- @GET
- @Path("/getHadoopServiceConfigJSON")
- @Produces({"application/json"})
- @ApiOperation(GET_HADOOP_SERVICE_CONFIG_JSON_OD)
- public String getHadoopServiceConfigJSON() {
- return logMgr.getHadoopServiceConfigJSON();
- }
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/ambari/blob/f8cf23e4/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/rest/LogFileREST.java
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/rest/LogFileREST.java b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/rest/LogFileREST.java
index d53cff9..6099e0f 100644
--- a/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/rest/LogFileREST.java
+++ b/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();
http://git-wip-us.apache.org/repos/asf/ambari/blob/f8cf23e4/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/rest/PublicREST.java
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/rest/PublicREST.java b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/rest/PublicREST.java
index af48acd..5218f5d 100644
--- a/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/rest/PublicREST.java
+++ b/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();
http://git-wip-us.apache.org/repos/asf/ambari/blob/f8cf23e4/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/rest/ServiceLogsREST.java
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/rest/ServiceLogsREST.java b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/rest/ServiceLogsREST.java
new file mode 100644
index 0000000..373f7ff
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/rest/ServiceLogsREST.java
@@ -0,0 +1,578 @@
+/*
+ * 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. The ASF licenses this file
+ * 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
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.ambari.logsearch.rest;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.ws.rs.GET;
+import javax.ws.rs.Path;
+import javax.ws.rs.Produces;
+import javax.ws.rs.core.Context;
+import javax.ws.rs.core.Response;
+
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiImplicitParam;
+import io.swagger.annotations.ApiImplicitParams;
+import io.swagger.annotations.ApiOperation;
+import org.apache.ambari.logsearch.common.LogSearchConstants;
+import org.apache.ambari.logsearch.common.SearchCriteria;
+import org.apache.ambari.logsearch.manager.LogsMgr;
+import org.apache.ambari.logsearch.util.RESTErrorUtil;
+import org.apache.ambari.logsearch.view.VCountList;
+import org.apache.ambari.logsearch.view.VNameValueList;
+import org.apache.ambari.logsearch.view.VNodeList;
+import org.apache.commons.lang.StringEscapeUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.context.annotation.Scope;
+import org.springframework.stereotype.Component;
+
+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 = "service/logs", description = "Service log operations")
+@Path("service/logs")
+@Component
+@Scope("request")
+public class ServiceLogsREST {
+
+ @Autowired
+ LogsMgr logMgr;
+
+ @Autowired
+ RESTErrorUtil restErrorUtil;
+
+ @GET
+ @Produces({"application/json"})
+ @ApiOperation(SEARCH_LOGS_OD)
+ @ApiImplicitParams(value = {
+ @ApiImplicitParam(value = HOST_D, name = "host", dataType = "string", paramType = "query"),
+ @ApiImplicitParam(value = COMPONENT_D, name = "component", dataType = "string", paramType = "query"),
+ @ApiImplicitParam(value = FIND_D, name = "find", dataType = "string", paramType = "query"),
+ @ApiImplicitParam(value = SOURCE_LOG_ID_D, name = "sourceLogId", dataType = "string", paramType = "query"),
+ @ApiImplicitParam(value = KEYWORD_TYPE_D, name = "keywordType", dataType = "string", paramType = "query"),
+ @ApiImplicitParam(value = TOKEN_D, name = "token", dataType = "string", paramType = "query"),
+ @ApiImplicitParam(value = IS_LAST_PAGE_D, name = "isLastPage", dataType = "boolean", paramType = "query"),
+ @ApiImplicitParam(value = ADVANCED_SEARCH_D, name = "advancedSearch", dataType = "string", paramType = "query"),
+ @ApiImplicitParam(value = QUERY_D,name = "q", dataType = "string", paramType = "query"),
+ @ApiImplicitParam(value = LEVEL_D, name = "level", dataType = "string", paramType = "query"),
+ @ApiImplicitParam(value = TREE_PARAMS_D, name = "treeParams", 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 = G_MUST_NOT_D, name = "gMustNot", 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 = HOST_NAME_D, name = "host_name", dataType = "string", paramType = "query"),
+ @ApiImplicitParam(value = COMPONENT_NAME_D, name = "component_name", dataType = "string", paramType = "query"),
+ @ApiImplicitParam(value = FILE_NAME_D, name = "file_name", 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 = START_TIME_D, name = "start_time", dataType = "string", paramType = "query"),
+ @ApiImplicitParam(value = END_TIME_D, name = "end_time", dataType = "string", paramType = "query")
+ })
+ public String searchSolrData(@Context HttpServletRequest request) {
+ SearchCriteria searchCriteria = new SearchCriteria(request);
+ searchCriteria.addRequiredServiceLogsParams(request);
+ searchCriteria.addParam("hostLogFile", request.getParameter("host"));
+ searchCriteria.addParam("compLogFile",
+ request.getParameter("component"));
+ searchCriteria.addParam("keyword", StringEscapeUtils.unescapeXml(request.getParameter("find")));
+ searchCriteria.addParam("sourceLogId", request.getParameter("sourceLogId"));
+ searchCriteria.addParam("keywordType",
+ request.getParameter("keywordType"));
+ searchCriteria.addParam("token",
+ request.getParameter("token"));
+ searchCriteria.addParam("isLastPage",request.getParameter("isLastPage"));
+ return logMgr.searchLogs(searchCriteria);
+ }
+
+ @GET
+ @Path("/hosts")
+ @Produces({"application/json"})
+ @ApiOperation(GET_HOSTS_OD)
+ @ApiImplicitParams(value = {
+ @ApiImplicitParam(value = QUERY_D, name = "q", dataType = "string", paramType = "query")
+ })
+ public String getHosts(@Context HttpServletRequest request) {
+ SearchCriteria searchCriteria = new SearchCriteria(request);
+ searchCriteria.addParam("q", request.getParameter("q"));
+ return logMgr.getHosts(searchCriteria);
+ }
+
+ @GET
+ @Path("/components")
+ @Produces({"application/json"})
+ @ApiOperation(GET_COMPONENTS_OD)
+ @ApiImplicitParams(value = {
+ @ApiImplicitParam(value = QUERY_D, name = "q", dataType = "string", paramType = "query")
+ })
+ public String getComponents(@Context HttpServletRequest request) {
+ SearchCriteria searchCriteria = new SearchCriteria(request);
+ searchCriteria.addParam("q", request.getParameter("q"));
+ return logMgr.getComponents(searchCriteria);
+ }
+
+ @GET
+ @Path("/aggregated")
+ @Produces({"application/json"})
+ @ApiOperation(GET_AGGREGATED_INFO_OD)
+ @ApiImplicitParams(value = {
+ @ApiImplicitParam(value = ADVANCED_SEARCH_D, name = "advancedSearch", dataType = "string", paramType = "query"),
+ @ApiImplicitParam(value = QUERY_D,name = "q", dataType = "string", paramType = "query"),
+ @ApiImplicitParam(value = LEVEL_D, name = "level", dataType = "string", paramType = "query"),
+ @ApiImplicitParam(value = TREE_PARAMS_D, name = "treeParams", 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 = G_MUST_NOT_D, name = "gMustNot", 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 = HOST_NAME_D, name = "host_name", dataType = "string", paramType = "query"),
+ @ApiImplicitParam(value = COMPONENT_NAME_D, name = "component_name", dataType = "string", paramType = "query"),
+ @ApiImplicitParam(value = FILE_NAME_D, name = "file_name", 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 = START_TIME_D, name = "start_time", dataType = "string", paramType = "query"),
+ @ApiImplicitParam(value = END_TIME_D, name = "end_time", dataType = "string", paramType = "query")
+ })
+ public String getAggregatedInfo(@Context HttpServletRequest request) {
+ SearchCriteria searchCriteria = new SearchCriteria();
+ searchCriteria.addRequiredServiceLogsParams(request);
+ return logMgr.getAggregatedInfo(searchCriteria);
+ }
+
+ @GET
+ @Path("/levels/count")
+ @Produces({"application/json"})
+ @ApiOperation(GET_LOG_LEVELS_COUNT_OD)
+ @ApiImplicitParams(value = {
+ @ApiImplicitParam(value = QUERY_D, name = "q", dataType = "string", paramType = "query"),
+ @ApiImplicitParam(value = START_TIME_D, name = "start_time", dataType = "string", paramType = "query"),
+ @ApiImplicitParam(value = END_TIME_D, name = "end_time", dataType = "string", paramType = "query")
+ })
+ public VCountList getLogLevelsCount(@Context HttpServletRequest request) {
+ SearchCriteria searchCriteria = new SearchCriteria();
+ searchCriteria.addParam("q", request.getParameter("q"));
+ searchCriteria
+ .addParam("startDate", request.getParameter("start_time"));
+ searchCriteria.addParam("endDate", request.getParameter("end_time"));
+ return logMgr.getLogLevelCount(searchCriteria);
+ }
+
+ @GET
+ @Path("/components/count")
+ @Produces({"application/json"})
+ @ApiOperation(GET_COMPONENTS_COUNT_OD)
+ @ApiImplicitParams(value = {
+ @ApiImplicitParam(value = QUERY_D, name = "q", dataType = "string", paramType = "query"),
+ @ApiImplicitParam(value = START_TIME_D, name = "start_time", dataType = "string", paramType = "query"),
+ @ApiImplicitParam(value = END_TIME_D, name = "end_time", dataType = "string", paramType = "query")
+ })
+ public VCountList getComponentsCount(@Context HttpServletRequest request) {
+ SearchCriteria searchCriteria = new SearchCriteria();
+ searchCriteria.addParam("q", request.getParameter("q"));
+ searchCriteria
+ .addParam("startDate", request.getParameter("start_time"));
+ searchCriteria.addParam("endDate", request.getParameter("end_time"));
+ return logMgr.getComponentsCount(searchCriteria);
+ }
+
+ @GET
+ @Path("/hosts/count")
+ @Produces({"application/json"})
+ @ApiOperation(GET_HOSTS_COUNT_OD)
+ @ApiImplicitParams(value = {
+ @ApiImplicitParam(value = QUERY_D, name = "q", dataType = "string", paramType = "query"),
+ @ApiImplicitParam(value = START_TIME_D, name = "start_time", dataType = "string", paramType = "query"),
+ @ApiImplicitParam(value = END_TIME_D, name = "end_time", 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")
+ })
+ public VCountList getHostsCount(@Context HttpServletRequest request) {
+ SearchCriteria searchCriteria = new SearchCriteria();
+ searchCriteria.addParam("q", request.getParameter("q"));
+ searchCriteria
+ .addParam("startDate", request.getParameter("start_time"));
+ searchCriteria.addParam("endDate", request.getParameter("end_time"));
+ searchCriteria.addParam("excludeQuery", StringEscapeUtils
+ .unescapeXml(request.getParameter("excludeQuery")));
+ searchCriteria.addParam("includeQuery", StringEscapeUtils
+ .unescapeXml(request.getParameter("includeQuery")));
+ return logMgr.getHostsCount(searchCriteria);
+ }
+
+ @GET
+ @Path("/tree")
+ @Produces({"application/json"})
+ @ApiOperation(GET_TREE_EXTENSION_OD)
+ @ApiImplicitParams(value = {
+ @ApiImplicitParam(value = HOST_D, name = "host", dataType = "string", paramType = "query"),
+ @ApiImplicitParam(value = COMPONENT_D, name = "component", dataType = "string", paramType = "query"),
+ @ApiImplicitParam(value = ADVANCED_SEARCH_D, name = "advancedSearch", dataType = "string", paramType = "query"),
+ @ApiImplicitParam(value = QUERY_D,name = "q", dataType = "string", paramType = "query"),
+ @ApiImplicitParam(value = LEVEL_D, name = "level", dataType = "string", paramType = "query"),
+ @ApiImplicitParam(value = TREE_PARAMS_D, name = "treeParams", 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 = G_MUST_NOT_D, name = "gMustNot", 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 = HOST_NAME_D, name = "host_name", dataType = "string", paramType = "query"),
+ @ApiImplicitParam(value = COMPONENT_NAME_D, name = "component_name", dataType = "string", paramType = "query"),
+ @ApiImplicitParam(value = FILE_NAME_D, name = "file_name", 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 = START_TIME_D, name = "start_time", dataType = "string", paramType = "query"),
+ @ApiImplicitParam(value = END_TIME_D, name = "end_time", dataType = "string", paramType = "query")
+ })
+ public VNodeList getTreeExtension(@Context HttpServletRequest request) {
+ SearchCriteria searchCriteria = new SearchCriteria(request);
+ searchCriteria.addRequiredServiceLogsParams(request);
+ searchCriteria.addParam("hostLogFile", request.getParameter("host"));
+ searchCriteria.addParam("compLogFile",
+ request.getParameter("component"));
+ searchCriteria.addParam("hostName", request.getParameter("hostName"));
+ return logMgr.getTreeExtension(searchCriteria);
+ }
+
+ @GET
+ @Path("/levels/counts/namevalues")
+ @Produces({"application/json"})
+ @ApiOperation(GET_LOG_LEVELS_COUNT_OD)
+ @ApiImplicitParams(value = {
+ @ApiImplicitParam(value = HOST_D, name = "host", dataType = "string", paramType = "query"),
+ @ApiImplicitParam(value = COMPONENT_D, name = "component", dataType = "string", paramType = "query"),
+ @ApiImplicitParam(value = ADVANCED_SEARCH_D, name = "advancedSearch", dataType = "string", paramType = "query"),
+ @ApiImplicitParam(value = QUERY_D,name = "q", dataType = "string", paramType = "query"),
+ @ApiImplicitParam(value = LEVEL_D, name = "level", dataType = "string", paramType = "query"),
+ @ApiImplicitParam(value = TREE_PARAMS_D, name = "treeParams", 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 = G_MUST_NOT_D, name = "gMustNot", 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 = HOST_NAME_D, name = "host_name", dataType = "string", paramType = "query"),
+ @ApiImplicitParam(value = COMPONENT_NAME_D, name = "component_name", dataType = "string", paramType = "query"),
+ @ApiImplicitParam(value = FILE_NAME_D, name = "file_name", 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 = START_TIME_D, name = "start_time", dataType = "string", paramType = "query"),
+ @ApiImplicitParam(value = END_TIME_D, name = "end_time", dataType = "string", paramType = "query")
+ })
+ public VNameValueList getLogsLevelCount(@Context HttpServletRequest request) {
+ SearchCriteria searchCriteria = new SearchCriteria(request);
+ searchCriteria.addRequiredServiceLogsParams(request);
+ searchCriteria.addParam("hostLogFile", request.getParameter("host"));
+ searchCriteria.addParam("compLogFile",
+ request.getParameter("component"));
+ return logMgr.getLogsLevelCount(searchCriteria);
+ }
+
+ @GET
+ @Path("/histogram")
+ @Produces({"application/json"})
+ @ApiOperation(GET_HISTOGRAM_DATA_OD)
+ @ApiImplicitParams(value = {
+ @ApiImplicitParam(value = HOST_D, name = "host", dataType = "string", paramType = "query"),
+ @ApiImplicitParam(value = COMPONENT_D, name = "component", dataType = "string", paramType = "query"),
+ @ApiImplicitParam(value = UNIT_D, name = "unit", dataType = "string", paramType = "query"),
+ @ApiImplicitParam(value = ADVANCED_SEARCH_D, name = "advancedSearch", dataType = "string", paramType = "query"),
+ @ApiImplicitParam(value = QUERY_D,name = "q", dataType = "string", paramType = "query"),
+ @ApiImplicitParam(value = LEVEL_D, name = "level", dataType = "string", paramType = "query"),
+ @ApiImplicitParam(value = TREE_PARAMS_D, name = "treeParams", 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 = G_MUST_NOT_D, name = "gMustNot", 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 = HOST_NAME_D, name = "host_name", dataType = "string", paramType = "query"),
+ @ApiImplicitParam(value = COMPONENT_NAME_D, name = "component_name", dataType = "string", paramType = "query"),
+ @ApiImplicitParam(value = FILE_NAME_D, name = "file_name", 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 = START_TIME_D, name = "start_time", dataType = "string", paramType = "query"),
+ @ApiImplicitParam(value = END_TIME_D, name = "end_time", dataType = "string", paramType = "query")
+ })
+ public String getHistogramData(@Context HttpServletRequest request) {
+ SearchCriteria searchCriteria = new SearchCriteria(request);
+ searchCriteria.addRequiredServiceLogsParams(request);
+ searchCriteria.addParam("hostLogFile", request.getParameter("host"));
+ searchCriteria.addParam("compLogFile",
+ request.getParameter("component"));
+ searchCriteria.addParam("unit", request.getParameter("unit"));
+ return logMgr.getHistogramData(searchCriteria);
+ }
+
+ @GET
+ @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) {
+ String uniqueId = request.getParameter("token");
+ return logMgr.cancelFindRequestByDate(uniqueId);
+ }
+
+ @GET
+ @Path("/export")
+ @Produces({"application/json"})
+ @ApiOperation(EXPORT_TO_TEXT_FILE_OD)
+ @ApiImplicitParams(value = {
+ @ApiImplicitParam(value = HOST_D, name = "host", dataType = "string", paramType = "query"),
+ @ApiImplicitParam(value = COMPONENT_D, name = "component", dataType = "string", paramType = "query"),
+ @ApiImplicitParam(value = FORMAT_D, name = "format", dataType = "string", paramType = "query"),
+ @ApiImplicitParam(value = UTC_OFFSET_D, name = "utcOffset", dataType = "string", paramType = "query"),
+ @ApiImplicitParam(value = ADVANCED_SEARCH_D, name = "advancedSearch", dataType = "string", paramType = "query"),
+ @ApiImplicitParam(value = QUERY_D,name = "q", dataType = "string", paramType = "query"),
+ @ApiImplicitParam(value = LEVEL_D, name = "level", dataType = "string", paramType = "query"),
+ @ApiImplicitParam(value = TREE_PARAMS_D, name = "treeParams", 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 = G_MUST_NOT_D, name = "gMustNot", 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 = HOST_NAME_D, name = "host_name", dataType = "string", paramType = "query"),
+ @ApiImplicitParam(value = COMPONENT_NAME_D, name = "component_name", dataType = "string", paramType = "query"),
+ @ApiImplicitParam(value = FILE_NAME_D, name = "file_name", 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 = START_TIME_D, name = "start_time", dataType = "string", paramType = "query"),
+ @ApiImplicitParam(value = END_TIME_D, name = "end_time", dataType = "string", paramType = "query")
+ })
+ public Response exportToTextFile(@Context HttpServletRequest request) {
+
+ SearchCriteria searchCriteria = new SearchCriteria(request);
+ searchCriteria.addRequiredServiceLogsParams(request);
+ searchCriteria.addParam("hostLogFile", request.getParameter("host"));
+ searchCriteria.addParam("compLogFile",
+ request.getParameter("component"));
+ searchCriteria.addParam("format", request.getParameter("format"));
+ searchCriteria.addParam("utcOffset", request.getParameter("utcOffset"));
+ return logMgr.exportToTextFile(searchCriteria);
+
+ }
+
+ @GET
+ @Path("/hosts/components")
+ @Produces({"application/json"})
+ @ApiOperation(GET_HOST_LIST_BY_COMPONENT_OD)
+ @ApiImplicitParams(value = {
+ @ApiImplicitParam(value = HOST_D, name = "host", dataType = "string", paramType = "query"),
+ @ApiImplicitParam(value = COMPONENT_D, name = "component", dataType = "string", paramType = "query"),
+ @ApiImplicitParam(value = ADVANCED_SEARCH_D, name = "advancedSearch", dataType = "string", paramType = "query"),
+ @ApiImplicitParam(value = QUERY_D,name = "q", dataType = "string", paramType = "query"),
+ @ApiImplicitParam(value = LEVEL_D, name = "level", dataType = "string", paramType = "query"),
+ @ApiImplicitParam(value = TREE_PARAMS_D, name = "treeParams", 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 = G_MUST_NOT_D, name = "gMustNot", 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 = HOST_NAME_D, name = "host_name", dataType = "string", paramType = "query"),
+ @ApiImplicitParam(value = COMPONENT_NAME_D, name = "component_name", dataType = "string", paramType = "query"),
+ @ApiImplicitParam(value = FILE_NAME_D, name = "file_name", 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 = START_TIME_D, name = "start_time", dataType = "string", paramType = "query"),
+ @ApiImplicitParam(value = END_TIME_D, name = "end_time", dataType = "string", paramType = "query")
+ })
+ public String getHostListByComponent(@Context HttpServletRequest request) {
+ SearchCriteria searchCriteria = new SearchCriteria(request);
+ searchCriteria.addRequiredServiceLogsParams(request);
+ searchCriteria.addParam("hostLogFile", request.getParameter("host"));
+ searchCriteria.addParam("compLogFile",
+ request.getParameter("component"));
+ searchCriteria.addParam("componentName",
+ request.getParameter("componentName"));
+ return logMgr.getHostListByComponent(searchCriteria);
+ }
+
+ @GET
+ @Path("/components/level/counts")
+ @Produces({"application/json"})
+ @ApiOperation(GET_COMPONENT_LIST_WITH_LEVEL_COUNT_OD)
+ @ApiImplicitParams(value = {
+ @ApiImplicitParam(value = HOST_D, name = "host", dataType = "string", paramType = "query"),
+ @ApiImplicitParam(value = COMPONENT_D, name = "component", dataType = "string", paramType = "query"),
+ @ApiImplicitParam(value = ADVANCED_SEARCH_D, name = "advancedSearch", dataType = "string", paramType = "query"),
+ @ApiImplicitParam(value = QUERY_D,name = "q", dataType = "string", paramType = "query"),
+ @ApiImplicitParam(value = LEVEL_D, name = "level", dataType = "string", paramType = "query"),
+ @ApiImplicitParam(value = TREE_PARAMS_D, name = "treeParams", 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 = G_MUST_NOT_D, name = "gMustNot", 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 = HOST_NAME_D, name = "host_name", dataType = "string", paramType = "query"),
+ @ApiImplicitParam(value = COMPONENT_NAME_D, name = "component_name", dataType = "string", paramType = "query"),
+ @ApiImplicitParam(value = FILE_NAME_D, name = "file_name", 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 = START_TIME_D, name = "start_time", dataType = "string", paramType = "query"),
+ @ApiImplicitParam(value = END_TIME_D, name = "end_time", dataType = "string", paramType = "query")
+ })
+ public String getComponentListWithLevelCounts(
+ @Context HttpServletRequest request) {
+ SearchCriteria searchCriteria = new SearchCriteria(request);
+ searchCriteria.addRequiredServiceLogsParams(request);
+ searchCriteria.addParam("hostLogFile", request.getParameter("host"));
+ searchCriteria.addParam("compLogFile",
+ request.getParameter("component"));
+ return logMgr.getComponentListWithLevelCounts(searchCriteria);
+ }
+
+ @GET
+ @Path("/solr/boundarydates")
+ @Produces({"application/json"})
+ @ApiOperation(GET_EXTREME_DATES_FOR_BUNDLE_ID_OD)
+ public String getExtremeDatesForBundelId(@Context HttpServletRequest request) {
+
+ SearchCriteria searchCriteria = new SearchCriteria(request);
+ searchCriteria.addParam(LogSearchConstants.BUNDLE_ID,
+ request.getParameter("bundle_id"));
+
+ return logMgr.getExtremeDatesForBundelId(searchCriteria);
+
+ }
+
+ @GET
+ @Path("/fields")
+ @Produces({"application/json"})
+ @ApiOperation(GET_SERVICE_LOGS_FIELD_NAME_OD)
+ public String getServiceLogsFieldsName() {
+ return logMgr.getServiceLogsFieldsName();
+ }
+
+ @GET
+ @Path("/schema/fields")
+ @Produces({"application/json"})
+ @ApiOperation(GET_SERVICE_LOGS_SCHEMA_FIELD_NAME_OD)
+ public String getServiceLogsSchemaFieldsName() {
+ return logMgr.getServiceLogsSchemaFieldsName();
+ }
+
+ @GET
+ @Path("/anygraph")
+ @Produces({"application/json"})
+ @ApiOperation(GET_ANY_GRAPH_DATA_OD)
+ @ApiImplicitParams(value = {
+ @ApiImplicitParam(value = X_AXIS_D, name = "xAxis", dataType = "string", paramType = "query"),
+ @ApiImplicitParam(value = Y_AXIS_D, name = "yAxis", dataType = "string", paramType = "query"),
+ @ApiImplicitParam(value = STACK_BY_D, name = "stackBy", 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 = UNIT_D, name = "unit", dataType = "string", paramType = "query"),
+ @ApiImplicitParam(value = ADVANCED_SEARCH_D, name = "advancedSearch", dataType = "string", paramType = "query"),
+ @ApiImplicitParam(value = QUERY_D,name = "q", dataType = "string", paramType = "query"),
+ @ApiImplicitParam(value = LEVEL_D, name = "level", dataType = "string", paramType = "query"),
+ @ApiImplicitParam(value = TREE_PARAMS_D, name = "treeParams", 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 = G_MUST_NOT_D, name = "gMustNot", 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 = HOST_NAME_D, name = "host_name", dataType = "string", paramType = "query"),
+ @ApiImplicitParam(value = COMPONENT_NAME_D, name = "component_name", dataType = "string", paramType = "query"),
+ @ApiImplicitParam(value = FILE_NAME_D, name = "file_name", 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 = START_TIME_D, name = "start_time", dataType = "string", paramType = "query"),
+ @ApiImplicitParam(value = END_TIME_D, name = "end_time", dataType = "string", paramType = "query")
+ })
+ public String getAnyGraphData(@Context HttpServletRequest request) {
+ SearchCriteria searchCriteria = new SearchCriteria(request);
+ searchCriteria.addRequiredServiceLogsParams(request);
+ searchCriteria.addParam("xAxis", request.getParameter("xAxis"));
+ searchCriteria.addParam("yAxis", request.getParameter("yAxis"));
+ searchCriteria.addParam("stackBy", request.getParameter("stackBy"));
+ searchCriteria.addParam("from", request.getParameter("from"));
+ searchCriteria.addParam("to", request.getParameter("to"));
+ searchCriteria.addParam("unit", request.getParameter("unit"));
+ return logMgr.getAnyGraphData(searchCriteria);
+ }
+
+ @GET
+ @Path("/truncated")
+ @Produces({"application/json"})
+ @ApiOperation(GET_AFTER_BEFORE_LOGS_OD)
+ @ApiImplicitParams(value = {
+ @ApiImplicitParam(value = HOST_D, name = "host", dataType = "string", paramType = "query"),
+ @ApiImplicitParam(value = COMPONENT_D,name = "component", dataType = "string", paramType = "query"),
+ @ApiImplicitParam(value = ID_D, name = "id", dataType = "string", paramType = "query"),
+ @ApiImplicitParam(value = SCROLL_TYPE_D, name = "scrollType", dataType = "string", paramType = "query"),
+ @ApiImplicitParam(value = NUMBER_ROWS_D, name = "numberRows", dataType = "string", paramType = "query"),
+ @ApiImplicitParam(value = ADVANCED_SEARCH_D, name = "advancedSearch", dataType = "string", paramType = "query"),
+ @ApiImplicitParam(value = QUERY_D,name = "q", dataType = "string", paramType = "query"),
+ @ApiImplicitParam(value = LEVEL_D, name = "level", dataType = "string", paramType = "query"),
+ @ApiImplicitParam(value = TREE_PARAMS_D, name = "treeParams", 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 = G_MUST_NOT_D, name = "gMustNot", 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 = HOST_NAME_D, name = "host_name", dataType = "string", paramType = "query"),
+ @ApiImplicitParam(value = COMPONENT_NAME_D, name = "component_name", dataType = "string", paramType = "query"),
+ @ApiImplicitParam(value = FILE_NAME_D, name = "file_name", 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 = START_TIME_D, name = "start_time", dataType = "string", paramType = "query"),
+ @ApiImplicitParam(value = END_TIME_D, name = "end_time", dataType = "string", paramType = "query")
+ })
+ public String getAfterBeforeLogs(@Context HttpServletRequest request) {
+ SearchCriteria searchCriteria = new SearchCriteria(request);
+ searchCriteria.addRequiredServiceLogsParams(request);
+ searchCriteria.addParam("hostLogFile", request.getParameter("host"));
+ searchCriteria.addParam("compLogFile",
+ request.getParameter("component"));
+ searchCriteria.addParam("id", request.getParameter("id"));
+ searchCriteria.addParam("scrollType",
+ request.getParameter("scrollType"));
+ searchCriteria.addParam("numberRows",
+ request.getParameter("numberRows"));
+ return logMgr.getAfterBeforeLogs(searchCriteria);
+ }
+
+ @GET
+ @Path("/serviceconfig")
+ @Produces({"application/json"})
+ @ApiOperation(GET_HADOOP_SERVICE_CONFIG_JSON_OD)
+ public String getHadoopServiceConfigJSON() {
+ return logMgr.getHadoopServiceConfigJSON();
+ }
+}
http://git-wip-us.apache.org/repos/asf/ambari/blob/f8cf23e4/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/rest/UserConfigREST.java
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/rest/UserConfigREST.java b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/rest/UserConfigREST.java
index 4b1675f..a79a737 100644
--- a/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/rest/UserConfigREST.java
+++ b/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() {
http://git-wip-us.apache.org/repos/asf/ambari/blob/f8cf23e4/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/login.html
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/login.html b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/login.html
index 44f1aeb..038cec2 100644
--- a/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/login.html
+++ b/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();
}
}
http://git-wip-us.apache.org/repos/asf/ambari/blob/f8cf23e4/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/scripts/collection_bases/VAuditLogListBase.js
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/scripts/collection_bases/VAuditLogListBase.js b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/scripts/collection_bases/VAuditLogListBase.js
index 12f7c31..0f72697 100644
--- a/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/scripts/collection_bases/VAuditLogListBase.js
+++ b/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;
});
-
-
http://git-wip-us.apache.org/repos/asf/ambari/blob/f8cf23e4/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/scripts/collection_bases/VEventHistoryListBase.js
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/scripts/collection_bases/VEventHistoryListBase.js b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/scripts/collection_bases/VEventHistoryListBase.js
index f6f720d..06b2619 100644
--- a/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/scripts/collection_bases/VEventHistoryListBase.js
+++ b/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',