API reference

class api4jenkins.Jenkins(url, **kwargs)[source]

Constructs Jenkins.

Parameters
  • url – URL of Jenkins server, str

  • auth – (optional) Auth tuple to enable Basic/Digest/Custom HTTP Auth.

  • token – (optional) Boolean, Create user token when initialize instance and revoke token once instance is destroied. useful when LDAP server refuse username and password used too much often. Defaults to False.

  • **kwargs – other kwargs are same as requests.Session.request

Usage:

>>> from api4jenkins import Jenkins
>>> j = Jenkins('http://127.0.0.1:8080/', auth=('admin', 'admin'))
>>> print(j)
<Jenkins: http://127.0.0.1:8080/>
>>> j.version
'2.176.2'
api_json(tree='', depth=0)
build_job(full_name, **params)[source]

Build job with/without params

Parameters
  • full_namestr, full name of job

  • params – parameters for building, support delay and remote token

Returns

QueueItem

Usage:

>>> from api4jenkins import Jenkins
>>> j = Jenkins('http://127.0.0.1:8080/', auth=('admin', 'admin'))
>>> item = j.build_job('freestylejob')
>>> import time
>>> while not item.get_build():
...      time.sleep(1)
>>> build = item.get_build()
>>> print(build)
<FreeStyleBuild: http://127.0.0.1:8080/job/freestylejob/1/>
>>> for line in build.progressive_output():
...     print(line)
...
check_job_name(name)[source]
copy_job(full_name, dest)[source]

Create job by copying other job, the source job and dest job are in same folder.

Parameters
  • full_name – full name of source job

  • dest – name of new job

Usage:

>>> from api4jenkins import Jenkins
>>> j = Jenkins('http://127.0.0.1:8080/', auth=('admin', 'admin'))
>>> j.copy_job('folder/freestylejob', 'newjob')
>>> j.get_job('folder/newjob')
>>> print(job)
<FreeStyleProject: http://127.0.0.1:8080/job/folder/job/newjob/>
create_job(full_name, xml, recursive=False)[source]

Create new jenkins job with given xml configuration

Parameters
  • full_namestr, full name of job

  • xml – xml configuration string

  • recursive – (optional) Boolean, recursively create folder if not existed

Usage:

>>> from api4jenkins import Jenkins
>>> j = Jenkins('http://127.0.0.1:8080/', auth=('admin', 'admin'))
>>> xml = """<?xml version='1.1' encoding='UTF-8'?>
... <project>
...   <builders>
...     <hudson.tasks.Shell>
...       <command>echo $JENKINS_VERSION</command>
...     </hudson.tasks.Shell>
...   </builders>
... </project>"""
>>> j.create_job('freestylejob', xml)
>>> job = j.get_job('freestylejob')
>>> print(job)
<FreeStyleProject: http://127.0.0.1:8080/job/freestylejob/>
property credentials

An object for managing credentials. see Credentials

property crumb

Crumb of Jenkins

delete_job(full_name)[source]

Delete job

Parameters

full_namestr, full name of job

Usage:

>>> from api4jenkins import Jenkins
>>> j = Jenkins('http://127.0.0.1:8080/', auth=('admin', 'admin'))
>>> job = j.get_job('freestylejob')
>>> print(job)
<FreeStyleProject: http://127.0.0.1:8080/job/freestylejob/>
>>> j.delete_job('freestylejob')
>>> job = j.get_job('freestylejob')
>>> print(job)
None
property dynamic_attrs
exists()[source]

Check if Jenkins server is up

Returns

Ture or False

get_job(full_name)[source]

Get job by full name

Parameters

full_namestr, full name of job

Returns

Corresponding Job object or None

Usage:

>>> from api4jenkins import Jenkins
>>> j = Jenkins('http://127.0.0.1:8080/', auth=('admin', 'admin'))
>>> job = j.get_job('freestylejob')
>>> print(job)
<FreeStyleProject: http://127.0.0.1:8080/job/freestylejob/>
handle_req(method, entry, **kwargs)
headers = {'Content-Type': 'text/xml; charset=utf-8'}
iter_jobs(depth=0)[source]

Iterate jobs with depth

Parameters

depthint, depth to iterate, default is 0

Returns

iterator of jobs

Usage:

