Class: RightScale::CloudApi::AWS::CF::ApiManager

Inherits:
CloudApi::ApiManager
  • Object
show all
Includes:
Mixin::QueryApiPatterns
Defined in:
lib/cloud/aws/cf/manager.rb

Overview

Amazon Cloud Front (CF) compatible manager (thread unsafe)

See Also:

Defined Under Namespace

Classes: Error

Constant Summary collapse

DEFAULT_API_VERSION =

Default API version for CloudFront service

To override the API version use :api_version key when instantiating a manager.

'2012-07-01'

Instance Method Summary collapse

Constructor Details

#initialize(aws_access_key_id, aws_secret_access_key, endpoint, options = {}) ⇒ RightScale::CloudApi::AWS::CF::ApiManager

Initializes Amazon CloudFront service manager

Examples:

# see Manager class for example

Parameters:

  • aws_access_key_id (String)
  • aws_secret_access_key (String)
  • endpoint (String)
  • options (Hash) (defaults to: {})

See Also:



139
140
141
142
143
# File 'lib/cloud/aws/cf/manager.rb', line 139

def initialize(aws_access_key_id, aws_secret_access_key, endpoint, options={})
  credentials = { :aws_access_key_id     => aws_access_key_id,
                  :aws_secret_access_key => aws_secret_access_key }
  super(credentials, endpoint, options)
end

Instance Method Details

#api(verb, *args, &block) ⇒ Object

Makes an API call to AWS Cloud Front compatible cloud

Examples:

api(verb,                      opts={})
api(verb, 'distribution',      opts={})
# Where opts may have next keys: :options, :headers, :params
api(verb, 'distribution/path', opts={})

Parameters:

  • verb (String, Symbol)
  • args (Objects)

Returns:

  • (Object)

Raises:



159
160
161
162
163
164
# File 'lib/cloud/aws/cf/manager.rb', line 159

def api(verb, *args, &block)
  relative_path = args.first.is_a?(String) ? args.shift : ''
  opts          = args.shift || {}
  raise Error::new("Opts must be Hash not #{opts.class.name}") unless opts.is_a?(Hash)
  process_api_request(verb, relative_path, opts, &block)
end