GitHub user doanduyhai reopened a pull request:

    https://github.com/apache/zeppelin/pull/746

    [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/

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/doanduyhai/incubator-zeppelin ZEPPELIN-699

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/zeppelin/pull/746.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #746
    
----
commit 8367acfc0526965a884f58eea8f8ddda70d011d7
Author: DuyHai DOAN <doanduy...@gmail.com>
Date:   2016-06-02T14:15:46Z

    [ZEPPELIN-699] Add new synchronous paragraph run REST API

commit fb0570ce70c47d3648ce4b9cc8265ebe51f6bdc8
Author: DuyHai DOAN <doanduy...@gmail.com>
Date:   2016-06-02T14:24:38Z

    [ZEPPELIN-699] Update Notebook REST API documentation

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

Reply via email to