>>> from api4jenkins import Jenkins
>>> j = Jenkins('http://127.0.0.1:8080/', auth=('admin', 'admin'))
>>> for job in j.iter_jobs():
...     print(job)
<FreeStyleProject: http://127.0.0.1:8080/job/freestylejob/>
...
property me
property nodes

An object for managing nodes. see Nodes

property plugins

An object for managing plugins. see PluginsManager

property queue

An object for managing build queue. see Queue

property system

An object for managing system operation. see System

property users
validate_jenkinsfile(content)[source]

validate Jenkinsfile, see https://www.jenkins.io/doc/book/pipeline/development/#linter

Args:

content (str): content of Jenkinsfile

Returns:

str: ‘Jenkinsfile successfully validated.’ if validate successful or error message

property version

Version of Jenkins

property views

An object for managing views of main window. see Views

class api4jenkins.job.BitbucketSCMNavigator(jenkins, url)[source]
api_json(tree='', depth=0)
build(**params)
property building
configure(xml=None)
delete()
disable()
duplicate(path, recursive=False)
property dynamic_attrs
enable()
exists()
filter_builds_by_result(*, result)

filter build by build results, avaliable results are: ‘SUCCESS’, ‘UNSTABLE’, ‘FAILURE’, ‘NOT_BUILT’, ‘ABORTED’ see: https://javadoc.jenkins-ci.org/hudson/model/Result.html

property full_display_name
property full_name
get_build(number)
get_parameters()
handle_req(method, entry, **kwargs)
headers = {'Content-Type': 'text/xml; charset=utf-8'}
iter_all_builds()
iter_builds()
move(path)
property name
property parent
rename(name)
set_description(text)
set_next_build_number(number)
class api4jenkins.job.ExternalJob(jenkins, url)[source]
api_json(tree='', depth=0)
build(**params)
property building
configure(xml=None)
delete()
disable()
duplicate(path, recursive=False)
property dynamic_attrs
enable()
exists()
filter_builds_by_result(*, result)

filter build by build results, avaliable results are: ‘SUCCESS’, ‘UNSTABLE’, ‘FAILURE’, ‘NOT_BUILT’, ‘ABORTED’ see: https://javadoc.jenkins-ci.org/hudson/model/Result.html

property full_display_name
property full_name
get_build(number)
get_parameters()
handle_req(method, entry, **kwargs)
headers = {'Content-Type': 'text/xml; charset=utf-8'}
iter_all_builds()
iter_builds()
move(path)
property name
property parent
rename(name)
set_description(text)
set_next_build_number(number)
class api4jenkins.job.Folder(jenkins, url)[source]
api_json(tree='', depth=0)
configure(xml=None)
copy(src, dest)[source]
create(name, xml)[source]
property credentials
delete()
duplicate(path, recursive=False)
property dynamic_attrs
exists()
property full_display_name
property full_name
get(name)[source]
handle_req(method, entry, **kwargs)
headers = {'Content-Type': 'text/xml; charset=utf-8'}
iter(depth=0)[source]
move(path)
property name
property parent
reload()[source]
rename(name)
set_description(text)
property views
class api4jenkins.job.FreeStyleProject(jenkins, url)[source]
api_json(tree='', depth=0)
build(**params)
property building
configure(xml=None)
delete()
disable()
duplicate(path, recursive=False)
property dynamic_attrs
enable()
exists()
filter_builds_by_result(*, result)

filter build by build results, avaliable results are: ‘SUCCESS’, ‘UNSTABLE’, ‘FAILURE’, ‘NOT_BUILT’, ‘ABORTED’ see: https://javadoc.jenkins-ci.org/hudson/model/Result.html

property full_display_name
property full_name
get_build(number)
get_parameters()
handle_req(method, entry, **kwargs)
headers = {'Content-Type': 'text/xml; charset=utf-8'}
iter_all_builds()
iter_builds()
move(path)
property name
property parent
rename(name)
set_description(text)
set_next_build_number(number)
class api4jenkins.job.GitHubSCMNavigator(jenkins, url)[source]
api_json(tree='', depth=0)
build(**params)
property building
configure(xml=None)
delete()
disable()
duplicate(path, recursive=False)
property dynamic_attrs
enable()
exists()
filter_builds_by_result(*, result)

