pyjen.plugin_manager module

Interfaces for managing plugins for a particular Jenkins instance

class pyjen.plugin_manager.PluginManager(api)[source]

Bases: object

Abstraction around Jenkins plugin management interfaces

Supports adding, removing and querying information about Jenkins plugins

Parameters

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

find_plugin_by_shortname(short_name)[source]

Finds an installed plugin based on it’s abbreviated name

Parameters

short_name (str) – abbreviated form of the plugin name to locate

Returns

reference to the given plugin, or None if no such plugin found

Return type

Plugin

install_plugin(plugin_file)[source]

Installs a new plugin on the selected Jenkins instance

NOTE: If using this method to batch-install many plugins at once you may want to add a short wait / sleep between calls so as to not overwhelm the target server with upload requests. Ad-hoc tests show that Jenkins will refuse connections if too many uploads are running in parallel.

Parameters

plugin_file (str) – path to the HPI/JPI file to install

plugins

list of all installed plugins from the current Jenkins instance

Returns

list of 0 or more plugins installed on the Jenkins instance

Return type

List of 0 or more Plugin objects