Class: Jenkins2API::Command::Node
- Inherits:
-
ThorCommand
- Object
- Thor
- ThorCommand
- Jenkins2API::Command::Node
- Defined in:
- lib/commands/node.rb
Overview
Contains all the commands under node
namespace
Constant Summary collapse
- MASTER_CLASS =
Jenkins java class of the master instance
'hudson.model.Hudson$MasterComputer'.freeze
Instance Method Summary collapse
-
#all ⇒ Object
List all available nodes.
-
#slaves ⇒ Object
List all avilable slaves.
Instance Method Details
#all ⇒ Object
List all available nodes
13 14 15 16 17 18 19 20 |
# File 'lib/commands/node.rb', line 13 def all nodes = client.node.all nodes['computer'].each do |computer| type = 'slave' type = 'master' if computer['_class'] == MASTER_CLASS printf("[%6s] %s\n", type, computer['displayName']) end end |
#slaves ⇒ Object
List all avilable slaves
24 25 26 27 28 29 30 |
# File 'lib/commands/node.rb', line 24 def slaves nodes = client.node.all nodes['computer'].each do |computer| next if computer['_class'] == MASTER_CLASS puts computer['displayName'] end end |