Method: RightAws::AsInterface#initialize

Defined in:
lib/as/right_as_interface.rb

#initialize(aws_access_key_id = nil, aws_secret_access_key = nil, params = {}) ⇒ AsInterface

Create a new handle to an CSLS account. All handles share the same per process or per thread HTTP connection to Amazon CSLS. Each handle is for a specific account. The params have the following options:

  • :endpoint_url a fully qualified url to Amazon API endpoint (this overwrites: :server, :port, :service, :protocol). Example: ‘autoscaling.amazonaws.com/’

  • :server: AS service host, default: DEFAULT_HOST

  • :port: AS service port, default: DEFAULT_PORT

  • :protocol: ‘http’ or ‘https’, default: DEFAULT_PROTOCOL

  • :logger: for log messages, default: RAILS_DEFAULT_LOGGER else STDOUT

  • :signature_version: The signature version : ‘0’,‘1’ or ‘2’(default)

  • :cache: true/false(default): describe_auto_scaling_groups



102
103
104
105
106
107
108
109
110
111
112
# File 'lib/as/right_as_interface.rb', line 102

def initialize(aws_access_key_id=nil, aws_secret_access_key=nil, params={})
  init({ :name                => 'AS',
         :default_host        => ENV['AS_URL'] ? URI.parse(ENV['AS_URL']).host   : DEFAULT_HOST,
         :default_port        => ENV['AS_URL'] ? URI.parse(ENV['AS_URL']).port   : DEFAULT_PORT,
         :default_service     => ENV['AS_URL'] ? URI.parse(ENV['AS_URL']).path   : DEFAULT_PATH,
         :default_protocol    => ENV['AS_URL'] ? URI.parse(ENV['AS_URL']).scheme : DEFAULT_PROTOCOL,
         :default_api_version => ENV['AS_API_VERSION'] || API_VERSION },
       aws_access_key_id    || ENV['AWS_ACCESS_KEY_ID'] ,
       aws_secret_access_key|| ENV['AWS_SECRET_ACCESS_KEY'],
       params)
end