filter build by build results, avaliable results are: ‘SUCCESS’, ‘UNSTABLE’, ‘FAILURE’, ‘NOT_BUILT’, ‘ABORTED’ see: https://javadoc.jenkins-ci.org/hudson/model/Result.html

property full_display_name
property full_name
get_build(number)
get_parameters()
handle_req(method, entry, **kwargs)
headers = {'Content-Type': 'text/xml; charset=utf-8'}
iter_all_builds()
iter_builds()
move(path)
property name
property parent
rename(name)
set_description(text)
set_next_build_number(number)
class api4jenkins.job.IvyModuleSet(jenkins, url)[source]
api_json(tree='', depth=0)
build(**params)
property building
configure(xml=None)
delete()
disable()
duplicate(path, recursive=False)
property dynamic_attrs
enable()
exists()
filter_builds_by_result(*, result)

filter build by build results, avaliable results are: ‘SUCCESS’, ‘UNSTABLE’, ‘FAILURE’, ‘NOT_BUILT’, ‘ABORTED’ see: https://javadoc.jenkins-ci.org/hudson/model/Result.html

property full_display_name
property full_name
get_build(number)
get_parameters()
handle_req(method, entry, **kwargs)
headers = {'Content-Type': 'text/xml; charset=utf-8'}
iter_all_builds()
iter_builds()
move(path)
property name
property parent
rename(name)
set_description(text)
set_next_build_number(number)
class api4jenkins.job.Job(jenkins, url)[source]
api_json(tree='', depth=0)
configure(xml=None)
delete()
duplicate(path, recursive=False)[source]
property dynamic_attrs
exists()
property full_display_name
property full_name
handle_req(method, entry, **kwargs)
headers = {'Content-Type': 'text/xml; charset=utf-8'}
move(path)[source]
property name
property parent
rename(name)[source]
set_description(text)
class api4jenkins.job.MatrixProject(jenkins, url)[source]
api_json(tree='', depth=0)
build(**params)
property building
configure(xml=None)
delete()
disable()
duplicate(path, recursive=False)
property dynamic_attrs
enable()
exists()
filter_builds_by_result(*, result)

filter build by build results, avaliable results are: ‘SUCCESS’, ‘UNSTABLE’, ‘FAILURE’, ‘NOT_BUILT’, ‘ABORTED’ see: https://javadoc.jenkins-ci.org/hudson/model/Result.html

property full_display_name
property full_name
get_build(number)
get_parameters()
handle_req(method, entry, **kwargs)
headers = {'Content-Type': 'text/xml; charset=utf-8'}
iter_all_builds()
iter_builds()
move(path)
property name
property parent
rename(name)
set_description(text)
set_next_build_number(number)
class api4jenkins.job.MavenModuleSet(jenkins, url)[source]
api_json(tree='', depth=0)
build(**params)
property building
configure(xml=None)
delete()
disable()
duplicate(path, recursive=False)
property dynamic_attrs
enable()
exists()
filter_builds_by_result(*, result)

filter build by build results, avaliable results are: ‘SUCCESS’, ‘UNSTABLE’, ‘FAILURE’, ‘NOT_BUILT’, ‘ABORTED’ see: https://javadoc.jenkins-ci.org/hudson/model/Result.html

property full_display_name
property full_name
get_build(number)
get_parameters()
handle_req(method, entry, **kwargs)
headers = {'Content-Type': 'text/xml; charset=utf-8'}
iter_all_builds()
iter_builds()
move(path)
property name
property parent
rename(name)
set_description(text)
set_next_build_number(number)
class api4jenkins.job.MultiJobProject(jenkins, url)[source]
api_json(tree='', depth=0)
build(**params)
property building
configure(xml=None)
delete()
disable()
duplicate(path, recursive=False)
property dynamic_attrs
enable()
exists()
filter_builds_by_result(*, result)

filter build by build results, avaliable results are: ‘SUCCESS’, ‘UNSTABLE’, ‘FAILURE’, ‘NOT_BUILT’, ‘ABORTED’ see: https://javadoc.jenkins-ci.org/hudson/model/Result.html

