zeppelin/docs/rest-api/rest-notebookRepo.md
AhyoungRyu 8bb37c2c2e [DOCS][ZEPPELIN-2140] Add docs for notebookRepo REST API
### What is this PR for?
Added a docs page for notebookRepo REST API based on [NotebookRepoRestApi.java](https://github.com/apache/zeppelin/blob/master/zeppelin-server/src/main/java/org/apache/zeppelin/rest/NotebookRepoRestApi.java). And this PR will cover "notebook repository reload endpoint" : #2043 as well.

### What type of PR is it?
Documentation

### What is the Jira issue?
[ZEPPELIN-2140](https://issues.apache.org/jira/browse/ZEPPELIN-2140)

### How should this be tested?
Just checking screenshots will be faster!

### Screenshots (if appropriate)
 - In navbar
<img width="300" alt="screen shot 2017-02-25 at 11 02 02 pm" src="https://cloud.githubusercontent.com/assets/10060731/23331707/76551c8a-fbae-11e6-99b8-cc686e208c39.png">

 - API description list
<img width="751" alt="screen shot 2017-02-25 at 10 54 21 pm" src="https://cloud.githubusercontent.com/assets/10060731/23331704/57dd7d4c-fbae-11e6-8cc2-189fc9e68ece.png">
<img width="715" alt="screen shot 2017-02-25 at 10 54 29 pm" src="https://cloud.githubusercontent.com/assets/10060731/23331708/85f722a0-fbae-11e6-9b40-7f4c98761dd6.png">
<img width="730" alt="screen shot 2017-02-25 at 10 54 38 pm" src="https://cloud.githubusercontent.com/assets/10060731/23331709/8882b93a-fbae-11e6-9fe2-95bc2620e2c9.png">

### Questions:
* Does the licenses files need update? no
* Is there breaking changes for older versions? no
* Does this needs documentation? no

Author: AhyoungRyu <fbdkdud93@hanmail.net>

Closes #2067 from AhyoungRyu/ZEPPELIN-2140 and squashes the following commits:

c73e9b2 [AhyoungRyu] Fix typo :D
7d41435 [AhyoungRyu] Add underscore escaper
8eac3dd [AhyoungRyu] Add a docs page for notebookRepoRestApi
2017-02-28 13:02:02 +09:00

4.3 KiB

layout title description group
page Apache Zeppelin notebook repository REST API This page contains Apache Zeppelin notebook repository REST API information. rest-api

{% include JB/setup %}

Apache Zeppelin Notebook Repository API

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.

If you work with Apache Zeppelin and find a need for an additional REST API, please file an issue or send us an email.

Notebook Repository REST API List

List all available notebook repositories

Description This ```GET``` method returns all the available notebook repositories.
URL ```http://[zeppelin-server]:[zeppelin-port]/api/notebook-repositories```
Success code 200
Fail code 500
Sample JSON response
{
  "status": "OK",
  "message": "",
  "body": [
    {
      "name": "GitNotebookRepo",
      "className": "org.apache.zeppelin.notebook.repo.GitNotebookRepo",
      "settings": [
        {
          "type": "INPUT",
          "value": [],
          "selected": "ZEPPELIN_HOME/zeppelin/notebook/",
          "name": "Notebook Path"
        }
      ]
    }
  ]
}
        

Reload a notebook repository

Description This ```GET``` method triggers reloading and broadcasting of the note list.
URL ```http://[zeppelin-server]:[zeppelin-port]/api/notebook-repositories/reload```
Success code 200
Fail code 500
Sample JSON response
{
  "status": "OK",
  "message": ""
}
        

Update a specific notebook repository

Description This ```PUT``` method updates a specific notebook repository.
URL ```http://[zeppelin-server]:[zeppelin-port]/api/notebook-repositories```
Success code 200
Fail code 404 when the specified notebook repository doesn't exist
406 for invalid payload
500 for any other errors
Sample JSON input
{
  "name":"org.apache.zeppelin.notebook.repo.GitNotebookRepo",
  "settings":{
    "Notebook Path":"/tmp/notebook/"
  }
}
        
Sample JSON response
{
  "status": "OK",
  "message": "",
  "body": {
    "name": "GitNotebookRepo",
    "className": "org.apache.zeppelin.notebook.repo.GitNotebookRepo",
    "settings": [
      {
        "type": "INPUT",
        "value": [],
        "selected": "/tmp/notebook/",
        "name": "Notebook Path"
      }
    ]
  }
}