Class: Jenkins2::CLI::DisconnectNode
Instance Attribute Summary
#errors, #options
Class Method Summary
collapse
Instance Method Summary
collapse
#call, class_to_command, #initialize, #parse, subcommands
Constructor Details
This class inherits a constructor from Jenkins2::CLI
Class Method Details
.description ⇒ Object
63
64
65
|
# File 'lib/jenkins2/cli/nodes.rb', line 63
def self.description
'Disconnect node(s).'
end
|
Instance Method Details
#add_options ⇒ Object
67
68
69
70
71
72
73
74
75
76
77
78
|
# File 'lib/jenkins2/cli/nodes.rb', line 67
def add_options
parser.separator 'Mandatory arguments:'
parser.on '-n', '--name X,Y,..', Array, 'Slave name, or "(master)" for master, '\
'comma-separated list is supported.' do |n|
options[:name] = n
end
parser.separator 'Optional arguments:'
parser.on '-m', '--message TEXT', 'Record the reason about why you are disconnecting the'\
' node(s).' do |m|
options[:message] = m
end
end
|
#run ⇒ Object
80
81
82
83
84
|
# File 'lib/jenkins2/cli/nodes.rb', line 80
def run
options[:name].all? do |name|
jc.computer(name).disconnect(options[:message])
end
end
|