property full_display_name
property full_name
get_build(number)
get_parameters()
handle_req(method, entry, **kwargs)
headers = {'Content-Type': 'text/xml; charset=utf-8'}
iter_all_builds()
iter_builds()
move(path)
property name
property parent
rename(name)
set_description(text)
set_next_build_number(number)
class api4jenkins.job.OrganizationFolder(jenkins, url)[source]
api_json(tree='', depth=0)
property buildable
configure(xml=None)
copy(src, dest)
create(name, xml)
property credentials
delete()
disable()
duplicate(path, recursive=False)
property dynamic_attrs
enable()
exists()
property full_display_name
property full_name
get(name)
get_scan_log(stream=False)
handle_req(method, entry, **kwargs)
headers = {'Content-Type': 'text/xml; charset=utf-8'}
iter(depth=0)
move(path)
property name
property parent
reload()
rename(name)
scan(delay=0)
set_description(text)
property views
class api4jenkins.job.PipelineMultiBranchDefaultsProject(jenkins, url)[source]
api_json(tree='', depth=0)
build(**params)
property building
configure(xml=None)
delete()
disable()
duplicate(path, recursive=False)
property dynamic_attrs
enable()
exists()
filter_builds_by_result(*, result)

filter build by build results, avaliable results are: ‘SUCCESS’, ‘UNSTABLE’, ‘FAILURE’, ‘NOT_BUILT’, ‘ABORTED’ see: https://javadoc.jenkins-ci.org/hudson/model/Result.html

property full_display_name
property full_name
get_build(number)
get_parameters()
handle_req(method, entry, **kwargs)
headers = {'Content-Type': 'text/xml; charset=utf-8'}
iter_all_builds()
iter_builds()
move(path)
property name
property parent
rename(name)
set_description(text)
set_next_build_number(number)
class api4jenkins.job.Project(jenkins, url)[source]
api_json(tree='', depth=0)
build(**params)[source]
property building
configure(xml=None)
delete()
disable()
duplicate(path, recursive=False)
property dynamic_attrs
enable()
exists()
filter_builds_by_result(*, result)[source]

filter build by build results, avaliable results are: ‘SUCCESS’, ‘UNSTABLE’, ‘FAILURE’, ‘NOT_BUILT’, ‘ABORTED’ see: https://javadoc.jenkins-ci.org/hudson/model/Result.html

property full_display_name
property full_name
get_build(number)[source]
get_parameters()[source]
handle_req(method, entry, **kwargs)
headers = {'Content-Type': 'text/xml; charset=utf-8'}
iter_all_builds()[source]
iter_builds()[source]
move(path)
property name
property parent
rename(name)
set_description(text)
set_next_build_number(number)[source]
class api4jenkins.job.WorkflowJob(jenkins, url)[source]
api_json(tree='', depth=0)
build(**params)
property building
configure(xml=None)
delete()
disable()
duplicate(path, recursive=False)
property dynamic_attrs
enable()
exists()
filter_builds_by_result(*, result)

filter build by build results, avaliable results are: ‘SUCCESS’, ‘UNSTABLE’, ‘FAILURE’, ‘NOT_BUILT’, ‘ABORTED’ see: https://javadoc.jenkins-ci.org/hudson/model/Result.html

property full_display_name
property full_name
get_build(number)
get_parameters()
handle_req(method, entry, **kwargs)
headers = {'Content-Type': 'text/xml; charset=utf-8'}
iter_all_builds()
iter_builds()
move(path)
property name
property parent
rename(name)
set_description(text)
set_next_build_number(number)
class api4jenkins.job.WorkflowMultiBranchProject(jenkins, url)[source]
api_json(tree='', depth=0)
property buildable
configure(xml=None)
copy(src, dest)
create(name, xml)
property credentials
delete()
disable()
duplicate(path, recursive=False)
property dynamic_attrs
enable()
exists()
property full_display_name
property full_name
get(name)
get_scan_log(stream=False)[source]
handle_req(method, entry, **kwargs)
headers = {'Content-Type': 'text/xml; charset=utf-8'}
iter(depth=0)
move(path)
property name
property parent
reload()
rename(name)
scan(delay=0)[source]
set_description(text)
property views
class api4jenkins.build.Build(jenkins, url)[source]
api_json(tree='', depth=0)
console_text(stream=False)[source]
delete()
property dynamic_attrs
exists()
get_causes()
get_coverage_report()[source]

Access coverage report generated by JaCoCo

get_coverage_result()[source]

Access coverage result generated by Code Coverage API

get_job()[source]

get job of this build

