awful 0.0.158 → 0.0.159

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b64a33d63741aa2b4eced60d8e54255ca2b7fce1
4
- data.tar.gz: 7c03f2f2db06f75724898fea0b80e8344bdbc08c
3
+ metadata.gz: fb6e7ca3e77e33a7ac755b4c5cc1997ed4c2a5e6
4
+ data.tar.gz: 89237af369dde02a1831430cc24db4434493d773
5
5
  SHA512:
6
- metadata.gz: a05d120601d21ef058a76ef1eab81cef24c8170ebffe2004682b29398bd1736ef90fd5b63a4d32c88b4d7c092d7913e9d684bd66ad5c77b0bdd5ea8922e36777
7
- data.tar.gz: 64d8328c03f27cabae26fca56f99b395344980f98f1e772e81d019d90c9d2ae1f193b3f58f06925484575210efff7784092467b3563afd40ca300ce30fdb707a
6
+ metadata.gz: dfac8dd0b55397b901b3bc1386c1fe50b7d0a0ab5e77034c51eb4510bdb7ea8e74354f4e3f3cc4209a173aa23640cc0dd2a4f12cab9ba66e63773e078c830a16
7
+ data.tar.gz: 6dcafed95b581ca2c2988d7f4d66094321b71f69390075e1bc831248a0868b1d23c4e2c010765f495290456006bbafcdc807c472162c5057f9b644fdf0c88a49
data/awful.gemspec CHANGED
@@ -22,6 +22,6 @@ Gem::Specification.new do |spec|
22
22
  spec.add_development_dependency "rake"
23
23
 
24
24
  spec.add_dependency('aws-sdk', '>= 2.7.2')
25
- spec.add_dependency('thor', '< 0.19.2')
25
+ spec.add_dependency('thor')
26
26
  spec.add_dependency('dotenv')
27
27
  end
data/lib/awful.rb CHANGED
@@ -16,9 +16,9 @@ end
16
16
 
17
17
  module Awful
18
18
  class Cli < Thor
19
- class_option :env, aliases: '-e', default: nil, desc: 'Load environment variables from file'
19
+ class_option :env, aliases: '-e', type: :string, default: nil, desc: 'Load environment variables from file'
20
20
  class_option :quiet, aliases: '-q', type: :boolean, default: false, desc: 'Quieten output'
21
- class_option :region, default: nil, desc: 'Set region; can use AWS_REGION instead'
21
+ class_option :region, type: :string, default: nil, desc: 'Set region; can use AWS_REGION instead'
22
22
 
23
23
  def initialize(args = [], local_options = {}, config = {})
24
24
  super
data/lib/awful/ami.rb CHANGED
@@ -33,7 +33,7 @@ module Awful
33
33
  end
34
34
 
35
35
  desc 'ls [PATTERN]', 'list AMIs'
36
- method_option :long, aliases: '-l', default: false, desc: 'Long listing'
36
+ method_option :long, aliases: '-l', type: :boolean, default: false, desc: 'Long listing'
37
37
  def ls(name = /./)
38
38
  images(options).select do |image|
39
39
  image.name.match(name)
@@ -16,7 +16,7 @@ module Awful
16
16
  module ApiGateway
17
17
  class RestApi < Cli
18
18
  desc 'ls', 'list rest apis'
19
- method_option :long, aliases: '-l', default: false, desc: 'Long listing'
19
+ method_option :long, aliases: '-l', type: :boolean, default: false, desc: 'Long listing'
20
20
  def ls
21
21
  api_gateway.get_rest_apis.items.output do |items|
22
22
  if options[:long]
@@ -9,7 +9,7 @@ module Awful
9
9
 
10
10
  class Deployments < Cli
11
11
  desc 'ls REST_API_ID', 'list deployments for given rest api'
12
- method_option :long, aliases: '-l', default: false, desc: 'Long listing'
12
+ method_option :long, aliases: '-l', type: :boolean, default: false, desc: 'Long listing'
13
13
  def ls(id)
14
14
  api_gateway.get_deployments(rest_api_id: id).items.output do |items|
15
15
  if options[:long]
@@ -9,7 +9,7 @@ module Awful
9
9
 
10
10
  class Methods < Cli
11
11
  desc 'dump REST_API_ID', 'list methods for given rest api and resource'
12
- method_option :method, aliases: '-m', default: 'GET', desc: 'HTTP method to get'
12
+ method_option :method, aliases: '-m', type: :boolean, default: 'GET', desc: 'HTTP method to get'
13
13
  def dump(id, resource)
14
14
  api_gateway.get_method(rest_api_id: id, resource_id: resource, http_method: options[:method]).output do |response|
15
15
  puts YAML.dump(stringify_keys(response.to_hash))
@@ -9,7 +9,7 @@ module Awful
9
9
 
10
10
  class Resources < Cli
11
11
  desc 'ls REST_API_ID', 'list resources for given rest api'
12
- method_option :long, aliases: '-l', default: false, desc: 'Long listing'
12
+ method_option :long, aliases: '-l', type: :boolean, default: false, desc: 'Long listing'
13
13
  def ls(id)
14
14
  api_gateway.get_resources(rest_api_id: id).items.output do |items|
15
15
  if options[:long]
@@ -9,7 +9,7 @@ module Awful
9
9
 
10
10
  class Stages < Cli
11
11
  desc 'ls REST_API_ID', 'list stages for given rest api'
