zeppelin/docs/rest-api
DuyHai DOAN 7e2a1b5d4f [ZEPPELIN-699] Add new synchronous paragraph run REST API
### What is this PR for?
Right now, when calling the REST API `http://<ip>:<port>/api/notebook/job/<note_id>/<paragraph_id>` Zeppelin always returns **OK** as shown by this source code: https://github.com/apache/incubator-zeppelin/blob/master/zeppelin-server/src/main/java/org/apache/zeppelin/rest/NotebookRestApi.java#L477

This ticket will update the behavior so that Zeppelin also return the result of the paragraph execution

### What type of PR is it?
[Improvement]

### Todos
* [ ] - Code Review
* [ ] - Simple Test

### Is there a relevant Jira issue?
**[ZEPPELIN-699]**

### How should this be tested?
* `git fetch origin pull/746/head:ParagraphExecutionRESTAPI`
* `git checkout ParagraphExecutionRESTAPI`
* `mvn clean package -DskipTests`
* `bin/zeppelin-daemon.sh restart`
* Create a new note
* In the first paragraph, put the following code

```scala
%sh

echo "Current time = "`date +"%T"
```

* Retrieve the current note id in the URL
* Retrieve the current paragraph id
* Use a REST Client like **[POSTman]** to create a HTTP POST query `http://<ip>:<port>/api/notebook/run/<note_id>/<paragraph_id>`
* You should receive something similar as follow for answer

```
{
    "status": "OK",
    "body": {
        "code": "SUCCESS",
        "type": "TEXT",
        "msg": "Current time = 16:14:18\n"
    }
}
```

### Screenshots (if appropriate)
![zeppelin_synchronous_rest_api](https://cloud.githubusercontent.com/assets/1532977/15748069/b4a26a46-28dd-11e6-8f51-aa13ddba3f1c.gif)

API Documentation update

**Existing asynchronous API**
![image](https://cloud.githubusercontent.com/assets/1532977/15773274/5b508cae-2976-11e6-9e52-14d8b7e7828e.png)

**New synchronous API**
![image](https://cloud.githubusercontent.com/assets/1532977/15773309/84965a94-2976-11e6-9719-81d8b555c3c4.png)

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

[ZEPPELIN-699]: https://issues.apache.org/jira/browse/ZEPPELIN-699
[POSTman]: https://www.getpostman.com/

Author: DuyHai DOAN <doanduyhai@gmail.com>

Closes #746 from doanduyhai/ZEPPELIN-699 and squashes the following commits:

fb0570c [DuyHai DOAN] [ZEPPELIN-699] Update Notebook REST API documentation
8367acf [DuyHai DOAN] [ZEPPELIN-699] Add new synchronous paragraph run REST API
2016-08-31 23:56:39 -07:00
..
rest-configuration.md [ZEPPELIN-1219] Add searching feature to Zeppelin docs site 2016-08-10 12:39:22 +09:00
rest-credential.md [ZEPPELIN-1219] Add searching feature to Zeppelin docs site 2016-08-10 12:39:22 +09:00
rest-interpreter.md [ZEPPELIN-728] Can't POST interpreter setting (CorsFilter?) 2016-08-24 12:54:45 +09:00
rest-notebook.md [ZEPPELIN-699] Add new synchronous paragraph run REST API 2016-08-31 23:56:39 -07:00