Class: Jenkins2::CLI::UpdateNode

Inherits:
Jenkins2::CLI show all
Defined in:
lib/jenkins2/cli/nodes.rb

Instance Attribute Summary

Attributes inherited from Jenkins2::CLI

#errors, #options

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Jenkins2::CLI

#call, class_to_command, #initialize, #parse, subcommands

Constructor Details

This class inherits a constructor from Jenkins2::CLI

Class Method Details

.descriptionObject



169
170
171
# File 'lib/jenkins2/cli/nodes.rb', line 169

def self.description
	'Update the node definition XML from stdin. The opposite of the get-node command.'
end

Instance Method Details

#add_optionsObject



173
174
175
176
177
178
# File 'lib/jenkins2/cli/nodes.rb', line 173

def add_options
	parser.separator 'Mandatory arguments:'
	parser.on '-n', '--name NAME', 'Name of the node.' do |n|
		options[:name] = n
	end
end

#runObject



180
181
182
# File 'lib/jenkins2/cli/nodes.rb', line 180

def run
	jc.computer(options[:name]).update($stdin.read)
end