awful 0.0.177 → 0.0.178

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: f64a6389e61a221feb7f96f0da90ca0a5c921432
4
- data.tar.gz: ce136a17d9267b07296d93feb7fc235d92bd6609
3
+ metadata.gz: 2711ca955cb405228aabe4da654e69fdd5c3b9e9
4
+ data.tar.gz: 968799a060206cdfb356251d6e9261bb6b0cc4b2
5
5
  SHA512:
6
- metadata.gz: cec28d0a31b48f0c2abac9a105d3d4ec2d0ddeaa2ae35ec08ba2ea0585e5b030ca0d9ec866f61545798dd26990b288473341cc9fb348b4646c313ac48be3b12b
7
- data.tar.gz: 3c528d461c246baf851df923936c1a3d007b3798829197fd05d352ea84640ef46a662d4da5ed569f42aa90b465dd4f0ca62b47bccd01e73fdb5bcd86f42edba7
6
+ metadata.gz: 95a4f8660464ce6e878c90b1ddaff7f6a10445b27d98a7c10163c1750fdb386c61326dabf05c095bdac38b41d5da6b732ee1309e27f27388697544b11e7119d8
7
+ data.tar.gz: 693f27371acb348f367e8459b6707720c318255045b824d77702faf5decfba84cc37b2dacc1e3a930cf02f006eab5a941cd8ffb0550eb43b0fdcf78963257469
data/bin/vpce ADDED
@@ -0,0 +1,7 @@
1
+ #!/usr/bin/env ruby
2
+ #-*- mode: ruby; -*-
3
+
4
+ require 'awful'
5
+ require 'awful/vpce'
6
+
7
+ Awful::Vpce.start(ARGV)
data/lib/awful/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Awful
2
- VERSION = '0.0.177'
2
+ VERSION = '0.0.178'
3
3
  end
data/lib/awful/vpce.rb ADDED
@@ -0,0 +1,52 @@
1
+ module Awful
2
+
3
+ class Vpce < Cli
4
+ COLORS = {
5
+ available: :green,
6
+ pending: :yellow,
7
+ deleting: :red,
8
+ deleted: :green,
9
+ }
10
+
11
+ no_commands do
12
+ def color(string)
13
+ set_color(string, COLORS.fetch(string.to_sym, :yellow))
14
+ end
15
+ end
16
+
17
+ desc 'ls [IDs]', 'list VPC endpoints'
18
+ method_option :long, aliases: '-l', type: :boolean, default: false, desc: 'long listing'
19
+ method_option :vpc, aliases: '-v', type: :array, default: [], desc: 'VPC IDs to filter'
20
+ method_option :service, aliases: '-s', type: :array, default: [], desc: 'services to filter'
21
+ method_option :state, type: :array, default: [], desc: 'state: pending | available | deleting | deleted'
22
+ def ls(*ids)
23
+ filters = [
24
+ { name: 'vpc-endpoint-id', values: ids },
25
+ { name: 'vpc-id', values: options[:vpc] },
26
+ { name: 'service-name', values: options[:service].map { |s| "com.amazonaws.#{ENV['AWS_REGION']}.#{s.downcase}" } },
27
+ { name: 'vpc-endpoint-state', values: options[:state] },
28
+ ].reject { |f| f[:values].empty? }
29
+ filters = nil if filters.empty?
30
+
31
+ ec2.describe_vpc_endpoints(filters: filters).vpc_endpoints.output do |endpoints|
32
+ if options[:long]
33
+ print_table endpoints.map { |e|
34
+ [e.vpc_endpoint_id, e.vpc_id, e.service_name, color(e.state), e.creation_timestamp]
35
+ }
36
+ else
37
+ puts endpoints.map(&:vpc_endpoint_id)
38
+ end
39
+ end
40
+ end
41
+
42
+ desc 'dump IDs', 'dump VPC endpoints with ids'
43
+ def dump(*ids)
44
+ ec2.describe_vpc_endpoints(
45
+ filters: [{name: 'vpc-endpoint-id', values: ids}]
46
+ ).vpc_endpoints.output do |endpoints|
47
+ puts YAML.dump(endpoints.map{ |e| stringify_keys(e.to_hash) })
48
+ end
49
+ end
50
+
51
+ end
52
+ end
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.177
4
+ version: 0.0.178
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ric Lister
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-07-17 00:00:00.000000000 Z
11
+ date: 2017-09-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -120,6 +120,7 @@ executables:
120
120
  - subnet
121
121
  - ta
122
122
  - vpc
123
+ - vpce
123
124
  - waf
124
125
  extensions: []
125
126
  extra_rdoc_files: []
@@ -166,6 +167,7 @@ files:
166
167
  - bin/subnet
167
168
  - bin/ta
168
169
  - bin/vpc
170
+ - bin/vpce
169
171
  - bin/waf
170
172
  - lib/awful.rb
171
173
  - lib/awful/acm.rb
@@ -212,6 +214,7 @@ files:
212
214
  - lib/awful/trusted_advisor.rb
213
215
  - lib/awful/version.rb
214
216
  - lib/awful/vpc.rb
217
+ - lib/awful/vpce.rb
215
218
  - lib/awful/waf.rb
216
219
  - lib/awful/waf_acl.rb
217
220
  - lib/awful/waf_ipset.rb
@@ -236,7 +239,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
236
239
  version: '0'
237
240
  requirements: []
238
241
  rubyforge_project:
239
- rubygems_version: 2.6.8
242
+ rubygems_version: 2.6.13
240
243
  signing_key:
241
244
  specification_version: 4
242
245
  summary: Simple AWS command-line tool.