4371 shaares
At work, we needed to retrieve the full list of jobs a given Jenkins instance was hosting.
Our first solution was to use the jenkinsapi Python package:
import xml.etree.ElementTree as XmlElementTree
from jenkinsapi.jenkins import Jenkins
def get_all_jenkins_jobs(server_url):
jenkins = Jenkins(server_url, lazy=True, timeout=30,
username=os …