aws_cloud_map 0.1.0 → 0.2.0

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.
Files changed (3) hide show
  1. data/VERSION +1 -1
  2. data/lib/aws_cloud_map.rb +32 -1
  3. metadata +2 -2
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.0
1
+ 0.2.0
@@ -56,7 +56,14 @@ module AWS
56
56
  alias_method :public?, :aws_is_public
57
57
 
58
58
  def instances
59
- @@ec2.describe_instances.select { |instance| instance[:aws_image_id] == id }.map { |instance| Instance.new(instance) }
59
+ @instances ||= @@ec2.describe_instances.select { |instance| instance[:aws_image_id] == id }.map { |instance| Instance.new(instance) }
60
+ end
61
+
62
+ # TODO add all params
63
+ # TODO test
64
+ def create_instance(security_groups, key, user_data, size, region)
65
+ @instances = nil
66
+ Instance.new(@@ec2.run_instances(id, 1, 1, security_groups, key, user_data, nil, size, nil, nil, region).first)
60
67
  end
61
68
 
62
69
  def self.all
@@ -167,6 +174,30 @@ module AWS
167
174
  @@ec2.terminate_instances [id]
168
175
  end
169
176
 
177
+ #TODO test
178
+ #TODO also add to volume
179
+ #TODO allow for volume case
180
+ def attach!(volume_or_id, device)
181
+ @@ec2.attach_volume(volume_or_id, id, device)
182
+ @volumes = nil
183
+ end
184
+
185
+ #TODO test
186
+ #TODO also add to volume
187
+ #TODO allow for volume case
188
+ def detach!(volume_or_id)
189
+ @@ec2.detach_volume(volume_or_id, id, device)
190
+ @volumes = nil
191
+ end
192
+
193
+ #TODO test
194
+ #TODO allow for address case
195
+ #TODO refresh attributes
196
+ def associate!(address_or_ip)
197
+ @@ec2.associate_address(id, address_or_ip)
198
+ @address = nil
199
+ end
200
+
170
201
  def self.all
171
202
  @@ec2.describe_instances.map { |instance| new(instance) }
172
203
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: aws_cloud_map
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Marcus Irven
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-10-26 00:00:00 -05:00
12
+ date: 2009-10-27 00:00:00 -05:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency