poolparty 1.4.6 → 1.4.7
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION.yml +2 -2
- data/bin/cloud-contract +6 -1
- data/bin/cloud-list +5 -6
- data/bin/cloud-vnc +39 -0
- data/examples/rds_cloud.rb +44 -0
- data/lib/cloud_providers/connections.rb +0 -1
- data/lib/cloud_providers/ec2/ec2.rb +86 -25
- data/lib/cloud_providers/ec2/ec2_instance.rb +6 -2
- data/lib/cloud_providers/ec2/helpers/ec2_helper.rb +19 -6
- data/lib/cloud_providers/ec2/helpers/elastic_load_balancer.rb +3 -3
- data/lib/cloud_providers/ec2/helpers/rds_instance.rb +110 -0
- data/lib/cloud_providers/remote_instance.rb +5 -3
- data/lib/poolparty/cloud.rb +8 -3
- data/lib/poolparty/pool.rb +12 -0
- data/test/fixtures/clouds/rds_cloud.rb +14 -0
- data/test/fixtures/clouds/rds_missing_params.rb +11 -0
- data/test/fixtures/ec2/ec2-describe-security-groups_response_body.xml +23 -0
- data/test/fixtures/ec2/rds-describe-db-instances-empty_response_body.xml +9 -0
- data/test/lib/poolparty/rds_test.rb +35 -0
- data/test/test_helper.rb +4 -4
- data/vendor/gems/amazon-ec2/ChangeLog +15 -0
- data/vendor/gems/amazon-ec2/README.rdoc +27 -24
- data/vendor/gems/amazon-ec2/README_dev.rdoc +0 -2
- data/vendor/gems/amazon-ec2/Rakefile +8 -39
- data/vendor/gems/amazon-ec2/VERSION +1 -1
- data/vendor/gems/amazon-ec2/amazon-ec2.gemspec +24 -16
- data/vendor/gems/amazon-ec2/bin/setup.rb +1 -0
- data/vendor/gems/amazon-ec2/lib/AWS/Autoscaling/autoscaling.rb +6 -16
- data/vendor/gems/amazon-ec2/lib/AWS/EC2/availability_zones.rb +8 -0
- data/vendor/gems/amazon-ec2/lib/AWS/EC2/console.rb +2 -0
- data/vendor/gems/amazon-ec2/lib/AWS/EC2/devpay.rb +18 -0
- data/vendor/gems/amazon-ec2/lib/AWS/EC2/elastic_ips.rb +37 -32
- data/vendor/gems/amazon-ec2/lib/AWS/EC2/images.rb +43 -27
- data/vendor/gems/amazon-ec2/lib/AWS/EC2/instances.rb +136 -99
- data/vendor/gems/amazon-ec2/lib/AWS/EC2/keypairs.rb +3 -17
- data/vendor/gems/amazon-ec2/lib/AWS/EC2/security_groups.rb +4 -23
- data/vendor/gems/amazon-ec2/lib/AWS/EC2/snapshots.rb +38 -17
- data/vendor/gems/amazon-ec2/lib/AWS/EC2/volumes.rb +6 -21
- data/vendor/gems/amazon-ec2/lib/AWS/EC2.rb +2 -2
- data/vendor/gems/amazon-ec2/lib/AWS/ELB/load_balancers.rb +11 -38
- data/vendor/gems/amazon-ec2/lib/AWS/RDS/rds.rb +522 -0
- data/vendor/gems/amazon-ec2/lib/AWS/RDS.rb +73 -0
- data/vendor/gems/amazon-ec2/lib/AWS/exceptions.rb +103 -25
- data/vendor/gems/amazon-ec2/lib/AWS.rb +19 -9
- data/vendor/gems/amazon-ec2/perftools/ec2prof +0 -0
- data/vendor/gems/amazon-ec2/perftools/ec2prof-results.dot +130 -191
- data/vendor/gems/amazon-ec2/perftools/ec2prof-results.txt +100 -126
- data/vendor/gems/amazon-ec2/perftools/ec2prof.symbols +102 -129
- data/vendor/gems/amazon-ec2/test/test_Autoscaling_groups.rb +3 -2
- data/vendor/gems/amazon-ec2/test/test_EC2_images.rb +32 -0
- data/vendor/gems/amazon-ec2/test/test_EC2_instances.rb +204 -22
- data/vendor/gems/amazon-ec2/test/test_EC2_snapshots.rb +1 -1
- data/vendor/gems/amazon-ec2/test/test_ELB_load_balancers.rb +2 -2
- data/vendor/gems/amazon-ec2/test/test_RDS.rb +354 -0
- data/vendor/gems/amazon-ec2/wsdl/2009-10-31.ec2.wsdl +4261 -0
- data/vendor/gems/amazon-ec2/wsdl/2009-11-30.ec2.wsdl +4668 -0
- metadata +17 -2
@@ -3,36 +3,33 @@ module AWS
|
|
3
3
|
|
4
4
|
class Base < AWS::Base
|
5
5
|
|
6
|
+
|
6
7
|
# The DescribeSnapshots operation describes the status of Amazon EBS snapshots.
|
7
8
|
#
|
8
|
-
# @option options [Array] :snapshot_id ([])
|
9
|
+
# @option options [optional,Array] :snapshot_id ([]) The ID of the Amazon EBS snapshot.
|
10
|
+
# @option options [optional,String] :owner ('') Returns snapshots owned by the specified owner. Multiple owners can be specified. Valid values self | amazon | AWS Account ID
|
11
|
+
# @option options [optional,String] :restorable_by ('') Account ID of a user that can create volumes from the snapshot.
|
9
12
|
#
|
10
13
|
def describe_snapshots( options = {} )
|
11
|
-
|
12
|
-
options
|
13
|
-
|
14
|
-
params =
|
15
|
-
|
14
|
+
params = {}
|
15
|
+
params.merge!(pathlist("SnapshotId", options[:snapshot_id] )) unless options[:snapshot_id].nil? || options[:snapshot_id] == []
|
16
|
+
params["RestorableBy"] = options[:restorable_by] unless options[:restorable_by].nil?
|
17
|
+
params["Owner"] = options[:owner] unless options[:owner].nil?
|
16
18
|
return response_generator(:action => "DescribeSnapshots", :params => params)
|
17
|
-
|
18
19
|
end
|
19
20
|
|
21
|
+
|
20
22
|
# The CreateSnapshot operation creates a snapshot of an Amazon EBS volume and stores it in Amazon S3. You can use snapshots for backups, to launch instances from identical snapshots, and to save data before shutting down an instance.
|
21
23
|
#
|
22
24
|
# @option options [String] :volume_id ('')
|
23
25
|
#
|
24
26
|
def create_snapshot( options = {} )
|
25
|
-
|
26
27
|
options = { :volume_id => '' }.merge(options)
|
27
|
-
|
28
28
|
raise ArgumentError, "No :volume_id provided" if options[:volume_id].nil? || options[:volume_id].empty?
|
29
|
-
|
30
29
|
params = {
|
31
30
|
"VolumeId" => options[:volume_id]
|
32
31
|
}
|
33
|
-
|
34
32
|
return response_generator(:action => "CreateSnapshot", :params => params)
|
35
|
-
|
36
33
|
end
|
37
34
|
|
38
35
|
|
@@ -41,19 +38,43 @@ module AWS
|
|
41
38
|
# @option options [String] :snapshot_id ('')
|
42
39
|
#
|
43
40
|
def delete_snapshot( options = {} )
|
44
|
-
|
45
41
|
options = { :snapshot_id => '' }.merge(options)
|
46
|
-
|
47
42
|
raise ArgumentError, "No :snapshot_id provided" if options[:snapshot_id].nil? || options[:snapshot_id].empty?
|
48
|
-
|
49
43
|
params = {
|
50
44
|
"SnapshotId" => options[:snapshot_id]
|
51
45
|
}
|
52
|
-
|
53
46
|
return response_generator(:action => "DeleteSnapshot", :params => params)
|
47
|
+
end
|
54
48
|
|
49
|
+
|
50
|
+
# Not yet implemented
|
51
|
+
#
|
52
|
+
# @todo Implement this method
|
53
|
+
#
|
54
|
+
def describe_snapshot_attribute( options = {} )
|
55
|
+
raise "Not yet implemented"
|
56
|
+
end
|
57
|
+
|
58
|
+
|
59
|
+
# Not yet implemented
|
60
|
+
#
|
61
|
+
# @todo Implement this method
|
62
|
+
#
|
63
|
+
def modify_snapshot_attribute( options = {} )
|
64
|
+
raise "Not yet implemented"
|
55
65
|
end
|
56
66
|
|
67
|
+
|
68
|
+
# Not yet implemented
|
69
|
+
#
|
70
|
+
# @todo Implement this method
|
71
|
+
#
|
72
|
+
def reset_snapshot_attribute( options = {} )
|
73
|
+
raise "Not yet implemented"
|
74
|
+
end
|
75
|
+
|
76
|
+
|
57
77
|
end
|
58
78
|
end
|
59
|
-
end
|
79
|
+
end
|
80
|
+
|
@@ -2,6 +2,7 @@ module AWS
|
|
2
2
|
module EC2
|
3
3
|
class Base < AWS::Base
|
4
4
|
|
5
|
+
|
5
6
|
# The DescribeVolumes operation lists one or more Amazon EBS volumes that you own, If you do not specify any volumes, Amazon EBS returns all volumes that you own.
|
6
7
|
#
|
7
8
|
# @option options [optional, String] :volume_id ([])
|
@@ -12,6 +13,7 @@ module AWS
|
|
12
13
|
return response_generator(:action => "DescribeVolumes", :params => params)
|
13
14
|
end
|
14
15
|
|
16
|
+
|
15
17
|
# The CreateVolume operation creates a new Amazon EBS volume that you can mount from any Amazon EC2 instance.
|
16
18
|
#
|
17
19
|
# @option options [String] :availability_zone ('')
|
@@ -19,43 +21,33 @@ module AWS
|
|
19
21
|
# @option options [optional, String] :snapshot_id ('')
|
20
22
|
#
|
21
23
|
def create_volume( options = {} )
|
22
|
-
|
23
|
-
# defaults
|
24
24
|
options = { :availability_zone => '' }.merge(options)
|
25
|
-
|
26
25
|
raise ArgumentError, "No :availability_zone provided" if options[:availability_zone].nil? || options[:availability_zone].empty?
|
27
|
-
|
28
26
|
options = { :size => '' }.merge(options)
|
29
27
|
options = { :snapshot_id => '' }.merge(options)
|
30
|
-
|
31
28
|
params = {
|
32
29
|
"AvailabilityZone" => options[:availability_zone],
|
33
30
|
"Size" => options[:size],
|
34
31
|
"SnapshotId" => options[:snapshot_id]
|
35
32
|
}
|
36
|
-
|
37
33
|
return response_generator(:action => "CreateVolume", :params => params)
|
38
|
-
|
39
34
|
end
|
40
35
|
|
36
|
+
|
41
37
|
# The DeleteVolume operation deletes an Amazon EBS volume.
|
42
38
|
#
|
43
39
|
# @option options [String] :volume_id ('')
|
44
40
|
#
|
45
41
|
def delete_volume( options = {} )
|
46
|
-
|
47
42
|
options = { :volume_id => '' }.merge(options)
|
48
|
-
|
49
43
|
raise ArgumentError, "No :volume_id provided" if options[:volume_id].nil? || options[:volume_id].empty?
|
50
|
-
|
51
44
|
params = {
|
52
45
|
"VolumeId" => options[:volume_id]
|
53
46
|
}
|
54
|
-
|
55
47
|
return response_generator(:action => "DeleteVolume", :params => params)
|
56
|
-
|
57
48
|
end
|
58
49
|
|
50
|
+
|
59
51
|
# The AttachVolume operation attaches an Amazon EBS volume to an instance.
|
60
52
|
#
|
61
53
|
# @option options [String] :volume_id ('')
|
@@ -63,11 +55,9 @@ module AWS
|
|
63
55
|
# @option options [String] :device ('')
|
64
56
|
#
|
65
57
|
def attach_volume( options = {} )
|
66
|
-
|
67
58
|
options = { :volume_id => '' }.merge(options)
|
68
59
|
options = { :instance_id => '' }.merge(options)
|
69
60
|
options = { :device => '' }.merge(options)
|
70
|
-
|
71
61
|
raise ArgumentError, "No :volume_id provided" if options[:volume_id].nil? || options[:volume_id].empty?
|
72
62
|
raise ArgumentError, "No :instance_id provided" if options[:instance_id].nil? || options[:instance_id].empty?
|
73
63
|
raise ArgumentError, "No :device provided" if options[:device].nil? || options[:device].empty?
|
@@ -77,11 +67,10 @@ module AWS
|
|
77
67
|
"InstanceId" => options[:instance_id],
|
78
68
|
"Device" => options[:device]
|
79
69
|
}
|
80
|
-
|
81
70
|
return response_generator(:action => "AttachVolume", :params => params)
|
82
|
-
|
83
71
|
end
|
84
72
|
|
73
|
+
|
85
74
|
# The DetachVolume operation detaches an Amazon EBS volume from an instance.
|
86
75
|
#
|
87
76
|
# @option options [String] :volume_id ('')
|
@@ -90,25 +79,21 @@ module AWS
|
|
90
79
|
# @option options [optional, Boolean] :force ('')
|
91
80
|
#
|
92
81
|
def detach_volume( options = {} )
|
93
|
-
|
94
82
|
options = { :volume_id => '' }.merge(options)
|
95
|
-
|
96
83
|
raise ArgumentError, "No :volume_id provided" if options[:volume_id].nil? || options[:volume_id].empty?
|
97
|
-
|
98
84
|
options = { :instance_id => '' }.merge(options)
|
99
85
|
options = { :device => '' }.merge(options)
|
100
86
|
options = { :force => '' }.merge(options)
|
101
|
-
|
102
87
|
params = {
|
103
88
|
"VolumeId" => options[:volume_id],
|
104
89
|
"InstanceId" => options[:instance_id],
|
105
90
|
"Device" => options[:device],
|
106
91
|
"Force" => options[:force]
|
107
92
|
}
|
108
|
-
|
109
93
|
return response_generator(:action => "DetachVolume", :params => params)
|
110
94
|
end
|
111
95
|
|
96
|
+
|
112
97
|
end
|
113
98
|
end
|
114
99
|
end
|
@@ -8,7 +8,7 @@ module AWS
|
|
8
8
|
# export EC2_URL='https://ec2.amazonaws.com'
|
9
9
|
if ENV['EC2_URL']
|
10
10
|
EC2_URL = ENV['EC2_URL']
|
11
|
-
VALID_HOSTS = ['https://ec2.amazonaws.com', 'https://us-east-1.ec2.amazonaws.com', 'https://eu-west-1.ec2.amazonaws.com']
|
11
|
+
VALID_HOSTS = ['https://ec2.amazonaws.com', 'https://us-east-1.ec2.amazonaws.com', 'https://us-west-1.ec2.amazonaws.com', 'https://eu-west-1.ec2.amazonaws.com']
|
12
12
|
raise ArgumentError, "Invalid EC2_URL environment variable : #{EC2_URL}" unless VALID_HOSTS.include?(EC2_URL)
|
13
13
|
DEFAULT_HOST = URI.parse(EC2_URL).host
|
14
14
|
else
|
@@ -16,7 +16,7 @@ module AWS
|
|
16
16
|
DEFAULT_HOST = 'ec2.amazonaws.com'
|
17
17
|
end
|
18
18
|
|
19
|
-
API_VERSION = '2009-
|
19
|
+
API_VERSION = '2009-11-30'
|
20
20
|
|
21
21
|
class Base < AWS::Base
|
22
22
|
def api_version
|
@@ -92,9 +92,7 @@ module AWS
|
|
92
92
|
raise ArgumentError, "No :instances provided" if options[:instances].nil? || options[:instances].empty?
|
93
93
|
raise ArgumentError, "No :load_balancer_name provided" if options[:load_balancer_name].nil? || options[:load_balancer_name].empty?
|
94
94
|
params = {}
|
95
|
-
params.merge!(pathhashlist('Instances.member',
|
96
|
-
:instance_id => 'InstanceId'
|
97
|
-
}))
|
95
|
+
params.merge!(pathhashlist('Instances.member', options[:instances].flatten.collect{|e| {:instance_id => e}}, {:instance_id => 'InstanceId'}))
|
98
96
|
params['LoadBalancerName'] = options[:load_balancer_name]
|
99
97
|
return response_generator(:action => "RegisterInstancesWithLoadBalancer", :params => params)
|
100
98
|
end
|
@@ -116,12 +114,8 @@ module AWS
|
|
116
114
|
def deregister_instances_from_load_balancer( options = {} )
|
117
115
|
raise ArgumentError, "No :instances provided" if options[:instances].nil? || options[:instances].empty?
|
118
116
|
raise ArgumentError, "No :load_balancer_name provided" if options[:load_balancer_name].nil? || options[:load_balancer_name].empty?
|
119
|
-
|
120
117
|
params = {}
|
121
|
-
params.merge!(
|
122
|
-
:instance_id => 'InstanceId'
|
123
|
-
}))
|
124
|
-
|
118
|
+
params.merge!(pathlist('Instances.member', [options[:instances]].flatten))
|
125
119
|
params['LoadBalancerName'] = options[:load_balancer_name]
|
126
120
|
return response_generator(:action => "DeregisterInstancesFromLoadBalancer", :params => params)
|
127
121
|
end
|
@@ -155,49 +149,28 @@ module AWS
|
|
155
149
|
return response_generator(:action => "ConfigureHealthCheck", :params => params)
|
156
150
|
end
|
157
151
|
|
152
|
+
# Not yet implemented
|
158
153
|
#
|
159
|
-
# @todo
|
154
|
+
# @todo Implement this method
|
160
155
|
#
|
161
156
|
def describe_instance_health( options = {} )
|
162
|
-
raise
|
163
|
-
|
164
|
-
params = {}
|
165
|
-
params['LoadBalancerName'] = options[:load_balancer_name]
|
166
|
-
return response_generator(:action => "DescribeInstanceHealth", :params => params)
|
157
|
+
raise "Not yet implemented"
|
167
158
|
end
|
168
159
|
|
160
|
+
# Not yet implemented
|
169
161
|
#
|
170
|
-
# @todo
|
162
|
+
# @todo Implement this method
|
171
163
|
#
|
172
164
|
def disable_availability_zones_for_load_balancer( options = {} )
|
173
|
-
raise
|
174
|
-
raise ArgumentError, "No availability_zones specified" unless options[:availability_zones]
|
175
|
-
|
176
|
-
params = {}
|
177
|
-
params['LoadBalancerName'] = options[:load_balancer_name]
|
178
|
-
params.merge!(pathlist("AvailabilityZones.member", options[:availability_zones]))
|
179
|
-
|
180
|
-
return response_generator(:action => "DisableAvailabilityZonesForLoadBalancer", :params => params)
|
165
|
+
raise "Not yet implemented"
|
181
166
|
end
|
182
167
|
|
168
|
+
# Not yet implemented
|
183
169
|
#
|
184
|
-
# @todo
|
170
|
+
# @todo Implement this method
|
185
171
|
#
|
186
172
|
def enable_availability_zones_for_load_balancer( options = {} )
|
187
|
-
raise
|
188
|
-
raise ArgumentError, "No availability_zones specified" unless options[:availability_zones]
|
189
|
-
|
190
|
-
params = {}
|
191
|
-
params['LoadBalancerName'] = options[:load_balancer_name]
|
192
|
-
params.merge!(pathlist("AvailabilityZones.member", options[:availability_zones]))
|
193
|
-
|
194
|
-
return response_generator(:action => "EnableAvailabilityZonesForLoadBalancer", :params => params)
|
195
|
-
end
|
196
|
-
|
197
|
-
#convenience methods
|
198
|
-
# return an array of hashes describing the load_balancers
|
199
|
-
def list
|
200
|
-
describe_load_balancers.DescribeLoadBalancersResult.LoadBalancerDescriptions.member
|
173
|
+
raise "Not yet implemented"
|
201
174
|
end
|
202
175
|
|
203
176
|
end
|