pyjen.node module

Declarations for the abstraction of a Jenkins build agent

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

Bases: object

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

See find_node() for more details

Parameters

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

property is_idle

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

Type

bool

property is_offline

checks to see whether this Node is currently offline or not

Type

bool

property name

the display name of this Node

Type

str

property number_of_executors

the number of executors this node provides

Type

int

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” and vice-versa.

Parameters

message (str) – optional descriptive message 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) – Optional 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