Search in sources :

Example 21 with JsonResponse

use of org.apache.zeppelin.server.JsonResponse in project zeppelin by apache.

the class NotebookRestApi method clearAllParagraphOutput.

/**
   * Clear result of all paragraphs REST API
   *
   * @param noteId ID of Note
   * @return JSON with status.ok
   */
@PUT
@Path("{noteId}/clear")
@ZeppelinApi
public Response clearAllParagraphOutput(@PathParam("noteId") String noteId) throws IOException {
    LOG.info("clear all paragraph output of note {}", noteId);
    checkIfUserCanWrite(noteId, "Insufficient privileges you cannot clear this note");
    Note note = notebook.getNote(noteId);
    checkIfNoteIsNotNull(note);
    note.clearAllParagraphOutput();
    return new JsonResponse(Status.OK, "").build();
}
Also used : Note(org.apache.zeppelin.notebook.Note) JsonResponse(org.apache.zeppelin.server.JsonResponse) Path(javax.ws.rs.Path) ZeppelinApi(org.apache.zeppelin.annotation.ZeppelinApi) PUT(javax.ws.rs.PUT)

Aggregations

JsonResponse (org.apache.zeppelin.server.JsonResponse)21 ZeppelinApi (org.apache.zeppelin.annotation.ZeppelinApi)15 Path (javax.ws.rs.Path)13 POST (javax.ws.rs.POST)6 IOException (java.io.IOException)5 Note (org.apache.zeppelin.notebook.Note)5 PUT (javax.ws.rs.PUT)4 InterpreterException (org.apache.zeppelin.interpreter.InterpreterException)4 GET (javax.ws.rs.GET)3 ZeppelinConfiguration (org.apache.zeppelin.conf.ZeppelinConfiguration)3 InterpreterSetting (org.apache.zeppelin.interpreter.InterpreterSetting)3 Paragraph (org.apache.zeppelin.notebook.Paragraph)3 AuthenticationInfo (org.apache.zeppelin.user.AuthenticationInfo)3 UserCredentials (org.apache.zeppelin.user.UserCredentials)3 DELETE (javax.ws.rs.DELETE)2 Subject (org.apache.shiro.subject.Subject)2 JsonParseException (com.google.gson.JsonParseException)1 JsonSyntaxException (com.google.gson.JsonSyntaxException)1 TypeToken (com.google.gson.reflect.TypeToken)1 HashMap (java.util.HashMap)1