get_next_build()[source]
get_parameters()
get_previous_build()[source]
get_test_report()[source]
handle_req(method, entry, **kwargs)
headers = {'Content-Type': 'text/xml; charset=utf-8'}
kill()[source]
progressive_output(html=False)[source]
set_description(text)
stop()[source]
term()[source]
class api4jenkins.build.FreeStyleBuild(jenkins, url)[source]
api_json(tree='', depth=0)
console_text(stream=False)
delete()
property dynamic_attrs
exists()
get_causes()
get_coverage_report()

Access coverage report generated by JaCoCo

get_coverage_result()

Access coverage result generated by Code Coverage API

get_job()

get job of this build

get_next_build()
get_parameters()
get_previous_build()
get_test_report()
handle_req(method, entry, **kwargs)
headers = {'Content-Type': 'text/xml; charset=utf-8'}
kill()
progressive_output(html=False)
set_description(text)
stop()
term()
class api4jenkins.build.MatrixBuild(jenkins, url)[source]
api_json(tree='', depth=0)
console_text(stream=False)
delete()
property dynamic_attrs
exists()
get_causes()
get_coverage_report()

Access coverage report generated by JaCoCo

get_coverage_result()

Access coverage result generated by Code Coverage API

get_job()

get job of this build

get_next_build()
get_parameters()
get_previous_build()
get_test_report()
handle_req(method, entry, **kwargs)
headers = {'Content-Type': 'text/xml; charset=utf-8'}
kill()
progressive_output(html=False)
set_description(text)
stop()
term()
class api4jenkins.build.WorkflowRun(jenkins, url)[source]
api_json(tree='', depth=0)
console_text(stream=False)
delete()
property dynamic_attrs
exists()
get_artifacts()[source]
get_causes()
get_coverage_report()

Access coverage report generated by JaCoCo

get_coverage_result()

Access coverage result generated by Code Coverage API

get_job()

get job of this build

get_next_build()
get_parameters()
get_pending_input()[source]

get current pending input step

get_previous_build()
get_test_report()
handle_req(method, entry, **kwargs)
headers = {'Content-Type': 'text/xml; charset=utf-8'}
kill()
progressive_output(html=False)
save_artifacts(filename='archive.zip')[source]
set_description(text)
stop()
term()
class api4jenkins.input.PendingInputAction(jenkins, raw)[source]

this class implement functionality to process input step

abort()[source]

submit input step

api_json(tree='', depth=0)
property dynamic_attrs
exists()
handle_req(method, entry, **kwargs)
headers = {'Content-Type': 'text/xml; charset=utf-8'}
submit(**params)[source]

submit input step

  • for input requires parametes:
    • if submit without parameters, it will use default value of parameters

    • if submit with wrong parameters, exception raised

  • for input does not requires parameters, but submit with paramters, exception raised

