ec2ctl 0.6.0 → 0.6.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +2 -1
- data/lib/ec2ctl.rb +15 -2
- data/lib/ec2ctl/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: 9a6511dd684bf6069e077eac1cb5a6301e8fae0c
|
4
|
+
data.tar.gz: 1c3b5fda5ab55debd040bb6b39d3da53661003eb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
-
|
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]
|
data/lib/ec2ctl/version.rb
CHANGED
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.
|
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-
|
11
|
+
date: 2015-08-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thor
|