Class: VMC::App::Instances

Inherits:
Base
  • Object
show all
Defined in:
lib/appfog-vmc-plugin/vmc/app/instances.rb

Constant Summary collapse

IS_UTF8 =
!!(ENV["LC_ALL"] || ENV["LC_CTYPE"] || ENV["LANG"] || "")["UTF-8"].freeze

Instance Method Summary collapse

Instance Method Details

#instancesObject



11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# File 'lib/appfog-vmc-plugin/vmc/app/instances.rb', line 11

def instances
  app = input[:app]

  if input.has?(:inst)
    inst = input[:inst]
  else
    inst = input[:inst, app.total_instances]
  end

  app.total_instances = inst.to_i if input.has?(:inst)
  fail "No changes!" unless app.changed?

  with_progress("Scaling #{c(app.name, :name)}") do
    app.update!
  end

  if app.started?
    invoke :restart, :app => app
  end

end