awful 0.0.140 → 0.0.141
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/awful/alb.rb +46 -0
- data/lib/awful/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 32967d3c353628878e0e68835842ca72a4184f08
|
4
|
+
data.tar.gz: f67a4ca5b77a51c05dd0816eb0ad2b8c4d6d4f1b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e9132709fb02a3cbc69bd664eef409336cbaca3e3f0fd0cc8510738c16e70d26493611a45333e9712810b60c1fe1588cd259039c5d7fc81978a9fdf92e9d458a
|
7
|
+
data.tar.gz: 80619e51be54afc305081ba9d87d8199a3dd0c0645bb9e43a17e993110ab58720732e91573c95949016b39ad5bb1c509097c8040c06998eab880b5831797fbe9
|
data/lib/awful/alb.rb
CHANGED
@@ -10,6 +10,8 @@ module Awful
|
|
10
10
|
active: :green,
|
11
11
|
provisioning: :yellow,
|
12
12
|
failed: :red,
|
13
|
+
healthy: :green,
|
14
|
+
unhealthy: :red,
|
13
15
|
InService: :green,
|
14
16
|
OutOfService: :red,
|
15
17
|
}
|
@@ -83,5 +85,49 @@ module Awful
|
|
83
85
|
end
|
84
86
|
end
|
85
87
|
|
88
|
+
desc 'targets NAME', 'list target groups for ALB with NAME or ARN'
|
89
|
+
method_option :long, aliases: '-l', type: :boolean, default: false, desc: 'long listing'
|
90
|
+
def targets(name)
|
91
|
+
alb.describe_target_groups(load_balancer_arn: get_arn(name)).target_groups.output do |target_groups|
|
92
|
+
if options[:long]
|
93
|
+
print_table target_groups.map { |t|
|
94
|
+
[t.target_group_name, t.port, t.protocol, t.vpc_id]
|
95
|
+
}
|
96
|
+
else
|
97
|
+
puts target_groups.map(&:target_group_name)
|
98
|
+
end
|
99
|
+
end
|
100
|
+
end
|
101
|
+
|
102
|
+
desc 'instances NAME', 'list instances and health for ALB with NAME or ARN'
|
103
|
+
method_option :long, aliases: '-l', type: :boolean, default: false, desc: 'long listing'
|
104
|
+
def instances(name)
|
105
|
+
alb.describe_target_groups(load_balancer_arn: get_arn(name)).target_groups.map do |tg|
|
106
|
+
alb.describe_target_health(target_group_arn: tg.target_group_arn).target_health_descriptions
|
107
|
+
end.flatten(1).output do |targets|
|
108
|
+
if options[:long]
|
109
|
+
print_table targets.map { |t|
|
110
|
+
[t.target.id, t.target.port, color(t.target_health.state), t.target_health.reason, t.target_health.description]
|
111
|
+
}
|
112
|
+
else
|
113
|
+
puts targets.map{ |t| t.target.id }
|
114
|
+
end
|
115
|
+
end
|
116
|
+
end
|
117
|
+
|
118
|
+
desc 'rules LISTENER', 'list rules for listener'
|
119
|
+
method_option :long, aliases: '-l', type: :boolean, default: false, desc: 'long listing'
|
120
|
+
def rules(listener)
|
121
|
+
alb.describe_rules(listener_arn: listener).rules.output do |rules|
|
122
|
+
if options[:long]
|
123
|
+
print_table rules.map { |r|
|
124
|
+
[r.priority, r.rule_arn]
|
125
|
+
}
|
126
|
+
else
|
127
|
+
puts rules.map(&:rule_arn)
|
128
|
+
end
|
129
|
+
end
|
130
|
+
end
|
131
|
+
|
86
132
|
end
|
87
133
|
end
|
data/lib/awful/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: awful
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.141
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ric Lister
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-09-
|
11
|
+
date: 2016-09-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|