Class: Nucleon::Action::Node::Destroy
- Inherits:
-
Object
- Object
- Nucleon::Action::Node::Destroy
- Defined in:
- lib/nucleon/action/node/destroy.rb
Class Method Summary collapse
-
.describe ⇒ Object
—————————————————————————– Info.
Instance Method Summary collapse
- #arguments ⇒ Object
-
#configure ⇒ Object
—————————————————————————– Settings.
-
#execute ⇒ Object
—————————————————————————– Operations.
-
#ignore ⇒ Object
—.
Class Method Details
.describe ⇒ Object
Info
10 11 12 |
# File 'lib/nucleon/action/node/destroy.rb', line 10 def self.describe super(:node, :destroy, 580) end |
Instance Method Details
#arguments ⇒ Object
31 32 33 |
# File 'lib/nucleon/action/node/destroy.rb', line 31 def arguments [ :destroy_nodes ] end |
#configure ⇒ Object
Settings
17 18 19 20 21 22 23 |
# File 'lib/nucleon/action/node/destroy.rb', line 17 def configure super do register_bool :force, false register_nodes :destroy_nodes end end |
#execute ⇒ Object
Operations
38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 |
# File 'lib/nucleon/action/node/destroy.rb', line 38 def execute super do |local_node| ensure_network do if settings[:force] answer = 'YES' else = ('prompt', { :operation => :ask }) + "\n\n" array(settings[:destroy_nodes]).each do |hostname| << " #{hostname}\n" end << "\n" + ('yes_query', { :operation => :ask, :yes => 'YES' }) + ' ' answer = ask() end if answer.upcase == 'YES' batch_success = network.batch(settings[:destroy_nodes], settings[:node_provider], settings[:parallel], false) do |node| info('start', { :provider => node.plugin_provider, :name => node.plugin_name }) node.destroy end myself.status = code.batch_error unless batch_success end end end end |
#ignore ⇒ Object
27 28 29 |
# File 'lib/nucleon/action/node/destroy.rb', line 27 def ignore [ :nodes ] end |