def __init__(self, baseurl, jenkins_obj, poll_cache_timeout=0): """ Handy access to all of the nodes on your Jenkins server """ self.jenkins = jenkins_obj JenkinsBase.__init__(self, baseurl, poll_cache_timeout=poll_cache_timeout)
def __init__( self, baseurl, username=None, password=None, proxyhost=None, proxyport=None, proxyuser=None, proxypass=None, formauth=False, krbauth=False, ): """ :param baseurl: baseurl for jenkins instance including port, str :param username: username for jenkins auth, str :param password: password for jenkins auth, str :param proxyhost: proxyhostname, str :param proxyport: proxyport, int :param proxyuser: proxyusername for proxy auth, str :param proxypass: proxypassword for proxyauth, str :return: a Jenkins obj """ self.username = username self.password = password self.proxyhost = proxyhost self.proxyport = proxyport self.proxyuser = proxyuser self.proxypass = proxypass JenkinsBase.__init__(self, baseurl, formauth=formauth, krbauth=krbauth)
def __init__(self, baseurl, username=None, password=None, proxyhost=None, proxyport=None, proxyuser=None, proxypass=None, formauth=False): """ :param baseurl: baseurl for jenkins instance including port, str :param username: username for jenkins auth, str :param password: password for jenkins auth, str :param proxyhost: proxyhostname, str :param proxyport: proxyport, int :param proxyuser: proxyusername for proxy auth, str :param proxypass: proxypassword for proxyauth, str :return: a Jenkins obj """ self.username = username self.password = password self.proxyhost = proxyhost self.proxyport = proxyport self.proxyuser = proxyuser self.proxypass = proxypass JenkinsBase.__init__(self, baseurl, formauth=formauth)
def __init__(self, url, name, jenkins_obj): self.name = name self.jenkins = jenkins_obj self._revmap = None self._config = None self.bs = None JenkinsBase.__init__(self, url)
def __init__(self, url, name, jenkins_obj): self.name = name self.jenkins = jenkins_obj self._revmap = None self._config = None self._element_tree = None self._scm_map = { "hudson.scm.SubversionSCM": "svn", "hudson.plugins.git.GitSCM": "git", "hudson.plugins.mercurial.MercurialSCM": "hg", "hudson.scm.NullSCM": "NullSCM", } self._scmurlmap = { "svn": lambda element_tree: list(element_tree.findall(SVN_URL)), "git": lambda element_tree: list(element_tree.findall(GIT_URL)), "hg": lambda element_tree: list(element_tree.findall(HG_URL)), None: lambda element_tree: [], } self._scmbranchmap = { "svn": lambda element_tree: [], "git": lambda element_tree: list(element_tree.findall(GIT_BRANCH)), "hg": self._get_hg_branch, None: lambda element_tree: [], } JenkinsBase.__init__(self, url)
def __init__(self, url, name, jenkins_obj): self.name = name self.jenkins = jenkins_obj self._revmap = None self._config = None self._element_tree = None self._scm_map = { 'hudson.scm.SubversionSCM': 'svn', 'hudson.plugins.git.GitSCM': 'git', 'hudson.plugins.mercurial.MercurialSCM': 'hg', 'hudson.scm.NullSCM': 'NullSCM' } self._scmurlmap = { 'svn': lambda element_tree: [element for element in element_tree.findall('./scm/locations/hudson.scm.SubversionSCM_-ModuleLocation/remote')], 'git': lambda element_tree: [element for element in element_tree.findall('./scm/userRemoteConfigs/hudson.plugins.git.UserRemoteConfig/url')], 'hg': lambda element_tree: [element_tree.find('./scm/source')], None: lambda element_tree: [] } self._scmbranchmap = { 'svn': lambda element_tree: [], 'git': lambda element_tree: [element for element in element_tree.findall('./scm/branches/hudson.plugins.git.BranchSpec/name')], 'hg': lambda element_tree: [element_tree.find('./scm/branch')], None: lambda element_tree: [] } JenkinsBase.__init__(self, url)
def __init__(self, baseurl, username=None, password=None, requester=None, lazy=False, ssl_verify=True, timeout=10): """ :param baseurl: baseurl for jenkins instance including port, str :param username: username for jenkins auth, str :param password: password for jenkins auth, str :return: a Jenkins obj """ self.username = username self.password = password self.requester = requester or Requester(username, password, baseurl=baseurl, ssl_verify=ssl_verify, timeout=timeout) self.requester.timeout = timeout self.lazy = lazy self.jobs_container = None JenkinsBase.__init__(self, baseurl, poll=not lazy)
def __init__( self, baseurl, username=None, password=None, requester=None, lazy=False, ssl_verify=True, cert=None, timeout=10): """ :param baseurl: baseurl for jenkins instance including port, str :param username: username for jenkins auth, str :param password: password for jenkins auth, str :return: a Jenkins obj """ self.username = username self.password = password self.requester = requester or Requester( username, password, baseurl=baseurl, ssl_verify=ssl_verify, cert=cert, timeout=timeout ) self.requester.timeout = timeout self.lazy = lazy self.jobs_container = None JenkinsBase.__init__(self, baseurl, poll=not lazy)
def __init__(self, baseurl, username=None, password=None, requester=None, lazy=False, ssl_verify=True, cert=None, timeout=10, use_baseurl=False): """ :param baseurl: baseurl for jenkins instance including port, str :param username: username for jenkins auth, str :param password: password for jenkins auth, str :param requester: , Requester :param lazy: delay polling of data, bool :param ssl_verify: requests lib Verify SSL (See requests lib), bool. :param cert: requests lib certificate (See requests lib), String or tuple. :param timeout: requests lib timeout (See requests lib), float or tuple. :param use_baseurl: If jenkins baseurl is diff from job url, use jenkins baseurl, bool. :return: a Jenkins obj """ self.username = username self.password = password self.requester = requester or Requester(username, password, baseurl=baseurl, ssl_verify=ssl_verify, cert=cert, timeout=timeout) self.requester.timeout = timeout self.lazy = lazy self.jobs_container = None self.use_baseurl = use_baseurl JenkinsBase.__init__(self, baseurl, poll=not lazy)
def __init__(self, baseurl, id, jenkins_obj): logging.basicConfig() self.jenkins_obj = jenkins_obj assert self.RE_MD5.search( id ), "%s does not look like a valid id" % id url = "%s/fingerprint/%s/" % ( baseurl, id ) JenkinsBase.__init__( self, url, poll=False ) self.id = id
def __init__(self, url, name, jenkins_obj): self.name = name self.jenkins = jenkins_obj self._revmap = None self._config = None self._element_tree = None self._scm_map = { 'hudson.scm.SubversionSCM': 'svn', 'hudson.plugins.git.GitSCM': 'git', 'hudson.plugins.mercurial.MercurialSCM': 'hg', 'hudson.scm.NullSCM': 'NullSCM' } self._scmurlmap = { 'svn': lambda element_tree: list(element_tree.findall(SVN_URL)), 'git': lambda element_tree: list(element_tree.findall(GIT_URL)), 'hg': lambda element_tree: list(element_tree.findall(HG_URL)), None: lambda element_tree: [] } self._scmbranchmap = { 'svn': lambda element_tree: [], 'git': lambda element_tree: list(element_tree.findall(GIT_BRANCH)), 'hg': self._get_hg_branch, None: lambda element_tree: [] } self.url = url JenkinsBase.__init__(self, self.url)
def __init__(self, baseurl, jenkins_obj): """ Handy access to all of the nodes on your Jenkins server """ self.jenkins = jenkins_obj JenkinsBase.__init__(self, baseurl.rstrip('/') if '/computer' in baseurl else baseurl.rstrip('/') + '/computer')
def __init__(self, url, build, poll_cache_timeout=0): """ Init a resultset :param url: url for a build, str :param build: build obj """ self.build = build JenkinsBase.__init__(self, url, poll_cache_timeout=poll_cache_timeout)
def __init__(self, baseurl, id_, jenkins_obj): logging.basicConfig() self.jenkins_obj = jenkins_obj assert self.RE_MD5.search(id_), "%s does not look like a valid id" % id_ url = "%s/fingerprint/%s/" % (baseurl, id_) JenkinsBase.__init__(self, url, poll=False) self.id_ = id_ self.unknown = False # Previously uninitialized in ctor
def __init__(self, url, build): """ Init a resultset :param url: url for a build, str :param build: build obj """ self.build = build JenkinsBase.__init__(self, url)
def __init__(self, baseurl, jenkins_obj): """ Init the Jenkins queue object :param baseurl: basic url for the queue :param jenkins_obj: ref to the jenkins obj """ self.jenkins = jenkins_obj JenkinsBase.__init__(self, baseurl)
def __init__(self, baseurl, username=None, password=None, requester=None): """ :param baseurl: baseurl for jenkins instance including port, str :param username: username for jenkins auth, str :param password: password for jenkins auth, str :return: a Jenkins obj """ self.username = username self.password = password self.requester = requester or Requester(username, password) JenkinsBase.__init__(self, baseurl)
def __init__(self, baseurl, nodename, jenkins_obj): """ Init a node object by providing all relevant pointers to it :param baseurl: basic url for querying information on a node :param nodename: hostname of the node :param jenkins_obj: ref to the jenkins obj :return: Node obj """ self.name = nodename self.jenkins = jenkins_obj JenkinsBase.__init__(self, baseurl)
def __init__(self, baseurl, labelname, jenkins_obj): """ Init a label object by providing all relevant pointers to it :param baseurl: basic url for querying information on a node :param labelname: name of the label :param jenkins_obj: ref to the jenkins obj :return: Label obj """ self.labelname = labelname self.jenkins = jenkins_obj self.baseurl = baseurl JenkinsBase.__init__(self, baseurl)
def __init__(self, name, jenkins_obj): """ Init a label by providing the labels name and the Jenkins environment it is hosted on. :param name: the label name as it would appear in jenkins :param jenkins_obj: the jenkins environment to look for the label in. :return: Label obj """ self.name = name self.jenkins = jenkins_obj self.baseurl = self.jenkins.baseurl + "/label/" + self.name self._nodes = None self._jobs = None JenkinsBase.__init__(self, self.baseurl)
def __init__(self, baseurl, username=None, password=None, requester=None, lazy=False, ssl_verify=True): """ :param baseurl: baseurl for jenkins instance including port, str :param username: username for jenkins auth, str :param password: password for jenkins auth, str :param ssl_verify: verify ssl certificate, boolean :return: a Jenkins obj """ self.username = username self.password = password self.requester = requester or Requester(username, password, baseurl=baseurl, ssl_verify=ssl_verify) self.lazy = lazy JenkinsBase.__init__(self, baseurl, poll=not lazy)
def __init__(self, url, buildno, job, depth=1): """ depth=1 is for backward compatibility consideration About depth, the deeper it is, the more build data you get back. If depth=0 is sufficient for you, don't go up to 1. See section 'Depth control' of https://wiki.jenkins-ci.org/display/JENKINS/Remote+access+API """ assert isinstance(buildno, int) self.buildno = buildno self.job = job self.depth = depth JenkinsBase.__init__(self, url)
def __init__(self, baseurl, username=None, password=None, requester=None, lazy=False, ssl_verify=True, cert=None, timeout=10, useCrumb=False): """ :param baseurl: baseurl for jenkins instance including port, str :param username: username for jenkins auth, str :param password: password for jenkins auth, str :return: a Jenkins obj """ if username == None: self.username = JenkinsBase.USERNAME else: self.username = username if password == None: self.password = JenkinsBase.PASSWORD else: self.password = password if requester is None: if useCrumb: requester = CrumbRequester else: requester = Requester self.requester = requester(self.username, self.password, baseurl=baseurl, ssl_verify=ssl_verify, cert=cert, timeout=timeout) else: self.requester = requester self.requester.timeout = timeout self.lazy = lazy self.jobs_container = None JenkinsBase.__init__(self, baseurl, poll=not lazy)
def __init__(self, url, buildno, job, poll_cache_timeout=0): assert type(buildno) == int self.buildno = buildno self.job = job JenkinsBase.__init__(self, url, poll_cache_timeout=poll_cache_timeout)
def __init__(self, url, name, jenkins_obj): self.name = name self.jenkins_obj = jenkins_obj JenkinsBase.__init__(self, url) self.deleted = False
def __init__(self, baseurl, jenkins_obj): self.baseurl = baseurl self.jenkins = jenkins_obj JenkinsBase.__init__(self, baseurl) self.credentials = self._data['credentials']
def __init__(self, url, jenkins_obj, poll_cache_timeout=0): self.jenkins_obj = jenkins_obj JenkinsBase.__init__(self, url, poll_cache_timeout=poll_cache_timeout)
def __init__(self, url, jenkins_obj): self.jenkins_obj = jenkins_obj JenkinsBase.__init__(self, url)
def __init__(self, url, buildno, job): assert isinstance(buildno, int) self.buildno = buildno self.job = job JenkinsBase.__init__(self, url)
def __init__(self, jenkins_obj, baseurl, nodename, node_dict, poll=True): """ Init a node object by providing all relevant pointers to it :param jenkins_obj: ref to the jenkins obj :param baseurl: basic url for querying information on a node If url is not set - object will construct it itself. This is useful when node is being created and not exists in Jenkins yet :param nodename: hostname of the node :param dict node_dict: Dict with node parameters as described below :param bool poll: set to False if node does not exist or automatic refresh from Jenkins is not required. Default is True. If baseurl parameter is set to None - poll parameter will be set to False JNLP Node: { 'num_executors': int, 'node_description': str, 'remote_fs': str, 'labels': str, 'exclusive': bool } SSH Node: { 'num_executors': int, 'node_description': str, 'remote_fs': str, 'labels': str, 'exclusive': bool, 'host': str, 'port': int 'credential_description': str, 'jvm_options': str, 'java_path': str, 'prefix_start_slave_cmd': str, 'suffix_start_slave_cmd': str 'max_num_retries': int, 'retry_wait_time': int, 'retention': str ('Always' or 'OnDemand') 'ondemand_delay': int (only for OnDemand retention) 'ondemand_idle_delay': int (only for OnDemand retention) 'env': [ { 'key':'TEST', 'value':'VALUE' }, { 'key':'TEST2', 'value':'value2' } ], 'tool_location': [ { "key": "hudson.tasks.Maven$MavenInstallation$DescriptorImpl@Maven 3.0.5", "home": "/home/apache-maven-3.0.5/" }, { "key": "hudson.plugins.git.GitTool$DescriptorImpl@Default", "home": "/home/git-3.0.5/" }, ] } :return: None :return: Node obj """ self.name = nodename self.jenkins = jenkins_obj if not baseurl: poll = False baseurl = '%s/computer/%s' % (self.jenkins.baseurl, self.name) JenkinsBase.__init__(self, baseurl, poll=poll) self.node_attributes = node_dict self._element_tree = None self._config = None
def __init__(self, build, url): self.build = build JenkinsBase.__init__(self, url)
def __init__(self, baseurl, nodename, jenkins): self.nodename = nodename self.jenkins = jenkins JenkinsBase.__init__(self, baseurl) self.count = self._data['numExecutors']
def __init__(self, url, buildno, job): assert type(buildno) == int self.buildno = buildno self.job = job JenkinsBase.__init__(self, url)
def __init__(self, url, name, jenkins_obj, poll_cache_timeout=0): self.name = name self.jenkins_obj = jenkins_obj JenkinsBase.__init__(self, url, poll_cache_timeout=poll_cache_timeout) self.deleted = False
def __init__(self, baseurl, jenkins_obj): """ Handy access to all of the nodes on your Jenkins server """ self.jenkins = jenkins_obj JenkinsBase.__init__(self, baseurl)
def __init__(self, jenkins_obj, baseurl, nodename, node_dict, poll=True): """ Init a node object by providing all relevant pointers to it :param jenkins_obj: ref to the jenkins obj :param baseurl: basic url for querying information on a node If url is not set - object will construct it itself. This is useful when node is being created and not exists in Jenkins yet :param nodename: hostname of the node :param dict node_dict: Dict with node parameters as described below :param bool poll: set to False if node does not exist or automatic refresh from Jenkins is not required. Default is True. If baseurl parameter is set to None - poll parameter will be set to False JNLP Node: { 'num_executors': int, 'node_description': str, 'remote_fs': str, 'labels': str, 'exclusive': bool } SSH Node: { 'num_executors': int, 'node_description': str, 'remote_fs': str, 'labels': str, 'exclusive': bool, 'host': str, 'port': int 'credential_description': str, 'jvm_options': str, 'java_path': str, 'prefix_start_slave_cmd': str, 'suffix_start_slave_cmd': str 'max_num_retries': int, 'retry_wait_time': int, 'retention': str ('Always' or 'OnDemand') 'ondemand_delay': int (only for OnDemand retention) 'ondemand_idle_delay': int (only for OnDemand retention) 'env': [ { 'key':'TEST', 'value':'VALUE' }, { 'key':'TEST2', 'value':'value2' } ] } :return: None :return: Node obj """ self.name = nodename self.jenkins = jenkins_obj if not baseurl: poll = False baseurl = '%s/computer/%s' % (self.jenkins.baseurl, self.name) JenkinsBase.__init__(self, baseurl, poll=poll) self.node_attributes = node_dict self._element_tree = None self._config = None
def __init__(self, build, url): self.build = build JenkinsBase.__init__(self,url)
def __init__( self, url, buildno, job ): assert type(buildno) == int self.buildno = buildno self.job = job JenkinsBase.__init__( self, url )