grempe-amazon-ec2 0.2.13 → 0.2.14

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.
data/CHANGELOG CHANGED
@@ -1,3 +1,6 @@
1
+ === 0.2.14 2008-06-30
2
+ * Merged patch from 'orionz' which adds support for EC2 Availability Zones. Thanks!
3
+
1
4
  === 0.2.12 2008-04-25
2
5
  * A few adjustments to work with GitHub.
3
6
 
data/lib/EC2/instances.rb CHANGED
@@ -64,6 +64,7 @@ module EC2
64
64
  # :user_data => String (default : nil)
65
65
  # :addressing_type => String (default : "public")
66
66
  # :instance_type => String (default : "m1.small")
67
+ # :availability_zone => String (default : nil)
67
68
  # :base64_encoded => Boolean (default : false)
68
69
  #
69
70
  def run_instances( options = {} )
@@ -76,6 +77,7 @@ module EC2
76
77
  :user_data => nil,
77
78
  :addressing_type => "public",
78
79
  :instance_type => "m1.small",
80
+ :availability_zone => nil,
79
81
  :base64_encoded => false }.merge(options)
80
82
 
81
83
  # Do some validation on the arguments provided
@@ -109,6 +111,7 @@ module EC2
109
111
  params["UserData"] = user_data unless user_data.nil?
110
112
  params["AddressingType"] = options[:addressing_type]
111
113
  params["InstanceType"] = options[:instance_type]
114
+ params["Placement.AvailabilityZone"] = options[:availability_zone] unless options[:availability_zone].nil?
112
115
 
113
116
  return response_generator(:action => "RunInstances", :params => params)
114
117
 
@@ -220,6 +220,12 @@ context "EC2 instances " do
220
220
  end
221
221
 
222
222
 
223
+ specify "should be able specify an availability_zone" do
224
+ @ec2.stubs(:make_request).with('RunInstances', "ImageId" => "ami-60a54009", "MinCount" => '1', "MaxCount" => '1', "Placement.AvailabilityZone" => "zone123", "UserData" => "foo", "AddressingType" => 'public', 'InstanceType' => 'm1.small').
225
+ returns stub(:body => @run_instances_response_body, :is_a? => true)
226
+ @ec2.run_instances( :image_id => "ami-60a54009", :min_count => 1, :max_count => 1, :availability_zone => "zone123", :group_id => [], :user_data => "foo", :base64_encoded => true ).should.be.an.instance_of EC2::Response
227
+ end
228
+
223
229
  specify "should be able to call run_instances with :user_data and :base64_encoded => true (default is false)" do
224
230
  @ec2.stubs(:make_request).with('RunInstances', "ImageId" => "ami-60a54009", "MinCount" => '1', "MaxCount" => '1', "UserData" => "foo", "AddressingType" => 'public', 'InstanceType' => 'm1.small').
225
231
  returns stub(:body => @run_instances_response_body, :is_a? => true)
@@ -322,4 +328,4 @@ context "EC2 instances " do
322
328
  @response.instancesSet.item[1].previousState.name.should.equal "pending"
323
329
  end
324
330
 
325
- end
331
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: grempe-amazon-ec2
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.13
4
+ version: 0.2.14
5
5
  platform: ruby
6
6
  authors:
7
7
  - Glenn Rempe
@@ -9,7 +9,7 @@ autorequire: EC2
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2008-05-14 00:00:00 -07:00
12
+ date: 2008-06-25 00:00:00 -07:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
@@ -118,7 +118,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
118
118
  requirements: []
119
119
 
120
120
  rubyforge_project:
121
- rubygems_version: 1.0.1
121
+ rubygems_version: 1.2.0
122
122
  signing_key:
123
123
  specification_version: 2
124
124
  summary: An interface library that allows Ruby applications to easily connect to the HTTP 'Query API' for the Amazon Web Services Elastic Compute Cloud (EC2) and manipulate cloud servers.