Guest User

Untitled

a guest
Feb 3rd, 2019
142
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.63 KB | None | 0 0
  1. #!/usr/bin/env bash
  2.  
  3. if [ -z ${1} ]; then
  4. echo "Zeppelin URL required."
  5. exit 1
  6. fi
  7.  
  8. ZEPPELIN_URL=$1
  9.  
  10. if [ -z ${2} ]; then
  11. echo "User required;"
  12. exit 2
  13. fi
  14.  
  15. ZEPPELIN_USER=$2
  16.  
  17. if [ -z ${3} ]; then
  18. echo "Password required;"
  19. exit 3
  20. fi
  21.  
  22. ZEPPELIN_PASSWORD=$3
  23.  
  24. if [ -z ${4} ]; then
  25. echo "Notebook required;"
  26. exit 4
  27. fi
  28.  
  29. ZEPPELIN_NOTEBOOK=$4
  30. ZEPPELIN_SESSION=$(mktemp)
  31.  
  32. curl --silent --data "userName=$ZEPPELIN_USER&password=$ZEPPELIN_PASSWORD" -c $ZEPPELIN_SESSION -XPOST $ZEPPELIN_URL/api/login
  33. # run all paragraphs
  34. curl -b $ZEPPELIN_SESSION -XPOST $ZEPPELIN_URL/api/notebook/job/$ZEPPELIN_NOTEBOOK
  35.  
  36. rm $ZEPPELIN_SESSION
Add Comment
Please, Sign In to add comment