Apache Zeppelin (Experimental support)
Sanity check for Zeppelin
Once Zeppelin is running, you can access the Zeppelin web application.
Open at https://zeppelin.example.com
to access the Zeppelin GUI.
You will be redirected to the Keyrock login page.
Once you have logged in, you will be redirected to the Zeppelin GUI.
Get Zeppelin version
You can get the Zeppelin version by the following command:
Request:
curl -s https://zeppelin.example.com/api/version
Response:
{
"status": "OK",
"message": "Zeppelin version",
"body": {
"git-commit-id": "",
"git-timestamp": "",
"version": "0.9.0"
}
}
Print historical data on Zeppelin notebook
Setup instance
First, setup Orion, Cygnus and Zeppelin as shown:
ORION=orion
CYGNUS=cygnus
CYGNUS_MONGO=true
ZEPPELIN=zeppelin
Subscribing to Context Changes
Create a subscription to notify Cygnus of changes in context and store it into MongoDB.
ngsi create \
--host orion.example.com \
--service openiot \
--path / \
subscription \
--description "Notify Cygnus of all context changes and store it into MongoDB" \
--idPattern ".*" \
--uri "http://cygnus:5051/notify"
Create context data
Generate context data by running the following script:
#!/bin/bash
set -eu
for i in {0..9}
do
echo $i
ngsi upsert \
--host orion.example.com \
--service openiot \
--path / \
entity \
--keyValues \
--data "{\"id\":\"device001\", \"type\":\"device\", \"temperature\":${RANDOM}}"
sleep 1
done
Reading historical data from MongoDB on notebook
Open the FIWARE Big Bang Example
notebook from Notebook menu.
You can read historical data from MongoDB by the following script.
%mongodb
db["sth_/_device001_device"].find({},{attrValue:1,recvTime:1}).table()
Run the paragraph on the notebook.
You will see a historical data on the notebook.