class api4jenkins.queue.BlockedItem(jenkins, url)[source]
api_json(tree='', depth=0)
cancel()
property dynamic_attrs
exists()
get_build()
get_causes()
get_job()
get_parameters()
handle_req(method, entry, **kwargs)
headers = {'Content-Type': 'text/xml; charset=utf-8'}
class api4jenkins.queue.BuildableItem(jenkins, url)[source]
api_json(tree='', depth=0)
cancel()
property dynamic_attrs
exists()
get_build()
get_causes()
get_job()
get_parameters()
handle_req(method, entry, **kwargs)
headers = {'Content-Type': 'text/xml; charset=utf-8'}
class api4jenkins.queue.LeftItem(jenkins, url)[source]
api_json(tree='', depth=0)
cancel()
property dynamic_attrs
exists()
get_build()
get_causes()
get_job()
get_parameters()
handle_req(method, entry, **kwargs)
headers = {'Content-Type': 'text/xml; charset=utf-8'}
class api4jenkins.queue.Queue(jenkins, url)[source]
api_json(tree='', depth=0)
cancel(id)[source]
property dynamic_attrs
exists()
get(id)[source]
handle_req(method, entry, **kwargs)
headers = {'Content-Type': 'text/xml; charset=utf-8'}
class api4jenkins.queue.QueueItem(jenkins, url)[source]
api_json(tree='', depth=0)
cancel()[source]
property dynamic_attrs
exists()
get_build()[source]
get_causes()
get_job()[source]
get_parameters()
handle_req(method, entry, **kwargs)
headers = {'Content-Type': 'text/xml; charset=utf-8'}
class api4jenkins.queue.WaitingItem(jenkins, url)[source]
api_json(tree='', depth=0)
cancel()
property dynamic_attrs
exists()
get_build()
get_causes()
get_job()
get_parameters()
handle_req(method, entry, **kwargs)
headers = {'Content-Type': 'text/xml; charset=utf-8'}
class api4jenkins.credential.Credential(jenkins, url)[source]
api_json(tree='', depth=0)
configure(xml=None)
delete()
property dynamic_attrs
exists()
handle_req(method, entry, **kwargs)
headers = {'Content-Type': 'text/xml; charset=utf-8'}
property name
class api4jenkins.credential.Credentials(jenkins, url)[source]
api_json(tree='', depth=0)
create(xml)[source]
property dynamic_attrs
exists()
get(id)[source]
handle_req(method, entry, **kwargs)
headers = {'Content-Type': 'text/xml; charset=utf-8'}
class api4jenkins.node.DockerComputer(jenkins, url)[source]
api_json(tree='', depth=0)
configure(xml=None)
delete()
disable(msg='')
property dynamic_attrs
enable()
exists()
handle_req(method, entry, **kwargs)
headers = {'Content-Type': 'text/xml; charset=utf-8'}
iter_building_builds()
iter_builds()
property name
run_script(script)
class api4jenkins.node.EC2Computer(jenkins, url)[source]
api_json(tree='', depth=0)
configure(xml=None)
delete()
disable(msg='')
property dynamic_attrs
enable()
exists()
handle_req(method, entry, **kwargs)
headers = {'Content-Type': 'text/xml; charset=utf-8'}
iter_building_builds()
iter_builds()
property name
run_script(script)
class api4jenkins.node.KubernetesComputer(jenkins, url)[source]
api_json(tree='', depth=0)
configure(xml=None)
delete()
disable(msg='')
property dynamic_attrs
enable()
exists()[source]
handle_req(method, entry, **kwargs)
headers = {'Content-Type': 'text/xml; charset=utf-8'}
iter_building_builds()
iter_builds()
property name
run_script(script)
class api4jenkins.node.MasterComputer(jenkins, url)[source]
api_json(tree='', depth=0)
configure(xml=None)
delete()
disable(msg='')
property dynamic_attrs
enable()
exists()
handle_req(method, entry, **kwargs)
headers = {'Content-Type': 'text/xml; charset=utf-8'}
iter_building_builds()
iter_builds()
property name
run_script(script)
class api4jenkins.node.Node(jenkins, url)[source]
api_json(tree='', depth=0)
configure(xml=None)
delete()
disable(msg='')[source]
property dynamic_attrs
enable()[source]
exists()
handle_req(method, entry, **kwargs)
headers = {'Content-Type': 'text/xml; charset=utf-8'}
iter_building_builds()[source]
iter_builds()[source]
property name
run_script(script)
class api4jenkins.node.Nodes(jenkins, url)[source]

classdocs

