Last active
January 20, 2017 16:49
-
-
Save sambos/c6856c75825e5ebe62e1c1a6fb152b26 to your computer and use it in GitHub Desktop.
Useful scrpits
This file contains 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 python | |
# curl equivalent: | |
# curl --negotiate -u:userid "http://localhost:11000/oozie?job=x" -H 'Content-type:text/xml' | |
import urllib2 | |
import json | |
import pycurl | |
#req = urllib2.Request('http://localhost:11000/oozie/v1/jobs?jobtype=wf') | |
#response = urllib2.urlopen(req) | |
#output = response.read() | |
#print json.dumps(json.loads(output), indent=4, separators=(',', ': ')) | |
curl = pycurl.Curl() | |
curl.setopt(pycurl.HTTPAUTH, pycurl.HTTPAUTH_GSSNEGOTIATE) | |
curl.setopt(pycurl.USERPWD, ':') | |
curl.setopt(pycurl.URL, 'http://localhost:11000/oozie/v1/jobs?jobtype=wf') | |
curl.perform() | |
curl.close() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment