10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
|
# File 'lib/ecs_autoscaling_scheduler/cli/create.rb', line 10
def run(option)
cluster_name = option.cluster_name || ask_cluster_name
service_name = option.service_name || ask_service_name(cluster_name)
timezone = option.timezone || ask_timezone
schedule = option.schedule || ask_schedule
min_capacity = option.min_capacity || ask_min_capacity
max_capacity = option.max_capacity || ask_max_capacity
scheduled_action_name = option.scheduled_action_name || ask_scheduled_action_name(schedule, min_capacity, max_capacity)
if ask_ok
application_auto_scaling_client.put_scheduled_action(
cluster_name: cluster_name,
service_name: service_name,
scheduled_action_name: scheduled_action_name,
schedule_datetime: schedule,
timezone: timezone,
min_capacity: min_capacity,
max_capacity: max_capacity,
)
puts "Create complete."
else
puts "Create cancelled."
end
end
|