Last active
October 5, 2017 14:14
-
-
Save EricLondon/a4ba93775a682cb2fa6b9a341a76e7a1 to your computer and use it in GitHub Desktop.
EMR/Zeppelin API notebook status check
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
require 'open-uri' | |
require 'json' | |
require 'pp' | |
ZEP_HOST = 'localhost' | |
ZEP_PORT = 8890 | |
ZEP_ADDR = "http://#{ZEP_HOST}:#{ZEP_PORT}" | |
# list notebooks | |
notebooks = JSON.parse(open("#{ZEP_ADDR}/api/notebook").read)['body'] | |
notebooks.each do |notebook| | |
puts "--------------------------------------------------" | |
pp notebook | |
status = JSON.parse(open("#{ZEP_ADDR}/api/notebook/job/#{notebook['id']}").read)['body'] | |
pp status | |
end | |
__END__ | |
# Usage: | |
curl https://gist.githubusercontent.com/EricLondon/a4ba93775a682cb2fa6b9a341a76e7a1/raw/934c89917fcb021af74be5f81edd07ce8a9c1a86 > emr-zeppelin-status.rb | |
chmod +x emr-zeppelin-status.rb | |
./emr-zeppelin-status.rb |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment