Module AWS
In: lib/AWS.rb
lib/AWS/Autoscaling.rb
lib/AWS/Autoscaling/autoscaling.rb
lib/AWS/Cloudwatch.rb
lib/AWS/Cloudwatch/monitoring.rb
lib/AWS/EC2.rb
lib/AWS/EC2/availability_zones.rb
lib/AWS/EC2/console.rb
lib/AWS/EC2/devpay.rb
lib/AWS/EC2/elastic_ips.rb
lib/AWS/EC2/image_attributes.rb
lib/AWS/EC2/images.rb
lib/AWS/EC2/instances.rb
lib/AWS/EC2/keypairs.rb
lib/AWS/EC2/products.rb
lib/AWS/EC2/security_groups.rb
lib/AWS/EC2/snapshots.rb
lib/AWS/EC2/spot_instance_requests.rb
lib/AWS/EC2/spot_prices.rb
lib/AWS/EC2/subnets.rb
lib/AWS/EC2/volumes.rb
lib/AWS/ELB.rb
lib/AWS/ELB/load_balancers.rb
lib/AWS/RDS.rb
lib/AWS/RDS/rds.rb
lib/AWS/exceptions.rb
lib/AWS/responses.rb
Error InvalidClientTokenId InsufficientAddressCapacity InternalError InvalidVolumeIDDuplicate InvalidReservedInstancesOfferingId InvalidReservationIDNotFound InvalidParameterValue InvalidInstanceIDMalformed InvalidInstance SnapshotLimitExceeded InvalidReservationIDMalformed InvalidInstanceIDNotFound InvalidAttachmentNotFound ArgumentError SignatureDoesNotMatch InvalidPermissionMalformed InvalidGroupNotFound IncorrectState TooManyLoadBalancers LoadBalancerNotFound ReservedInstancesLimitExceeded InsufficientReservedInstancesCapacity InvalidAMIIDMalformed AuthFailure AttachmentLimitExceeded AddressLimitExceeded InvalidConfigurationRequest Unavailable InvalidGroupReserved InvalidGroupDuplicate InstanceLimitExceeded ValidationError InsufficientReservedInstanceCapacity InvalidVolumeIDMalformed InvalidVolumeIDNotFound InvalidPermissionDuplicate InvalidAMIIDNotFound PendingSnapshotLimitExceeded NonEBSInstance InvalidVolumeIDZoneMismatch InvalidReservedInstancesId InvalidManifest InvalidGroupInUse InvalidKeyPairNotFound InvalidAMIIDUnavailable DuplicateLoadBalancerName InsufficientInstanceCapacity VolumeLimitExceeded UnknownParameter InvalidZoneNotFound InvalidSnapshotIDNotFound InvalidSnapshotIDMalformed InvalidParameterCombination InvalidKeyPairDuplicate InvalidUserIDMalformed InvalidDeviceInUse InvalidAMIAttributeItemValue RuntimeError Base Base\n[lib/AWS/RDS.rb\nlib/AWS/RDS/rds.rb] Base\n[lib/AWS/Cloudwatch.rb\nlib/AWS/Cloudwatch/monitoring.rb] Base\n[lib/AWS/ELB.rb\nlib/AWS/ELB/load_balancers.rb] Base\n[lib/AWS/Autoscaling.rb\nlib/AWS/Autoscaling/autoscaling.rb] Base\n[lib/AWS/EC2.rb\nlib/AWS/EC2/availability_zones.rb\nlib/AWS/EC2/console.rb\nlib/AWS/EC2/devpay.rb\nlib/AWS/EC2/elastic_ips.rb\nlib/AWS/EC2/image_attributes.rb\nlib/AWS/EC2/images.rb\nlib/AWS/EC2/instances.rb\nlib/AWS/EC2/keypairs.rb\nlib/AWS/EC2/products.rb\nlib/AWS/EC2/security_groups.rb\nlib/AWS/EC2/snapshots.rb\nlib/AWS/EC2/spot_instance_requests.rb\nlib/AWS/EC2/spot_prices.rb\nlib/AWS/EC2/subnets.rb\nlib/AWS/EC2/volumes.rb] Response lib/AWS.rb lib/AWS/responses.rb lib/AWS/exceptions.rb lib/AWS/RDS/rds.rb RDS lib/AWS/Cloudwatch/monitoring.rb Cloudwatch lib/AWS/ELB/load_balancers.rb ELB lib/AWS/Autoscaling/autoscaling.rb Autoscaling lib/AWS/EC2/volumes.rb Instance EC2 AWS dot/m_26_0.png

Methods

Classes and Modules

