awful 0.0.160 → 0.0.161
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/awful/launch_config.rb +28 -14
- data/lib/awful/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 468c76dd67311ec96f097e6d05ecf53287800b64
|
4
|
+
data.tar.gz: f3a59e49c7c61e4d05941b18368a09292450f7a3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 06d367fe21ee33f8c58ea6308e4160caa937209f8f8238afffbbb8b40b0033a2be48df59bc1e3182284fcde9f88891b804ebce43ebd26c13fc5ca0829688c12f
|
7
|
+
data.tar.gz: 5dfa3f87196eff10c0df6565561b9694d73ecec663e8fd264041bcbb15933cb32376cc2ff7cb5a02d8c7acdb705a2bf0e7b084f2f307c6cce49a0f750cfa0fcc
|
data/lib/awful/launch_config.rb
CHANGED
@@ -4,16 +4,22 @@ module Awful
|
|
4
4
|
|
5
5
|
class LaunchConfig < Cli
|
6
6
|
|
7
|
-
desc 'ls [
|
8
|
-
method_option :long,
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
end.
|
14
|
-
|
15
|
-
end.
|
16
|
-
|
7
|
+
desc 'ls [NAMES]', 'list launch configurations'
|
8
|
+
method_option :long, aliases: '-l', type: :boolean, default: false, desc: 'long listing'
|
9
|
+
method_option :match, aliases: '-m', type: :string, default: nil, desc: 'filter by matching name'
|
10
|
+
def ls(*names)
|
11
|
+
paginate(:launch_configurations) do |token|
|
12
|
+
autoscaling.describe_launch_configurations(launch_configuration_names: names, next_token: token)
|
13
|
+
end.tap do |lcs|
|
14
|
+
lcs.select! { |lc| lc.launch_configuration_name.match(options[:match]) } if options[:match]
|
15
|
+
end.output do |lcs|
|
16
|
+
if options[:long]
|
17
|
+
print_table lcs.map { |lc|
|
18
|
+
[lc.launch_configuration_name, lc.image_id, lc.instance_type, lc.created_time]
|
19
|
+
}
|
20
|
+
else
|
21
|
+
puts lcs.map(&:launch_configuration_name)
|
22
|
+
end
|
17
23
|
end
|
18
24
|
end
|
19
25
|
|
@@ -37,10 +43,18 @@ module Awful
|
|
37
43
|
end
|
38
44
|
|
39
45
|
desc 'dump NAME', 'dump existing launch_configuration as yaml'
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
46
|
+
method_option :match, aliases: '-m', type: :string, default: nil, desc: 'filter by matching name'
|
47
|
+
def dump(*names)
|
48
|
+
paginate(:launch_configurations) do |token|
|
49
|
+
autoscaling.describe_launch_configurations(launch_configuration_names: names, next_token: token)
|
50
|
+
end.tap do |lcs|
|
51
|
+
lcs.select! { |lc| lc.launch_configuration_name.match(options[:match]) } if options[:match]
|
52
|
+
end.output do |lcs|
|
53
|
+
lcs.each do |lc|
|
54
|
+
lc[:user_data] = Base64.decode64(lc[:user_data])
|
55
|
+
puts YAML.dump(stringify_keys(lc.to_hash))
|
56
|
+
end
|
57
|
+
end
|
44
58
|
end
|
45
59
|
|
46
60
|
desc 'latest', 'latest'
|
data/lib/awful/version.rb
CHANGED