amazon-ec2 0.4.8 → 0.5.0
Sign up to get free protection for your applications and to get access to all the features.
- data/ChangeLog +7 -4
- data/README.rdoc +12 -12
- data/README_dev.rdoc +6 -0
- data/Rakefile +2 -1
- data/VERSION +1 -1
- data/amazon-ec2.gemspec +25 -18
- data/bin/ec2-gem-example.rb +3 -3
- data/bin/ec2-gem-profile.rb +2 -2
- data/bin/ec2sh +4 -4
- data/bin/setup.rb +4 -2
- data/lib/{EC2.rb → AWS.rb} +33 -67
- data/lib/AWS/EC2.rb +67 -0
- data/lib/AWS/EC2/availability_zones.rb +43 -0
- data/lib/AWS/EC2/console.rb +46 -0
- data/lib/AWS/EC2/elastic_ips.rb +154 -0
- data/lib/AWS/EC2/image_attributes.rb +168 -0
- data/lib/AWS/EC2/images.rb +136 -0
- data/lib/AWS/EC2/instances.rb +218 -0
- data/lib/AWS/EC2/keypairs.rb +96 -0
- data/lib/AWS/EC2/products.rb +45 -0
- data/lib/AWS/EC2/security_groups.rb +234 -0
- data/lib/AWS/EC2/snapshots.rb +96 -0
- data/lib/AWS/EC2/volumes.rb +172 -0
- data/lib/AWS/ELB.rb +67 -0
- data/lib/AWS/ELB/load_balancers.rb +198 -0
- data/lib/{EC2 → AWS}/exceptions.rb +21 -2
- data/lib/{EC2 → AWS}/responses.rb +4 -5
- data/perftools/ec2prof-results.txt +4 -4
- data/perftools/ec2prof.symbols +4 -4
- data/test/test_EC2.rb +14 -14
- data/test/test_EC2_availability_zones.rb +2 -2
- data/test/test_EC2_console.rb +5 -5
- data/test/test_EC2_elastic_ips.rb +13 -13
- data/test/test_EC2_image_attributes.rb +35 -35
- data/test/test_EC2_images.rb +7 -7
- data/test/test_EC2_instances.rb +35 -35
- data/test/test_EC2_keypairs.rb +10 -10
- data/test/test_EC2_products.rb +7 -7
- data/test/test_EC2_responses.rb +2 -2
- data/test/test_EC2_s3_xmlsimple.rb +2 -2
- data/test/test_EC2_security_groups.rb +13 -13
- data/test/test_EC2_snapshots.rb +2 -2
- data/test/test_EC2_volumes.rb +2 -2
- data/test/test_ELB_load_balancers.rb +239 -0
- data/test/test_helper.rb +1 -1
- metadata +24 -17
- data/lib/EC2/availability_zones.rb +0 -41
- data/lib/EC2/console.rb +0 -44
- data/lib/EC2/elastic_ips.rb +0 -153
- data/lib/EC2/image_attributes.rb +0 -166
- data/lib/EC2/images.rb +0 -134
- data/lib/EC2/instances.rb +0 -216
- data/lib/EC2/keypairs.rb +0 -94
- data/lib/EC2/products.rb +0 -43
- data/lib/EC2/security_groups.rb +0 -232
- data/lib/EC2/snapshots.rb +0 -94
- data/lib/EC2/volumes.rb +0 -170
@@ -12,8 +12,8 @@ require File.dirname(__FILE__) + '/test_helper.rb'
|
|
12
12
|
|
13
13
|
context "EC2 security groups " do
|
14
14
|
|
15
|
-
|
16
|
-
@ec2 = EC2::Base.new( :access_key_id => "not a key", :secret_access_key => "not a secret" )
|
15
|
+
before do
|
16
|
+
@ec2 = AWS::EC2::Base.new( :access_key_id => "not a key", :secret_access_key => "not a secret" )
|
17
17
|
|
18
18
|
@create_security_group_response_body = <<-RESPONSE
|
19
19
|
<CreateSecurityGroupResponse xmlns="http://ec2.amazonaws.com/doc/2007-03-01">
|
@@ -92,16 +92,16 @@ context "EC2 security groups " do
|
|
92
92
|
@ec2.stubs(:make_request).with('CreateSecurityGroup', {"GroupName"=>"WebServers", "GroupDescription"=>"Web"}).
|
93
93
|
returns stub(:body => @create_security_group_response_body, :is_a? => true)
|
94
94
|
|
95
|
-
lambda { @ec2.create_security_group( :group_name => "WebServers", :group_description => "Web" ) }.should.not.raise(
|
96
|
-
lambda { @ec2.create_security_group() }.should.raise(
|
95
|
+
lambda { @ec2.create_security_group( :group_name => "WebServers", :group_description => "Web" ) }.should.not.raise(AWS::ArgumentError)
|
96
|
+
lambda { @ec2.create_security_group() }.should.raise(AWS::ArgumentError)
|
97
97
|
|
98
98
|
# :group_name can't be nil or empty
|
99
|
-
lambda { @ec2.create_security_group( :group_name => "", :group_description => "Web" ) }.should.raise(
|
100
|
-
lambda { @ec2.create_security_group( :group_name => nil, :group_description => "Web" ) }.should.raise(
|
99
|
+
lambda { @ec2.create_security_group( :group_name => "", :group_description => "Web" ) }.should.raise(AWS::ArgumentError)
|
100
|
+
lambda { @ec2.create_security_group( :group_name => nil, :group_description => "Web" ) }.should.raise(AWS::ArgumentError)
|
101
101
|
|
102
102
|
# :group_description can't be nil or empty
|
103
|
-
lambda { @ec2.create_security_group( :group_name => "WebServers", :group_description => "" ) }.should.raise(
|
104
|
-
lambda { @ec2.create_security_group( :group_name => "WebServers", :group_description => nil ) }.should.raise(
|
103
|
+
lambda { @ec2.create_security_group( :group_name => "WebServers", :group_description => "" ) }.should.raise(AWS::ArgumentError)
|
104
|
+
lambda { @ec2.create_security_group( :group_name => "WebServers", :group_description => nil ) }.should.raise(AWS::ArgumentError)
|
105
105
|
end
|
106
106
|
|
107
107
|
|
@@ -116,12 +116,12 @@ context "EC2 security groups " do
|
|
116
116
|
@ec2.stubs(:make_request).with('DeleteSecurityGroup', {"GroupName"=>"WebServers"}).
|
117
117
|
returns stub(:body => @delete_security_group_response_body, :is_a? => true)
|
118
118
|
|
119
|
-
lambda { @ec2.delete_security_group( :group_name => "WebServers" ) }.should.not.raise(
|
120
|
-
lambda { @ec2.delete_security_group() }.should.raise(
|
119
|
+
lambda { @ec2.delete_security_group( :group_name => "WebServers" ) }.should.not.raise(AWS::ArgumentError)
|
120
|
+
lambda { @ec2.delete_security_group() }.should.raise(AWS::ArgumentError)
|
121
121
|
|
122
122
|
# :group_name can't be nil or empty
|
123
|
-
lambda { @ec2.delete_security_group( :group_name => "" ) }.should.raise(
|
124
|
-
lambda { @ec2.delete_security_group( :group_name => nil ) }.should.raise(
|
123
|
+
lambda { @ec2.delete_security_group( :group_name => "" ) }.should.raise(AWS::ArgumentError)
|
124
|
+
lambda { @ec2.delete_security_group( :group_name => nil ) }.should.raise(AWS::ArgumentError)
|
125
125
|
end
|
126
126
|
|
127
127
|
|
@@ -156,7 +156,7 @@ context "EC2 security groups " do
|
|
156
156
|
@ec2.stubs(:make_request).with('DescribeSecurityGroups', {"GroupName.1"=>"WebServers"}).
|
157
157
|
returns stub(:body => @describe_security_groups_response_body, :is_a? => true)
|
158
158
|
|
159
|
-
lambda { @ec2.describe_security_groups( :group_name => "WebServers" ) }.should.not.raise(
|
159
|
+
lambda { @ec2.describe_security_groups( :group_name => "WebServers" ) }.should.not.raise(AWS::ArgumentError)
|
160
160
|
|
161
161
|
end
|
162
162
|
|
data/test/test_EC2_snapshots.rb
CHANGED
@@ -12,8 +12,8 @@ require File.dirname(__FILE__) + '/test_helper.rb'
|
|
12
12
|
|
13
13
|
context "EC2 snaphots " do
|
14
14
|
|
15
|
-
|
16
|
-
@ec2 = EC2::Base.new( :access_key_id => "not a key", :secret_access_key => "not a secret" )
|
15
|
+
before do
|
16
|
+
@ec2 = AWS::EC2::Base.new( :access_key_id => "not a key", :secret_access_key => "not a secret" )
|
17
17
|
|
18
18
|
@describe_snapshots_response_body = <<-RESPONSE
|
19
19
|
<DescribeSnapshotsResponse xmlns="http://ec2.amazonaws.com/doc/2008-05-05">
|
data/test/test_EC2_volumes.rb
CHANGED
@@ -12,8 +12,8 @@ require File.dirname(__FILE__) + '/test_helper.rb'
|
|
12
12
|
|
13
13
|
context "EC2 volumes " do
|
14
14
|
|
15
|
-
|
16
|
-
@ec2 = EC2::Base.new( :access_key_id => "not a key", :secret_access_key => "not a secret" )
|
15
|
+
before do
|
16
|
+
@ec2 = AWS::EC2::Base.new( :access_key_id => "not a key", :secret_access_key => "not a secret" )
|
17
17
|
|
18
18
|
@describe_volumes_response_body = <<-RESPONSE
|
19
19
|
<DescribeVolumesResponse xmlns="http://ec2.amazonaws.com/doc/2008-05-05">
|
@@ -0,0 +1,239 @@
|
|
1
|
+
require File.dirname(__FILE__) + '/test_helper.rb'
|
2
|
+
|
3
|
+
context "elb load balancers " do
|
4
|
+
before do
|
5
|
+
@elb = AWS::ELB::Base.new( :access_key_id => "not a key", :secret_access_key => "not a secret" )
|
6
|
+
|
7
|
+
@valid_create_load_balancer_params = {
|
8
|
+
:load_balancer_name => 'Test Name',
|
9
|
+
:availability_zones => ['east-1a'],
|
10
|
+
:listeners => [{:protocol => 'HTTP', :load_balancer_port => '80', :instance_port => '80'}]
|
11
|
+
}
|
12
|
+
|
13
|
+
@create_load_balancer_response_body = <<-RESPONSE
|
14
|
+
<CreateLoadBalancerResult>
|
15
|
+
<DNSName>TestLoadBalancer-380544827.us-east-1.ec2.amazonaws.com</DNSName>
|
16
|
+
</CreateLoadBalancerResult>
|
17
|
+
RESPONSE
|
18
|
+
|
19
|
+
@valid_delete_load_balancer_params = {
|
20
|
+
:load_balancer_name => 'Test Name'
|
21
|
+
}
|
22
|
+
|
23
|
+
@delete_load_balancer_response_body = <<-RESPONSE
|
24
|
+
<DeleteLoadBalancerResult>
|
25
|
+
<return>true</return>
|
26
|
+
</DeleteLoadBalancerResult>
|
27
|
+
RESPONSE
|
28
|
+
|
29
|
+
@valid_describe_load_balancer_params = {
|
30
|
+
}
|
31
|
+
|
32
|
+
@describe_load_balancer_response_body = <<-RESPONSE
|
33
|
+
<DescribeLoadBalancersResponse xmlns="http://elasticloadbalancing.amazonaws.com/doc/2009-05-15/">
|
34
|
+
<DescribeLoadBalancersResult>
|
35
|
+
<LoadBalancerDescriptions>
|
36
|
+
<member>
|
37
|
+
<Listeners>
|
38
|
+
<member>
|
39
|
+
<Protocol>HTTP</Protocol>
|
40
|
+
<LoadBalancerPort>80</LoadBalancerPort>
|
41
|
+
<InstancePort>80</InstancePort>
|
42
|
+
</member>
|
43
|
+
</Listeners>
|
44
|
+
<CreatedTime>2009-07-02T01:07:55.080Z</CreatedTime>
|
45
|
+
<LoadBalancerName>TestLB</LoadBalancerName>
|
46
|
+
<DNSName>TestLB-1459724896.us-east-1.elb.amazonaws.com</DNSName>
|
47
|
+
<HealthCheck>
|
48
|
+
<Interval>30</Interval>
|
49
|
+
<Target>TCP:80</Target>
|
50
|
+
<HealthyThreshold>10</HealthyThreshold>
|
51
|
+
<Timeout>5</Timeout>
|
52
|
+
<UnhealthyThreshold>2</UnhealthyThreshold>
|
53
|
+
</HealthCheck>
|
54
|
+
<Instances/>
|
55
|
+
<AvailabilityZones>
|
56
|
+
<member>us-east-1a</member>
|
57
|
+
</AvailabilityZones>
|
58
|
+
</member>
|
59
|
+
</LoadBalancerDescriptions>
|
60
|
+
</DescribeLoadBalancersResult>
|
61
|
+
<ResponseMetadata>
|
62
|
+
<RequestId>67dd800e-66a5-11de-b844-07deabfcc881</RequestId>
|
63
|
+
</ResponseMetadata>
|
64
|
+
</DescribeLoadBalancersResponse>
|
65
|
+
RESPONSE
|
66
|
+
|
67
|
+
@valid_register_instances_with_load_balancer_params = {
|
68
|
+
:load_balancer_name => 'Test Name',
|
69
|
+
:instances => ['i-6055fa09']
|
70
|
+
}
|
71
|
+
|
72
|
+
@register_instances_with_load_balancer_response_body = <<-RESPONSE
|
73
|
+
<RegisterInstancesWithLoadBalancerResult>
|
74
|
+
<Instances>
|
75
|
+
<member>
|
76
|
+
<InstanceId>i-6055fa09</InstanceId>
|
77
|
+
</member>
|
78
|
+
</Instances>
|
79
|
+
</RegisterInstancesWithLoadBalancerResult>
|
80
|
+
RESPONSE
|
81
|
+
|
82
|
+
@valid_deregister_instances_from_load_balancer_params = @valid_register_instances_with_load_balancer_params
|
83
|
+
@deregister_instances_from_load_balancer_response_body = <<-RESPONSE
|
84
|
+
<DeregisterInstancesFromLoadBalancerResult>
|
85
|
+
<Instances/>
|
86
|
+
</DeregisterInstancesFromLoadBalancerResult>
|
87
|
+
RESPONSE
|
88
|
+
|
89
|
+
@valid_configure_health_check_params = {
|
90
|
+
:load_balancer_name => 'Test Name',
|
91
|
+
:health_check => {
|
92
|
+
:target => 'HTTP:80/servlets-examples/servlet/',
|
93
|
+
:timeout => '2',
|
94
|
+
:interval => '5',
|
95
|
+
:unhealthy_threshold => '2',
|
96
|
+
:healthy_threshold => '2'
|
97
|
+
}
|
98
|
+
}
|
99
|
+
@configure_health_check_response_body = <<-RESPONSE
|
100
|
+
<ConfigureHealthCheckResult>
|
101
|
+
<HealthCheck>
|
102
|
+
<Interval>5</Interval>
|
103
|
+
<Target>HTTP:80/servlets-examples/servlet/</Target>
|
104
|
+
<HealthyThreshold>2</HealthyThreshold>
|
105
|
+
<Timeout>2</Timeout>
|
106
|
+
<UnhealthyThreshold>2</UnhealthyThreshold>
|
107
|
+
</HealthCheck>
|
108
|
+
</ConfigureHealthCheckResult>
|
109
|
+
RESPONSE
|
110
|
+
end
|
111
|
+
|
112
|
+
specify "should be able to be created" do
|
113
|
+
@elb.stubs(:make_request).with('CreateLoadBalancer', {
|
114
|
+
'LoadBalancerName' => 'Test Name',
|
115
|
+
'AvailabilityZones.member.1' => 'east-1a',
|
116
|
+
'Listeners.member.1.Protocol' => 'HTTP',
|
117
|
+
'Listeners.member.1.LoadBalancerPort' => '80',
|
118
|
+
'Listeners.member.1.InstancePort' => '80'
|
119
|
+
}).returns stub(:body => @create_load_balancer_response_body, :is_a? => true)
|
120
|
+
|
121
|
+
response = @elb.create_load_balancer(@valid_create_load_balancer_params)
|
122
|
+
response.should.be.an.instance_of Hash
|
123
|
+
response.DNSName.should.equal "TestLoadBalancer-380544827.us-east-1.ec2.amazonaws.com"
|
124
|
+
end
|
125
|
+
|
126
|
+
specify "method create_load_balancer should reject bad arguments" do
|
127
|
+
@elb.stubs(:make_request).with('CreateLoadBalancer', {
|
128
|
+
'LoadBalancerName' => 'Test Name',
|
129
|
+
'AvailabilityZones.member.1' => 'east-1a',
|
130
|
+
'Listeners.member.1.Protocol' => 'HTTP',
|
131
|
+
'Listeners.member.1.LoadBalancerPort' => '80',
|
132
|
+
'Listeners.member.1.InstancePort' => '80'
|
133
|
+
}).returns stub(:body => @create_load_balancer_response_body, :is_a? => true)
|
134
|
+
|
135
|
+
lambda { @elb.create_load_balancer(@valid_create_load_balancer_params) }.should.not.raise(AWS::ArgumentError)
|
136
|
+
lambda { @elb.create_load_balancer(@valid_create_load_balancer_params.merge(:load_balancer_name=>nil)) }.should.raise(AWS::ArgumentError)
|
137
|
+
lambda { @elb.create_load_balancer(@valid_create_load_balancer_params.merge(:load_balancer_name=>'')) }.should.raise(AWS::ArgumentError)
|
138
|
+
lambda { @elb.create_load_balancer(@valid_create_load_balancer_params.merge(:availability_zones=>'')) }.should.raise(AWS::ArgumentError)
|
139
|
+
lambda { @elb.create_load_balancer(@valid_create_load_balancer_params.merge(:availability_zones=>[])) }.should.raise(AWS::ArgumentError)
|
140
|
+
lambda { @elb.create_load_balancer(@valid_create_load_balancer_params.merge(:listeners=>[])) }.should.raise(AWS::ArgumentError)
|
141
|
+
lambda { @elb.create_load_balancer(@valid_create_load_balancer_params.merge(:listeners=>nil)) }.should.raise(AWS::ArgumentError)
|
142
|
+
end
|
143
|
+
|
144
|
+
specify "should be able to be deleted with delete_load_balancer" do
|
145
|
+
@elb.stubs(:make_request).with('DeleteLoadBalancer', {'LoadBalancerName' => 'Test Name'}).
|
146
|
+
returns stub(:body => @delete_load_balancer_response_body, :is_a? => true)
|
147
|
+
|
148
|
+
response = @elb.delete_load_balancer( :load_balancer_name => "Test Name" )
|
149
|
+
response.should.be.an.instance_of Hash
|
150
|
+
response.return.should.equal "true"
|
151
|
+
end
|
152
|
+
|
153
|
+
specify "should be able to be described with describe_load_balancer" do
|
154
|
+
@elb.stubs(:make_request).with('DescribeLoadBalancers', {}).
|
155
|
+
returns stub(:body => @describe_load_balancer_response_body, :is_a? => true)
|
156
|
+
|
157
|
+
response = @elb.describe_load_balancers()
|
158
|
+
response.should.be.an.instance_of Hash
|
159
|
+
|
160
|
+
response.DescribeLoadBalancersResult.LoadBalancerDescriptions.member.length.should == 1
|
161
|
+
end
|
162
|
+
|
163
|
+
specify "should be able to be register instances to load balancers with register_instances_with_load_balancer" do
|
164
|
+
@elb.stubs(:make_request).with('RegisterInstancesWithLoadBalancer', {
|
165
|
+
'LoadBalancerName' => 'Test Name',
|
166
|
+
'Instances.member.1' => 'i-6055fa09'
|
167
|
+
}).returns stub(:body => @register_instances_with_load_balancer_response_body, :is_a? => true)
|
168
|
+
|
169
|
+
response = @elb.register_instances_with_load_balancer(@valid_register_instances_with_load_balancer_params)
|
170
|
+
response.should.be.an.instance_of Hash
|
171
|
+
|
172
|
+
response.Instances.member.length.should == 1
|
173
|
+
end
|
174
|
+
|
175
|
+
specify "method register_instances_with_load_balancer should reject bad arguments" do
|
176
|
+
@elb.stubs(:make_request).with('RegisterInstancesWithLoadBalancer', {
|
177
|
+
'LoadBalancerName' => 'Test Name',
|
178
|
+
'Instances.member.1' => 'i-6055fa09'
|
179
|
+
}).returns stub(:body => @register_instances_with_load_balancer_response_body, :is_a? => true)
|
180
|
+
|
181
|
+
lambda { @elb.register_instances_with_load_balancer(@valid_register_instances_with_load_balancer_params) }.should.not.raise(AWS::ArgumentError)
|
182
|
+
lambda { @elb.register_instances_with_load_balancer(@valid_register_instances_with_load_balancer_params.merge(:load_balancer_name=>nil)) }.should.raise(AWS::ArgumentError)
|
183
|
+
lambda { @elb.register_instances_with_load_balancer(@valid_register_instances_with_load_balancer_params.merge(:instances=>nil)) }.should.raise(AWS::ArgumentError)
|
184
|
+
lambda { @elb.register_instances_with_load_balancer(@valid_register_instances_with_load_balancer_params.merge(:instances=>[])) }.should.raise(AWS::ArgumentError)
|
185
|
+
end
|
186
|
+
|
187
|
+
specify "should be able to degresiter instances from load balancers with degregister_instances_from_load_balancer" do
|
188
|
+
@elb.stubs(:make_request).with('DeregisterInstancesFromLoadBalancer', {
|
189
|
+
'LoadBalancerName' => 'Test Name',
|
190
|
+
'Instances.member.1' => 'i-6055fa09'
|
191
|
+
}).returns stub(:body => @deregister_instances_from_load_balancer_response_body, :is_a? => true)
|
192
|
+
|
193
|
+
response = @elb.deregister_instances_from_load_balancer(@valid_deregister_instances_from_load_balancer_params)
|
194
|
+
response.should.be.an.instance_of Hash
|
195
|
+
end
|
196
|
+
|
197
|
+
specify "method deregister_instances_from_load_balancer should reject bad arguments" do
|
198
|
+
@elb.stubs(:make_request).with('DeregisterInstancesFromLoadBalancer', {
|
199
|
+
'LoadBalancerName' => 'Test Name',
|
200
|
+
'Instances.member.1' => 'i-6055fa09'
|
201
|
+
}).returns stub(:body => @deregister_instances_from_load_balancer_response_body, :is_a? => true)
|
202
|
+
|
203
|
+
lambda { @elb.deregister_instances_from_load_balancer(@valid_deregister_instances_from_load_balancer_params) }.should.not.raise(AWS::ArgumentError)
|
204
|
+
lambda { @elb.deregister_instances_from_load_balancer(@valid_deregister_instances_from_load_balancer_params.merge(:load_balancer_name=>nil)) }.should.raise(AWS::ArgumentError)
|
205
|
+
lambda { @elb.deregister_instances_from_load_balancer(@valid_deregister_instances_from_load_balancer_params.merge(:instances=>nil)) }.should.raise(AWS::ArgumentError)
|
206
|
+
lambda { @elb.deregister_instances_from_load_balancer(@valid_deregister_instances_from_load_balancer_params.merge(:instances=>[])) }.should.raise(AWS::ArgumentError)
|
207
|
+
end
|
208
|
+
|
209
|
+
specify "should be able to degresiter instances from load balancers with degregister_instances_from_load_balancer" do
|
210
|
+
@elb.stubs(:make_request).with('ConfigureHealthCheck', {
|
211
|
+
'LoadBalancerName' => 'Test Name',
|
212
|
+
'HealthCheck.Interval' => '5',
|
213
|
+
'HealthCheck.Target' => 'HTTP:80/servlets-examples/servlet/',
|
214
|
+
'HealthCheck.HealthyThreshold' => '2',
|
215
|
+
'HealthCheck.Timeout' => '2',
|
216
|
+
'HealthCheck.UnhealthyThreshold' => '2'
|
217
|
+
}).returns stub(:body => @configure_health_check_response_body, :is_a? => true)
|
218
|
+
|
219
|
+
response = @elb.configure_health_check(@valid_configure_health_check_params)
|
220
|
+
response.should.be.an.instance_of Hash
|
221
|
+
end
|
222
|
+
|
223
|
+
specify "method degregister_instances_from_load_balancer should reject bad arguments" do
|
224
|
+
@elb.stubs(:make_request).with('ConfigureHealthCheck', {
|
225
|
+
'LoadBalancerName' => 'Test Name',
|
226
|
+
'HealthCheck.Interval' => '5',
|
227
|
+
'HealthCheck.Target' => 'HTTP:80/servlets-examples/servlet/',
|
228
|
+
'HealthCheck.HealthyThreshold' => '2',
|
229
|
+
'HealthCheck.Timeout' => '2',
|
230
|
+
'HealthCheck.UnhealthyThreshold' => '2'
|
231
|
+
}).returns stub(:body => @configure_health_check_response_body, :is_a? => true)
|
232
|
+
|
233
|
+
lambda { @elb.configure_health_check(@valid_configure_health_check_params) }.should.not.raise(AWS::ArgumentError)
|
234
|
+
lambda { @elb.configure_health_check(@valid_configure_health_check_params.merge(:load_balancer_name=>nil)) }.should.raise(AWS::ArgumentError)
|
235
|
+
lambda { @elb.configure_health_check(@valid_configure_health_check_params.merge(:health_check=>nil)) }.should.raise(AWS::ArgumentError)
|
236
|
+
end
|
237
|
+
|
238
|
+
end
|
239
|
+
|
data/test/test_helper.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: amazon-ec2
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.5.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Glenn Rempe
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2009-08-
|
12
|
+
date: 2009-08-11 00:00:00 -07:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
@@ -62,7 +62,7 @@ dependencies:
|
|
62
62
|
- !ruby/object:Gem::Version
|
63
63
|
version: 0.1.6
|
64
64
|
version:
|
65
|
-
description:
|
65
|
+
description: A Ruby library for accessing the Amazon Web Services Elastic Compute Cloud (EC2) and Elastic Load Balancer (ELB) API's.
|
66
66
|
email: glenn@rempe.us
|
67
67
|
executables:
|
68
68
|
- ec2-gem-example.rb
|
@@ -75,11 +75,13 @@ extra_rdoc_files:
|
|
75
75
|
- ChangeLog
|
76
76
|
- LICENSE
|
77
77
|
- README.rdoc
|
78
|
+
- README_dev.rdoc
|
78
79
|
files:
|
79
80
|
- .gitignore
|
80
81
|
- ChangeLog
|
81
82
|
- LICENSE
|
82
83
|
- README.rdoc
|
84
|
+
- README_dev.rdoc
|
83
85
|
- Rakefile
|
84
86
|
- VERSION
|
85
87
|
- amazon-ec2.gemspec
|
@@ -88,20 +90,23 @@ files:
|
|
88
90
|
- bin/ec2sh
|
89
91
|
- bin/setup.rb
|
90
92
|
- deps.rip
|
91
|
-
- lib/
|
92
|
-
- lib/EC2
|
93
|
-
- lib/EC2/
|
94
|
-
- lib/EC2/
|
95
|
-
- lib/EC2/
|
96
|
-
- lib/EC2/image_attributes.rb
|
97
|
-
- lib/EC2/images.rb
|
98
|
-
- lib/EC2/instances.rb
|
99
|
-
- lib/EC2/keypairs.rb
|
100
|
-
- lib/EC2/products.rb
|
101
|
-
- lib/EC2/
|
102
|
-
- lib/EC2/
|
103
|
-
- lib/EC2/
|
104
|
-
- lib/
|
93
|
+
- lib/AWS.rb
|
94
|
+
- lib/AWS/EC2.rb
|
95
|
+
- lib/AWS/EC2/availability_zones.rb
|
96
|
+
- lib/AWS/EC2/console.rb
|
97
|
+
- lib/AWS/EC2/elastic_ips.rb
|
98
|
+
- lib/AWS/EC2/image_attributes.rb
|
99
|
+
- lib/AWS/EC2/images.rb
|
100
|
+
- lib/AWS/EC2/instances.rb
|
101
|
+
- lib/AWS/EC2/keypairs.rb
|
102
|
+
- lib/AWS/EC2/products.rb
|
103
|
+
- lib/AWS/EC2/security_groups.rb
|
104
|
+
- lib/AWS/EC2/snapshots.rb
|
105
|
+
- lib/AWS/EC2/volumes.rb
|
106
|
+
- lib/AWS/ELB.rb
|
107
|
+
- lib/AWS/ELB/load_balancers.rb
|
108
|
+
- lib/AWS/exceptions.rb
|
109
|
+
- lib/AWS/responses.rb
|
105
110
|
- perftools/ec2prof
|
106
111
|
- perftools/ec2prof-results.dot
|
107
112
|
- perftools/ec2prof-results.txt
|
@@ -120,6 +125,7 @@ files:
|
|
120
125
|
- test/test_EC2_security_groups.rb
|
121
126
|
- test/test_EC2_snapshots.rb
|
122
127
|
- test/test_EC2_volumes.rb
|
128
|
+
- test/test_ELB_load_balancers.rb
|
123
129
|
- test/test_helper.rb
|
124
130
|
- wsdl/2007-08-29.ec2.wsdl
|
125
131
|
- wsdl/2008-02-01.ec2.wsdl
|
@@ -176,4 +182,5 @@ test_files:
|
|
176
182
|
- test/test_EC2_security_groups.rb
|
177
183
|
- test/test_EC2_snapshots.rb
|
178
184
|
- test/test_EC2_volumes.rb
|
185
|
+
- test/test_ELB_load_balancers.rb
|
179
186
|
- test/test_helper.rb
|
@@ -1,41 +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
|
-
module EC2
|
12
|
-
|
13
|
-
class Base
|
14
|
-
|
15
|
-
#Amazon Developer Guide Docs:
|
16
|
-
#
|
17
|
-
# The DescribeAvailabilityZones operation describes availability zones that are currently
|
18
|
-
# available to the account and their states.
|
19
|
-
#
|
20
|
-
# An optional list of zone names can be passed.
|
21
|
-
#
|
22
|
-
#Required Arguments:
|
23
|
-
#
|
24
|
-
# none
|
25
|
-
#
|
26
|
-
#Optional Arguments:
|
27
|
-
#
|
28
|
-
# :zone_name => Array (default : [])
|
29
|
-
#
|
30
|
-
|
31
|
-
def describe_availability_zones( options = {} )
|
32
|
-
|
33
|
-
options = { :zone_name => [] }.merge(options)
|
34
|
-
|
35
|
-
params = pathlist("ZoneName", options[:zone_name] )
|
36
|
-
|
37
|
-
return response_generator(:action => "DescribeAvailabilityZones", :params => params)
|
38
|
-
|
39
|
-
end
|
40
|
-
end
|
41
|
-
end
|