Class: Befog::Commands::Stop
- Inherits:
-
Object
- Object
- Befog::Commands::Stop
- Includes:
- Mixins::Command, Mixins::Configurable, Mixins::Help, Mixins::Safely, Mixins::Scope, Mixins::Selectable
- Defined in:
- lib/befog/commands/stop.rb
Instance Attribute Summary
Attributes included from Mixins::Command
Instance Method Summary collapse
Methods included from Mixins::Help
Methods included from Mixins::Safely
Methods included from Mixins::Selectable
Methods included from Mixins::Scope
#_bank, #account_key, #account_secret, #bank, #bank?, #bank_name, #banks, #compute, #flavor, #flavor?, #get_server, #image, #image?, #keypair, #keypair?, #price, #provider, #provider?, #provider_name, #providers, #region, #region?, #security_group, #security_group?, #servers, #servers=
Methods included from Mixins::Configurable
#_configuration, #configuration, #configuration_name, #configuration_path, included, #save
Methods included from Mixins::Command
#command, #error, included, #initialize, #log, #process_options, #usage
Instance Method Details
#run ⇒ Object
26 27 28 29 30 31 32 33 34 35 36 |
# File 'lib/befog/commands/stop.rb', line 26 def run run_for_selected do |id| server = get_server(id) if server.state == "running" $stdout.puts "Stopping server #{id} ..." server.stop else $stdout.puts "Server #{id} is not (yet) running" end end end |