fog 0.2.23 → 0.2.24
Sign up to get free protection for your applications and to get access to all the features.
- data/fog.gemspec +2 -2
- data/lib/fog.rb +1 -1
- data/lib/fog/aws/models/ec2/server.rb +12 -1
- data/lib/fog/aws/parsers/ec2/run_instances.rb +2 -0
- data/lib/fog/aws/requests/ec2/run_instances.rb +1 -1
- metadata +3 -3
data/fog.gemspec
CHANGED
@@ -7,8 +7,8 @@ Gem::Specification.new do |s|
|
|
7
7
|
## If your rubyforge_project name is different, then edit it and comment out
|
8
8
|
## the sub! line in the Rakefile
|
9
9
|
s.name = 'fog'
|
10
|
-
s.version = '0.2.
|
11
|
-
s.date = '2010-08-
|
10
|
+
s.version = '0.2.24'
|
11
|
+
s.date = '2010-08-17'
|
12
12
|
s.rubyforge_project = 'fog'
|
13
13
|
|
14
14
|
## Make sure your summary is short. The description may be as long
|
data/lib/fog.rb
CHANGED
@@ -29,10 +29,11 @@ module Fog
|
|
29
29
|
attribute :root_device_name, 'rootDeviceName'
|
30
30
|
attribute :root_device_type, 'rootDeviceType'
|
31
31
|
attribute :state, 'instanceState'
|
32
|
+
attribute :subnet_id, 'subnetId'
|
32
33
|
attribute :user_data
|
33
34
|
|
34
35
|
def initialize(attributes={})
|
35
|
-
@groups ||= ["default"]
|
36
|
+
@groups ||= ["default"] if attributes[:subnet_id].blank?
|
36
37
|
@flavor_id ||= 'm1.small'
|
37
38
|
super
|
38
39
|
end
|
@@ -124,8 +125,18 @@ module Fog
|
|
124
125
|
'Placement.AvailabilityZone' => @availability_zone,
|
125
126
|
'RamdiskId' => @ramdisk_id,
|
126
127
|
'SecurityGroup' => @groups,
|
128
|
+
'SubnetId' => subnet_id,
|
127
129
|
'UserData' => @user_data
|
128
130
|
}
|
131
|
+
|
132
|
+
# If subnet is defined we are working on a virtual private cloud.
|
133
|
+
# subnet & security group cannot co-exist. I wish VPC just ignored
|
134
|
+
# the security group parameter instead, it would be much easier!
|
135
|
+
if subnet_id.blank?
|
136
|
+
options.delete('SubnetId')
|
137
|
+
else
|
138
|
+
options.delete('SecurityGroup')
|
139
|
+
end
|
129
140
|
|
130
141
|
data = connection.run_instances(@image_id, 1, 1, options)
|
131
142
|
merge_attributes(data.body['instancesSet'].first)
|
@@ -26,7 +26,7 @@ module Fog
|
|
26
26
|
# * 'Ebs.SnapshotId'<~String> - id of snapshot to boot volume from
|
27
27
|
# * 'Ebs.VolumeSize'<~String> - size of volume in GiBs required unless snapshot is specified
|
28
28
|
# * 'Ebs.DeleteOnTermination'<~String> - specifies whether or not to delete the volume on instance termination
|
29
|
-
# * 'SecurityGroup'<~Array> or <~String> - Name of security group(s) for instances
|
29
|
+
# * 'SecurityGroup'<~Array> or <~String> - Name of security group(s) for instances (you must omit this parameter if using Virtual Private Clouds)
|
30
30
|
# * 'InstanceInitiatedShutdownBehaviour'<~String> - specifies whether volumes are stopped or terminated when instance is shutdown
|
31
31
|
# * 'InstanceType'<~String> - Type of instance to boot. Valid options
|
32
32
|
# in ['m1.small', 'm1.large', 'm1.xlarge', 'c1.medium', 'c1.xlarge', 'm2.2xlarge', 'm2.4xlarge']
|
metadata
CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 0
|
7
7
|
- 2
|
8
|
-
-
|
9
|
-
version: 0.2.
|
8
|
+
- 24
|
9
|
+
version: 0.2.24
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- geemus (Wesley Beary)
|
@@ -14,7 +14,7 @@ autorequire:
|
|
14
14
|
bindir: bin
|
15
15
|
cert_chain: []
|
16
16
|
|
17
|
-
date: 2010-08-
|
17
|
+
date: 2010-08-17 00:00:00 -07:00
|
18
18
|
default_executable: fog
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|