Class: EcsAutoscalingScheduler::Cli::Index

Inherits:
Object
  • Object
show all
Defined in:
lib/ecs_autoscaling_scheduler/cli/index.rb

Instance Method Summary collapse

Instance Method Details

#runObject



8
9
10
11
12
13
14
15
16
17
18
19
20
# File 'lib/ecs_autoscaling_scheduler/cli/index.rb', line 8

def run
  cluster_name = ask_cluster_name
  service_name = ask_service_name(cluster_name)

  scheduled_actions = application_auto_scaling_client.describe_scheduled_actions(
    cluster_name: cluster_name,
    service_name: service_name,
  )

  scheduled_actions.sort_by(&:schedule).each do |a|
    puts "* name: #{a.scheduled_action_name}, min: #{a.scalable_target_action.min_capacity}, max: #{a.scalable_target_action.max_capacity}, schedule: #{a.schedule}, timezone: #{a.timezone}"
  end
end