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,249 +0,0 @@
|
|
1
|
-
module AWS
|
2
|
-
module EC2
|
3
|
-
class Base < AWS::Base
|
4
|
-
|
5
|
-
# Launches a specified number of instances of an AMI for which you have permissions.
|
6
|
-
#
|
7
|
-
# Amazon API Docs : HTML[http://docs.amazonwebservices.com/AWSEC2/2009-10-31/APIReference/index.html?ApiReference-query-RunInstances.html]
|
8
|
-
#
|
9
|
-
# @option options [String] :image_id ("") Unique ID of a machine image.
|
10
|
-
# @option options [Integer] :min_count (1) Minimum number of instances to launch. If the value is more than Amazon EC2 can launch, no instances are launched at all.
|
11
|
-
# @option options [Integer] :max_count (1) Maximum number of instances to launch. If the value is more than Amazon EC2 can launch, the largest possible number above minCount will be launched instead.
|
12
|
-
# @option options [optional, String] :key_name (nil) The name of the key pair.
|
13
|
-
# @option options [optional, Array of Strings or String] :security_group (nil) Name of the security group(s).
|
14
|
-
# @option options [optional, String] :additional_info (nil) Specifies additional information to make available to the instance(s).
|
15
|
-
# @option options [optional, String] :user_data (nil) MIME, Base64-encoded user data.
|
16
|
-
# @option options [optional, String] :instance_type (nil) Specifies the instance type.
|
17
|
-
# @option options [optional, String] :availability_zone (nil) Specifies the placement constraints (Availability Zones) for launching the instances.
|
18
|
-
# @option options [optional, String] :kernel_id (nil) The ID of the kernel with which to launch the instance.
|
19
|
-
# @option options [optional, String] :ramdisk_id (nil) The ID of the RAM disk with which to launch the instance. Some kernels require additional drivers at launch. Check the kernel requirements for information on whether you need to specify a RAM disk. To find kernel requirements, go to the Resource Center and search for the kernel ID.
|
20
|
-
# @option options [optional, Array] :block_device_mapping ([]) An array of Hashes representing the elements of the block device mapping. e.g. [{:device_name => '/dev/sdh', :virtual_name => '', :ebs_snapshot_id => '', :ebs_volume_size => '', :ebs_delete_on_termination => ''},{},...]
|
21
|
-
# @option options [optional, Boolean] :monitoring_enabled (false) Enables monitoring for the instance.
|
22
|
-
# @option options [optional, String] :subnet_id (nil) Specifies the Amazon VPC subnet ID within which to launch the instance(s) for Amazon Virtual Private Cloud.
|
23
|
-
# @option options [optional, Boolean] :disable_api_termination (true) Specifies whether the instance can be terminated using the APIs. You must modify this attribute before you can terminate any "locked" instances from the APIs.
|
24
|
-
# @option options [optional, String] :instance_initiated_shutdown_behavior ('stop') Specifies whether the instance's Amazon EBS volumes are stopped or terminated when the instance is shut down. Valid values : 'stop', 'terminate'
|
25
|
-
# @option options [optional, Boolean] :base64_encoded (false)
|
26
|
-
#
|
27
|
-
def run_instances( options = {} )
|
28
|
-
options = { :image_id => "",
|
29
|
-
:min_count => 1,
|
30
|
-
:max_count => 1,
|
31
|
-
:base64_encoded => false }.merge(options)
|
32
|
-
|
33
|
-
raise ArgumentError, ":addressing_type has been deprecated." if options[:addressing_type]
|
34
|
-
raise ArgumentError, ":group_id has been deprecated." if options[:group_id]
|
35
|
-
|
36
|
-
raise ArgumentError, ":image_id must be provided" if options[:image_id].nil? || options[:image_id].empty?
|
37
|
-
raise ArgumentError, ":min_count is not valid" unless options[:min_count].to_i > 0
|
38
|
-
raise ArgumentError, ":max_count is not valid or must be >= :min_count" unless options[:max_count].to_i > 0 && options[:max_count].to_i >= options[:min_count].to_i
|
39
|
-
raise ArgumentError, ":instance_type must specify a valid instance size" unless options[:instance_type].nil? || ["m1.small", "m1.large", "m1.xlarge", "c1.medium", "c1.xlarge", "m2.2xlarge", "m2.4xlarge"].include?(options[:instance_type])
|
40
|
-
raise ArgumentError, ":monitoring_enabled must be 'true' or 'false'" unless options[:monitoring_enabled].nil? || [true, false].include?(options[:monitoring_enabled])
|
41
|
-
raise ArgumentError, ":disable_api_termination must be 'true' or 'false'" unless options[:disable_api_termination].nil? || [true, false].include?(options[:disable_api_termination])
|
42
|
-
raise ArgumentError, ":instance_initiated_shutdown_behavior must be 'stop' or 'terminate'" unless options[:instance_initiated_shutdown_behavior].nil? || ["stop", "terminate"].include?(options[:instance_initiated_shutdown_behavior])
|
43
|
-
raise ArgumentError, ":base64_encoded must be 'true' or 'false'" unless [true, false].include?(options[:base64_encoded])
|
44
|
-
|
45
|
-
user_data = extract_user_data(options)
|
46
|
-
|
47
|
-
params = {}
|
48
|
-
|
49
|
-
if options[:security_group]
|
50
|
-
params.merge!(pathlist("SecurityGroup", options[:security_group]))
|
51
|
-
end
|
52
|
-
|
53
|
-
if options[:block_device_mapping]
|
54
|
-
params.merge!(pathhashlist('BlockDeviceMapping', options[:block_device_mapping].flatten, {:device_name => 'DeviceName', :virtual_name => 'VirtualName', :ebs_snapshot_id => 'Ebs.SnapshotId', :ebs_volume_size => 'Ebs.VolumeSize', :ebs_delete_on_termination => 'Ebs.DeleteOnTermination' }))
|
55
|
-
end
|
56
|
-
|
57
|
-
params["ImageId"] = options[:image_id]
|
58
|
-
params["MinCount"] = options[:min_count].to_s
|
59
|
-
params["MaxCount"] = options[:max_count].to_s
|
60
|
-
params["KeyName"] = options[:key_name] unless options[:key_name].nil?
|
61
|
-
params["AdditionalInfo"] = options[:additional_info] unless options[:additional_info].nil?
|
62
|
-
params["UserData"] = user_data unless user_data.nil?
|
63
|
-
params["InstanceType"] = options[:instance_type] unless options[:instance_type].nil?
|
64
|
-
params["Placement.AvailabilityZone"] = options[:availability_zone] unless options[:availability_zone].nil?
|
65
|
-
params["KernelId"] = options[:kernel_id] unless options[:kernel_id].nil?
|
66
|
-
params["RamdiskId"] = options[:ramdisk_id] unless options[:ramdisk_id].nil?
|
67
|
-
params["Monitoring.Enabled"] = options[:monitoring_enabled].to_s unless options[:monitoring_enabled].nil?
|
68
|
-
params["SubnetId"] = options[:subnet_id] unless options[:subnet_id].nil?
|
69
|
-
params["DisableApiTermination"] = options[:disable_api_termination].to_s unless options[:disable_api_termination].nil?
|
70
|
-
params["InstanceInitiatedShutdownBehavior"] = options[:instance_initiated_shutdown_behavior] unless options[:instance_initiated_shutdown_behavior].nil?
|
71
|
-
|
72
|
-
return response_generator(:action => "RunInstances", :params => params)
|
73
|
-
end
|
74
|
-
|
75
|
-
# If :user_data is passed in then URL escape and Base64 encode it
|
76
|
-
# as needed. Need for URL Escape + Base64 encoding is determined
|
77
|
-
# by :base64_encoded param.
|
78
|
-
def extract_user_data( options = {} )
|
79
|
-
return unless options[:user_data]
|
80
|
-
if options[:user_data]
|
81
|
-
if options[:base64_encoded]
|
82
|
-
Base64.encode64(options[:user_data]).gsub(/\n/,"").strip()
|
83
|
-
else
|
84
|
-
options[:user_data]
|
85
|
-
end
|
86
|
-
end
|
87
|
-
end
|
88
|
-
|
89
|
-
|
90
|
-
# The DescribeInstances operation returns information about instances owned by the user
|
91
|
-
# making the request.
|
92
|
-
#
|
93
|
-
# An optional list of instance IDs may be provided to request information for those instances only. If no
|
94
|
-
# instance IDs are provided, information of all relevant instances information will be returned. If an
|
95
|
-
# instance is specified that does not exist a fault is returned. If an instance is specified that exists but is not
|
96
|
-
# owned by the user making the request, then that instance will not be included in the returned results.
|
97
|
-
#
|
98
|
-
# Recently terminated instances will be included in the returned results for a small interval subsequent to
|
99
|
-
# their termination. This interval is typically of the order of one hour
|
100
|
-
#
|
101
|
-
# @option options [Array] :instance_id ([])
|
102
|
-
#
|
103
|
-
def describe_instances( options = {} )
|
104
|
-
options = { :instance_id => [] }.merge(options)
|
105
|
-
params = pathlist("InstanceId", options[:instance_id])
|
106
|
-
return response_generator(:action => "DescribeInstances", :params => params)
|
107
|
-
end
|
108
|
-
|
109
|
-
|
110
|
-
# Not yet implemented
|
111
|
-
#
|
112
|
-
# @todo Implement this method
|
113
|
-
#
|
114
|
-
def describe_instance_attribute( options = {} )
|
115
|
-
raise "Not yet implemented"
|
116
|
-
end
|
117
|
-
|
118
|
-
|
119
|
-
# Not yet implemented
|
120
|
-
#
|
121
|
-
# @todo Implement this method
|
122
|
-
#
|
123
|
-
def modify_instance_attribute( options = {} )
|
124
|
-
raise "Not yet implemented"
|
125
|
-
end
|
126
|
-
|
127
|
-
|
128
|
-
# Not yet implemented
|
129
|
-
#
|
130
|
-
# @todo Implement this method
|
131
|
-
#
|
132
|
-
def reset_instance_attribute( options = {} )
|
133
|
-
raise "Not yet implemented"
|
134
|
-
end
|
135
|
-
|
136
|
-
|
137
|
-
# Starts an instance that uses an Amazon EBS volume as its root device.
|
138
|
-
#
|
139
|
-
# @option options [Array] :instance_id ([]) Array of unique instance ID's of stopped instances.
|
140
|
-
#
|
141
|
-
def start_instances( options = {} )
|
142
|
-
options = { :instance_id => [] }.merge(options)
|
143
|
-
raise ArgumentError, "No :instance_id provided" if options[:instance_id].nil? || options[:instance_id].empty?
|
144
|
-
params = {}
|
145
|
-
params.merge!(pathlist("InstanceId", options[:instance_id]))
|
146
|
-
return response_generator(:action => "StartInstances", :params => params)
|
147
|
-
end
|
148
|
-
|
149
|
-
|
150
|
-
# Stops an instance that uses an Amazon EBS volume as its root device.
|
151
|
-
#
|
152
|
-
# @option options [Array] :instance_id ([]) Unique instance ID of a running instance.
|
153
|
-
# @option options [optional, Boolean] :force (false) Forces the instance to stop. The instance will not have an opportunity to flush file system caches nor file system meta data. If you use this option, you must perform file system check and repair procedures. This option is not recommended for Windows instances.
|
154
|
-
#
|
155
|
-
def stop_instances( options = {} )
|
156
|
-
options = { :instance_id => [] }.merge(options)
|
157
|
-
raise ArgumentError, "No :instance_id provided" if options[:instance_id].nil? || options[:instance_id].empty?
|
158
|
-
raise ArgumentError, ":force must be 'true' or 'false'" unless options[:force].nil? || [true, false].include?(options[:force])
|
159
|
-
params = {}
|
160
|
-
params.merge!(pathlist("InstanceId", options[:instance_id]))
|
161
|
-
params["Force"] = options[:force].to_s unless options[:force].nil?
|
162
|
-
return response_generator(:action => "StopInstances", :params => params)
|
163
|
-
end
|
164
|
-
|
165
|
-
|
166
|
-
# The RebootInstances operation requests a reboot of one or more instances. This operation is
|
167
|
-
# asynchronous; it only queues a request to reboot the specified instance(s). The operation will succeed
|
168
|
-
# provided the instances are valid and belong to the user. Terminated instances will be ignored.
|
169
|
-
#
|
170
|
-
# @option options [Array] :instance_id ([])
|
171
|
-
#
|
172
|
-
def reboot_instances( options = {} )
|
173
|
-
options = { :instance_id => [] }.merge(options)
|
174
|
-
raise ArgumentError, "No instance IDs provided" if options[:instance_id].nil? || options[:instance_id].empty?
|
175
|
-
params = pathlist("InstanceId", options[:instance_id])
|
176
|
-
return response_generator(:action => "RebootInstances", :params => params)
|
177
|
-
end
|
178
|
-
|
179
|
-
|
180
|
-
# The TerminateInstances operation shuts down one or more instances. This operation is idempotent
|
181
|
-
# and terminating an instance that is in the process of shutting down (or already terminated) will succeed.
|
182
|
-
# Terminated instances remain visible for a short period of time (approximately one hour) after
|
183
|
-
# termination, after which their instance ID is invalidated.
|
184
|
-
#
|
185
|
-
# @option options [Array] :instance_id ([])
|
186
|
-
#
|
187
|
-
def terminate_instances( options = {} )
|
188
|
-
options = { :instance_id => [] }.merge(options)
|
189
|
-
raise ArgumentError, "No :instance_id provided" if options[:instance_id].nil? || options[:instance_id].empty?
|
190
|
-
params = pathlist("InstanceId", options[:instance_id])
|
191
|
-
return response_generator(:action => "TerminateInstances", :params => params)
|
192
|
-
end
|
193
|
-
|
194
|
-
|
195
|
-
# The MonitorInstances operation tells Cloudwatch to begin logging metrics from one or more EC2 instances
|
196
|
-
#
|
197
|
-
# @option options [Array] :instance_id ([])
|
198
|
-
#
|
199
|
-
def monitor_instances( options = {} )
|
200
|
-
options = { :instance_id => [] }.merge(options)
|
201
|
-
raise ArgumentError, "No :instance_id provided" if options[:instance_id].nil? || options[:instance_id].empty?
|
202
|
-
params = pathlist("InstanceId", options[:instance_id])
|
203
|
-
return response_generator(:action => "MonitorInstances", :params => params)
|
204
|
-
end
|
205
|
-
|
206
|
-
|
207
|
-
# The UnmonitorInstances operation tells Cloudwatch to stop logging metrics from one or more EC2 instances
|
208
|
-
#
|
209
|
-
# @option options [Array] :instance_id ([])
|
210
|
-
#
|
211
|
-
def unmonitor_instances( options = {} )
|
212
|
-
options = { :instance_id => [] }.merge(options)
|
213
|
-
raise ArgumentError, "No :instance_id provided" if options[:instance_id].nil? || options[:instance_id].empty?
|
214
|
-
params = pathlist("InstanceId", options[:instance_id])
|
215
|
-
return response_generator(:action => "UnmonitorInstances", :params => params)
|
216
|
-
end
|
217
|
-
|
218
|
-
|
219
|
-
# Not yet implemented
|
220
|
-
#
|
221
|
-
# @todo Implement this method
|
222
|
-
#
|
223
|
-
def describe_reserved_instances( options = {} )
|
224
|
-
raise "Not yet implemented"
|
225
|
-
end
|
226
|
-
|
227
|
-
|
228
|
-
# Not yet implemented
|
229
|
-
#
|
230
|
-
# @todo Implement this method
|
231
|
-
#
|
232
|
-
def describe_reserved_instances_offerings( options = {} )
|
233
|
-
raise "Not yet implemented"
|
234
|
-
end
|
235
|
-
|
236
|
-
|
237
|
-
# Not yet implemented
|
238
|
-
#
|
239
|
-
# @todo Implement this method
|
240
|
-
#
|
241
|
-
def purchase_reserved_instances_offering( options = {} )
|
242
|
-
raise "Not yet implemented"
|
243
|
-
end
|
244
|
-
|
245
|
-
|
246
|
-
end
|
247
|
-
end
|
248
|
-
end
|
249
|
-
|
@@ -1,47 +0,0 @@
|
|
1
|
-
module AWS
|
2
|
-
module EC2
|
3
|
-
class Base < AWS::Base
|
4
|
-
|
5
|
-
|
6
|
-
# The CreateKeyPair operation creates a new 2048 bit RSA keypair and returns a unique ID that can be
|
7
|
-
# used to reference this keypair when launching new instances.
|
8
|
-
#
|
9
|
-
# @option options [String] :key_name ("")
|
10
|
-
#
|
11
|
-
def create_keypair( options = {} )
|
12
|
-
options = { :key_name => "" }.merge(options)
|
13
|
-
raise ArgumentError, "No :key_name provided" if options[:key_name].nil? || options[:key_name].empty?
|
14
|
-
params = { "KeyName" => options[:key_name] }
|
15
|
-
return response_generator(:action => "CreateKeyPair", :params => params)
|
16
|
-
end
|
17
|
-
|
18
|
-
|
19
|
-
# The DescribeKeyPairs operation returns information about keypairs available for use by the user
|
20
|
-
# making the request. Selected keypairs may be specified or the list may be left empty if information for
|
21
|
-
# all registered keypairs is required.
|
22
|
-
#
|
23
|
-
# @option options [Array] :key_name ([])
|
24
|
-
#
|
25
|
-
def describe_keypairs( options = {} )
|
26
|
-
options = { :key_name => [] }.merge(options)
|
27
|
-
params = pathlist("KeyName", options[:key_name] )
|
28
|
-
return response_generator(:action => "DescribeKeyPairs", :params => params)
|
29
|
-
end
|
30
|
-
|
31
|
-
|
32
|
-
# The DeleteKeyPair operation deletes a keypair.
|
33
|
-
#
|
34
|
-
# @option options [String] :key_name ("")
|
35
|
-
#
|
36
|
-
def delete_keypair( options = {} )
|
37
|
-
options = { :key_name => "" }.merge(options)
|
38
|
-
raise ArgumentError, "No :key_name provided" if options[:key_name].nil? || options[:key_name].empty?
|
39
|
-
params = { "KeyName" => options[:key_name] }
|
40
|
-
return response_generator(:action => "DeleteKeyPair", :params => params)
|
41
|
-
end
|
42
|
-
|
43
|
-
|
44
|
-
end
|
45
|
-
end
|
46
|
-
end
|
47
|
-
|
@@ -1,21 +0,0 @@
|
|
1
|
-
module AWS
|
2
|
-
module EC2
|
3
|
-
class Base < AWS::Base
|
4
|
-
|
5
|
-
# The ConfirmProductInstance operation returns true if the given product code is attached to the instance
|
6
|
-
# with the given instance id. False is returned if the product code is not attached to the instance.
|
7
|
-
#
|
8
|
-
# @option options [String] :product_code ("")
|
9
|
-
# @option options [String] :instance_id ("")
|
10
|
-
#
|
11
|
-
def confirm_product_instance( options ={} )
|
12
|
-
options = {:product_code => "", :instance_id => ""}.merge(options)
|
13
|
-
raise ArgumentError, "No product code provided" if options[:product_code].nil? || options[:product_code].empty?
|
14
|
-
raise ArgumentError, "No instance ID provided" if options[:instance_id].nil? || options[:instance_id].empty?
|
15
|
-
params = { "ProductCode" => options[:product_code], "InstanceId" => options[:instance_id] }
|
16
|
-
return response_generator(:action => "ConfirmProductInstance", :params => params)
|
17
|
-
end
|
18
|
-
|
19
|
-
end
|
20
|
-
end
|
21
|
-
end
|
@@ -1,164 +0,0 @@
|
|
1
|
-
module AWS
|
2
|
-
module EC2
|
3
|
-
class Base < AWS::Base
|
4
|
-
|
5
|
-
|
6
|
-
# The CreateSecurityGroup operation creates a new security group. Every instance is launched
|
7
|
-
# in a security group. If none is specified as part of the launch request then instances
|
8
|
-
# are launched in the default security group. Instances within the same security group have
|
9
|
-
# unrestricted network access to one another. Instances will reject network access attempts from other
|
10
|
-
# instances in a different security group. As the owner of instances you may grant or revoke specific
|
11
|
-
# permissions using the AuthorizeSecurityGroupIngress and RevokeSecurityGroupIngress operations.
|
12
|
-
#
|
13
|
-
# @option options [String] :group_name ("")
|
14
|
-
# @option options [String] :group_description ("")
|
15
|
-
#
|
16
|
-
def create_security_group( options = {} )
|
17
|
-
options = {:group_name => "",
|
18
|
-
:group_description => ""
|
19
|
-
}.merge(options)
|
20
|
-
raise ArgumentError, "No :group_name provided" if options[:group_name].nil? || options[:group_name].empty?
|
21
|
-
raise ArgumentError, "No :group_description provided" if options[:group_description].nil? || options[:group_description].empty?
|
22
|
-
params = {
|
23
|
-
"GroupName" => options[:group_name],
|
24
|
-
"GroupDescription" => options[:group_description]
|
25
|
-
}
|
26
|
-
return response_generator(:action => "CreateSecurityGroup", :params => params)
|
27
|
-
end
|
28
|
-
|
29
|
-
|
30
|
-
# The DescribeSecurityGroups operation returns information about security groups owned by the
|
31
|
-
# user making the request.
|
32
|
-
#
|
33
|
-
# An optional list of security group names may be provided to request information for those security
|
34
|
-
# groups only. If no security group names are provided, information of all security groups will be
|
35
|
-
# returned. If a group is specified that does not exist an exception is returned.
|
36
|
-
#
|
37
|
-
# @option options [optional, Array] :group_name ([])
|
38
|
-
#
|
39
|
-
def describe_security_groups( options = {} )
|
40
|
-
options = { :group_name => [] }.merge(options)
|
41
|
-
params = pathlist("GroupName", options[:group_name] )
|
42
|
-
return response_generator(:action => "DescribeSecurityGroups", :params => params)
|
43
|
-
end
|
44
|
-
|
45
|
-
|
46
|
-
# The DeleteSecurityGroup operation deletes a security group.
|
47
|
-
#
|
48
|
-
# If an attempt is made to delete a security group and any instances exist that are members of that group a
|
49
|
-
# fault is returned.
|
50
|
-
#
|
51
|
-
# @option options [String] :group_name ("")
|
52
|
-
#
|
53
|
-
def delete_security_group( options = {} )
|
54
|
-
options = { :group_name => "" }.merge(options)
|
55
|
-
raise ArgumentError, "No :group_name provided" if options[:group_name].nil? || options[:group_name].empty?
|
56
|
-
params = { "GroupName" => options[:group_name] }
|
57
|
-
return response_generator(:action => "DeleteSecurityGroup", :params => params)
|
58
|
-
end
|
59
|
-
|
60
|
-
|
61
|
-
# The AuthorizeSecurityGroupIngress operation adds permissions to a security group.
|
62
|
-
#
|
63
|
-
# Permissions are specified in terms of the IP protocol (TCP, UDP or ICMP), the source of the request (by
|
64
|
-
# IP range or an Amazon EC2 user-group pair), source and destination port ranges (for TCP and UDP),
|
65
|
-
# and ICMP codes and types (for ICMP). When authorizing ICMP, -1 may be used as a wildcard in the
|
66
|
-
# type and code fields.
|
67
|
-
#
|
68
|
-
# Permission changes are propagated to instances within the security group being modified as quickly as
|
69
|
-
# possible. However, a small delay is likely, depending on the number of instances that are members of
|
70
|
-
# the indicated group.
|
71
|
-
#
|
72
|
-
# When authorizing a user/group pair permission, GroupName, SourceSecurityGroupName and
|
73
|
-
# SourceSecurityGroupOwnerId must be specified. When authorizing a CIDR IP permission,
|
74
|
-
# GroupName, IpProtocol, FromPort, ToPort and CidrIp must be specified. Mixing these two types
|
75
|
-
# of parameters is not allowed.
|
76
|
-
#
|
77
|
-
# @option options [String] :group_name ("")
|
78
|
-
# @option options [optional, String] :ip_protocol (nil) Required when authorizing CIDR IP permission
|
79
|
-
# @option options [optional, Integer] :from_port (nil) Required when authorizing CIDR IP permission
|
80
|
-
# @option options [optional, Integer] :to_port (nil) Required when authorizing CIDR IP permission
|
81
|
-
# @option options [optional, String] :cidr_ip (nil) Required when authorizing CIDR IP permission
|
82
|
-
# @option options [optional, String] :source_security_group_name (nil) Required when authorizing user group pair permissions
|
83
|
-
# @option options [optional, String] :source_security_group_owner_id (nil) Required when authorizing user group pair permissions
|
84
|
-
#
|
85
|
-
def authorize_security_group_ingress( options = {} )
|
86
|
-
options = { :group_name => nil,
|
87
|
-
:ip_protocol => nil,
|
88
|
-
:from_port => nil,
|
89
|
-
:to_port => nil,
|
90
|
-
:cidr_ip => nil,
|
91
|
-
:source_security_group_name => nil,
|
92
|
-
:source_security_group_owner_id => nil }.merge(options)
|
93
|
-
|
94
|
-
# lets not validate the rest of the possible permutations of required params and instead let
|
95
|
-
# EC2 sort it out on the server side. We'll only require :group_name as that is always needed.
|
96
|
-
raise ArgumentError, "No :group_name provided" if options[:group_name].nil? || options[:group_name].empty?
|
97
|
-
|
98
|
-
params = { "GroupName" => options[:group_name],
|
99
|
-
"IpProtocol" => options[:ip_protocol],
|
100
|
-
"FromPort" => options[:from_port].to_s,
|
101
|
-
"ToPort" => options[:to_port].to_s,
|
102
|
-
"CidrIp" => options[:cidr_ip],
|
103
|
-
"SourceSecurityGroupName" => options[:source_security_group_name],
|
104
|
-
"SourceSecurityGroupOwnerId" => options[:source_security_group_owner_id]
|
105
|
-
}
|
106
|
-
return response_generator(:action => "AuthorizeSecurityGroupIngress", :params => params)
|
107
|
-
end
|
108
|
-
|
109
|
-
|
110
|
-
# The RevokeSecurityGroupIngress operation revokes existing permissions that were previously
|
111
|
-
# granted to a security group. The permissions to revoke must be specified using the same values
|
112
|
-
# originally used to grant the permission.
|
113
|
-
#
|
114
|
-
# Permissions are specified in terms of the IP protocol (TCP, UDP or ICMP), the source of the request (by
|
115
|
-
# IP range or an Amazon EC2 user-group pair), source and destination port ranges (for TCP and UDP),
|
116
|
-
# and ICMP codes and types (for ICMP). When authorizing ICMP, -1 may be used as a wildcard in the
|
117
|
-
# type and code fields.
|
118
|
-
#
|
119
|
-
# Permission changes are propagated to instances within the security group being modified as quickly as
|
120
|
-
# possible. However, a small delay is likely, depending on the number of instances that are members of
|
121
|
-
# the indicated group.
|
122
|
-
#
|
123
|
-
# When revoking a user/group pair permission, GroupName, SourceSecurityGroupName and
|
124
|
-
# SourceSecurityGroupOwnerId must be specified. When authorizing a CIDR IP permission,
|
125
|
-
# GroupName, IpProtocol, FromPort, ToPort and CidrIp must be specified. Mixing these two types
|
126
|
-
# of parameters is not allowed.
|
127
|
-
#
|
128
|
-
# @option options [String] :group_name ("")
|
129
|
-
# @option options [optional, String] :ip_protocol (nil) Required when revoking CIDR IP permission
|
130
|
-
# @option options [optional, Integer] :from_port (nil) Required when revoking CIDR IP permission
|
131
|
-
# @option options [optional, Integer] :to_port (nil) Required when revoking CIDR IP permission
|
132
|
-
# @option options [optional, String] :cidr_ip (nil) Required when revoking CIDR IP permission
|
133
|
-
# @option options [optional, String] :source_security_group_name (nil) Required when revoking user group pair permissions
|
134
|
-
# @option options [optional, String] :source_security_group_owner_id (nil) Required when revoking user group pair permissions
|
135
|
-
#
|
136
|
-
def revoke_security_group_ingress( options = {} )
|
137
|
-
options = { :group_name => nil,
|
138
|
-
:ip_protocol => nil,
|
139
|
-
:from_port => nil,
|
140
|
-
:to_port => nil,
|
141
|
-
:cidr_ip => nil,
|
142
|
-
:source_security_group_name => nil,
|
143
|
-
:source_security_group_owner_id => nil }.merge(options)
|
144
|
-
|
145
|
-
# lets not validate the rest of the possible permutations of required params and instead let
|
146
|
-
# EC2 sort it out on the server side. We'll only require :group_name as that is always needed.
|
147
|
-
raise ArgumentError, "No :group_name provided" if options[:group_name].nil? || options[:group_name].empty?
|
148
|
-
|
149
|
-
params = { "GroupName" => options[:group_name],
|
150
|
-
"IpProtocol" => options[:ip_protocol],
|
151
|
-
"FromPort" => options[:from_port].to_s,
|
152
|
-
"ToPort" => options[:to_port].to_s,
|
153
|
-
"CidrIp" => options[:cidr_ip],
|
154
|
-
"SourceSecurityGroupName" => options[:source_security_group_name],
|
155
|
-
"SourceSecurityGroupOwnerId" => options[:source_security_group_owner_id]
|
156
|
-
}
|
157
|
-
return response_generator(:action => "RevokeSecurityGroupIngress", :params => params)
|
158
|
-
end
|
159
|
-
|
160
|
-
|
161
|
-
end
|
162
|
-
end
|
163
|
-
end
|
164
|
-
|
@@ -1,80 +0,0 @@
|
|
1
|
-
module AWS
|
2
|
-
module EC2
|
3
|
-
|
4
|
-
class Base < AWS::Base
|
5
|
-
|
6
|
-
|
7
|
-
# The DescribeSnapshots operation describes the status of Amazon EBS snapshots.
|
8
|
-
#
|
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.
|
12
|
-
#
|
13
|
-
def describe_snapshots( options = {} )
|
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?
|
18
|
-
return response_generator(:action => "DescribeSnapshots", :params => params)
|
19
|
-
end
|
20
|
-
|
21
|
-
|
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.
|
23
|
-
#
|
24
|
-
# @option options [String] :volume_id ('')
|
25
|
-
#
|
26
|
-
def create_snapshot( options = {} )
|
27
|
-
options = { :volume_id => '' }.merge(options)
|
28
|
-
raise ArgumentError, "No :volume_id provided" if options[:volume_id].nil? || options[:volume_id].empty?
|
29
|
-
params = {
|
30
|
-
"VolumeId" => options[:volume_id]
|
31
|
-
}
|
32
|
-
return response_generator(:action => "CreateSnapshot", :params => params)
|
33
|
-
end
|
34
|
-
|
35
|
-
|
36
|
-
# The DeleteSnapshot operation deletes a snapshot of an Amazon EBS volume that is stored in Amazon S3.
|
37
|
-
#
|
38
|
-
# @option options [String] :snapshot_id ('')
|
39
|
-
#
|
40
|
-
def delete_snapshot( options = {} )
|
41
|
-
options = { :snapshot_id => '' }.merge(options)
|
42
|
-
raise ArgumentError, "No :snapshot_id provided" if options[:snapshot_id].nil? || options[:snapshot_id].empty?
|
43
|
-
params = {
|
44
|
-
"SnapshotId" => options[:snapshot_id]
|
45
|
-
}
|
46
|
-
return response_generator(:action => "DeleteSnapshot", :params => params)
|
47
|
-
end
|
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"
|
65
|
-
end
|
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
|
-
|
77
|
-
end
|
78
|
-
end
|
79
|
-
end
|
80
|
-
|
@@ -1,100 +0,0 @@
|
|
1
|
-
module AWS
|
2
|
-
module EC2
|
3
|
-
class Base < AWS::Base
|
4
|
-
|
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.
|
7
|
-
#
|
8
|
-
# @option options [optional, String] :volume_id ([])
|
9
|
-
#
|
10
|
-
def describe_volumes( options = {} )
|
11
|
-
options = { :volume_id => [] }.merge(options)
|
12
|
-
params = pathlist("VolumeId", options[:volume_id] )
|
13
|
-
return response_generator(:action => "DescribeVolumes", :params => params)
|
14
|
-
end
|
15
|
-
|
16
|
-
|
17
|
-
# The CreateVolume operation creates a new Amazon EBS volume that you can mount from any Amazon EC2 instance.
|
18
|
-
#
|
19
|
-
# @option options [String] :availability_zone ('')
|
20
|
-
# @option options [optional, String] :size ('')
|
21
|
-
# @option options [optional, String] :snapshot_id ('')
|
22
|
-
#
|
23
|
-
def create_volume( options = {} )
|
24
|
-
options = { :availability_zone => '' }.merge(options)
|
25
|
-
raise ArgumentError, "No :availability_zone provided" if options[:availability_zone].nil? || options[:availability_zone].empty?
|
26
|
-
options = { :size => '' }.merge(options)
|
27
|
-
options = { :snapshot_id => '' }.merge(options)
|
28
|
-
params = {
|
29
|
-
"AvailabilityZone" => options[:availability_zone],
|
30
|
-
"Size" => options[:size],
|
31
|
-
"SnapshotId" => options[:snapshot_id]
|
32
|
-
}
|
33
|
-
return response_generator(:action => "CreateVolume", :params => params)
|
34
|
-
end
|
35
|
-
|
36
|
-
|
37
|
-
# The DeleteVolume operation deletes an Amazon EBS volume.
|
38
|
-
#
|
39
|
-
# @option options [String] :volume_id ('')
|
40
|
-
#
|
41
|
-
def delete_volume( options = {} )
|
42
|
-
options = { :volume_id => '' }.merge(options)
|
43
|
-
raise ArgumentError, "No :volume_id provided" if options[:volume_id].nil? || options[:volume_id].empty?
|
44
|
-
params = {
|
45
|
-
"VolumeId" => options[:volume_id]
|
46
|
-
}
|
47
|
-
return response_generator(:action => "DeleteVolume", :params => params)
|
48
|
-
end
|
49
|
-
|
50
|
-
|
51
|
-
# The AttachVolume operation attaches an Amazon EBS volume to an instance.
|
52
|
-
#
|
53
|
-
# @option options [String] :volume_id ('')
|
54
|
-
# @option options [String] :instance_id ('')
|
55
|
-
# @option options [String] :device ('')
|
56
|
-
#
|
57
|
-
def attach_volume( options = {} )
|
58
|
-
options = { :volume_id => '' }.merge(options)
|
59
|
-
options = { :instance_id => '' }.merge(options)
|
60
|
-
options = { :device => '' }.merge(options)
|
61
|
-
raise ArgumentError, "No :volume_id provided" if options[:volume_id].nil? || options[:volume_id].empty?
|
62
|
-
raise ArgumentError, "No :instance_id provided" if options[:instance_id].nil? || options[:instance_id].empty?
|
63
|
-
raise ArgumentError, "No :device provided" if options[:device].nil? || options[:device].empty?
|
64
|
-
|
65
|
-
params = {
|
66
|
-
"VolumeId" => options[:volume_id],
|
67
|
-
"InstanceId" => options[:instance_id],
|
68
|
-
"Device" => options[:device]
|
69
|
-
}
|
70
|
-
return response_generator(:action => "AttachVolume", :params => params)
|
71
|
-
end
|
72
|
-
|
73
|
-
|
74
|
-
# The DetachVolume operation detaches an Amazon EBS volume from an instance.
|
75
|
-
#
|
76
|
-
# @option options [String] :volume_id ('')
|
77
|
-
# @option options [optional, String] :instance_id ('')
|
78
|
-
# @option options [optional, String] :device ('')
|
79
|
-
# @option options [optional, Boolean] :force ('')
|
80
|
-
#
|
81
|
-
def detach_volume( options = {} )
|
82
|
-
options = { :volume_id => '' }.merge(options)
|
83
|
-
raise ArgumentError, "No :volume_id provided" if options[:volume_id].nil? || options[:volume_id].empty?
|
84
|
-
options = { :instance_id => '' }.merge(options)
|
85
|
-
options = { :device => '' }.merge(options)
|
86
|
-
options = { :force => '' }.merge(options)
|
87
|
-
params = {
|
88
|
-
"VolumeId" => options[:volume_id],
|
89
|
-
"InstanceId" => options[:instance_id],
|
90
|
-
"Device" => options[:device],
|
91
|
-
"Force" => options[:force]
|
92
|
-
}
|
93
|
-
return response_generator(:action => "DetachVolume", :params => params)
|
94
|
-
end
|
95
|
-
|
96
|
-
|
97
|
-
end
|
98
|
-
end
|
99
|
-
end
|
100
|
-
|