View and Views

Views

Module for jenkinsapi Views

class jenkinsapi.views.Views(jenkins)[source]

Bases: object

An abstraction on a Jenkins object’s views

CATEGORIZED_VIEW = 'org.jenkinsci.plugins.categorizedview.CategorizedJobsView'
DASHBOARD_VIEW = 'hudson.plugins.view.dashboard.Dashboard'
LIST_VIEW = 'hudson.model.ListView'
MY_VIEW = 'hudson.model.MyView'
NESTED_VIEW = 'hudson.plugins.nested_view.NestedView'
PIPELINE_VIEW = 'au.com.centrumsystems.hudson.plugin.buildpipeline.BuildPipelineView'
create(view_name, view_type='hudson.model.ListView', config=None)[source]

Create a view :param view_name: name of new view, str :param view_type: type of the view, one of the constants in Views, str :param config: XML configuration of the new view :return: new View obj or None if view was not created

iteritems()[source]

Get the names & objects for all views

iterkeys()[source]

Get the names of all available views

keys()[source]

Return a list of the names of all views

poll(tree=None)[source]

View

Module for jenkinsapi views

class jenkinsapi.view.View(url: str, name: str, jenkins_obj: Jenkins)[source]

Bases: JenkinsBase

View class

add_job(job_name: str, job=None) bool[source]

Add job to a view

Parameters:
  • job_name – name of the job to be added

  • job – Job object to be added

Returns:

True if job has been added, False if job already exists or job not known to Jenkins

delete() None[source]

Remove this view object

get_config() str[source]

Return the config.xml from the view

get_config_xml_url() str[source]
get_jenkins_obj() Jenkins[source]
get_job_dict() dict[source]
get_job_url(str_job_name: str) str[source]
get_nested_view_dict() dict[source]
items()[source]
iteritems() Iterator[Tuple[str, Job]][source]
keys() list[str][source]
remove_job(job_name: str) bool[source]

Remove job from a view

Parameters:

job_name – name of the job to be removed

Returns:

True if job has been removed, False if job not assigned to this view

update_config(config: str) str[source]

Update the config.xml to the view

values() list[Job][source]
property views