pyjen.node module

Declarations for the abstraction of a Jenkins build agent

class pyjen.node.Node(data_io_controller)[source]

Bases: object

Wrapper around a Jenkins build agent (aka: Node) configuration

Use this class to manipulate agents managed by a Jenkins master

Instances of this class are typically created using one of the node methods on the Jenkins class, such as find_node()

To instantiate an instance of this class using auto-generated configuration parameters, see the easy_connect() method

Parameters:data_io_controller (DataRequester) – class capable of handling common HTTP IO requests sent by this object to the Jenkins REST API
is_idle[source]

Checks to see whether any executors are in use on this Node or not

Returns:returns True if there are no active builds on this Node at the moment otherwise returns False
Return type:bool
is_offline[source]

Checks to see whether this Node is currently offline or not

Returns:True if this Node is offline otherwise False
Return type:bool
name[source]

Gets the display name of this Node

Returns:the name of this Node
Return type:str
toggle_offline(message=None)[source]

Toggles the online status of this Node

If the current state of this Node is “offline” it will be toggled to “online” when calling this method, and vice versa.

Parameters:message (str) – optional descriptive message to display on the dashboard explaining the reason this node has been taken offline.
wait_for_idle(max_timeout=None)[source]

Blocks execution until this Node enters an idle state

Parameters:max_timeout (int) – The maximum amount of time, in seconds, to wait for an idle state. If this value is undefined, this method will block indefinitely.
Returns:True if the Node has entered idle state before returning otherwise returns False
Return type:bool