poolparty 1.6.6 → 1.6.7
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION.yml +2 -3
- data/lib/poolparty/chef_solo.rb +0 -1
- metadata +12 -69
- data/vendor/gems/amazon-ec2/ChangeLog +0 -304
- data/vendor/gems/amazon-ec2/LICENSE +0 -66
- data/vendor/gems/amazon-ec2/README.rdoc +0 -359
- data/vendor/gems/amazon-ec2/README_dev.rdoc +0 -10
- data/vendor/gems/amazon-ec2/Rakefile +0 -70
- data/vendor/gems/amazon-ec2/VERSION +0 -1
- data/vendor/gems/amazon-ec2/amazon-ec2.gemspec +0 -142
- data/vendor/gems/amazon-ec2/bin/ec2-gem-example.rb +0 -137
- data/vendor/gems/amazon-ec2/bin/ec2-gem-profile.rb +0 -10
- data/vendor/gems/amazon-ec2/bin/ec2sh +0 -62
- data/vendor/gems/amazon-ec2/bin/setup.rb +0 -29
- data/vendor/gems/amazon-ec2/deps.rip +0 -1
- data/vendor/gems/amazon-ec2/lib/AWS/Autoscaling/autoscaling.rb +0 -273
- data/vendor/gems/amazon-ec2/lib/AWS/Autoscaling.rb +0 -70
- data/vendor/gems/amazon-ec2/lib/AWS/Cloudwatch/monitoring.rb +0 -80
- data/vendor/gems/amazon-ec2/lib/AWS/Cloudwatch.rb +0 -32
- data/vendor/gems/amazon-ec2/lib/AWS/EC2/availability_zones.rb +0 -29
- data/vendor/gems/amazon-ec2/lib/AWS/EC2/console.rb +0 -25
- data/vendor/gems/amazon-ec2/lib/AWS/EC2/devpay.rb +0 -18
- data/vendor/gems/amazon-ec2/lib/AWS/EC2/elastic_ips.rb +0 -86
- data/vendor/gems/amazon-ec2/lib/AWS/EC2/image_attributes.rb +0 -133
- data/vendor/gems/amazon-ec2/lib/AWS/EC2/images.rb +0 -117
- data/vendor/gems/amazon-ec2/lib/AWS/EC2/instances.rb +0 -249
- data/vendor/gems/amazon-ec2/lib/AWS/EC2/keypairs.rb +0 -47
- data/vendor/gems/amazon-ec2/lib/AWS/EC2/products.rb +0 -21
- data/vendor/gems/amazon-ec2/lib/AWS/EC2/security_groups.rb +0 -164
- data/vendor/gems/amazon-ec2/lib/AWS/EC2/snapshots.rb +0 -80
- data/vendor/gems/amazon-ec2/lib/AWS/EC2/volumes.rb +0 -100
- data/vendor/gems/amazon-ec2/lib/AWS/EC2.rb +0 -33
- data/vendor/gems/amazon-ec2/lib/AWS/ELB/load_balancers.rb +0 -178
- data/vendor/gems/amazon-ec2/lib/AWS/ELB.rb +0 -71
- data/vendor/gems/amazon-ec2/lib/AWS/RDS/rds.rb +0 -522
- data/vendor/gems/amazon-ec2/lib/AWS/RDS.rb +0 -73
- data/vendor/gems/amazon-ec2/lib/AWS/exceptions.rb +0 -200
- data/vendor/gems/amazon-ec2/lib/AWS/responses.rb +0 -21
- data/vendor/gems/amazon-ec2/lib/AWS.rb +0 -304
- data/vendor/gems/amazon-ec2/perftools/ec2prof +0 -0
- data/vendor/gems/amazon-ec2/perftools/ec2prof-results.dot +0 -132
- data/vendor/gems/amazon-ec2/perftools/ec2prof-results.txt +0 -100
- data/vendor/gems/amazon-ec2/perftools/ec2prof.symbols +0 -102
- data/vendor/gems/amazon-ec2/test/test_Autoscaling_groups.rb +0 -337
- data/vendor/gems/amazon-ec2/test/test_EC2.rb +0 -68
- data/vendor/gems/amazon-ec2/test/test_EC2_availability_zones.rb +0 -49
- data/vendor/gems/amazon-ec2/test/test_EC2_console.rb +0 -54
- data/vendor/gems/amazon-ec2/test/test_EC2_elastic_ips.rb +0 -144
- data/vendor/gems/amazon-ec2/test/test_EC2_image_attributes.rb +0 -238
- data/vendor/gems/amazon-ec2/test/test_EC2_images.rb +0 -229
- data/vendor/gems/amazon-ec2/test/test_EC2_instances.rb +0 -611
- data/vendor/gems/amazon-ec2/test/test_EC2_keypairs.rb +0 -123
- data/vendor/gems/amazon-ec2/test/test_EC2_products.rb +0 -48
- data/vendor/gems/amazon-ec2/test/test_EC2_responses.rb +0 -53
- data/vendor/gems/amazon-ec2/test/test_EC2_s3_xmlsimple.rb +0 -80
- data/vendor/gems/amazon-ec2/test/test_EC2_security_groups.rb +0 -205
- data/vendor/gems/amazon-ec2/test/test_EC2_snapshots.rb +0 -83
- data/vendor/gems/amazon-ec2/test/test_EC2_volumes.rb +0 -142
- data/vendor/gems/amazon-ec2/test/test_ELB_load_balancers.rb +0 -239
- data/vendor/gems/amazon-ec2/test/test_RDS.rb +0 -354
- data/vendor/gems/amazon-ec2/test/test_helper.rb +0 -23
- data/vendor/gems/amazon-ec2/wsdl/2007-08-29.ec2.wsdl +0 -1269
- data/vendor/gems/amazon-ec2/wsdl/2008-02-01.ec2.wsdl +0 -1614
- data/vendor/gems/amazon-ec2/wsdl/2008-05-05.ec2.wsdl +0 -2052
- data/vendor/gems/amazon-ec2/wsdl/2008-12-01.ec2.wsdl +0 -2354
- data/vendor/gems/amazon-ec2/wsdl/2009-10-31.ec2.wsdl +0 -4261
- data/vendor/gems/amazon-ec2/wsdl/2009-11-30.ec2.wsdl +0 -4668
@@ -1,229 +0,0 @@
|
|
1
|
-
#--
|
2
|
-
# Amazon Web Services EC2 Query API Ruby library
|
3
|
-
#
|
4
|
-
# Ruby Gem Name:: amazon-ec2
|
5
|
-
# Author:: Glenn Rempe (mailto:glenn@rempe.us)
|
6
|
-
# Copyright:: Copyright (c) 2007-2008 Glenn Rempe
|
7
|
-
# License:: Distributes under the same terms as Ruby
|
8
|
-
# Home:: http://github.com/grempe/amazon-ec2/tree/master
|
9
|
-
#++
|
10
|
-
|
11
|
-
require File.dirname(__FILE__) + '/test_helper.rb'
|
12
|
-
|
13
|
-
context "An EC2 image " do
|
14
|
-
|
15
|
-
before do
|
16
|
-
@ec2 = AWS::EC2::Base.new( :access_key_id => "not a key", :secret_access_key => "not a secret" )
|
17
|
-
|
18
|
-
@create_image_response_body = <<-RESPONSE
|
19
|
-
<CreateImageResponse xmlns="http://ec2.amazonaws.com/doc/2009-10-31/">
|
20
|
-
<imageId>ami-4fa54026</imageId>
|
21
|
-
</CreateImageResponse>
|
22
|
-
RESPONSE
|
23
|
-
|
24
|
-
@register_image_response_body = <<-RESPONSE
|
25
|
-
<RegisterImageResponse xmlns="http://ec2.amazonaws.com/doc/2007-03-01">
|
26
|
-
<imageId>ami-61a54008</imageId>
|
27
|
-
</RegisterImageResponse>
|
28
|
-
RESPONSE
|
29
|
-
|
30
|
-
@describe_image_response_body = <<-RESPONSE
|
31
|
-
<DescribeImagesResponse xmlns="http://ec2.amazonaws.com/doc/2007-03-01">
|
32
|
-
<imagesSet>
|
33
|
-
<item>
|
34
|
-
<imageId>ami-61a54008</imageId>
|
35
|
-
<imageLocation>foobar1/image.manifest.xml</imageLocation>
|
36
|
-
<imageState>available</imageState>
|
37
|
-
<imageOwnerId>AAAATLBUXIEON5NQVUUX6OMPWBZIAAAA</imageOwnerId>
|
38
|
-
<isPublic>true</isPublic>
|
39
|
-
<productCodes>
|
40
|
-
<item>
|
41
|
-
<productCode>774F4FF8</productCode>
|
42
|
-
</item>
|
43
|
-
</productCodes>
|
44
|
-
</item>
|
45
|
-
<item>
|
46
|
-
<imageId>ami-61a54009</imageId>
|
47
|
-
<imageLocation>foobar2/image.manifest.xml</imageLocation>
|
48
|
-
<imageState>deregistered</imageState>
|
49
|
-
<imageOwnerId>ZZZZTLBUXIEON5NQVUUX6OMPWBZIZZZZ</imageOwnerId>
|
50
|
-
<isPublic>false</isPublic>
|
51
|
-
</item>
|
52
|
-
</imagesSet>
|
53
|
-
</DescribeImagesResponse>
|
54
|
-
RESPONSE
|
55
|
-
|
56
|
-
@deregister_image_response_body = <<-RESPONSE
|
57
|
-
<DeregisterImageResponse xmlns="http://ec2.amazonaws.com/doc/2007-03-01">
|
58
|
-
<return>true</return>
|
59
|
-
</DeregisterImageResponse>
|
60
|
-
RESPONSE
|
61
|
-
|
62
|
-
end
|
63
|
-
|
64
|
-
|
65
|
-
specify "should be able to be created" do
|
66
|
-
@ec2.stubs(:make_request).with('CreateImage', {"InstanceId"=>"fooid", "Name" => "fooname", "Description" => "foodesc", "NoReboot" => "true"}).
|
67
|
-
returns stub(:body => @create_image_response_body, :is_a? => true)
|
68
|
-
@ec2.create_image(:instance_id => "fooid", :name => "fooname", :description => "foodesc", :no_reboot => true).should.be.an.instance_of Hash
|
69
|
-
@ec2.create_image(:instance_id => "fooid", :name => "fooname", :description => "foodesc", :no_reboot => true).imageId.should.equal "ami-4fa54026"
|
70
|
-
end
|
71
|
-
|
72
|
-
|
73
|
-
specify "method create_image should raise an exception when called with nil/empty string arguments" do
|
74
|
-
lambda { @ec2.create_image() }.should.raise(AWS::ArgumentError)
|
75
|
-
lambda { @ec2.create_image(:instance_id => "", :name => "fooname") }.should.raise(AWS::ArgumentError)
|
76
|
-
lambda { @ec2.create_image(:instance_id => "fooid", :name => "") }.should.raise(AWS::ArgumentError)
|
77
|
-
lambda { @ec2.create_image(:instance_id => nil, :name => "fooname") }.should.raise(AWS::ArgumentError)
|
78
|
-
lambda { @ec2.create_image(:instance_id => "fooid", :name => nil) }.should.raise(AWS::ArgumentError)
|
79
|
-
end
|
80
|
-
|
81
|
-
|
82
|
-
specify "method create_image should raise an exception when called with bad arguments" do
|
83
|
-
lambda { @ec2.create_image(:instance_id => "fooid", :name => "f"*2) }.should.raise(AWS::ArgumentError)
|
84
|
-
lambda { @ec2.create_image(:instance_id => "fooid", :name => "f"*129) }.should.raise(AWS::ArgumentError)
|
85
|
-
lambda { @ec2.create_image(:instance_id => "fooid", :name => "f"*128, :description => "f"*256) }.should.raise(AWS::ArgumentError)
|
86
|
-
lambda { @ec2.create_image(:instance_id => "fooid", :name => "f"*128, :no_reboot => "true") }.should.raise(AWS::ArgumentError)
|
87
|
-
lambda { @ec2.create_image(:instance_id => "fooid", :name => "f"*128, :no_reboot => "false") }.should.raise(AWS::ArgumentError)
|
88
|
-
end
|
89
|
-
|
90
|
-
|
91
|
-
specify "should be able to be registered" do
|
92
|
-
@ec2.stubs(:make_request).with('RegisterImage', {"ImageLocation"=>"mybucket-myimage.manifest.xml"}).
|
93
|
-
returns stub(:body => @register_image_response_body, :is_a? => true)
|
94
|
-
@ec2.register_image(:image_location => "mybucket-myimage.manifest.xml").imageId.should.equal "ami-61a54008"
|
95
|
-
@ec2.register_image(:image_location => "mybucket-myimage.manifest.xml").should.be.an.instance_of Hash
|
96
|
-
end
|
97
|
-
|
98
|
-
|
99
|
-
specify "method register_image should raise an exception when called without nil/empty string arguments" do
|
100
|
-
lambda { @ec2.register_image() }.should.raise(AWS::ArgumentError)
|
101
|
-
lambda { @ec2.register_image(:image_location => "") }.should.raise(AWS::ArgumentError)
|
102
|
-
end
|
103
|
-
|
104
|
-
|
105
|
-
specify "should be able to be described and return the correct Ruby response class for parent and members" do
|
106
|
-
@ec2.stubs(:make_request).with('DescribeImages', {}).
|
107
|
-
returns stub(:body => @describe_image_response_body, :is_a? => true)
|
108
|
-
@ec2.describe_images.should.be.an.instance_of Hash
|
109
|
-
response = @ec2.describe_images
|
110
|
-
response.should.be.an.instance_of Hash
|
111
|
-
end
|
112
|
-
|
113
|
-
|
114
|
-
specify "should be able to be described with no params and return an imagesSet" do
|
115
|
-
@ec2.stubs(:make_request).with('DescribeImages', {}).
|
116
|
-
returns stub(:body => @describe_image_response_body, :is_a? => true)
|
117
|
-
@ec2.describe_images.imagesSet.item.length.should.equal 2
|
118
|
-
end
|
119
|
-
|
120
|
-
specify "should be able to be described by an Array of ImageId.N ID's and return an array of Items" do
|
121
|
-
@ec2.stubs(:make_request).with('DescribeImages', {"ImageId.1"=>"ami-61a54008", "ImageId.2"=>"ami-61a54009"}).
|
122
|
-
returns stub(:body => @describe_image_response_body, :is_a? => true)
|
123
|
-
@ec2.describe_images( :image_id => ["ami-61a54008", "ami-61a54009"] ).imagesSet.item.length.should.equal 2
|
124
|
-
|
125
|
-
response = @ec2.describe_images( :image_id => ["ami-61a54008", "ami-61a54009"] )
|
126
|
-
|
127
|
-
# test first 'Item' object returned
|
128
|
-
response.imagesSet.item[0].imageId.should.equal "ami-61a54008"
|
129
|
-
response.imagesSet.item[0].imageLocation.should.equal "foobar1/image.manifest.xml"
|
130
|
-
response.imagesSet.item[0].imageState.should.equal "available"
|
131
|
-
response.imagesSet.item[0].imageOwnerId.should.equal "AAAATLBUXIEON5NQVUUX6OMPWBZIAAAA"
|
132
|
-
response.imagesSet.item[0].isPublic.should.equal "true"
|
133
|
-
response.imagesSet.item[0].productCodes.item[0].productCode.should.equal "774F4FF8"
|
134
|
-
|
135
|
-
# test second 'Item' object returned
|
136
|
-
response.imagesSet.item[1].imageId.should.equal "ami-61a54009"
|
137
|
-
response.imagesSet.item[1].imageLocation.should.equal "foobar2/image.manifest.xml"
|
138
|
-
response.imagesSet.item[1].imageState.should.equal "deregistered"
|
139
|
-
response.imagesSet.item[1].imageOwnerId.should.equal "ZZZZTLBUXIEON5NQVUUX6OMPWBZIZZZZ"
|
140
|
-
response.imagesSet.item[1].isPublic.should.equal "false"
|
141
|
-
end
|
142
|
-
|
143
|
-
|
144
|
-
specify "should be able to be described by an owners with Owner.N ID's and return an array of Items" do
|
145
|
-
@ec2.stubs(:make_request).with('DescribeImages', "Owner.1" => "AAAATLBUXIEON5NQVUUX6OMPWBZIAAAA", "Owner.2" => "ZZZZTLBUXIEON5NQVUUX6OMPWBZIZZZZ").
|
146
|
-
returns stub(:body => @describe_image_response_body, :is_a? => true)
|
147
|
-
@ec2.describe_images( :owner_id => ["AAAATLBUXIEON5NQVUUX6OMPWBZIAAAA", "ZZZZTLBUXIEON5NQVUUX6OMPWBZIZZZZ"] ).imagesSet.item.length.should.equal 2
|
148
|
-
|
149
|
-
# owner ID's
|
150
|
-
response = @ec2.describe_images( :owner_id => ["AAAATLBUXIEON5NQVUUX6OMPWBZIAAAA", "ZZZZTLBUXIEON5NQVUUX6OMPWBZIZZZZ"] )
|
151
|
-
response.imagesSet.item[0].imageId.should.equal "ami-61a54008"
|
152
|
-
response.imagesSet.item[1].imageId.should.equal "ami-61a54009"
|
153
|
-
end
|
154
|
-
|
155
|
-
|
156
|
-
specify "should be able to be described by an owner of 'self' and return an array of Items that I own" do
|
157
|
-
@ec2.stubs(:make_request).with('DescribeImages', "Owner.1" => "self").
|
158
|
-
returns stub(:body => @describe_image_response_body, :is_a? => true)
|
159
|
-
@ec2.describe_images( :owner_id => "self" ).imagesSet.item.length.should.equal 2
|
160
|
-
|
161
|
-
# 'self' - Those that I own
|
162
|
-
response = @ec2.describe_images( :owner_id => "self" )
|
163
|
-
response.imagesSet.item[0].imageId.should.equal "ami-61a54008"
|
164
|
-
end
|
165
|
-
|
166
|
-
|
167
|
-
specify "should be able to be described by an owner of 'amazon' and return an array of Items that are Amazon Public AMI's" do
|
168
|
-
@ec2.stubs(:make_request).with('DescribeImages', "Owner.1" => "amazon").
|
169
|
-
returns stub(:body => @describe_image_response_body, :is_a? => true)
|
170
|
-
@ec2.describe_images( :owner_id => "amazon" ).imagesSet.item.length.should.equal 2
|
171
|
-
|
172
|
-
# 'amazon' - Those that are owned and created by AWS
|
173
|
-
response = @ec2.describe_images( :owner_id => "amazon" )
|
174
|
-
response.imagesSet.item[0].imageId.should.equal "ami-61a54008"
|
175
|
-
end
|
176
|
-
|
177
|
-
|
178
|
-
specify "should be able to be described by an owners with Owner.N ID's who can execute AMI's and return an array of Items" do
|
179
|
-
@ec2.stubs(:make_request).with('DescribeImages', "ExecutableBy.1" => "AAAATLBUXIEON5NQVUUX6OMPWBZIAAAA", "ExecutableBy.2" => "ZZZZTLBUXIEON5NQVUUX6OMPWBZIZZZZ").
|
180
|
-
returns stub(:body => @describe_image_response_body, :is_a? => true)
|
181
|
-
@ec2.describe_images( :executable_by => ["AAAATLBUXIEON5NQVUUX6OMPWBZIAAAA", "ZZZZTLBUXIEON5NQVUUX6OMPWBZIZZZZ"] ).imagesSet.item.length.should.equal 2
|
182
|
-
|
183
|
-
# executable by owner ID's
|
184
|
-
response = @ec2.describe_images( :executable_by => ["AAAATLBUXIEON5NQVUUX6OMPWBZIAAAA", "ZZZZTLBUXIEON5NQVUUX6OMPWBZIZZZZ"] )
|
185
|
-
response.imagesSet.item[0].imageId.should.equal "ami-61a54008"
|
186
|
-
response.imagesSet.item[1].imageId.should.equal "ami-61a54009"
|
187
|
-
end
|
188
|
-
|
189
|
-
|
190
|
-
specify "should be able to be described by an owners with Owner.N of 'self' who can execute AMI's and return an array of Items" do
|
191
|
-
@ec2.stubs(:make_request).with('DescribeImages', "ExecutableBy.1" => "self").
|
192
|
-
returns stub(:body => @describe_image_response_body, :is_a? => true)
|
193
|
-
@ec2.describe_images( :executable_by => "self" ).imagesSet.item.length.should.equal 2
|
194
|
-
|
195
|
-
# executable by owner ID's
|
196
|
-
response = @ec2.describe_images( :executable_by => "self" )
|
197
|
-
response.imagesSet.item[0].imageId.should.equal "ami-61a54008"
|
198
|
-
response.imagesSet.item[1].imageId.should.equal "ami-61a54009"
|
199
|
-
end
|
200
|
-
|
201
|
-
|
202
|
-
specify "should be able to be described by an owners with Owner.N of 'all' who can execute AMI's and return an array of Items" do
|
203
|
-
@ec2.stubs(:make_request).with('DescribeImages', "ExecutableBy.1" => "all").
|
204
|
-
returns stub(:body => @describe_image_response_body, :is_a? => true)
|
205
|
-
@ec2.describe_images( :executable_by => "all" ).imagesSet.item.length.should.equal 2
|
206
|
-
|
207
|
-
# executable by owner ID's
|
208
|
-
response = @ec2.describe_images( :executable_by => "all" )
|
209
|
-
response.imagesSet.item[0].imageId.should.equal "ami-61a54008"
|
210
|
-
response.imagesSet.item[1].imageId.should.equal "ami-61a54009"
|
211
|
-
end
|
212
|
-
|
213
|
-
|
214
|
-
specify "should be able to be de-registered" do
|
215
|
-
@ec2.stubs(:make_request).with('DeregisterImage', {"ImageId"=>"ami-61a54008"}).
|
216
|
-
returns stub(:body => @deregister_image_response_body, :is_a? => true)
|
217
|
-
@ec2.deregister_image(:image_id => "ami-61a54008" ).should.be.an.instance_of Hash
|
218
|
-
@ec2.deregister_image(:image_id => "ami-61a54008" ).return.should.equal "true"
|
219
|
-
end
|
220
|
-
|
221
|
-
|
222
|
-
specify "method deregister_image should raise an exception when called without nil/empty string arguments" do
|
223
|
-
lambda { @ec2.deregister_image() }.should.raise(AWS::ArgumentError)
|
224
|
-
lambda { @ec2.deregister_image( :image_id => nil ) }.should.raise(AWS::ArgumentError)
|
225
|
-
lambda { @ec2.deregister_image( :image_id => "" ) }.should.raise(AWS::ArgumentError)
|
226
|
-
end
|
227
|
-
|
228
|
-
|
229
|
-
end
|