Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env bash
- if [ -z ${1} ]; then
- echo "Zeppelin URL required."
- exit 1
- fi
- ZEPPELIN_URL=$1
- if [ -z ${2} ]; then
- echo "User required;"
- exit 2
- fi
- ZEPPELIN_USER=$2
- if [ -z ${3} ]; then
- echo "Password required;"
- exit 3
- fi
- ZEPPELIN_PASSWORD=$3
- if [ -z ${4} ]; then
- echo "Notebook required;"
- exit 4
- fi
- ZEPPELIN_NOTEBOOK=$4
- ZEPPELIN_SESSION=$(mktemp)
- curl --silent --data "userName=$ZEPPELIN_USER&password=$ZEPPELIN_PASSWORD" -c $ZEPPELIN_SESSION -XPOST $ZEPPELIN_URL/api/login
- # run all paragraphs
- curl -b $ZEPPELIN_SESSION -XPOST $ZEPPELIN_URL/api/notebook/job/$ZEPPELIN_NOTEBOOK
- rm $ZEPPELIN_SESSION
Add Comment
Please, Sign In to add comment