Class: Jenkins2::CLI::DeleteNode
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
44
45
46
|
# File 'lib/jenkins2/cli/nodes.rb', line 44
def self.description
'Delete node(s).'
end
|
Instance Method Details
#add_options ⇒ Object
48
49
50
51
52
53
|
# File 'lib/jenkins2/cli/nodes.rb', line 48
def add_options
parser.separator 'Mandatory arguments:'
parser.on '-n', '--name X,Y,..', Array, 'Names of nodes to delete.' do |n|
options[:name] = n
end
end
|
#run ⇒ Object
55
56
57
58
59
|
# File 'lib/jenkins2/cli/nodes.rb', line 55
def run
options[:name].all? do |name|
jc.computer(name).delete
end
end
|