ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From oleew...@apache.org
Subject ambari git commit: AMBARI-21159. Fix swagger sytax errors in Log Search REST API doc (oleewere)
Date Thu, 01 Jun 2017 11:55:29 GMT
Repository: ambari
Updated Branches:
  refs/heads/trunk db700d595 -> 7bb3fdd84


AMBARI-21159. Fix swagger sytax errors in Log Search REST API doc (oleewere)


Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/7bb3fdd8
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/7bb3fdd8
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/7bb3fdd8

Branch: refs/heads/trunk
Commit: 7bb3fdd8464ee3e26d2cfbb75a7bb1d1b2b8759e
Parents: db700d5
Author: oleewere <oleewere@gmail.com>
Authored: Wed May 31 20:49:24 2017 +0200
Committer: oleewere <oleewere@gmail.com>
Committed: Thu Jun 1 13:55:11 2017 +0200

----------------------------------------------------------------------
 .../ambari/logsearch/conf/ApiDocConfig.java     | 35 ++++++++++++++++----
 .../logsearch/rest/AuditLogsResource.java       |  2 +-
 2 files changed, 29 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/7bb3fdd8/ambari-logsearch/ambari-logsearch-server/src/main/java/org/apache/ambari/logsearch/conf/ApiDocConfig.java
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-server/src/main/java/org/apache/ambari/logsearch/conf/ApiDocConfig.java
b/ambari-logsearch/ambari-logsearch-server/src/main/java/org/apache/ambari/logsearch/conf/ApiDocConfig.java
index 630e73a..9d4e96e 100644
--- a/ambari-logsearch/ambari-logsearch-server/src/main/java/org/apache/ambari/logsearch/conf/ApiDocConfig.java
+++ b/ambari-logsearch/ambari-logsearch-server/src/main/java/org/apache/ambari/logsearch/conf/ApiDocConfig.java
@@ -22,12 +22,22 @@ import io.swagger.jaxrs.config.BeanConfig;
 import io.swagger.jaxrs.listing.ApiListingResource;
 import io.swagger.jaxrs.listing.SwaggerSerializers;
 
+import io.swagger.models.Info;
+import io.swagger.models.License;
 import org.springframework.context.annotation.Bean;
 import org.springframework.context.annotation.Configuration;
 
 @Configuration
 public class ApiDocConfig {
 
+  private static final String DESCRIPTION = "Log aggregation, analysis, and visualization.";
+  private static final String VERSION = "1.0.0";
+  private static final String TITLE = "Log Search REST API";
+  private static final String LICENSE = "Apache 2.0";
+  private static final String LICENSE_URL = "http://www.apache.org/licenses/LICENSE-2.0.html";
+  private static final String RESOURCE_PACKAGE = "org.apache.ambari.logsearch.rest";
+  private static final String BASE_PATH = "/api/v1";
+
   @Bean
   public ApiListingResource apiListingResource() {
     return new ApiListingResource();
@@ -42,14 +52,25 @@ public class ApiDocConfig {
   public BeanConfig swaggerConfig() {
     BeanConfig beanConfig = new BeanConfig();
     beanConfig.setSchemes(new String[]{"http", "https"});
-    beanConfig.setBasePath("/api/v1");
-    beanConfig.setTitle("Log Search REST API");
-    beanConfig.setDescription("Log aggregation, analysis, and visualization.");
-    beanConfig.setLicense("Apache 2.0");
-    beanConfig.setLicenseUrl("http://www.apache.org/licenses/LICENSE-2.0.html");
+    beanConfig.setBasePath(BASE_PATH);
+    beanConfig.setTitle(TITLE);
+    beanConfig.setDescription(DESCRIPTION);
+    beanConfig.setLicense(LICENSE);
+    beanConfig.setLicenseUrl(LICENSE_URL);
     beanConfig.setScan(true);
-    beanConfig.setVersion("1.0.0");
-    beanConfig.setResourcePackage("org.apache.ambari.logsearch.rest");
+    beanConfig.setVersion(VERSION);
+    beanConfig.setResourcePackage(RESOURCE_PACKAGE);
+
+    License license = new License();
+    license.setName(LICENSE);
+    license.setUrl(LICENSE_URL);
+
+    Info info = new Info();
+    info.setDescription(DESCRIPTION);
+    info.setTitle(TITLE);
+    info.setVersion(VERSION);
+    info.setLicense(license);
+    beanConfig.setInfo(info);
     return beanConfig;
   }
 }

http://git-wip-us.apache.org/repos/asf/ambari/blob/7bb3fdd8/ambari-logsearch/ambari-logsearch-server/src/main/java/org/apache/ambari/logsearch/rest/AuditLogsResource.java
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-server/src/main/java/org/apache/ambari/logsearch/rest/AuditLogsResource.java
b/ambari-logsearch/ambari-logsearch-server/src/main/java/org/apache/ambari/logsearch/rest/AuditLogsResource.java
index 5312da8..27a3e83 100644
--- a/ambari-logsearch/ambari-logsearch-server/src/main/java/org/apache/ambari/logsearch/rest/AuditLogsResource.java
+++ b/ambari-logsearch/ambari-logsearch-server/src/main/java/org/apache/ambari/logsearch/rest/AuditLogsResource.java
@@ -123,7 +123,7 @@ public class AuditLogsResource {
   @Path("/clusters")
   @Produces({"application/json"})
   @ApiOperation(GET_AUDIT_CLUSTERS_OD)
-  public List<String> getClustersForServiceLog() {
+  public List<String> getClustersForAuditLog() {
     return auditLogsManager.getClusters();
   }
 


Mime
View raw message