Class: Befog::Commands::Start

Inherits:
Object
  • Object
show all
Includes:
Mixins::Command, Mixins::Configurable, Mixins::Help, Mixins::Safely, Mixins::Scope, Mixins::Selectable
Defined in:
lib/befog/commands/start.rb

Instance Attribute Summary

Attributes included from Mixins::Command

#options

Instance Method Summary collapse

Methods included from Mixins::Help

included

Methods included from Mixins::Selectable

included, #run_for_selected

Methods included from Mixins::Safely

#safely

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

#runObject



29
30
31
32
33
34
35
36
37
38
39
# File 'lib/befog/commands/start.rb', line 29

def run
  run_for_selected do |id|
    server = get_server(id)
    if server.state == "stopped"
      $stdout.puts "Starting server #{id} ..."
      server.start
    else
      $stdout.puts "Server #{id} is already (or still) running"
    end
  end
end