ec2ctl 0.6.0 → 0.6.1

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: 3d7a6433b5c621fa7c9fee1cc099f4982b2373bf
4
- data.tar.gz: 794818375ced3f00fd1cee3fe28107f2b6d854fd
3
+ metadata.gz: 9a6511dd684bf6069e077eac1cb5a6301e8fae0c
4
+ data.tar.gz: 1c3b5fda5ab55debd040bb6b39d3da53661003eb
5
5
  SHA512:
6
- metadata.gz: a7c5657494083f21c8283ab76c84dba0a745b9d7d55169bdc9b91842142c4d64cfc9f544d9e7350aadfc8dd1c2be941534c09b86580b47ba1f1e6728043b8d2f
7
- data.tar.gz: b2ccbf0e10a90f4013a8aff487a51789c98c9775b802836e70e8c82002ec5e873b42109ce2e3218e2196d70c68317e6a523354abfb3b09f1d0f37d78c7f99180
6
+ metadata.gz: 52ddf4a6bd35854d1b42248de4b5c52e74db52fa62ba86283c143e69b50ab211da0ba5a83e934bf79c3a31218f42df1118290fcac187a968b301a7238546f424
7
+ data.tar.gz: 968eb9d216e34f934b4dbd489280e962c03dc5584289a8f513b9acfcce5b834a4cb8f413f5610a23ded0d301fd2a88d049dbc802a13725e5ffc02b1c5283d710
data/README.md CHANGED
@@ -33,7 +33,8 @@ Commands:
33
33
  ec2ctl start NAME # Start instance. Instance will be searched by Name tag.
34
34
  ec2ctl status NAME # Show instance status. Instance will be searched by Name tag.
35
35
  ec2ctl stop NAME # Stop instance. Instance will be searched by Name tag.
36
-
36
+ ec2ctl reboot NAME # Reboot instance. Instance will be searched by Name tag.
37
+
37
38
  Options:
38
39
  k, [--access-key-id=ACCESS_KEY_ID]
39
40
  s, [--secret-access-key=SECRET_ACCESS_KEY]
data/lib/ec2ctl.rb CHANGED
@@ -1,4 +1,4 @@
1
- require "ec2ctl/version"
1
+ #require "lib/ec2ctl/version"
2
2
 
3
3
  require "thor"
4
4
  require "aws-sdk-v1"
@@ -33,6 +33,7 @@ module Ec2ctl
33
33
  puts VERSION
34
34
  end
35
35
 
36
+ option :only, default: false
36
37
  option :sort, default: name, aliases: [:S]
37
38
  option :limit, type: :numeric, aliases: [:l]
38
39
  desc "list PATTERN", "List all instances in region. Specify PATTERN to filter results by name."
@@ -65,7 +66,11 @@ module Ec2ctl
65
66
  rows.sort_by! {|row| row[col].to_s} if col
66
67
  rows = rows[0, options[:limit]] if options[:limit]
67
68
 
68
- puts Terminal::Table.new headings: ["ID", "Name", "Type", "Private IP", "Public IP", "Status"], rows: rows
69
+ unless options[:only]
70
+ puts Terminal::Table.new headings: ["ID", "Name", "Type", "Private IP", "Public IP", "Status"], rows: rows
71
+ else
72
+ rows.each { |r| puts r[col] }
73
+ end
69
74
  end
70
75
 
71
76
  desc "status NAME", "Show instance status. Instance will be searched by Name tag."
@@ -102,6 +107,14 @@ module Ec2ctl
102
107
  puts "Instance is now #{status_colorize instance.status}."
103
108
  end
104
109
 
110
+ desc "reboot NAME", "Reboot instance. Instance will be searched by Name tag."
111
+ def reboot name
112
+ instance = find_instance_by_name name
113
+ abort "Instance is not running!" unless instance.status == :running
114
+ instance.reboot
115
+ sleep 2
116
+ end
117
+
105
118
  option :user, default: "ec2-user", aliases: [:u]
106
119
  option :port, default: 22, aliases: [:p]
107
120
  option :identity_file, default: "~/.ssh/id_rsa", aliases: [:i]
@@ -1,3 +1,3 @@
1
1
  module Ec2ctl
2
- VERSION = "0.6.0"
2
+ VERSION = "0.6.1"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ec2ctl
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.0
4
+ version: 0.6.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - y13i
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-03-11 00:00:00.000000000 Z
11
+ date: 2015-08-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor