Module: Jenkins::Slaves::ComputerListener
- Extended by:
- Plugin::Behavior
- Includes:
- Extension
- Defined in:
- lib/jenkins/slaves/computer_listener.rb
Overview
Receive notification of what computers in a build array are doing.
Include this module in your class in order to receive callbacks when nodes come online, offline, etc.., etc…
To receive a callback, override the method with the same name as the event. E.g.
class MyComputerListener
include Jenkins::Slaves::ComputerListener
def online(computer, listener)
puts "#{computer} is now online!"
end
end
Instance Method Summary collapse
-
#configured ⇒ Object
Called when configuration of the node was changed, a node is added/removed, etc.
-
#launchfailed(computer, listener) ⇒ Object
Called when a slave attempted to connect via ComputerLauncher but failed.
-
#offline(computer) ⇒ Object
Called right after a Computer went offline.
-
#online(computer, listener) ⇒ Object
Called right after a Computer comes online.
-
#prelaunch(computer, listener) ⇒ Object
Called before a ComputerLauncher is asked to launch a connection with Computer.
-
#preonline(computer, channel, root, listener) ⇒ Object
Called before a Computer is marked online.
Methods included from Plugin::Behavior
extended, implemented, included
Methods included from Plugin::Behavior::BehavesAs
Instance Method Details
#configured ⇒ Object
Called when configuration of the node was changed, a node is added/removed, etc.
81 82 |
# File 'lib/jenkins/slaves/computer_listener.rb', line 81 def configured() end |
#launchfailed(computer, listener) ⇒ Object
Called when a slave attempted to connect via ComputerLauncher but failed.
44 45 |
# File 'lib/jenkins/slaves/computer_listener.rb', line 44 def launchfailed(computer, listener) end |
#offline(computer) ⇒ Object
Called right after a Computer went offline.
77 78 |
# File 'lib/jenkins/slaves/computer_listener.rb', line 77 def offline(computer) end |
#online(computer, listener) ⇒ Object
Called right after a Computer comes online.
This enables you to do some work on all the slaves as they get connected.
71 72 |
# File 'lib/jenkins/slaves/computer_listener.rb', line 71 def online(computer, listener) end |
#prelaunch(computer, listener) ⇒ Object
Called before a ComputerLauncher is asked to launch a connection with Computer.
This enables you to do some configurable checks to see if we want to bring this slave online or if there are considerations that would keep us from doing so.
Calling Computer#abort would let you veto the launch operation. Other thrown exceptions will also have the same effect
37 38 |
# File 'lib/jenkins/slaves/computer_listener.rb', line 37 def prelaunch(computer, listener) end |
#preonline(computer, channel, root, listener) ⇒ Object
Called before a Computer is marked online.
This enables you to do some work on all the slaves as they get connected. Unlike #online, a failure to carry out this function normally will prevent a computer from marked as online.
58 59 |
# File 'lib/jenkins/slaves/computer_listener.rb', line 58 def preonline(computer, channel, root, listener) end |