awful 0.0.55 → 0.0.56
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/awful/elb.rb +33 -18
- 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: 26f0326b74820ced71a71f07aaf0f4fee963d1b4
|
4
|
+
data.tar.gz: 658234154ad0d798cfd05cd657207cca1b9a95a2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 15aa87695dff68a363302b9c31f0233b02da4d081a19e6b3cd1452a508eb16eee02df29af49b07f31b861211e5b5da6ff6805c29f751beed6f48c61fcbb16c22
|
7
|
+
data.tar.gz: 0e9b09cb86c5650c3a245eb3c11bdeed010b34b744038b2138b4d3b55a272a4f491b867aea8621baac95e948a9b43bbe9d1f3c42dfeb0be68a98a107564f92df
|
data/lib/awful/elb.rb
CHANGED
@@ -11,21 +11,26 @@ module Awful
|
|
11
11
|
def color(string)
|
12
12
|
set_color(string, COLORS.fetch(string.to_sym, :yellow))
|
13
13
|
end
|
14
|
+
|
15
|
+
## cannot search ELBs by tag, so just name here
|
16
|
+
def all_matching_elbs(name)
|
17
|
+
elb.describe_load_balancers.map(&:load_balancer_descriptions).flatten.select do |elb|
|
18
|
+
elb.load_balancer_name.match(name)
|
19
|
+
end
|
20
|
+
end
|
14
21
|
end
|
15
22
|
|
16
|
-
desc 'ls [
|
23
|
+
desc 'ls [NAME]', 'list load-balancers matching NAME'
|
17
24
|
method_option :long, aliases: '-l', default: false, desc: 'Long listing'
|
18
25
|
def ls(name = /./)
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
end.tap do |list|
|
28
|
-
print_table list
|
26
|
+
all_matching_elbs(name).tap do |elbs|
|
27
|
+
if options[:long]
|
28
|
+
print_table elbs.map { |e|
|
29
|
+
[e.load_balancer_name, e.instances.length, e.availability_zones.join(','), e.dns_name]
|
30
|
+
}
|
31
|
+
else
|
32
|
+
puts elbs.map(&:load_balancer_name)
|
33
|
+
end
|
29
34
|
end
|
30
35
|
end
|
31
36
|
|
@@ -51,16 +56,26 @@ module Awful
|
|
51
56
|
|
52
57
|
desc 'dump NAME', 'dump VPC with id or tag NAME as yaml'
|
53
58
|
def dump(name)
|
54
|
-
|
55
|
-
|
59
|
+
all_matching_elbs(name).map(&:to_hash).tap do |elbs|
|
60
|
+
elbs.each do |elb|
|
61
|
+
puts YAML.dump(stringify_keys(elb))
|
62
|
+
end
|
63
|
+
end
|
64
|
+
end
|
65
|
+
|
66
|
+
desc 'tags NAME', 'dump tags on all ELBs matching NAME (up to 20)'
|
67
|
+
def tags(name)
|
68
|
+
elb.describe_tags(load_balancer_names: all_matching_elbs(name).map(&:load_balancer_name)).tag_descriptions.tap do |tags|
|
69
|
+
tags.each do |tag|
|
70
|
+
puts YAML.dump(stringify_keys(tag.to_hash))
|
71
|
+
end
|
72
|
+
end
|
56
73
|
end
|
57
74
|
|
58
|
-
desc 'dns NAME', 'get DNS
|
75
|
+
desc 'dns NAME', 'get DNS names for load-balancers matching NAME'
|
59
76
|
def dns(name)
|
60
|
-
|
61
|
-
|
62
|
-
end.map(&:dns_name).tap do |dns|
|
63
|
-
puts dns
|
77
|
+
all_matching_elbs(name).map(&:dns_name).tap do |dns_names|
|
78
|
+
puts dns_names
|
64
79
|
end
|
65
80
|
end
|
66
81
|
|
data/lib/awful/version.rb
CHANGED