Created
June 8, 2016 11:09
-
-
Save monester/c914e32e7a2c729474700ae8f185c7bc to your computer and use it in GitHub Desktop.
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
import requests | |
import lxml.etree as etree | |
def pp(url): | |
responce = requests.get(url, auth=auth) | |
if responce.status_code == 200: | |
content = responce.content | |
print etree.tostring(etree.fromstring(content), pretty_print = True) | |
else: | |
print "Invalid responce, code=%s, url=%s" % (responce.status_code, url) | |
auth = None | |
jenkins_api = 'https://ci.fuel-infra.org/api/xml/?' | |
pp(jenkins_api +"tree=jobs[name,builds[number,result]]&" + | |
"xpath=hudson/job[name='10.0-community.all']/build[result='SUCCESS']/&wrapper=builds") | |
pp(jenkins_api + "tree=jobs[name,builds[number,result,url,actions[parameters[name,value]]]]&" + | |
"xpath=hudson/job[name='publish_fuel_community_iso']/build[result='SUCCESS']/action/parameter[value='10.0']" + \ | |
"&wrapper=builds") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment