Skip to content

Commit

Permalink
Added stubs for unimplemented methods in most recent API. Whitespace …
Browse files Browse the repository at this point in the history
…cleanup.
  • Loading branch information
grempe committed Dec 4, 2009
1 parent 26d963b commit f38dbae
Show file tree
Hide file tree
Showing 10 changed files with 207 additions and 134 deletions.
8 changes: 8 additions & 0 deletions lib/AWS/EC2/availability_zones.rb
Expand Up @@ -15,6 +15,14 @@ def describe_availability_zones( options = {} )
return response_generator(:action => "DescribeAvailabilityZones", :params => params)
end

# Not yet implemented
#
# @todo Implement this method
#
def describe_regions( options = {} )
raise "Not yet implemented"
end

end
end
end
Expand Down
2 changes: 2 additions & 0 deletions lib/AWS/EC2/console.rb
Expand Up @@ -2,6 +2,7 @@ module AWS
module EC2
class Base < AWS::Base


# The GetConsoleOutput operation retrieves console output that has been posted for the specified instance.
#
# Instance console output is buffered and posted shortly after instance boot, reboot and once the instance
Expand All @@ -17,6 +18,7 @@ def get_console_output( options = {} )
return response_generator(:action => "GetConsoleOutput", :params => params)
end


end
end
end
Expand Down
18 changes: 18 additions & 0 deletions lib/AWS/EC2/devpay.rb
@@ -0,0 +1,18 @@
module AWS
module EC2
class Base < AWS::Base


# Not yet implemented
#
# @todo Implement this method
#
def confirm_product_instance( options = {} )
raise "Not yet implemented"
end


end
end
end

69 changes: 37 additions & 32 deletions lib/AWS/EC2/elastic_ips.rb
Expand Up @@ -2,43 +2,13 @@ module AWS
module EC2
class Base < AWS::Base


# The AllocateAddress operation acquires an elastic IP address for use with your account.
#
def allocate_address
return response_generator(:action => "AllocateAddress")
end

# The DescribeAddresses operation lists elastic IP addresses assigned to your account.
#
# @option options [Array] :public_ip ([]) an IP address to be described
#
def describe_addresses( options = {} )
options = { :public_ip => [] }.merge(options)
params = pathlist("PublicIp", options[:public_ip])
return response_generator(:action => "DescribeAddresses", :params => params)
end

# The ReleaseAddress operation releases an elastic IP address associated with your account.
#
# If you run this operation on an elastic IP address that is already released, the address
# might be assigned to another account which will cause Amazon EC2 to return an error.
#
# Note : Releasing an IP address automatically disassociates it from any instance
# with which it is associated. For more information, see DisassociateAddress.
#
# Important! After releasing an elastic IP address, it is released to the IP
# address pool and might no longer be available to your account. Make sure
# to update your DNS records and any servers or devices that communicate
# with the address.
#
# @option options [String] :public_ip ('') an IP address to be released.
#
def release_address( options = {} )
options = { :public_ip => '' }.merge(options)
raise ArgumentError, "No ':public_ip' provided" if options[:public_ip].nil? || options[:public_ip].empty?
params = { "PublicIp" => options[:public_ip] }
return response_generator(:action => "ReleaseAddress", :params => params)
end

# The AssociateAddress operation associates an elastic IP address with an instance.
#
Expand All @@ -60,6 +30,18 @@ def associate_address( options = {} )
return response_generator(:action => "AssociateAddress", :params => params)
end


# The DescribeAddresses operation lists elastic IP addresses assigned to your account.
#
# @option options [Array] :public_ip ([]) an IP address to be described
#
def describe_addresses( options = {} )
options = { :public_ip => [] }.merge(options)
params = pathlist("PublicIp", options[:public_ip])
return response_generator(:action => "DescribeAddresses", :params => params)
end


# The DisassociateAddress operation disassociates the specified elastic IP
# address from the instance to which it is assigned. This is an idempotent
# operation. If you enter it more than once, Amazon EC2 does not return
Expand All @@ -74,8 +56,31 @@ def disassociate_address( options = {} )
return response_generator(:action => "DisassociateAddress", :params => params)
end

end

# The ReleaseAddress operation releases an elastic IP address associated with your account.
#
# If you run this operation on an elastic IP address that is already released, the address
# might be assigned to another account which will cause Amazon EC2 to return an error.
#
# Note : Releasing an IP address automatically disassociates it from any instance
# with which it is associated. For more information, see DisassociateAddress.
#
# Important! After releasing an elastic IP address, it is released to the IP
# address pool and might no longer be available to your account. Make sure
# to update your DNS records and any servers or devices that communicate
# with the address.
#
# @option options [String] :public_ip ('') an IP address to be released.
#
def release_address( options = {} )
options = { :public_ip => '' }.merge(options)
raise ArgumentError, "No ':public_ip' provided" if options[:public_ip].nil? || options[:public_ip].empty?
params = { "PublicIp" => options[:public_ip] }
return response_generator(:action => "ReleaseAddress", :params => params)
end


end
end
end

52 changes: 25 additions & 27 deletions lib/AWS/EC2/images.rb
Expand Up @@ -3,6 +3,28 @@ module EC2

class Base < AWS::Base

# Not yet implemented
#
# @todo Implement this method
#
def create_image( options = {} )
raise "Not yet implemented"
end


