pyjen.plugins.nestedview module

Primitives for working with Jenkins views of type ‘NestedView’

class pyjen.plugins.nestedview.NestedView(api)[source]

Bases: pyjen.view.View

all Jenkins related ‘view’ information for views of type NestedView

Parameters

api (JenkinsAPI) – Pre-initialized connection to the Jenkins REST API

property all_views

all views contained within this view, recursively

Type

list (View)

create_view(view_name, view_class)[source]

Creates a new sub-view within this nested view

Parameters
  • view_name (str) – name of the new sub-view to create

  • view_class – PyJen plugin class associated with the type of view to be created

Returns

reference to the newly created view

Return type

View

find_all_views(view_name)[source]

Attempts to locate a sub-view under this nested view by name, recursively

NOTE: Seeing as how view names need only be unique within a single parent view, there may be multiple nested views with the same name. To reflect this requirement this method will return a list of views nested within this one that have the name given. If the list is empty then there are no matches for the given name anywhere in this view’s sub-tree.

Parameters

view_name (str) – the name of the sub-view to locate

Returns

0 or more views with the given name

Return type

list (View)

find_view(view_name)[source]

Attempts to locate a sub-view under this nested view by name

NOTE: Seeing as how view names need only be unique within a single parent view, there may be multiple nested views with the same name. To reflect this requirement this method will return a list of views nested within this one that have the name given. If the list is empty then there are no matches for the given name anywhere in this view’s sub-tree.

Parameters

view_name (str) – the name of the sub-view to locate

Returns

0 or more views with the given name

Return type

list (View)

static get_jenkins_plugin_name()[source]

str: the name of the Jenkins plugin associated with this PyJen plugin

This static method is used by the PyJen plugin API to associate this class with a specific Jenkins plugin, as it is encoded in the config.xml

property views

all views contained within this view, non-recursively

To get a recursive list of all child views and their children use all_views().

Type

list (View)

pyjen.plugins.nestedview.PluginClass

alias of pyjen.plugins.nestedview.NestedView