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,142 +0,0 @@
|
|
1
|
-
#--
|
2
|
-
# Amazon Web Services EC2 Query API Ruby library, EBS volumes support
|
3
|
-
#
|
4
|
-
# Ruby Gem Name:: amazon-ec2
|
5
|
-
# Author:: Yann Klis (mailto:yann.klis@novelys.com)
|
6
|
-
# Copyright:: Copyright (c) 2008 Yann Klis
|
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 "EC2 volumes " 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
|
-
@describe_volumes_response_body = <<-RESPONSE
|
19
|
-
<DescribeVolumesResponse xmlns="http://ec2.amazonaws.com/doc/2008-05-05">
|
20
|
-
<volumeSet>
|
21
|
-
<item>
|
22
|
-
<volumeId>vol-4282672b</volumeId>
|
23
|
-
<size>800</size>
|
24
|
-
<status>in-use</status>
|
25
|
-
<createTime>2008-05-07T11:51:50.000Z</createTime>
|
26
|
-
<attachmentSet>
|
27
|
-
<item>
|
28
|
-
<volumeId>vol-4282672b</volumeId>
|
29
|
-
<instanceId>i-6058a509</instanceId>
|
30
|
-
<size>800</size>
|
31
|
-
<status>attached</status>
|
32
|
-
<attachTime>2008-05-07T12:51:50.000Z</attachTime>
|
33
|
-
</item>
|
34
|
-
</attachmentSet>
|
35
|
-
</item>
|
36
|
-
</volumeSet>
|
37
|
-
</DescribeVolumesResponse>
|
38
|
-
RESPONSE
|
39
|
-
|
40
|
-
@create_volume_response_body = <<-RESPONSE
|
41
|
-
<CreateVolumeResponse xmlns="http://ec2.amazonaws.com/doc/2008-05-05">
|
42
|
-
<volumeId>vol-4d826724</volumeId>
|
43
|
-
<size>800</size>
|
44
|
-
<status>creating</status>
|
45
|
-
<createTime>2008-05-07T11:51:50.000Z</createTime>
|
46
|
-
<zone>us-east-1a</zone>
|
47
|
-
<snapshotId></snapshotId>
|
48
|
-
</CreateVolumeResponse>
|
49
|
-
RESPONSE
|
50
|
-
|
51
|
-
@delete_volume_response_body = <<-RESPONSE
|
52
|
-
<ReleaseAddressResponse xmlns="http://ec2.amazonaws.com/doc/2008-05-05">
|
53
|
-
<return>true</return>
|
54
|
-
</ReleaseAddressResponse>
|
55
|
-
RESPONSE
|
56
|
-
|
57
|
-
@attach_volume_response_body = <<-RESPONSE
|
58
|
-
<AttachVolumeResponse xmlns="http://ec2.amazonaws.com/doc/2008-05-05">
|
59
|
-
<volumeId>vol-4d826724</volumeId>
|
60
|
-
<instanceId>i-6058a509</instanceId>
|
61
|
-
<device>/dev/sdh</device>
|
62
|
-
<status>attaching</status>
|
63
|
-
<attachTime>2008-05-07T11:51:50.000Z</attachTime>
|
64
|
-
</AttachVolumeResponse>
|
65
|
-
RESPONSE
|
66
|
-
|
67
|
-
@detach_volume_response_body = <<-RESPONSE
|
68
|
-
<DetachVolumeResponse xmlns="http://ec2.amazonaws.com/doc/2008-05-05">
|
69
|
-
<volumeId>vol-4d826724</volumeId>
|
70
|
-
<instanceId>i-6058a509</instanceId>
|
71
|
-
<device>/dev/sdh</device>
|
72
|
-
<status>detaching</status>
|
73
|
-
<attachTime>2008-05-08T11:51:50.000Z</attachTime>
|
74
|
-
</DetachVolumeResponse>
|
75
|
-
RESPONSE
|
76
|
-
|
77
|
-
end
|
78
|
-
|
79
|
-
|
80
|
-
specify "should be able to be described with describe_volumes" do
|
81
|
-
@ec2.stubs(:make_request).with('DescribeVolumes', {"VolumeId.1"=>"vol-4282672b"}).
|
82
|
-
returns stub(:body => @describe_volumes_response_body, :is_a? => true)
|
83
|
-
|
84
|
-
@ec2.describe_volumes( :volume_id => ["vol-4282672b"] ).should.be.an.instance_of Hash
|
85
|
-
|
86
|
-
response = @ec2.describe_volumes( :volume_id => ["vol-4282672b"] )
|
87
|
-
response.volumeSet.item[0].volumeId.should.equal "vol-4282672b"
|
88
|
-
response.volumeSet.item[0].attachmentSet.item[0]['size'].should.equal "800"
|
89
|
-
response.volumeSet.item[0].attachmentSet.item[0].volumeId.should.equal "vol-4282672b"
|
90
|
-
response.volumeSet.item[0].attachmentSet.item[0].instanceId.should.equal "i-6058a509"
|
91
|
-
end
|
92
|
-
|
93
|
-
specify "should be able to be created with an availability_zone with size" do
|
94
|
-
@ec2.stubs(:make_request).with('CreateVolume', {"AvailabilityZone" => "us-east-1a", "Size"=>"800", "SnapshotId"=>""}).
|
95
|
-
returns stub(:body => @create_volume_response_body, :is_a? => true)
|
96
|
-
|
97
|
-
@ec2.create_volume( :availability_zone => "us-east-1a", :size => "800" ).should.be.an.instance_of Hash
|
98
|
-
|
99
|
-
response = @ec2.create_volume( :availability_zone => "us-east-1a", :size => "800" )
|
100
|
-
response.volumeId.should.equal "vol-4d826724"
|
101
|
-
response['size'].should.equal "800"
|
102
|
-
response.status.should.equal "creating"
|
103
|
-
response.zone.should.equal "us-east-1a"
|
104
|
-
end
|
105
|
-
|
106
|
-
specify "should be able to be deleted with a volume_id" do
|
107
|
-
@ec2.stubs(:make_request).with('DeleteVolume', {"VolumeId" => "vol-4282672b"}).
|
108
|
-
returns stub(:body => @delete_volume_response_body, :is_a? => true)
|
109
|
-
|
110
|
-
@ec2.delete_volume( :volume_id => "vol-4282672b" ).should.be.an.instance_of Hash
|
111
|
-
|
112
|
-
response = @ec2.delete_volume( :volume_id => "vol-4282672b" )
|
113
|
-
response.return.should.equal "true"
|
114
|
-
end
|
115
|
-
|
116
|
-
specify "should be able to be attached with a volume_id with an instance_id with a device" do
|
117
|
-
@ec2.stubs(:make_request).with('AttachVolume', {"VolumeId" => "vol-4d826724", "InstanceId"=>"i-6058a509", "Device"=>"/dev/sdh"}).
|
118
|
-
returns stub(:body => @attach_volume_response_body, :is_a? => true)
|
119
|
-
|
120
|
-
@ec2.attach_volume( :volume_id => "vol-4d826724", :instance_id => "i-6058a509", :device => "/dev/sdh" ).should.be.an.instance_of Hash
|
121
|
-
|
122
|
-
response = @ec2.attach_volume( :volume_id => "vol-4d826724", :instance_id => "i-6058a509", :device => "/dev/sdh" )
|
123
|
-
response.volumeId.should.equal "vol-4d826724"
|
124
|
-
response.instanceId.should.equal "i-6058a509"
|
125
|
-
response.device.should.equal "/dev/sdh"
|
126
|
-
response.status.should.equal "attaching"
|
127
|
-
end
|
128
|
-
|
129
|
-
specify "should be able to be detached with a volume_id with an instance_id" do
|
130
|
-
@ec2.stubs(:make_request).with('DetachVolume', {"VolumeId" => "vol-4d826724", "InstanceId"=>"i-6058a509", "Device"=>"", "Force"=>""}).
|
131
|
-
returns stub(:body => @detach_volume_response_body, :is_a? => true)
|
132
|
-
|
133
|
-
@ec2.detach_volume( :volume_id => "vol-4d826724", :instance_id => "i-6058a509" ).should.be.an.instance_of Hash
|
134
|
-
|
135
|
-
response = @ec2.detach_volume( :volume_id => "vol-4d826724", :instance_id => "i-6058a509" )
|
136
|
-
response.volumeId.should.equal "vol-4d826724"
|
137
|
-
response.instanceId.should.equal "i-6058a509"
|
138
|
-
response.device.should.equal "/dev/sdh"
|
139
|
-
response.status.should.equal "detaching"
|
140
|
-
end
|
141
|
-
|
142
|
-
end
|
@@ -1,239 +0,0 @@
|
|
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.InstanceId' => '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.InstanceId' => '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
|
-
|