Class: Jenkins2::CLI::OnlineNode

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



150
151
152
153
# File 'lib/jenkins2/cli/nodes.rb', line 150

def self.description
	'Resume using a node for performing builds, to cancel out the earlier "offline-node" '\
	'command.'
end

Instance Method Details

#add_optionsObject



155
156
157
158
159
160
# File 'lib/jenkins2/cli/nodes.rb', line 155

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

#runObject



162
163
164
165
# File 'lib/jenkins2/cli/nodes.rb', line 162

def run
	return unless jc.computer(options[:name]).temporarilyOffline
	jc.computer(options[:name]).toggle_offline
end