Class: Jenkins2::CLI::OfflineNode
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
126
127
128
129
|
# File 'lib/jenkins2/cli/nodes.rb', line 126
def self.description
'Stop using a node for performing builds temporarily, until the next "online-node" '\
'command.'
end
|
Instance Method Details
#add_options ⇒ Object
131
132
133
134
135
136
137
138
139
140
141
|
# File 'lib/jenkins2/cli/nodes.rb', line 131
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
parser.separator 'Optional arguments:'
parser.on '-m', '--message TEXT', 'Record the reason about why you are disconnecting the'\
' node.' do |m|
options[:message] = m
end
end
|
#run ⇒ Object
143
144
145
146
|
# File 'lib/jenkins2/cli/nodes.rb', line 143
def run
return if jc.computer(options[:name]).temporarilyOffline
jc.computer(options[:name]).toggle_offline(options[:message])
end
|