Add documenation, fix response message

This commit is contained in:
Karup 2017-05-21 15:58:46 +05:30
parent e4782c3fae
commit 4017a83d57
5 changed files with 82 additions and 2 deletions

View file

@ -105,6 +105,7 @@
<li><a href="{{BASE_PATH}}/storage/storage.html#notebook-storage-in-mongodb">MongoDB Storage</a></li>
<li role="separator" class="divider"></li>
<li class="title"><span><b>REST API</b><span></li>
<li><a href="{{BASE_PATH}}/rest-api/rest-zeppelin-server.html">Zeppelin Server API</a></li>
<li><a href="{{BASE_PATH}}/rest-api/rest-interpreter.html">Interpreter API</a></li>
<li><a href="{{BASE_PATH}}/rest-api/rest-notebook.html">Notebook API</a></li>
<li><a href="{{BASE_PATH}}/rest-api/rest-notebookRepo.html">Notebook Repository API</a></li>

View file

@ -161,6 +161,7 @@ Join to our [Mailing list](https://zeppelin.apache.org/community.html) and repor
* [Azure Storage](./storage/storage.html#notebook-storage-in-azure)
* [ZeppelinHub Storage](./storage/storage.html#storage-in-zeppelinhub)
* REST API: available REST API list in Apache Zeppelin
* [Zeppelin server API](./rest-api/rest-zeppelin-server.html)
* [Interpreter API](./rest-api/rest-interpreter.html)
* [Notebook API](./rest-api/rest-notebook.html)
* [Notebook Repository API](./rest-api/rest-notebookRepo.html)

View file

@ -29,7 +29,6 @@ All REST APIs are available starting with the following endpoint `http://[zeppel
Note that Apache Zeppelin REST APIs receive or return JSON objects, it is recommended for you to install some JSON viewers such as [JSONView](https://chrome.google.com/webstore/detail/jsonview/chklaanhfefbnpoihckbnefhakgolnmc).
If you work with Apache Zeppelin and find a need for an additional REST API, please [file an issue or send us an email](http://zeppelin.apache.org/community.html).
nd a need for an additional REST API, please [file an issue or send us mail](../../community.html).
## Configuration REST API list

View file

@ -0,0 +1,78 @@
---
layout: page
title: "Apache Zeppelin Server REST API"
description: "This page contains Apache Zeppelin Server REST API information."
group: rest-api
---
<!--
Licensed 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.
-->
{% include JB/setup %}
# Apache Zeppelin Server REST API
<div id="toc"></div>
## Overview
Apache Zeppelin provides several REST APIs for interaction and remote activation of zeppelin functionality.
All REST APIs are available starting with the following endpoint `http://[zeppelin-server]:[zeppelin-port]/api`.
Note that Apache Zeppelin REST APIs receive or return JSON objects, it is recommended for you to install some JSON viewers such as [JSONView](https://chrome.google.com/webstore/detail/jsonview/chklaanhfefbnpoihckbnefhakgolnmc).
If you work with Apache Zeppelin and find a need for an additional REST API, please [file an issue or send us an email](http://zeppelin.apache.org/community.html).
## Zeppelin Server REST API list
### Change the log level of Zeppelin Server
<table class="table-configuration">
<col width="200">
<tr>
<td>Description</td>
<td>This ```PUT``` method is used to update the root logger's log level of the server.</td>
</tr>
<tr>
<td>URL</td>
<td>```http://[zeppelin-server]:[zeppelin-port]/api/log/level/<LOG_LEVEL>```</td>
</tr>
<tr>
<td>Success code</td>
<td>200</td>
</tr>
<tr>
<td> Fail code</td>
<td> 406 </td>
</tr>
<tr>
<td> sample JSON response
</td>
<td>
<pre>
{
"status": "OK"
}
</pre>
</td>
</tr>
<tr>
<td> sample error JSON response
</td>
<td>
<pre>
{
"status":"NOT_ACCEPTABLE",
"message":"Please check LOG level specified. Valid values: DEBUG, ERROR, FATAL, INFO, TRACE, WARN"
}
</pre>
</td>
</tr>
</table>

View file

@ -75,7 +75,8 @@ public class ZeppelinRestApi {
return new JsonResponse<>(Response.Status.OK).build();
} else {
return new JsonResponse<>(Response.Status.NOT_ACCEPTABLE,
"Not a valid LOG level").build();
"Please check LOG level specified. Valid values: DEBUG, ERROR, FATAL, "
+ "INFO, TRACE, WARN").build();
}
}
}