Class AWS::Base
In: lib/AWS.rb
Parent: Object

This class provides all the methods for using the EC2 or ELB service including the handling of header signing and other security concerns. This class uses the Net::HTTP library to interface with the AWS Query API interface. You should not instantiate this directly, instead you should setup an instance of ‘AWS::EC2::Base’ or ‘AWS::ELB::Base’.

Methods

Attributes

port  [R] 
proxy_server  [R] 
server  [R] 
use_ssl  [R] 

Public Class methods

@option options [String] :access_key_id ("") The user‘s AWS Access Key ID @option options [String] :secret_access_key ("") The user‘s AWS Secret Access Key @option options [Boolean] :use_ssl (true) Connect using SSL? @option options [String] :server ("ec2.amazonaws.com") The server API endpoint host @option options [String] :proxy_server (nil) An HTTP proxy server FQDN @return [Object] the object.

Public Instance methods

If :user_data is passed in then URL escape and Base64 encode it as needed. Need for URL Escape + Base64 encoding is determined by :base64_encoded param.

Protected Instance methods

Raises the appropriate error if the specified Net::HTTPResponse object contains an AWS error; returns false otherwise.

Set the Authorization header using AWS signed header authentication

Make the connection to AWS EC2 passing in our request. This is generally called from within a ‘Response’ class object or one of its sub-classes so the response is interpreted in its proper context. See lib/EC2/responses.rb

Same as pathlist except it deals with arrays of hashes. So if you pass in args ("People", [{:name=>’jon’, :age=>’22’}, {:name=>’chris’}], {:name => ‘Name’, :age => ‘Age’}) you should get {"People.1.Name"=>"jon", "People.1.Age"=>’22’, ‘People.2.Name’=>’chris’}

Same as pathhashlist except it generates explicit <prefix>.Key= and <prefix>.Value or <prefix>.Value.1, <prefix>.Value.2 depending on whether the value is a scalar or an array.

So if you pass in args ("People", [{:name=>’jon’}, {:names=>[‘chris’, ‘bob’]} with key_name = ‘Key’ and value_name = ‘Value’, you should get {"People.1.Key"=>"name", "People.1.Value"=>’jon’, "People.2.Key"=>’names’, ‘People.2.Value.1’=>’chris’, ‘People.2.Value.2’=>’bob’}

pathlist is a utility method which takes a key string and and array as input. It converts the array into a Hash with the hash key being ‘Key.n’ where ‘n’ increments by 1 for each iteration. So if you pass in args ("ImageId", ["123", "456"]) you should get {"ImageId.1"=>"123", "ImageId.2"=>"456"} returned.

allow us to have a one line call in each method which will do all of the work in making the actual request to AWS.

[Validate]