drill-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From par...@apache.org
Subject [5/6] drill git commit: DRILL-4716: status.json doesn't work in drill ui
Date Sun, 19 Jun 2016 00:03:45 GMT
DRILL-4716: status.json doesn't work in drill ui


Project: http://git-wip-us.apache.org/repos/asf/drill/repo
Commit: http://git-wip-us.apache.org/repos/asf/drill/commit/1c451a34
Tree: http://git-wip-us.apache.org/repos/asf/drill/tree/1c451a34
Diff: http://git-wip-us.apache.org/repos/asf/drill/diff/1c451a34

Branch: refs/heads/master
Commit: 1c451a341e80c2372be47d999741240fb5495eea
Parents: 4123ed2
Author: Arina Ielchiieva <arina.yelchiyeva@gmail.com>
Authored: Sun Jun 12 16:10:52 2016 +0000
Committer: Parth Chandra <parthc@apache.org>
Committed: Sat Jun 18 17:03:00 2016 -0700

----------------------------------------------------------------------
 .../apache/drill/exec/server/rest/StatusResources.java   | 11 ++++++++++-
 exec/java-exec/src/main/resources/rest/status.ftl        |  3 +--
 2 files changed, 11 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/drill/blob/1c451a34/exec/java-exec/src/main/java/org/apache/drill/exec/server/rest/StatusResources.java
----------------------------------------------------------------------
diff --git a/exec/java-exec/src/main/java/org/apache/drill/exec/server/rest/StatusResources.java
b/exec/java-exec/src/main/java/org/apache/drill/exec/server/rest/StatusResources.java
index 439cb7f..d0007d3 100644
--- a/exec/java-exec/src/main/java/org/apache/drill/exec/server/rest/StatusResources.java
+++ b/exec/java-exec/src/main/java/org/apache/drill/exec/server/rest/StatusResources.java
@@ -33,6 +33,8 @@ import javax.ws.rs.core.MediaType;
 import javax.ws.rs.core.SecurityContext;
 import javax.xml.bind.annotation.XmlRootElement;
 
+import org.apache.commons.lang3.tuple.ImmutablePair;
+import org.apache.commons.lang3.tuple.Pair;
 import org.apache.drill.exec.server.options.OptionValue;
 import org.apache.drill.exec.server.options.OptionValue.Kind;
 import org.apache.drill.exec.server.rest.DrillRestServer.UserAuthEnabled;
@@ -53,10 +55,17 @@ public class StatusResources {
   @Inject SecurityContext sc;
 
   @GET
+  @Path("/status.json")
+  @Produces(MediaType.APPLICATION_JSON)
+  public Pair<String, String> getStatusJSON() {
+    return new ImmutablePair<>("status", "Running!");
+  }
+
+  @GET
   @Path("/status")
   @Produces(MediaType.TEXT_HTML)
   public Viewable getStatus() {
-    return ViewableWithPermissions.create(authEnabled.get(), "/rest/status.ftl", sc, "Running!");
+    return ViewableWithPermissions.create(authEnabled.get(), "/rest/status.ftl", sc, getStatusJSON());
   }
 
   @GET

http://git-wip-us.apache.org/repos/asf/drill/blob/1c451a34/exec/java-exec/src/main/resources/rest/status.ftl
----------------------------------------------------------------------
diff --git a/exec/java-exec/src/main/resources/rest/status.ftl b/exec/java-exec/src/main/resources/rest/status.ftl
index cafa523..c5992fb 100644
--- a/exec/java-exec/src/main/resources/rest/status.ftl
+++ b/exec/java-exec/src/main/resources/rest/status.ftl
@@ -17,10 +17,9 @@
   <a href="/queries">back</a><br/>
   <div class="page-header">
     <div class="alert alert-success">
-      <strong>${model}</strong>
+      <strong>${model.getValue()}</strong>
     </div>
   </div>
-  <a href="/status/options"> System Options </a>
 </#macro>
 
 <@page_html/>


Mime
View raw message