Zeppelin API interface
WebSocket Endpoint
Anonymous:
const zeppelinHost = `localhost:8000`const wsEndpoint = `ws:///ws`const socket = // ...
With login:
const zeppelinHost = `localhost:8000`const wsEndpoint = `ws:///ws`const httpHost = `http:///`User
Then:
socket socket socket socket
In actOnSocketMessage
you would manage the entire list of socket messages, while the list of possible socket
commands is here.
REST Endpoints
Every function returns a promise of Object { success: boolean, response: Object | string, error?: string }
.
success
: the HTTP JSON call was successful or notresponse
: the JSON in case of success, the body text in case of errorerror
: the HTTP error returned from the server
The hostname can be set once, with setHost
.
// In production it should be left to empty string
Notebooks
- Auto-documented source: index.js
- Zeppelin API Doc: Notebook API
// List all notebooksNotebook // Create a notebookNotebook
If using Babel ES2017 or Node 7.6+, you can also use async/await
syntax:
{ const success response error = await Notebook if !success return console // Remember to always handle the error in some way const createdNotebookId = responsebody console}
Paragraphs
- Auto-documented source: index.js
- Zeppelin API Doc: Paragraph API
The methods are the same as in Notebook
, with the exception of an additional notebookId
parameter in first position.
The only difference is the Notebook.create
method, which accepts an Object with the data for creation:
Paragraph
Running Paragraphs
- Auto-documented source: index.js
- Zeppelin API Doc: Paragraph Run
The ParagraphJobs
namespace have methods to run
, runSync
, stop
, stat
(get status).
The runSync
function does a run in a single HTTP call:
ParagraphJobs
response.body.code
contains the paragraphtext
compilation status.response.body.msg
has a representation of the result.
For longer data computations, an asynchronous run
call will be necessary.
The implementation is there, but not yet tested.
Development
To release a new version run yarn release
, it will guide to a new release.