You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@drill.apache.org by am...@apache.org on 2016/06/23 18:10:44 UTC
[4/7] drill git commit: DRILL-4716: status.json doesn't work in drill
ui
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/23a46a09
Tree: http://git-wip-us.apache.org/repos/asf/drill/tree/23a46a09
Diff: http://git-wip-us.apache.org/repos/asf/drill/diff/23a46a09
Branch: refs/heads/1.7.0
Commit: 23a46a09f28cae4a6e94b633e84f256ec816ff9c
Parents: 7a8bb16
Author: Arina Ielchiieva <ar...@gmail.com>
Authored: Sun Jun 12 16:10:52 2016 +0000
Committer: Aman Sinha <as...@maprtech.com>
Committed: Wed Jun 22 15:15:47 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/23a46a09/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/23a46a09/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/>