# The DeregisterImage operation deregisters an AMI. Once deregistered, instances of the AMI may no
# longer be launched.
#
# @option options [String] :image_id ("")
#
def deregister_image( options = {} )
options = { :image_id => "" }.merge(options)
raise ArgumentError, "No :image_id provided" if options[:image_id].nil? || options[:image_id].empty?
params = { "ImageId" => options[:image_id] }
return response_generator(:action => "DeregisterImage", :params => params)
end


# The RegisterImage operation registers an AMI with Amazon EC2. Images must be registered before
# they can be launched. Each AMI is associated with an unique ID which is provided by the EC2
# service via the Registerimage operation. As part of the registration process, Amazon EC2 will
Expand All @@ -15,17 +37,13 @@ class Base < AWS::Base
# @option options [String] :image_location ("")
#
def register_image( options = {} )

options = {:image_location => ""}.merge(options)

raise ArgumentError, "No :image_location provided" if options[:image_location].nil? || options[:image_location].empty?

params = { "ImageLocation" => options[:image_location] }

return response_generator(:action => "RegisterImage", :params => params)

end


# The DescribeImages operation returns information about AMIs available for use by the user. This
# includes both public AMIs (those available for any user to launch) and private AMIs (those owned by
# the user making the request and those owned by other users that the user making the request has explicit
Expand Down Expand Up @@ -67,35 +85,15 @@ def register_image( options = {} )
# @option options [Array] :executable_by ([])
#
def describe_images( options = {} )

options = { :image_id => [], :owner_id => [], :executable_by => [] }.merge(options)

params = pathlist( "ImageId", options[:image_id] )
params.merge!(pathlist( "Owner", options[:owner_id] ))
params.merge!(pathlist( "ExecutableBy", options[:executable_by] ))

return response_generator(:action => "DescribeImages", :params => params)

end

# The DeregisterImage operation deregisters an AMI. Once deregistered, instances of the AMI may no
# longer be launched.
#
# @option options [String] :image_id ("")
#
def deregister_image( options = {} )

options = { :image_id => "" }.merge(options)

raise ArgumentError, "No :image_id provided" if options[:image_id].nil? || options[:image_id].empty?

params = { "ImageId" => options[:image_id] }

return response_generator(:action => "DeregisterImage", :params => params)

end

end

end
end
end

73 changes: 73 additions & 0 deletions lib/AWS/EC2/instances.rb
Expand Up @@ -124,6 +124,51 @@ def describe_instances( options = {} )
end


# Not yet implemented
#
# @todo Implement this method
#
def describe_instance_attribute( options = {} )
raise "Not yet implemented"
end


# Not yet implemented
#
# @todo Implement this method
#
def modify_instance_attribute( options = {} )
raise "Not yet implemented"
end


# Not yet implemented
#
# @todo Implement this method
#
def reset_instance_attribute( options = {} )
raise "Not yet implemented"
end


# Not yet implemented
#
# @todo Implement this method
#
def start_instances( options = {} )
raise "Not yet implemented"
end


# Not yet implemented
#
# @todo Implement this method
#
def stop_instances( options = {} )
raise "Not yet implemented"
end


# The RebootInstances operation requests a reboot of one or more instances. This operation is
# asynchronous; it only queues a request to reboot the specified instance(s). The operation will succeed
# provided the instances are valid and belong to the user. Terminated instances will be ignored.
Expand Down Expand Up @@ -176,6 +221,34 @@ def unmonitor_instances( options = {} )
return response_generator(:action => "UnmonitorInstances", :params => params)
end


# Not yet implemented
#
# @todo Implement this method
#
def describe_reserved_instances( options = {} )
raise "Not yet implemented"
end


# Not yet implemented
#
# @todo Implement this method
#
def describe_reserved_instances_offerings( options = {} )
raise "Not yet implemented"
end


# Not yet implemented
#
# @todo Implement this method
#
def purchase_reserved_instances_offering( options = {} )
raise "Not yet implemented"
end


end
end
end
Expand Down
20 changes: 3 additions & 17 deletions lib/AWS/EC2/keypairs.rb
@@ -1,6 +1,5 @@
module AWS
module EC2

class Base < AWS::Base


Expand All @@ -10,15 +9,10 @@ class Base < AWS::Base
# @option options [String] :key_name ("")
#
def create_keypair( options = {} )

options = { :key_name => "" }.merge(options)

raise ArgumentError, "No :key_name provided" if options[:key_name].nil? || options[:key_name].empty?

params = { "KeyName" => options[:key_name] }

return response_generator(:action => "CreateKeyPair", :params => params)

end


Expand All @@ -29,13 +23,9 @@ def create_keypair( options = {} )
# @option options [Array] :key_name ([])
#
def describe_keypairs( options = {} )

options = { :key_name => [] }.merge(options)

params = pathlist("KeyName", options[:key_name] )

return response_generator(:action => "DescribeKeyPairs", :params => params)

end


Expand All @@ -44,18 +34,14 @@ def describe_keypairs( options = {} )
# @option options [String] :key_name ("")
#
def delete_keypair( options = {} )

options = { :key_name => "" }.merge(options)

raise ArgumentError, "No :key_name provided" if options[:key_name].nil? || options[:key_name].empty?

params = { "KeyName" => options[:key_name] }

return response_generator(:action => "DeleteKeyPair", :params => params)

end

end

end
end
end
end

0 comments on commit f38dbae

Please sign in to comment.