2013-05-30 23:19:08 +00:00
|
|
|
module AWS
|
|
|
|
class FakeAutoScaling
|
|
|
|
def initialize
|
|
|
|
end
|
2013-05-31 20:08:23 +00:00
|
|
|
|
|
|
|
def groups
|
|
|
|
@groups ||= GroupCollection.new
|
|
|
|
end
|
|
|
|
|
|
|
|
class GroupCollection
|
|
|
|
def initialize
|
|
|
|
@groups = {}
|
|
|
|
end
|
|
|
|
|
|
|
|
def [](name)
|
|
|
|
@groups[name]
|
|
|
|
end
|
|
|
|
|
|
|
|
def create(name, options = {})
|
|
|
|
@groups[name] = Group.new name
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
class Group
|
2013-05-31 22:16:41 +00:00
|
|
|
attr_reader :name, :max_size, :desired_capacity
|
2013-05-31 20:08:23 +00:00
|
|
|
|
|
|
|
def initialize(name)
|
|
|
|
@name = name
|
2013-05-31 22:05:16 +00:00
|
|
|
@suspended_processes = {}
|
2013-05-31 22:16:41 +00:00
|
|
|
@max_size = 2
|
|
|
|
@desired_capacity = 1
|
2013-05-31 22:05:16 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
def suspend_processes(*processes)
|
|
|
|
processes.each do |process|
|
|
|
|
@suspended_processes[process] = 'test'
|
|
|
|
end
|
2013-05-31 20:08:23 +00:00
|
|
|
end
|
2013-05-31 22:16:41 +00:00
|
|
|
|
2013-06-04 01:07:10 +00:00
|
|
|
def resume_all_processes
|
|
|
|
@suspended_processes.clear
|
|
|
|
end
|
|
|
|
|
2013-05-31 22:16:41 +00:00
|
|
|
def update(options = {})
|
|
|
|
options.each do |key, value|
|
|
|
|
self.instance_variable_set "@#{key}", value
|
|
|
|
end
|
|
|
|
end
|
2013-06-03 23:19:03 +00:00
|
|
|
|
|
|
|
def ec2_instances
|
|
|
|
[]
|
|
|
|
end
|
2013-05-31 20:08:23 +00:00
|
|
|
end
|
2013-05-30 23:19:08 +00:00
|
|
|
end
|
|
|
|
end
|