Class AWS::Core::Client
In: lib/aws/core/client.rb
Parent: Object

Base class for all of the Amazon AWS service clients. @private

Methods

Classes and Modules

Class AWS::Core::Client::ClientRequestMethodBuilder

Constants

CACHEABLE_REQUESTS = Set.new

Attributes

config  [R]  @return [Configuration] This clients configuration.
endpoint  [R]  @return [String] Returns the service endpoint (hostname) this client
  makes requests against.
port  [R]  @return [Integer] What port this client makes requests via.
service_ruby_name  [R]  @return [String] The snake-cased ruby name for the service
  (e.g. 's3', 'iam', 'dynamo_db', etc).
signer  [R]  @return [DefaultSigner,Object] Returns the signer for this client.
  This is normally a DefaultSigner, but it can be configured to
  an other object.

Public Class methods

Creates a new low-level client.

Required Options

To create a client you must provide access to AWS credentials. There are two options:

  • +:signer+ — An object that responds to access_key_id (to return the AWS Access Key ID) and to sign(string_to_sign) (to return a signature for a given string). An example implementation is AWS::Core::DefaultSigner. This option is useful if you want to more tightly control access to your secret access key (for example by moving the signature computation into a different process).
  • +:access_key_id+ and +:secret_access_key+ — You can use these options to provide the AWS Access Key ID and AWS Secret Access Key directly to the client.

Optional

  • +:http_handler+ — Any object that implements a handle(request, response) method; an example is BuiltinHttpHandler. This method is used to perform the HTTP requests that this client constructs.

Protected Class methods

Public Instance methods

Primarily used for testing, this method returns an empty psuedo service response without making a request. Its used primarily for testing the ligher level service interfaces. @private

The stub returned is memoized. @see new_stub_for @private

@param [Configuration] The configuration object to use. @return [Core::Client] Returns a new client object with the given

  configuration.

Returns a copy of the client with a different HTTP handler. You can pass an object like BuiltinHttpHandler or you can use a block; for example:

  s3_with_logging = s3.with_http_handler do |request, response|
    $stderr.puts request.inspect
    super
  end

The block executes in the context of an HttpHandler instance, and super delegates to the HTTP handler used by this client. This provides an easy way to spy on requests and responses. See HttpHandler, HttpRequest, and HttpResponse for more details on how to implement a fully functional HTTP handler using a different HTTP library than the one that ships with Ruby. @param handler (nil) A new http handler. Leave blank and pass a

  block to wrap the current handler with the block.

@return [Core::Client] Returns a new instance of the client class with

  the modified or wrapped http handler.

@param [Hash] options @see AWS.config detailed list of accepted options.

Protected Instance methods

[Validate]