api_json(tree='', depth=0)
create(name, **kwargs)[source]
property dynamic_attrs
exists()
filter_node_by_label(*labels)[source]
filter_node_by_status(*, online)[source]
get(name)[source]
handle_req(method, entry, **kwargs)
headers = {'Content-Type': 'text/xml; charset=utf-8'}
iter_building_builds()[source]
iter_builds()[source]
class api4jenkins.node.SlaveComputer(jenkins, url)[source]
api_json(tree='', depth=0)
configure(xml=None)
delete()
disable(msg='')
property dynamic_attrs
enable()
exists()
handle_req(method, entry, **kwargs)
headers = {'Content-Type': 'text/xml; charset=utf-8'}
iter_building_builds()
iter_builds()
property name
run_script(script)
class api4jenkins.plugin.Plugin(jenkins, url)[source]
api_json(tree='', depth=0)
property dynamic_attrs
exists()
handle_req(method, entry, **kwargs)
headers = {'Content-Type': 'text/xml; charset=utf-8'}
uninstall()[source]
class api4jenkins.plugin.PluginsManager(jenkins, url)[source]
api_json(tree='', depth=0)
check_updates_server()[source]
property dynamic_attrs
exists()
get(name)[source]
handle_req(method, entry, **kwargs)
headers = {'Content-Type': 'text/xml; charset=utf-8'}
install(*names, block=False)[source]
property installation_done
property restart_required
set_proxy(name, port, *, username='', password='', no_proxy='', test_url='')[source]
set_site(url)[source]
property site
uninstall(*names)[source]
property update_center
class api4jenkins.plugin.UpdateCenter(jenkins, url)[source]
api_json(tree='', depth=0)
property dynamic_attrs
exists()
handle_req(method, entry, **kwargs)
headers = {'Content-Type': 'text/xml; charset=utf-8'}
property installation_done
property restart_required
property site
class api4jenkins.view.AllView(jenkins, url)[source]
api_json(tree='', depth=0)
configure(xml=None)
delete()
property dynamic_attrs
exclude(name)
exists()
get_job(name)
handle_req(method, entry, **kwargs)
headers = {'Content-Type': 'text/xml; charset=utf-8'}
include(name)
property name
set_description(text)
class api4jenkins.view.Dashboard(jenkins, url)[source]
api_json(tree='', depth=0)
configure(xml=None)
delete()
property dynamic_attrs
exclude(name)
exists()
get_job(name)
handle_req(method, entry, **kwargs)
headers = {'Content-Type': 'text/xml; charset=utf-8'}
include(name)
property name
set_description(text)
class api4jenkins.view.ListView(jenkins, url)[source]
api_json(tree='', depth=0)
configure(xml=None)
delete()
property dynamic_attrs
exclude(name)
exists()
get_job(name)
handle_req(method, entry, **kwargs)
headers = {'Content-Type': 'text/xml; charset=utf-8'}
include(name)
property name
set_description(text)
class api4jenkins.view.MyView(jenkins, url)[source]
api_json(tree='', depth=0)
configure(xml=None)
delete()
property dynamic_attrs
exclude(name)
exists()
get_job(name)
handle_req(method, entry, **kwargs)
headers = {'Content-Type': 'text/xml; charset=utf-8'}
include(name)
property name
set_description(text)
class api4jenkins.view.NestedView(jenkins, url)[source]
api_json(tree='', depth=0)
configure(xml=None)
delete()
property dynamic_attrs
exclude(name)
exists()
get_job(name)
handle_req(method, entry, **kwargs)
headers = {'Content-Type': 'text/xml; charset=utf-8'}
include(name)
property name
set_description(text)
property views
class api4jenkins.view.SectionedView(jenkins, url)[source]
api_json(tree='', depth=0)
configure(xml=None)
delete()
property dynamic_attrs
exclude(name)
exists()
get_job(name)
handle_req(method, entry, **kwargs)
headers = {'Content-Type': 'text/xml; charset=utf-8'}
include(name)
property name
set_description(text)
class api4jenkins.view.View(jenkins, url)[source]
api_json(tree='', depth=0)
configure(xml=None)
delete()
property dynamic_attrs
exclude(name)[source]
exists()
get_job(name)[source]
handle_req(method, entry, **kwargs)
headers = {'Content-Type': 'text/xml; charset=utf-8'}
include(name)[source]
property name
set_description(text)
class api4jenkins.view.Views(owner)[source]

classdocs

api_json(tree='', depth=0)
create(name, xml)[source]
property dynamic_attrs
exists()
get(name)[source]
handle_req(method, entry, **kwargs)
headers = {'Content-Type': 'text/xml; charset=utf-8'}
class api4jenkins.system.System(jenkins, url)[source]
api_json(tree='', depth=0)
apply_jcasc(new)[source]
decrypt_secret(text)[source]
property dynamic_attrs
exists()
export_jcasc(filename='jenkins.yaml')[source]
handle_req(method, entry, **kwargs)
headers = {'Content-Type': 'text/xml; charset=utf-8'}
reload_jcasc()[source]
run_script(script)
class api4jenkins.user.ApiToken(name, uuid, value)
count(value, /)

Return number of occurrences of value.

index(value, start=0, stop=9223372036854775807, /)

Return first index of value.

Raises ValueError if the value is not present.

property name

Alias for field number 0

property uuid

Alias for field number 1

property value

Alias for field number 2