Module AWS::Autoscaling
Module AWS::Cloudwatch
Module AWS::EC2
Module AWS::ELB
Module AWS::RDS
Class AWS::AddressLimitExceeded
Class AWS::ArgumentError
Class AWS::AttachmentLimitExceeded
Class AWS::AuthFailure
Class AWS::Base
Class AWS::DuplicateLoadBalancerName
Class AWS::Error
Class AWS::IncorrectState
Class AWS::InstanceLimitExceeded
Class AWS::InsufficientAddressCapacity
Class AWS::InsufficientInstanceCapacity
Class AWS::InsufficientReservedInstanceCapacity
Class AWS::InsufficientReservedInstancesCapacity
Class AWS::InternalError
Class AWS::InvalidAMIAttributeItemValue
Class AWS::InvalidAMIIDMalformed
Class AWS::InvalidAMIIDNotFound
Class AWS::InvalidAMIIDUnavailable
Class AWS::InvalidAttachmentNotFound
Class AWS::InvalidClientTokenId
Class AWS::InvalidConfigurationRequest
Class AWS::InvalidDeviceInUse
Class AWS::InvalidGroupDuplicate
Class AWS::InvalidGroupInUse
Class AWS::InvalidGroupNotFound
Class AWS::InvalidGroupReserved
Class AWS::InvalidInstance
Class AWS::InvalidInstanceIDMalformed
Class AWS::InvalidInstanceIDNotFound
Class AWS::InvalidKeyPairDuplicate
Class AWS::InvalidKeyPairNotFound
Class AWS::InvalidManifest
Class AWS::InvalidParameterCombination
Class AWS::InvalidParameterValue
Class AWS::InvalidPermissionDuplicate
Class AWS::InvalidPermissionMalformed
Class AWS::InvalidReservationIDMalformed
Class AWS::InvalidReservationIDNotFound
Class AWS::InvalidReservedInstancesId
Class AWS::InvalidReservedInstancesOfferingId
Class AWS::InvalidSnapshotIDMalformed
Class AWS::InvalidSnapshotIDNotFound
Class AWS::InvalidUserIDMalformed
Class AWS::InvalidVolumeIDDuplicate
Class AWS::InvalidVolumeIDMalformed
Class AWS::InvalidVolumeIDNotFound
Class AWS::InvalidVolumeIDZoneMismatch
Class AWS::InvalidZoneNotFound
Class AWS::LoadBalancerNotFound
Class AWS::NonEBSInstance
Class AWS::PendingSnapshotLimitExceeded
Class AWS::ReservedInstancesLimitExceeded
Class AWS::Response
Class AWS::SignatureDoesNotMatch
Class AWS::SnapshotLimitExceeded
Class AWS::TooManyLoadBalancers
Class AWS::Unavailable
Class AWS::UnknownParameter
Class AWS::ValidationError
Class AWS::VolumeLimitExceeded

Public Class methods

Builds the canonical string for signing requests. This strips out all ’&’, ’?’, and ’=’ from the query string to be signed. The parameters in the path passed in must already be sorted in case-insensitive alphabetical order and must not be url encoded.

@param [String] params the params that will be sorted and encoded as a canonical string. @param [String] host the hostname of the API endpoint. @param [String] method the HTTP method that will be used to submit the params. @param [String] base the URI path that this information will be submitted to. @return [String] the canonical request description string.

[Source]

    # File lib/AWS.rb, line 63
63:   def AWS.canonical_string(params, host, method="POST", base="/")
64:     # Sort, and encode parameters into a canonical string.
65:     sorted_params = params.sort {|x,y| x[0] <=> y[0]}
66:     encoded_params = sorted_params.collect do |p|
67:       encoded = (CGI::escape(p[0].to_s) +
68:                  "=" + CGI::escape(p[1].to_s))
69:       # Ensure spaces are encoded as '%20', not '+'
70:       encoded = encoded.gsub('+', '%20')
71:       # According to RFC3986 (the scheme for values expected by signing requests), '~' 
72:       # should not be encoded
73:       encoded = encoded.gsub('%7E', '~')
74:     end
75:     sigquery = encoded_params.join("&")
76: 
77:     # Generate the request description string
78:     req_desc =
79:       method + "\n" +
80:       host + "\n" +
81:       base + "\n" +
82:       sigquery
83: 
84:   end

Encodes the given string with the secret_access_key by taking the hmac-sha1 sum, and then base64 encoding it. Optionally, it will also url encode the result of that to protect the string if it‘s going to be used as a query string parameter.

@param [String] secret_access_key the user‘s secret access key for signing. @param [String] str the string to be hashed and encoded. @param [Boolean] urlencode whether or not to url encode the result., true or false @return [String] the signed and encoded string.

[Source]

     # File lib/AWS.rb, line 95
 95:   def AWS.encode(secret_access_key, str, urlencode=true)
 96:     digest = OpenSSL::Digest::Digest.new('sha1')
 97:     b64_hmac =
 98:       Base64.encode64(
 99:         OpenSSL::HMAC.digest(digest, secret_access_key, str)).gsub("\n","")
100: 
101:     if urlencode
102:       return CGI::escape(b64_hmac)
103:     else
104:       return b64_hmac
105:     end
106:   end

[Validate]