Class: Ufo::Scale
Instance Method Summary collapse
-
#initialize(service, count, options = {}) ⇒ Scale
constructor
A new instance of Scale.
- #service_exists? ⇒ Boolean
- #update ⇒ Object
Methods inherited from Base
#full_service, #info, #no_service_message, #switch_current
Methods included from Ufo::Stack::Helper
#adjust_stack_name, #find_stack, #status
Methods included from Settings
Methods included from Util
#default_cluster, #display_params, #execute, #pretty_time, #settings, #task_definition_arns, #user_params
Methods included from AwsService
#cloudformation, #cloudwatchlogs, #ec2, #ecr, #ecs, #elb
Constructor Details
#initialize(service, count, options = {}) ⇒ Scale
Returns a new instance of Scale.
5 6 7 8 |
# File 'lib/ufo/scale.rb', line 5 def initialize(service, count, ={}) super(service, ) @count = count end |
Instance Method Details
#service_exists? ⇒ Boolean
24 25 26 |
# File 'lib/ufo/scale.rb', line 24 def service_exists? !!service end |
#update ⇒ Object
10 11 12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/ufo/scale.rb', line 10 def update unless service_exists? puts "Unable to find the #{@service.color(:green)} service on the #{@cluster.color(:green)} cluster." puts "Are you sure you are trying to scale the right service on the right cluster?" exit end ecs.update_service( service: service.service_name, cluster: @cluster, desired_count: @count ) puts "Scale #{full_service.color(:green)} service in #{@cluster.color(:green)} to #{@count}" unless @options[:mute] end |