awful 0.0.167 → 0.0.168

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: 707724c618d524adbace4d7cb12ecf78a6636412
4
- data.tar.gz: 26f835d01f873767fca0758273d5fdc69e024906
3
+ metadata.gz: 63a0b1c3952a709088734a645256ad77511cd364
4
+ data.tar.gz: 79ad0d19ac1ee5a14ca4000d716018e96be95ac1
5
5
  SHA512:
6
- metadata.gz: bd3a0d6bf3ad77b66324b679d2cc6a3d7003a474b480496f17e751eb2e84107e8a1bfe08cf07771c62a956e1968d75b4994f86c2875016924cbe77ea949831f3
7
- data.tar.gz: 50a08de9f3a5181294e9c927594f6fff73d345486c3cb4faa78dcbbe7a0c996c515324e17a220821df0fc9e425599f4edc206d573c869c0d823952afc07b8b64
6
+ metadata.gz: b993cd6e0a39ad48fe1fa8a4647204c924cff878eed8387f6f08144eae2e8070d3a6af1c3a8200316c292de6b2d47eeeb8791f9305682dac34b978411b739b4d
7
+ data.tar.gz: 881a4eb3a8c115556a74b4cdcabbb83ae5709468e996e583dae4723ce2109ff98e4bc732f1a150fa827d131d2afe44a07c06d3991f56b6d0ff766c4a028ca7b5
data/bin/keypair ADDED
@@ -0,0 +1,7 @@
1
+ #!/usr/bin/ruby
2
+ #-*- mode: ruby; -*-
3
+
4
+ require 'awful'
5
+ require 'awful/keypair'
6
+
7
+ Awful::Keypair.start(ARGV)
@@ -0,0 +1,44 @@
1
+ module Awful
2
+ module Short
3
+ def keypair(*args)
4
+ Awful::Keypair.new.invoke(*args)
5
+ end
6
+ end
7
+
8
+ class Keypair < Cli
9
+ desc 'ls [NAMES]', 'describe key pairs'
10
+ method_option :long, aliases: '-l', type: :boolean, default: false, desc: 'long listing'
11
+ def ls(*names)
12
+ names = nil if names.empty?
13
+ ec2.describe_key_pairs(key_names: names).key_pairs.output do |kp|
14
+ if options[:long]
15
+ print_table kp.map{ |k| [k.key_name, k.key_fingerprint] }
16
+ else
17
+ puts kp.map(&:key_name)
18
+ end
19
+ end
20
+ end
21
+
22
+ desc 'create NAME', 'create key pair'
23
+ def create(name)
24
+ ec2.create_key_pair(key_name: name.to_s).output do |k|
25
+ puts k.key_material
26
+ end
27
+ end
28
+
29
+ desc 'import NAME', 'import public key for your own key pair from stdin or file'
30
+ method_option :file, aliases: '-f', type: :string, default: nil, desc: 'file to load public key'
31
+ def import(name)
32
+ key = file_or_stdin(options[:file])
33
+ ec2.import_key_pair(key_name: name, public_key_material: key)
34
+ end
35
+
36
+ desc 'delete NAME', 'delete key pair'
37
+ def delete(name)
38
+ if yes?("Really delete key pair #{name}?", :yellow)
39
+ ec2.delete_key_pair(key_name: name)
40
+ end
41
+ end
42
+
43
+ end
44
+ end
data/lib/awful/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Awful
2
- VERSION = '0.0.167'
2
+ VERSION = '0.0.168'
3
3
  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.167
4
+ version: 0.0.168
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-02-24 00:00:00.000000000 Z
11
+ date: 2017-02-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -104,6 +104,7 @@ executables:
104
104
  - elasticache
105
105
  - elb
106
106
  - iam
107
+ - keypair
107
108
  - kms
108
109
  - lambda
109
110
  - lc
@@ -149,6 +150,7 @@ files:
149
150
  - bin/elasticache
150
151
  - bin/elb
151
152
  - bin/iam
153
+ - bin/keypair
152
154
  - bin/kms
153
155
  - bin/lambda
154
156
  - bin/lc
@@ -192,6 +194,7 @@ files:
192
194
  - lib/awful/elasticache.rb
193
195
  - lib/awful/elb.rb
194
196
  - lib/awful/iam.rb
197
+ - lib/awful/keypair.rb
195
198
  - lib/awful/kms.rb
196
199
  - lib/awful/lambda.rb
197
200
  - lib/awful/lambda_events.rb