pyjen.utils.helpers module

Primitives that perform some common Jenkins operations that span the object heirarchy

The functions and classes defined in this module provide users with some pre-rolled custom scripts that perform some common tasks that leverage a variety of tools and objects provided by the PyJen API to accomplish their tasks (ie: these primitives typically make use of multiple classes offered by the API and thus can’t be easily attached or embedded within the public PyJen API)

pyjen.utils.helpers.find_view(jenkins_url, credentials, view_name)[source]

Locates a view with a given name recursively across a Jenkins instance

This helper function has knowledge of view plugins that support sub-views and thus recursively searches these sub-views for the requested view

WARNING: This function can be quite slow when executed against a large Jenkins build farm with a large number of views and subviews.

Parameters:
  • jenkins_url (str) – URL of the root Jenkins master
  • credentials (tuple) – 2-tuple containing the user-name and password to authenticate with
  • view_name (str) – name of the view to locate
Returns:

Reference to the view with the provided name, or None if the view doesn’t exist

Return type:

View