awful 0.0.36 → 0.0.37
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/ta +7 -0
- data/lib/awful.rb +4 -0
- data/lib/awful/trusted_advisor.rb +53 -0
- data/lib/awful/version.rb +1 -1
- metadata +5 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: dc01ff7e05945c5a7df17207a7a33331b5189899
|
4
|
+
data.tar.gz: d117f8ea9bb1db41aac08ae8733baf9b90a8d82f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a799784f0ca082b810950637a8eb93b25194fe9396447e47bedf51e53c2ecc1c5e6f63d3a734801f90ac728fe44380a4cf953bb6ef678b281478dad1a786127f
|
7
|
+
data.tar.gz: c8d37aafefc44a9fad6caf96d3283c4e3e9b4842e874bace1ef06e27b5cdf58ea89305cc077a5cd93e66443c96078f49a5373039363050b5de800a776c3bcde7
|
data/bin/ta
ADDED
data/lib/awful.rb
CHANGED
@@ -0,0 +1,53 @@
|
|
1
|
+
module Awful
|
2
|
+
|
3
|
+
class TrustedAdvisor < Cli
|
4
|
+
|
5
|
+
desc 'ls', 'list trusted advisor checks'
|
6
|
+
method_option :long, aliases: '-l', default: false, desc: 'Long listing'
|
7
|
+
def ls(name = '.')
|
8
|
+
support.describe_trusted_advisor_checks(language: 'en').checks.select do |check|
|
9
|
+
check.name.match(/#{name}/i)
|
10
|
+
end.tap do |checks|
|
11
|
+
if options[:long]
|
12
|
+
print_table(checks.map { |c| [c.name, c.id, c.category] }.sort)
|
13
|
+
else
|
14
|
+
puts checks.map(&:name).sort
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
|
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'
|
22
|
+
def check(id)
|
23
|
+
support.describe_trusted_advisor_check_result(check_id: id).result.tap do |r|
|
24
|
+
if options[:long]
|
25
|
+
flagged = "#{r.resources_summary.resources_flagged}/#{r.resources_summary.resources_processed}"
|
26
|
+
puts "#{r.check_id} #{r.status} #{flagged}"
|
27
|
+
elsif options[:all]
|
28
|
+
print_table r.flagged_resources.map { |f| f.metadata }.sort
|
29
|
+
else
|
30
|
+
puts r.status
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
35
|
+
desc 'summary NAME', 'check summaries matching name'
|
36
|
+
def summary(name = '.')
|
37
|
+
checks = support.describe_trusted_advisor_checks(language: 'en').checks.select do |check|
|
38
|
+
check.name.match(/#{name}/i)
|
39
|
+
end.each_with_object({}) do |check, hash|
|
40
|
+
hash[check.id] = check
|
41
|
+
end
|
42
|
+
support.describe_trusted_advisor_check_summaries(check_ids: checks.keys).summaries.tap do |summaries|
|
43
|
+
summaries.map do |s|
|
44
|
+
check = checks[s.check_id]
|
45
|
+
flagged = "#{s.resources_summary.resources_flagged}/#{s.resources_summary.resources_processed}"
|
46
|
+
[check.name, s.check_id, s.status, flagged, s.timestamp]
|
47
|
+
end.tap { |list| print_table list.sort }
|
48
|
+
end
|
49
|
+
end
|
50
|
+
|
51
|
+
end
|
52
|
+
|
53
|
+
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.37
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ric Lister
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-09-
|
11
|
+
date: 2015-09-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -98,6 +98,7 @@ executables:
|
|
98
98
|
- s3
|
99
99
|
- sg
|
100
100
|
- subnet
|
101
|
+
- ta
|
101
102
|
- vpc
|
102
103
|
extensions: []
|
103
104
|
extra_rdoc_files: []
|
@@ -122,6 +123,7 @@ files:
|
|
122
123
|
- bin/s3
|
123
124
|
- bin/sg
|
124
125
|
- bin/subnet
|
126
|
+
- bin/ta
|
125
127
|
- bin/vpc
|
126
128
|
- lib/awful.rb
|
127
129
|
- lib/awful/ami.rb
|
@@ -138,6 +140,7 @@ files:
|
|
138
140
|
- lib/awful/s3.rb
|
139
141
|
- lib/awful/security_group.rb
|
140
142
|
- lib/awful/subnet.rb
|
143
|
+
- lib/awful/trusted_advisor.rb
|
141
144
|
- lib/awful/version.rb
|
142
145
|
- lib/awful/vpc.rb
|
143
146
|
homepage: ''
|