class api4jenkins.user.User(jenkins, url)[source]
api_json(tree='', depth=0)
delete()
property dynamic_attrs
exists()
generate_token(name='')[source]
handle_req(method, entry, **kwargs)
headers = {'Content-Type': 'text/xml; charset=utf-8'}
revoke_token(uuid)[source]
set_description(text)
class api4jenkins.user.Users(jenkins, url)[source]
api_json(tree='', depth=0)
property dynamic_attrs
exists()
get(id=None, full_name=None)[source]
handle_req(method, entry, **kwargs)
headers = {'Content-Type': 'text/xml; charset=utf-8'}
tree = 'users[user[id,absoluteUrl,fullName]]'
class api4jenkins.report.Coverage(raw)[source]
class api4jenkins.report.CoverageElement(raw)[source]
class api4jenkins.report.CoverageReport(jenkins, url)[source]

Access coverage report generated by JaCoCo

api_json(tree='', depth=0)
property dynamic_attrs
exists()
get(name)
handle_req(method, entry, **kwargs)
headers = {'Content-Type': 'text/xml; charset=utf-8'}
report_types = ['branchCoverage', 'classCoverage', 'complexityScore', 'instructionCoverage', 'lineCoverage', 'methodCoverage']
trends(count=2)[source]
class api4jenkins.report.CoverageResult(jenkins, url)[source]

Access coverage result generated by Code Coverage API

api_json(tree='', depth=0)
property dynamic_attrs
exists()
get(name)
handle_req(method, entry, **kwargs)
headers = {'Content-Type': 'text/xml; charset=utf-8'}
class api4jenkins.report.CoverageTrend(raw)[source]
class api4jenkins.report.CoverageTrends(jenkins, url)[source]
api_json(tree='', depth=0)
property dynamic_attrs
exists()
get(name)
handle_req(method, entry, **kwargs)
headers = {'Content-Type': 'text/xml; charset=utf-8'}
class api4jenkins.report.GetMixIn[source]
get(name)[source]
class api4jenkins.report.ResultBase(raw)[source]
class api4jenkins.report.TestCase(raw)[source]
class api4jenkins.report.TestReport(jenkins, url)[source]
api_json(tree='', depth=0)
property dynamic_attrs
exists()
get(name)
handle_req(method, entry, **kwargs)
headers = {'Content-Type': 'text/xml; charset=utf-8'}
property suites
class api4jenkins.report.TestSuite(raw)[source]
property cases
get(name)
class api4jenkins.item.Item(jenkins, url)[source]

classdocs

api_json(tree='', depth=0)[source]
property dynamic_attrs
exists()[source]
handle_req(method, entry, **kwargs)[source]
headers = {'Content-Type': 'text/xml; charset=utf-8'}
api4jenkins.item.append_slash(url)[source]
api4jenkins.item.camel(s)[source]
api4jenkins.item.new_item(jenkins, module, item)
api4jenkins.item.snake(name)
class api4jenkins.mix.ActionsMixIn[source]
get_causes()[source]
get_parameters()[source]
class api4jenkins.mix.ConfigurationMixIn[source]
configure(xml=None)[source]
property name
class api4jenkins.mix.DeletionMixIn[source]
delete()[source]
class api4jenkins.mix.DescriptionMixIn[source]
set_description(text)[source]
class api4jenkins.mix.EnableMixIn[source]
disable()[source]
enable()[source]
class api4jenkins.mix.Parameter(class_name, name, value)
property class_name

Alias for field number 0

count(value, /)

Return number of occurrences of value.

index(value, start=0, stop=9223372036854775807, /)

Return first index of value.

Raises ValueError if the value is not present.

property name

Alias for field number 1

property value

Alias for field number 2

class api4jenkins.mix.RawJsonMixIn[source]
api_json(tree='', depth=0)[source]
class api4jenkins.mix.RunScriptMixIn[source]
run_script(script)[source]
api4jenkins.requester.Requester(**kwargs)[source]
exception api4jenkins.exceptions.AuthenticationError[source]
args
with_traceback()

Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.

exception api4jenkins.exceptions.BadRequestError[source]
args
with_traceback()

Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.

exception api4jenkins.exceptions.ItemExistsError[source]
args
with_traceback()

Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.

exception api4jenkins.exceptions.ItemNotFoundError[source]
args
with_traceback()

Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.

exception api4jenkins.exceptions.ServerError[source]
args
with_traceback()

Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.

exception api4jenkins.exceptions.UnsafeCharacterError[source]
args
with_traceback()

Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.