User API¶
This module is a collection of helpful, high-level functions for automating common tasks. Many of these functions were designed to be exposed to the command-line, hence they have simple string arguments.
-
jenkinsapi.api.
block_until_complete
(jenkinsurl, jobs, maxwait=12000, interval=30, raise_on_timeout=True, username=None, password=None, ssl_verify=True)¶ Wait until all of the jobs in the list are complete.
-
jenkinsapi.api.
get_artifacts
(jenkinsurl, jobid=None, build_no=None, username=None, password=None, ssl_verify=True)¶ Find all the artifacts for the latest build of a job.
-
jenkinsapi.api.
get_build
(jenkinsurl, jobname, build_no, username=None, password=None, ssl_verify=True)¶ A convenience function to fetch down the test results from a jenkins job by build number.
-
jenkinsapi.api.
get_latest_build
(jenkinsurl, jobname, username=None, password=None, ssl_verify=True)¶ A convenience function to fetch down the very latest test results from a jenkins job.
-
jenkinsapi.api.
get_latest_complete_build
(jenkinsurl, jobname, username=None, password=None, ssl_verify=True)¶ A convenience function to fetch down the very latest test results from a jenkins job.
-
jenkinsapi.api.
get_latest_test_results
(jenkinsurl, jobname, username=None, password=None, ssl_verify=True)¶ A convenience function to fetch down the very latest test results from a jenkins job.
-
jenkinsapi.api.
get_nested_view_from_url
(url, username=None, password=None, ssl_verify=True)¶ Returns View based on provided URL. Convenient for nested views.
-
jenkinsapi.api.
get_view_from_url
(url, username=None, password=None, ssl_verify=True)¶ Factory method
-
jenkinsapi.api.
grab_artifact
(jenkinsurl, jobid, artifactid, targetdir, username=None, password=None, strict_validation=False, ssl_verify=True)¶ Convenience method to find the latest good version of an artifact and save it to a target directory. Directory is made automatically if not exists.
-
jenkinsapi.api.
install_artifacts
(artifacts, dirstruct, installdir, basestaticurl, strict_validation=False)¶ Install the artifacts.
-
jenkinsapi.api.
search_artifact_by_regexp
(jenkinsurl, jobid, artifactRegExp, username=None, password=None, ssl_verify=True)¶ Search the entire history of a hudson job for a build which has an artifact whose name matches a supplied regular expression. Return only that artifact.
@param jenkinsurl: The base URL of the jenkins server @param jobid: The name of the job we are to search through @param artifactRegExp: A compiled regular expression object
(not a re-string)@param username: Jenkins login user name, optional @param password: Jenkins login password, optional
-
jenkinsapi.api.
search_artifacts
(jenkinsurl, jobid, artifact_ids=None, username=None, password=None, ssl_verify=True)¶ Search the entire history of a jenkins job for a list of artifact names. If same_build is true then ensure that all artifacts come from the same build of the job