Skip to content

Conversation

@HeartSaVioR
Copy link
Contributor

What is this PR for?

This issue is intended to fill gap between REST API and WebSocket operations.
For now we can only access notebook and paragraph to READONLY (not writing) via REST API but after this PR, we can insert / retrieve / move / delete paragraph via REST API.

What type of PR is it?

Feature

Todos

Is there a relevant Jira issue?

https://issues.apache.org/jira/browse/ZEPPELIN-511

How should this be tested?

Please follow the explanation of added REST APIs from rest-notebook.md.

Screenshots (if appropriate)

Questions:

  • Does the licenses files need update? (No)
  • Is there breaking changes for older versions? (No)
  • Does this needs documentation? (Yes, I've addressed it.)

@Leemoonsoo
Copy link
Member

Thanks for adding really useful REST APIs!
Looks good to me!

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This variable should be p2

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@prabhjyotsingh Good finding! Will fix.

@prabhjyotsingh
Copy link
Contributor

@HeartSaVioR few more things

I think you should do a clean up as well after every test case execution

ZeppelinServer.notebook.removeNote(note.getId());

Also when I run this, line 538;

PostMethod post = httpPost("/notebook/" + note.getId() + "/paragraph/" + p.getId() + "/move/" + 10, "");

it returns

{"status":"OK","message":""}

Which i think is also not appropriate. Since, this was an invalid operation (total nos of paragraph = 2). This should have either returned some error, or should have moved 1st paragraph to the last location.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be also post2.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for finding, will fix.

@HeartSaVioR
Copy link
Contributor Author

@prabhjyotsingh
Thanks for the review. Addressed your comments.
Regarding moving paragraph to invalid index, I think it could be treated as bad request, so I applied it. Would it be fine for you?

@HeartSaVioR
Copy link
Contributor Author

Upmerged. Please take a look again, thanks!

@HeartSaVioR
Copy link
Contributor Author

Done with another upmerge.

@Leemoonsoo
Copy link
Member

Looks good to me.
Merge if there're no more discussions.

@minahlee
Copy link
Member

Would you mind to do rebase than merge? It will be easier to keep track who has credits on merged code.

…r paragraph

* implements 4 REST APIs about the paragraph
* Added unit test to test this features

Conflicts:
	zeppelin-server/src/test/java/org/apache/zeppelin/rest/ZeppelinRestApiTest.java
* also change http status code to 201 CREATED
Conflicts:
	zeppelin-zengine/src/main/java/org/apache/zeppelin/notebook/Note.java
@HeartSaVioR
Copy link
Contributor Author

@minahlee No problem. Rebased via creating new branch, cherry-pick, and reset branch's head.

@minahlee
Copy link
Member

@HeartSaVioR Thanks for quick response. LGTM

@Leemoonsoo
Copy link
Member

LGTM. Merging it into master

@asfgit asfgit closed this in 3bfd97e Dec 27, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants