Class: VagrantPlugins::Sakura::Action::PowerOn

Inherits:
Object
  • Object
show all
Defined in:
lib/vagrant-sakura/action/power_on.rb

Instance Method Summary collapse

Constructor Details

#initialize(app, env) ⇒ PowerOn

Returns a new instance of PowerOn.



7
8
9
10
# File 'lib/vagrant-sakura/action/power_on.rb', line 7

def initialize(app, env)
  @app    = app
  @logger = Log4r::Logger.new("vagrant_sakura::action::power_on")
end

Instance Method Details

#call(env) ⇒ Object



12
13
14
15
16
17
18
19
# File 'lib/vagrant-sakura/action/power_on.rb', line 12

def call(env)
  api      = env[:sakura_api]
  serverid = env[:machine].id

  env[:ui].info(I18n.t("vagrant_sakura.power_on"))
  api.put("/server/#{serverid}/power")
  @app.call(env)
end