Class: RightScale::CloudApi::MWS::ApiManager

Inherits:
AWS::ApiManager
  • Object
show all
Defined in:
lib/cloud/mws/base/manager.rb

Overview

Thread un-safe parent class for almost all the MWS services.

Constant Summary collapse

DEFAULT_API_VERSION =
'2009-01-01'
WMS_ENDPOINT =
'https://mws.amazonservices.com/'
WMS_SERVICE_PATH =
nil

Constants inherited from AWS::ApiManager

AWS::ApiManager::COMMON_QUERY_PARAMS

Instance Method Summary collapse

Methods inherited from AWS::ApiManager

#initialize, #method_missing, #parametrize

Constructor Details

This class inherits a constructor from RightScale::CloudApi::AWS::ApiManager

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class RightScale::CloudApi::AWS::ApiManager

Instance Method Details

#api(action, params = {}, &block) ⇒ Object



54
55
56
57
58
59
60
61
62
63
64
65
66
67
# File 'lib/cloud/mws/base/manager.rb', line 54

def api(action, params={}, &block)
  params['Action'] ||= action.to_s._snake_case._camelize
  opts = {}
  verb           = params.delete(:verb) || :post
  opts[:body]    = params.delete(:body)
  opts[:headers] = params.delete(:headers) || {}
  opts[:options] = params.delete(:options) || {}
  opts[:params]  = parametrize(params)
  if self.class::WMS_SERVICE_PATH
    opts[:options][:cloud] ||= {}
    opts[:options][:cloud][:service_path] = self.class::WMS_SERVICE_PATH
  end
  process_api_request(verb, '', opts, &block)
end