12
- method_option :long, aliases: '-l', default: false, desc: 'Long listing'
12
+ method_option :long, aliases: '-l', type: :boolean, default: false, desc: 'Long listing'
13
13
  def ls(id, deployment = nil)
14
14
  api_gateway.get_stages(rest_api_id: id, deployment_id: deployment).item.output do |items|
15
15
  if options[:long]
@@ -55,7 +55,7 @@ module Awful
55
55
  end
56
56
 
57
57
  desc 'ls NAMES', 'list autoscaling groups with given names'
58
- method_option :long, aliases: '-l', default: false, desc: 'Long listing'
58
+ method_option :long, aliases: '-l', type: :boolean, default: false, desc: 'Long listing'
59
59
  def ls(*names)
60
60
  autoscaling.describe_auto_scaling_groups(auto_scaling_group_names: names).auto_scaling_groups.output do |asgs|
61
61
  if options[:long]
@@ -113,7 +113,7 @@ module Awful
113
113
  end
114
114
 
115
115
  desc 'ips NAMES', 'list IPs for instances in named groups'
116
- method_option :long, aliases: '-l', default: false, desc: 'Long listing'
116
+ method_option :long, aliases: '-l', type: :boolean, default: false, desc: 'Long listing'
117
117
  def ips(*names)
118
118
  asg_instance_details(*names).output do |instances|
119
119
  if options[:long]
@@ -161,11 +161,11 @@ module Awful
161
161
  end
162
162
 
163
163
  desc 'create [FILE]', 'create a new auto-scaling group'
164
- method_option :auto_scaling_group_name, aliases: '-n', default: nil, desc: 'Auto-scaling group name'
165
- method_option :launch_configuration_name, aliases: '-l', default: nil, desc: 'Launch config name'
166
- method_option :desired_capacity, aliases: '-d', default: nil, desc: 'Set desired capacity'
167
- method_option :min_size, aliases: '-m', default: nil, desc: 'Set minimum capacity'
168
- method_option :max_size, aliases: '-M', default: nil, desc: 'Set maximum capacity'
164
+ method_option :auto_scaling_group_name, aliases: '-n', type: :string, default: nil, desc: 'Auto-scaling group name'
165
+ method_option :launch_configuration_name, aliases: '-l', type: :string, default: nil, desc: 'Launch config name'
166
+ method_option :desired_capacity, aliases: '-d', type: :numeric, default: nil, desc: 'Set desired capacity'
167
+ method_option :min_size, aliases: '-m', type: :numeric, default: nil, desc: 'Set minimum capacity'
168
+ method_option :max_size, aliases: '-M', type: :numeric, default: nil, desc: 'Set maximum capacity'
169
169
  def create(file = nil)
170
170
  opt = load_cfg(options, file)
