pyjen.utils.pluginapi module

Primitives for interacting with the PyJen plugin API

class pyjen.utils.pluginapi.PluginXML(xml_node)[source]

Bases: object

Class used to process XML configuration information associated with Jenkins plugins

Parameters:xml_node (xml.etree.ElementTree) – the XML sub-tree defining the properties of this plugin
get_class_name()[source]

Gets the Java class name of the plugin

Returns:the Java class name
Return type:str
get_module_name()[source]

Gets the name of the plugin

Returns:the plugin name
Return type:str
get_version()[source]

Gets the version of the plugin

Returns:the plugin version
Return type:str
pyjen.utils.pluginapi.create_xml_plugin(xml_node)[source]

Instantiates the appropriate XML-compatible PyJen plugin

Parameters:xml_node (xml.etree.ElementTree) – the node of the XML configuration defining the plugin configuration
Returns:a pre-initialized plugin of the appropriate type, or None if no supported plugin can be found
Return type:PluginBase derived class
pyjen.utils.pluginapi.find_plugin(plugin_type)[source]

Locates a PyJen plugin of the given type

Parameters:plugin_type (str) – the descriptive type-name for the plugin to find
Returns:reference to the plugin class for the specified type, or None if a compatible plugin could not be found
pyjen.utils.pluginapi.get_job_plugins()[source]

Returns a list of plugins that extend the default Jenkins Job type

Returns:list of plugins that extend the default Jenkins Job type
Return type:list of PluginBase derived classes
pyjen.utils.pluginapi.get_plugin_name(xml_node)[source]

Extracts the name of a plugin from an XML snippet

Parameters:xml_node (xml.etree.ElementTree) – the node of the XML configuration defining the plugin configuration
Returns:Name of the plugin this snippet is generated by
Return type:str
pyjen.utils.pluginapi.get_plugins()[source]

Returns list of classes for all plugins supported by PyJen

Returns:list of classes for all PyJen plugins
Return type:list of PluginBase derived objects
pyjen.utils.pluginapi.get_view_plugins()[source]

Returns a list of plugins that extend the default Jenkins View type

Returns:list of plugins that extend the default Jenkins View type
Return type:list of PluginBase derived classes
pyjen.utils.pluginapi.init_extension_plugin(dataio, jenkins_master)[source]

Instantiates a plugin that extends one of the Jenkins native objects such as a view or job

Parameters:
  • dataio – Jenkins REST API interface, initialized with the connection parameters of the new object
  • jenkins_master – Instance of the Jenkins master object that manages this entity
Returns:

PyJen plugin pre-initialized with the source data, or None if no compatible plugin could be found

Return type:

PluginBase derived object