awful 0.0.4 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/awful/ec2.rb +33 -0
- data/lib/awful/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: a102ebb758f56e3699436ff0e32fa5a3a7b1db36
|
4
|
+
data.tar.gz: 6b73e714e85aeb3a10aff2d57c038818dded6a74
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 76ffecd19a005dc4542f94c867e4940a5064dce71378c05ce5a8053231b088a4af7a15bded7cbbb741fde91c954c369b92b124ebfb695d46ab2c70bbcfab4fd6
|
7
|
+
data.tar.gz: 957a113135a6f9ea94e968e645cf8d9a34f7591f7fbc86edadb30e11cfaf49ab4c5c48a76c8fbdf43969ca93a6f20046ca5cddeb3663176f46d4443f35064982
|
data/lib/awful/ec2.rb
CHANGED
@@ -117,6 +117,39 @@ module Awful
|
|
117
117
|
end
|
118
118
|
end
|
119
119
|
|
120
|
+
desc 'update NAME', 'update an existing instance'
|
121
|
+
def user_data(name)
|
122
|
+
opt = load_cfg(options)
|
123
|
+
ec2.describe_instances.map(&:reservations).flatten.map(&:instances).flatten.find do |instance|
|
124
|
+
instance.instance_id == name or (n = tag_name(instance) and n.match(name))
|
125
|
+
end.tap do |instance|
|
126
|
+
ec2.modify_instance_attribute(instance_id: instance.instance_id, user_data: {
|
127
|
+
#value: Base64.strict_encode64(opt[:user_data])
|
128
|
+
value: opt[:user_data]
|
129
|
+
})
|
130
|
+
end
|
131
|
+
end
|
132
|
+
|
133
|
+
desc 'stop NAME', 'stop a running instance'
|
134
|
+
def stop(name)
|
135
|
+
ec2.describe_instances.map(&:reservations).flatten.map(&:instances).flatten.find do |instance|
|
136
|
+
instance.instance_id == name or (n = tag_name(instance) and n == name)
|
137
|
+
end.instance_id.tap do |id|
|
138
|
+
if yes? "Really stop instance #{name} (#{id})?", :yellow
|
139
|
+
ec2.stop_instances(instance_ids: Array(id))
|
140
|
+
end
|
141
|
+
end
|
142
|
+
end
|
143
|
+
|
144
|
+
desc 'start NAME', 'start a running instance'
|
145
|
+
def start(name)
|
146
|
+
ec2.describe_instances.map(&:reservations).flatten.map(&:instances).flatten.find do |instance|
|
147
|
+
instance.instance_id == name or (n = tag_name(instance) and n == name)
|
148
|
+
end.instance_id.tap do |id|
|
149
|
+
ec2.start_instances(instance_ids: Array(id))
|
150
|
+
end
|
151
|
+
end
|
152
|
+
|
120
153
|
desc 'delete NAME', 'terminate a running instance'
|
121
154
|
def delete(name)
|
122
155
|
id =
|
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.5
|
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-03-
|
11
|
+
date: 2015-03-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|