171
171
  whitelist = %i[auto_scaling_group_name launch_configuration_name instance_id min_size max_size desired_capacity default_cooldown availability_zones
@@ -181,10 +181,10 @@ module Awful
181
181
  end
182
182
 
183
183
  desc 'update NAME [FILE]', 'update existing auto-scaling group'
184
- method_option :desired_capacity, aliases: '-d', default: nil, desc: 'Set desired capacity'
185
- method_option :min_size, aliases: '-m', default: nil, desc: 'Set minimum capacity'
186
- method_option :max_size, aliases: '-M', default: nil, desc: 'Set maximum capacity'
187
- method_option :launch_configuration_name, aliases: '-l', default: nil, desc: 'Launch config name'
184
+ method_option :desired_capacity, aliases: '-d', type: :numeric, default: nil, desc: 'Set desired capacity'
185
+ method_option :min_size, aliases: '-m', type: :numeric, default: nil, desc: 'Set minimum capacity'
186
+ method_option :max_size, aliases: '-M', type: :numeric, default: nil, desc: 'Set maximum capacity'
187
+ method_option :launch_configuration_name, aliases: '-l', type: :string, default: nil, desc: 'Launch config name'
188
188
  def update(name, file = nil)
189
189
  opt = load_cfg(options, file)
190
190
 
@@ -313,7 +313,7 @@ module Awful
313
313
  end
314
314
 
315
315
  desc 'launch_configuration NAMES', 'get launch configs for given ASGs'
316
- method_option :long, aliases: '-l', default: false, desc: 'Long listing'
316
+ method_option :long, aliases: '-l', type: :boolean, default: false, desc: 'Long listing'
317
317
  def launch_configuration(*names)
318
318
  autoscaling.describe_auto_scaling_groups(
319
319
  auto_scaling_group_names: names
@@ -329,12 +329,12 @@ module Awful
329
329
  end
330
330
 
331
331
  desc 'old_instances ASGS', 'Deal with instances that are not on their ASG current launch config'
332
- method_option :long, aliases: '-l', default: false, desc: 'Long listing'
333
- method_option :groups, aliases: '-g', default: false, desc: 'Just list names of ASGs with outdated instances'
334
- method_option :detach, aliases: '-D', default: false, desc: 'Detach old instances from this ASG'
335
- method_option :decrement, aliases: '-d', default: false, desc: 'should decrement desired capacity when detaching instances from ASG'
336
- method_option :deregister, aliases: '-E', default: false, desc: 'Deregister old instances from ELB for this ASG'
337
- method_option :terminate, aliases: '-t', default: false, desc: 'Terminate old instances'
332
+ method_option :long, aliases: '-l', type: :boolean, default: false, desc: 'Long listing'
333
+ method_option :groups, aliases: '-g', type: :boolean, default: false, desc: 'Just list names of ASGs with outdated instances'
334
+ method_option :detach, aliases: '-D', type: :boolean, default: false, desc: 'Detach old instances from this ASG'
335
+ method_option :decrement, aliases: '-d', type: :boolean, default: false, desc: 'should decrement desired capacity when detaching instances from ASG'
336
+ method_option :deregister, aliases: '-E', type: :boolean, default: false, desc: 'Deregister old instances from ELB for this ASG'
337
+ method_option :terminate, aliases: '-t', type: :boolean, default: false, desc: 'Terminate old instances'
338
338
  def old_instances(*names)
339
339
  asgs = autoscaling.describe_auto_scaling_groups(auto_scaling_group_names: names).map(&:auto_scaling_groups).flatten
340
340
 
@@ -377,8 +377,8 @@ module Awful
377
377
  end
378
378
 
379
379
  desc 'activities ASG', 'describe recent scaling activities for group ASG'
380
- method_option :long, aliases: '-l', default: false, desc: 'Long listing'
381
- method_option :cause, aliases: '-c', default: false, desc: 'Long listing with cause of activity'
380
+ method_option :long, aliases: '-l', type: :boolean, default: false, desc: 'Long listing'
381
+ method_option :cause, aliases: '-c', type: :boolean, default: false, desc: 'Long listing with cause of activity'
382
382
  def activities(name)
383
383
  autoscaling.describe_scaling_activities(auto_scaling_group_name: name).activities.output do |activities|
384
384
  if options[:long]
@@ -3,7 +3,7 @@ module Awful
3
3
  class AutoScalingNotifications < Cli
4
4
 
5
5
  desc 'ls [NAMES]', 'describe notification configurations for named groups'
6
- method_option :long, aliases: '-l', default: false, desc: 'Long listing'
6
+ method_option :long, aliases: '-l', type: :boolean, default: false, desc: 'Long listing'
7
7
  def ls(*names)
8
8
  autoscaling.describe_notification_configurations(auto_scaling_group_names: names).notification_configurations.tap do |notifications|
9
9
  if options[:long]
data/lib/awful/certs.rb CHANGED
@@ -13,8 +13,8 @@ module Awful
13
13
  end
14
14
 
15
15
  desc 'ls [PATH_PREFIX]', 'list server certificates'
16
- method_option :long, aliases: '-l', default: false, desc: 'long listing'
17
- method_option :arns, aliases: '-a', default: false, desc: 'list ARNs'
16
+ method_option :long, aliases: '-l', type: :boolean, default: false, desc: 'long listing'
17
+ method_option :arns, aliases: '-a', type: :boolean, default: false, desc: 'list ARNs'
18
18
  def ls(path = nil)
19
19
  marker = nil
20
20
  certs = []
@@ -48,7 +48,7 @@ module Awful
48
48
  end
49
49
 
50
50
  desc 'ls STACK_NAME', 'list change sets for stack'
51
- method_option :long, aliases: '-l', default: false, desc: 'Long listing'
51
+ method_option :long, aliases: '-l', type: :boolean, default: false, desc: 'Long listing'
52
52
  def ls(stack_name)
53
53
  cf.list_change_sets(stack_name: stack_name).summaries.tap do |list|
54
54
  if options[:long]
@@ -45,8 +45,8 @@ module Awful
45
45
  end
46
46
 
47
47
  desc 'ls [PATTERN]', 'list cloudformation stacks matching PATTERN'
48
- method_option :long, aliases: '-l', default: false, desc: 'Long listing'
49
- method_option :all, aliases: '-a', default: false, desc: 'Show all, including stacks in DELETE_COMPLETE'
48
+ method_option :long, aliases: '-l', type: :boolean, default: false, desc: 'Long listing'
49
+ method_option :all, aliases: '-a', type: :boolean, default: false, desc: 'Show all, including stacks in DELETE_COMPLETE'
50
50
  def ls(name = /./)
51
51
  stacks = stack_summaries
52
52
 
@@ -218,7 +218,7 @@ module Awful
218
218
  end
219
219
 
220
220
  desc 'id NAME RESOURCE', 'get physical_resource_id from a logical_resource_id RESOURCE for stack with NAME'
221
- method_option :all, aliases: '-a', default: false, desc: 'Return all details about resource as YAML'
221
+ method_option :all, aliases: '-a', type: :boolean, default: false, desc: 'Return all details about resource as YAML'
222
222
  def id(name, resource)
223
223
  detail = cf.describe_stack_resource(stack_name: name, logical_resource_id: resource).stack_resource_detail
224
224
  if options[:all]
@@ -22,7 +22,7 @@ module Awful
22
22
  end
23
23
 
24
24
  desc 'ls [PREFIX]', 'list events'
25
- method_option :long, aliases: '-l', default: false, desc: 'Long listing'
25
+ method_option :long, aliases: '-l', type: :boolean, default: false, desc: 'Long listing'
26
26
  def ls(prefix = nil)
27
27
  next_token = nil
28
28
  rules = []
@@ -57,7 +57,7 @@ module Awful
57
57
  end
58
58
 
59
59
  desc 'targets NAME', 'list targets for named rule'
60
- method_option :long, aliases: '-l', default: false, desc: 'Long listing'
60
+ method_option :long, aliases: '-l', type: :boolean, default: false, desc: 'Long listing'
61
61
  def targets(name)
62
62
  next_token = nil
63
63
  targets = []
@@ -24,7 +24,7 @@ module Awful
24
24
  end
25
25
 
26
26
  desc 'ls [PREFIX]', 'list log groups'
27
- method_option :long, aliases: '-l', default: false, desc: 'Long listing'
27
+ method_option :long, aliases: '-l', type: :boolean, default: false, desc: 'Long listing'
28
28
  def ls(prefix = nil)
29
29
  paginate(:log_groups) do |token|
30
30
  logs.describe_log_groups(log_group_name_prefix: prefix, next_token: token)
@@ -55,9 +55,9 @@ module Awful
55
55
  end
56
56
 
57
57
  desc 'streams GROUP [PREFIX]', 'list log streams for GROUP'
58
- method_option :long, aliases: '-l', default: false, desc: 'long listing'
59
- method_option :limit, aliases: '-n', default: 50, desc: 'limit number of results per page call'
60
- method_option :alpha, aliases: '-a', default: false, desc: 'order by name'
58
+ method_option :long, aliases: '-l', type: :boolean, default: false, desc: 'long listing'
59
+ method_option :limit, aliases: '-n', type: :numeric, default: 50, desc: 'limit number of results per page call'
60
+ method_option :alpha, aliases: '-a', type: :boolean, default: false, desc: 'order by name'
61
61
  def streams(group, prefix = nil)
62
62
  paginate(:log_streams) do |token|
63
63
  logs.describe_log_streams(
@@ -4,7 +4,7 @@ module Awful
4
4
  class DataPipeline < Cli
5
5
 
6
6
  desc 'ls [PATTERN]', 'list data pipelines'
7
- method_option :long, aliases: '-l', default: false, desc: 'Long listing'
7
+ method_option :long, aliases: '-l', type: :boolean, default: false, desc: 'Long listing'
8
8
  def ls(name = /./)
9
9
  dps = datapipeline.list_pipelines.pipeline_id_list.select do |dp|
10
10
  dp.name.match(name)
@@ -47,7 +47,7 @@ module Awful
47
47
  end
48
48
 
49
49
  desc 'ls [PATTERN]', 'list dynamodb tables [matching PATTERN]'
50
- method_option :long, aliases: '-l', default: false, desc: 'Long listing'
50
+ method_option :long, aliases: '-l', type: :boolean, default: false, desc: 'Long listing'
51
51
  def ls(name = /./)
52
52
  tables = all_matching_tables(name)
53
53
 
@@ -167,8 +167,8 @@ module Awful
167
167
  end
168
168
 
169
169
  desc 'enable_streams NAME', 'enable/disable streams on the table'
170
- method_option :stream_view_type, aliases: '-t', default: 'NEW_IMAGE', desc: 'view type for the stream (NEW_IMAGE, OLD_IMAGE, NEW_AND_OLD_IMAGES, KEYS_ONLY)'
171
- method_option :disable, aliases: '-d', default: false, desc: 'disable the stream'
170
+ method_option :stream_view_type, aliases: '-t', type: :string, default: 'NEW_IMAGE', desc: 'view type (NEW_IMAGE, OLD_IMAGE, NEW_AND_OLD_IMAGES, KEYS_ONLY)'
171
+ method_option :disable, aliases: '-d', type: :boolean, default: false, desc: 'disable the stream'
172
172
  def enable_streams(name)
173
173
  stream_specification = {stream_enabled: !options[:disable]}
174
174
  stream_specification.merge!(stream_view_type: options[:stream_view_type].upcase) unless options[:disable]
@@ -13,7 +13,7 @@ module Awful
13
13
  end
14
14
 
15
15
  desc 'ls [NAME]', 'list dynamodb streams [for table NAME]'
16
- method_option :long, aliases: '-l', default: false, desc: 'Long listing'
16
+ method_option :long, aliases: '-l', type: :boolean, default: false, desc: 'Long listing'
17
17
  def ls(table_name = nil, exclusive_start_stream_arn = nil)
18
18
  response = streams.list_streams(
19
19
  table_name: table_name,
data/lib/awful/ec2.rb CHANGED
@@ -87,9 +87,9 @@ module Awful
87
87
  end
88
88
 
89
89
  desc 'create NAME', 'run new EC2 instance'
90
- method_option :subnet, :aliases => '-s', :default => nil, :desc => 'VPC subnet to use; default nil (classic)'
91
- method_option :public_ip, :aliases => '-p', :default => true, :desc => 'Assign public IP to VPC instances'
92
- method_option :elastic_ip, :aliases => '-e', :default => true, :desc => 'Assign new elastic IP to instances'
90
+ method_option :subnet, aliases: '-s', type: :string, default: nil, desc: 'VPC subnet to use; default nil (classic)'
91
+ method_option :public_ip, aliases: '-p', type: :boolean, default: true, desc: 'Assign public IP to VPC instances'
92
+ method_option :elastic_ip, aliases: '-e', type: :boolean, default: true, desc: 'Assign new elastic IP to instances'
93
93
  def create(name)
94
94
  opt = load_cfg.merge(symbolize_keys(options))
95
95
  whitelist = %i[image_id min_count max_count key_name security_group_ids user_data instance_type kernel_id
@@ -141,7 +141,7 @@ module Awful
141
141
  end
142
142
 
143
143
  desc 'az', 'list availability zones'
144
- method_option :long, aliases: '-l', default: false, desc: 'Long listing'
144
+ method_option :long, aliases: '-l', type: :boolean, default: false, desc: 'Long listing'
145
145
  def az
146
146
  ec2.describe_availability_zones.availability_zones.output do |zones|
147
147
  if options[:long]
data/lib/awful/ecs.rb CHANGED
@@ -28,8 +28,8 @@ module Awful
28
28
  end
29
29
 
30
30
  desc 'ls NAME', 'list ECS clusters'
31
- method_option :arns, aliases: '-a', default: false, desc: 'List just ARNs'
32
- method_option :long, aliases: '-l', default: false, desc: 'Long listing'
31
+ method_option :arns, aliases: '-a', type: :boolean, default: false, desc: 'List just ARNs'
32
+ method_option :long, aliases: '-l', type: :boolean, default: false, desc: 'Long listing'
33
33
  def ls(name = '.')
34
34
  arns = ecs.list_clusters.cluster_arns.select do |arn|
35
35
  arn.split('/').last.match(/#{name}/i)
@@ -61,7 +61,7 @@ module Awful
61
61
  end
62
62
 
63
63
  desc 'instances CLUSTER', 'list instances for CLUSTER'
64
- method_option :long, aliases: '-l', default: false, desc: 'Long listing'
64
+ method_option :long, aliases: '-l', type: :boolean, default: false, desc: 'Long listing'
65
65
  def instances(cluster)
66
66
  arns = ecs.list_container_instances(cluster: cluster).container_instance_arns
67
67
  if options[:long]
@@ -90,8 +90,8 @@ module Awful
90
90
  end
91
91
 
92
92
  desc 'definitions [FAMILY_PREFIX]', 'task definitions [for FAMILY]'
93
- method_option :arns, aliases: '-a', default: false, desc: 'show full ARNs for tasks definitions'
94
- method_option :inactive, aliases: '-i', default: false, desc: 'show INACTIVE instead of ACTIVE task definitions'
93
+ method_option :arns, aliases: '-a', type: :boolean, default: false, desc: 'show full ARNs for tasks definitions'
94
+ method_option :inactive, aliases: '-i', type: :boolean, default: false, desc: 'show INACTIVE instead of ACTIVE task definitions'
95
95
  def definitions(family = nil)
96
96
  params = {family_prefix: family, status: options[:inactive] ? 'INACTIVE' : 'ACTIVE'}.reject{|_,v| v.nil?}
97
97
  arns = ecs.list_task_definitions(params).task_definition_arns
@@ -133,7 +133,7 @@ module Awful
133
133
  end
134
134
 
135
135
  desc 'dump TASK', 'describe details for TASK definition'
136
- method_option :json, aliases: '-j', default: false, desc: 'dump as json instead of yaml'
136
+ method_option :json, aliases: '-j', type: :boolean, default: false, desc: 'dump as json instead of yaml'
137
137
  def dump(task)
138
138
  ecs.describe_task_definition(task_definition: task).task_definition.to_h.output do |hash|
139
139
  if options[:json]
@@ -145,8 +145,8 @@ module Awful
145
145
  end
146
146
 
147
147
  desc 'tasks CLUSTER', 'list tasks for CLUSTER'
148
- method_option :long, aliases: '-l', default: false, desc: 'Long listing'
149
- method_option :status, aliases: '-s', default: 'running', desc: 'choose status to show: running/pending/stopped'
148
+ method_option :long, aliases: '-l', type: :boolean, default: false, desc: 'Long listing'
149
+ method_option :status, aliases: '-s', type: :boolean, default: 'running', desc: 'choose status to show: running/pending/stopped'
150
150
  def tasks(cluster)
151
151
  status = %w[running pending stopped].find{ |s| s.match(/^#{options[:status]}/i) }
152
152
  arns = ecs.list_tasks(cluster: cluster, desired_status: status.upcase).task_arns
@@ -179,7 +179,7 @@ module Awful
179
179
  end
180
180
 
181
181
  desc 'services CLUSTER', 'list services for a cluster'
182
- method_option :long, aliases: '-l', default: false, desc: 'Long listing'
182
+ method_option :long, aliases: '-l', type: :boolean, default: false, desc: 'Long listing'
183
183
  def services(cluster)
184
184
  arns = ecs.list_services(cluster: cluster).service_arns
185
185
  if options[:long]
@@ -218,7 +218,7 @@ module Awful
218
218
  end
219
219
 
220
220
  desc 'run_task CLUSTER TASK_DEFINITION', 'run a task on given cluster'
221
- method_option :command, aliases: '-c', default: nil, desc: 'override container command as name:cmd,arg1,arg2'
221
+ method_option :command, aliases: '-c', type: :string, default: nil, desc: 'override container command as name:cmd,arg1,arg2'
222
222
  def run_task(cluster, task)
223
223
  container_overrides = {}
224
224
  if options[:command]
@@ -24,7 +24,7 @@ module Awful
24
24
  end
25
25
 
26
26
  desc 'ls [ID]', 'list clusters'
27
- method_option :long, aliases: '-l', default: false, desc: 'Long listing'
27
+ method_option :long, aliases: '-l', type: :boolean, default: false, desc: 'Long listing'
28
28
  def ls(id = nil)
29
29
  elasticache.describe_cache_clusters(cache_cluster_id: id).cache_clusters.tap do |clusters|
30
30
  if options[:long]
data/lib/awful/elb.rb CHANGED
@@ -32,7 +32,7 @@ module Awful
32
32
  end
33
33
 
34
34
  desc 'ls [NAME]', 'list load-balancers matching NAME'
35
- method_option :long, aliases: '-l', default: false, desc: 'Long listing'
35
+ method_option :long, aliases: '-l', type: :boolean, default: false, desc: 'Long listing'
36
36
  def ls(name = /./)
37
37
  all_matching_elbs(name).output do |elbs|
38
38
  if options[:long]
@@ -46,7 +46,7 @@ module Awful
46
46
  end
47
47
 
48
48
  desc 'instances NAME', 'list instances and states for elb NAME'
49
- method_option :long, aliases: '-l', default: false, desc: 'Long listing'
49
+ method_option :long, aliases: '-l', type: :boolean, default: false, desc: 'Long listing'
50
50
  def instances(name)
51
51
  instances = all_matching_elbs(name).map do |e|
52
52
  elb.describe_instance_health(load_balancer_name: e.load_balancer_name).map(&:instance_states)
@@ -116,11 +116,11 @@ module Awful
116
116
  end
117
117
 
118
118
  desc 'health_check NAME', 'set health-check'
119
- method_option :target, aliases: '-t', default: nil, desc: 'Health check target'
120
- method_option :interval, aliases: '-i', default: nil, desc: 'Check interval'
121
- method_option :timeout, aliases: '-o', default: nil, desc: 'Check timeout'
122
- method_option :unhealthy_threshold, aliases: '-u', default: nil, desc: 'Unhealthy threshold'
123
- method_option :healthy_threshold, aliases: '-h', default: nil, desc: 'Healthy threshold'
119
+ method_option :target, aliases: '-t', type: :string, default: nil, desc: 'Health check target'
120
+ method_option :interval, aliases: '-i', type: :numeric, default: nil, desc: 'Check interval'
121
+ method_option :timeout, aliases: '-o', type: :numeric, default: nil, desc: 'Check timeout'
122
+ method_option :unhealthy_threshold, aliases: '-u', type: :numeric, default: nil, desc: 'Unhealthy threshold'
123
+ method_option :healthy_threshold, aliases: '-h', type: :numeric, default: nil, desc: 'Healthy threshold'
124
124
  def health_check(name)
125
125
  opt = load_cfg.merge(options.reject(&:nil?))
126
126
  hc = elb.configure_health_check(load_balancer_name: name, health_check: opt[:health_check])
@@ -147,7 +147,7 @@ module Awful
147
147
  end
148
148
 
149
149
  desc 'state [INSTANCE_IDS]', 'show health state for all instances, or listed instance ids'
150
- method_option :long, aliases: '-l', default: false, desc: 'Long listing'
150
+ method_option :long, aliases: '-l', type: :boolean, default: false, desc: 'Long listing'
151
151
  def state(name, *instances)
152
152
  elb.describe_instance_health(load_balancer_name: name, instances: instance_ids(*instances)).instance_states.output do |list|
153
153
  if options[:long]
data/lib/awful/iam.rb CHANGED
@@ -29,7 +29,7 @@ module Awful
29
29
  end
30
30
 
31
31
  desc 'mfa', 'list MFA devices'
32
- method_option :long, aliases: '-l', default: false, desc: 'Long listing'
32
+ method_option :long, aliases: '-l', type: :boolean, default: false, desc: 'Long listing'
33
33
  def mfa
34
34
  iam.list_virtual_mfa_devices.virtual_mfa_devices.output do |devices|
35
35
  if options[:long]
@@ -44,8 +44,8 @@ module Awful
44
44
  end
45
45
 
46
46
  desc 'roles [NAME]', 'list IAM roles [matching NAME]'
47
- method_option :long, aliases: '-l', default: false, desc: 'Long listing'
48
- method_option :arns, aliases: '-a', default: false, desc: 'Show ARNs instead of names'
47
+ method_option :long, aliases: '-l', type: :boolean, default: false, desc: 'Long listing'
48
+ method_option :arns, aliases: '-a', type: :boolean, default: false, desc: 'Show ARNs instead of names'
49
49
  def roles(name = /./)
50
50
  iam.list_roles.roles.select do |role|
51
51
  role.role_name.match(name)
@@ -67,7 +67,7 @@ module Awful
67
67
  end
68
68
 
69
69
  desc 'policy {role,group,user} NAME', 'List or show policy(s) for {role,group,user} NAME'
70
- method_option :pretty, aliases: '-p', default: false, desc: 'Pretty-print policy document'
70
+ method_option :pretty, aliases: '-p', type: :boolean, default: false, desc: 'Pretty-print policy document'
71
71
  def policy(type, name, policy = nil)
72
72
 
73
73
  ## first matching role, group or user
data/lib/awful/lambda.rb CHANGED
@@ -23,8 +23,8 @@ module Awful
23
23
  end
24
24
 
25
25
  desc 'ls NAME', 'list lambda functions matching NAME pattern'
26
- method_option :long, aliases: '-l', default: false, desc: 'Long listing'
27
- method_option :arns, aliases: '-a', default: false, desc: 'List ARNs for functions'
26
+ method_option :long, aliases: '-l', type: :boolean, default: false, desc: 'Long listing'
27
+ method_option :arns, aliases: '-a', type: :boolean, default: false, desc: 'List ARNs for functions'
28
28
  def ls(name = /./)
29
29
  lambda.list_functions.functions.select do |function|
30
30
  function.function_name.match(name)
@@ -51,7 +51,7 @@ module Awful
51
51
  end
52
52
 
53
53
  desc 'update [NAME]', 'update lambda function config [and code]'
54
- method_option :zip_file, aliases: '-z', default: false, desc: 'Update code zip file (creates if necessary)'
54
+ method_option :zip_file, aliases: '-z', type: :boolean, default: false, desc: 'Update code zip file (creates if necessary)'
55
55
  def update(name = nil)
56
56
  opt = load_cfg
57
57
  opt[:function_name] = name unless name.nil?
@@ -83,7 +83,7 @@ module Awful
83
83
  end
84
84
 
85
85
  desc 'code NAME', 'get code for lambda function NAME'
86
- method_option :url, aliases: '-u', default: false, desc: 'Return just URL instead of downloading code'
86
+ method_option :url, aliases: '-u', type: :boolean, default: false, desc: 'Return just URL instead of downloading code'
87
87
  def code(name)
88
88
  url = lambda.get_function(function_name: name).code.location
89
89
  if options[:url]
@@ -20,7 +20,7 @@ module Awful
20
20
  end
21
21
 
22
22
  desc 'ls [FUNCTION_NAME]', 'list event source mappings'
23
- method_option :long, aliases: '-l', default: false, desc: 'Long listing'
23
+ method_option :long, aliases: '-l', type: :boolean, default: false, desc: 'Long listing'
24
24
  def ls(name = nil)
25
25
  lambda.list_event_source_mappings(function_name: name).event_source_mappings.tap do |sources|
26
26
  if options[:long]
@@ -5,7 +5,7 @@ module Awful
5
5
  class LaunchConfig < Cli
6
6
 
7
7
  desc 'ls [PATTERN]', 'list launch configs with name matching PATTERN'
8
- method_option :long, aliases: '-l', default: false, desc: 'Long listing'
8
+ method_option :long, aliases: '-l', type: :boolean, default: false, desc: 'Long listing'
9
9
  def ls(name = /./)
10
10
  fields = options[:long] ? %i[launch_configuration_name image_id instance_type created_time] : %i[launch_configuration_name]
11
11
  autoscaling.describe_launch_configurations.map(&:launch_configurations).flatten.select do |lc|
@@ -53,9 +53,9 @@ module Awful
53
53
  end
54
54
 
55
55
  desc 'create NAME [FILE]', 'create a new launch configuration'
56
- method_option :timestamp, aliases: '-t', default: false, desc: 'Add timestamp to launch config name'
57
- method_option :launch_configuration_name, aliases: '-n', default: nil, desc: 'launch configuration name'
58
- method_option :image_id, aliases: '-i', default: nil, desc: 'image ID (AMI to use)'
56
+ method_option :timestamp, aliases: '-t', type: :boolean, default: false, desc: 'Add timestamp to launch config name'
57
+ method_option :launch_configuration_name, aliases: '-n', type: :string, default: nil, desc: 'launch configuration name'
58
+ method_option :image_id, aliases: '-i', type: :string, default: nil, desc: 'image ID (AMI to use)'
59
59
  def create(file = nil)
60
60
  opt = load_cfg(options, file)
61
61
 
data/lib/awful/rds.rb CHANGED
@@ -3,7 +3,7 @@ module Awful
3
3
  class Rds < Cli
4
4
 
5
5
  desc 'ls [NAME]', 'list DB instances matching NAME'
6
- method_option :long, aliases: '-l', default: false, desc: 'Long listing'
6
+ method_option :long, aliases: '-l', type: :boolean, default: false, desc: 'Long listing'
7
7
  def ls(name = /./)
8
8
  fields = options[:long] ?
9
9
  ->(d) { [d.db_instance_identifier, d.availability_zone, d.db_instance_class, d.db_instance_status, d.preferred_maintenance_window, d.storage_type, d.allocated_storage,
data/lib/awful/route53.rb CHANGED
@@ -45,7 +45,7 @@ module Awful
45
45
  end
46
46
 
47
47
  desc 'ls [NAME]', 'list hosted zones'
48
- method_option :long, aliases: '-l', default: false, desc: 'Long listing'
48
+ method_option :long, aliases: '-l', type: :boolean, default: false, desc: 'Long listing'
49
49
  def ls(name = /./)
50
50
  route53.list_hosted_zones.hosted_zones.select do |zone|
51
51
  zone.name.match(name)
@@ -3,7 +3,7 @@ module Awful
3
3
  class RouteTable < Cli
4
4
 
5
5
  desc 'ls [PATTERN]', 'list routes'
6
- method_option :long, aliases: '-l', default: false, desc: 'Long listing'
6
+ method_option :long, aliases: '-l', type: :boolean, default: false, desc: 'Long listing'
7
7
  def ls(name = nil)
8
8
  fields = options[:long] ?
9
9
  ->(r) { [ tag_name(r), r.route_table_id, r.vpc_id ] } :
data/lib/awful/s3.rb CHANGED
@@ -20,7 +20,7 @@ module Awful
20
20
  end
21
21
 
22
22
  desc 'ls PATTERN', 'list buckets or objects'
23
- method_option :long, aliases: '-l', default: false, desc: 'Long listing'
23
+ method_option :long, aliases: '-l', type: :boolean, default: false, desc: 'Long listing'
24
24
  def ls(name = '.')
25
25
  if name.include?('/')
26
26
  bucket, prefix = name.split('/', 2)
@@ -31,7 +31,7 @@ module Awful
31
31
  end
32
32
 
33
33
  desc 'buckets [PATTERN]', 'list buckets'
34
- method_option :long, aliases: '-l', default: false, desc: 'Long listing'
34
+ method_option :long, aliases: '-l', type: :boolean, default: false, desc: 'Long listing'
35
35
  def buckets(name = /./)
36
36
  s3.list_buckets.buckets.select do |bucket|
37
37
  bucket.name.match(/#{name}/)
@@ -64,7 +64,7 @@ module Awful
64
64
  end
65
65
 
66
66
  desc 'inbound NAME', 'show inbound rules for named security group'
67
- method_option :long, aliases: '-l', default: false, desc: 'Long listing'
67
+ method_option :long, aliases: '-l', type: :boolean, default: false, desc: 'Long listing'
68
68
  def inbound(name)
69
69
  first_matching_sg(name).ip_permissions.output do |perms|
70
70
  sources = ->(perm) { perm.ip_ranges.map(&:cidr_ip) + perm.user_id_group_pairs.map(&:group_id) }
data/lib/awful/sqs.rb CHANGED
@@ -25,7 +25,7 @@ module Awful
25
25
  end
26
26
 
27
27
  desc 'ls [PATTERN]', 'list subnets [with any tags matching PATTERN]'
28
- method_option :long, aliases: '-l', default: false, desc: 'Long listing'
28
+ method_option :long, aliases: '-l', type: :boolean, default: false, desc: 'Long listing'
29
29
  def ls(prefix = nil)
30
30
  queues = sqs.list_queues(queue_name_prefix: prefix).queue_urls
31
31
  attr = %w[QueueArn ApproximateNumberOfMessages ApproximateNumberOfMessagesNotVisible LastModifiedTimestamp]
data/lib/awful/subnet.rb CHANGED
@@ -3,7 +3,7 @@ module Awful
3
3
  class Subnet < Cli
4
4
 
5
5
  desc 'ls [PATTERN]', 'list subnets [with any tags matching PATTERN]'
6
- method_option :long, aliases: '-l', default: false, desc: 'Long listing'
6
+ method_option :long, aliases: '-l', type: :boolean, default: false, desc: 'Long listing'
7
7
  def ls(name = /./)
8
8
  fields = options[:long] ?
9
9
  ->(s) { [(tag_name(s) || '-'), s.subnet_id, s.state, s.cidr_block, s.available_ip_address_count, s.availability_zone] } :
@@ -3,7 +3,7 @@ module Awful
3
3
  class TrustedAdvisor < Cli
4
4
 
5
5
  desc 'ls', 'list trusted advisor checks'
6
- method_option :long, aliases: '-l', default: false, desc: 'Long listing'
6
+ method_option :long, aliases: '-l', type: :boolean, default: false, desc: 'Long listing'
7
7
  def ls(name = '.')
8
8
  support.describe_trusted_advisor_checks(language: 'en').checks.select do |check|
9
9
  check.name.match(/#{name}/i)
@@ -17,8 +17,8 @@ module Awful
17
17
  end
18
18
 
19
19
  desc 'check ID', 'describe check result for given ID'
20
- method_option :long, aliases: '-l', default: false, desc: 'Long listing'
21
- method_option :all, aliases: '-a', default: false, desc: 'List all flagged resources'
20
+ method_option :long, aliases: '-l', type: :boolean, default: false, desc: 'Long listing'
21
+ method_option :all, aliases: '-a', type: :boolean, default: false, desc: 'List all flagged resources'
22
22
  def check(id)
23
23
  support.describe_trusted_advisor_check_result(check_id: id).result.tap do |r|
24
24
  if options[:long]
data/lib/awful/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Awful
2
- VERSION = '0.0.158'
2
+ VERSION = '0.0.159'
3
3
  end
data/lib/awful/vpc.rb CHANGED
@@ -3,7 +3,7 @@ module Awful
3
3
  class Vpc < Cli
4
4
 
5
5
  desc 'ls [PATTERN]', 'list vpcs [with any tags matching PATTERN]'
6
- method_option :long, aliases: '-l', default: false, desc: 'Long listing'
6
+ method_option :long, aliases: '-l', type: :boolean, default: false, desc: 'Long listing'
7
7
  def ls(name = /./)
8
8
  fields = options[:long] ?
9
9
  ->(v) { [tag_name(v), v.vpc_id, v.state, v.cidr_block] } :
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: awful
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.158
4
+ version: 0.0.159
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ric Lister
@@ -56,16 +56,16 @@ dependencies:
56
56
  name: thor
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - "<"
59
+ - - ">="
60
60
  - !ruby/object:Gem::Version
61
- version: 0.19.2
61
+ version: '0'
62
62
  type: :runtime
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
- - - "<"
66
+ - - ">="
67
67
  - !ruby/object:Gem::Version
68
- version: 0.19.2
68
+ version: '0'
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: dotenv
71
71
  requirement: !ruby/object:Gem::Requirement