[ZEPPELIN-2622] Merged version and git REST APIs

This commit is contained in:
Nelson Costa 2017-06-09 16:42:43 +01:00
parent 9ff7d6067d
commit 2d204555be
2 changed files with 6 additions and 45 deletions

View file

@ -60,42 +60,9 @@ If you work with Apache Zeppelin and find a need for an additional REST API, ple
{
"status": "OK",
"message": "Zeppelin version",
"body": "0.8.0-SNAPSHOT"
}
</pre>
</td>
</tr>
</table>
### Get Zeppelin git info
<table class="table-configuration">
<col width="200">
<tr>
<td>Description</td>
<td>This ```GET``` method returns Zeppelin Git info</td>
</tr>
<tr>
<td>URL</td>
<td>```http://[zeppelin-server]:[zeppelin-port]/api/git```</td>
</tr>
<tr>
<td>Success code</td>
<td>200</td>
</tr>
<tr>
<td> Fail code</td>
<td> 500 </td>
</tr>
<tr>
<td> sample JSON response
</td>
<td>
<pre>
{
"status": "OK",
"message": "Zeppelin Git Info",
"body": [
{
"version": "0.8.0-SNAPSHOT",
"commitId": "abc0123",
"timestamp": "2017-01-02 03:04:05"
}

View file

@ -59,18 +59,12 @@ public class ZeppelinRestApi {
@Path("version")
@ZeppelinApi
public Response getVersion() {
return new JsonResponse<>(Response.Status.OK, "Zeppelin version", Util.getVersion()).build();
}
Map<String, String> versionInfo = new HashMap<>();
versionInfo.put("version", Util.getVersion());
versionInfo.put("commitId", Util.getGitCommitId());
versionInfo.put("timestamp", Util.getGitTimestamp());
@GET
@Path("git")
@ZeppelinApi
public Response getGitInfo() {
Map<String, String> gitInfo = new HashMap<>();
gitInfo.put("commitId", Util.getGitCommitId());
gitInfo.put("timestamp", Util.getGitTimestamp());
return new JsonResponse<>(Response.Status.OK, "Zeppelin Git info", gitInfo).build();
return new JsonResponse<>(Response.Status.OK, "Zeppelin version", versionInfo).build();
}
/**