Module: Fog::CDN

Defined in:
lib/rackspace-fog/cdn.rb,
lib/rackspace-fog/hp/cdn.rb,
lib/rackspace-fog/aws/cdn.rb,
lib/rackspace-fog/rackspace/cdn.rb,
lib/rackspace-fog/hp/requests/cdn/put_container.rb,
lib/rackspace-fog/hp/requests/cdn/get_containers.rb,
lib/rackspace-fog/hp/requests/cdn/head_container.rb,
lib/rackspace-fog/hp/requests/cdn/post_container.rb,
lib/rackspace-fog/hp/requests/cdn/delete_container.rb,
lib/rackspace-fog/aws/requests/cdn/get_distribution.rb,
lib/rackspace-fog/aws/requests/cdn/post_distribution.rb,
lib/rackspace-fog/aws/requests/cdn/post_invalidation.rb,
lib/rackspace-fog/aws/requests/cdn/delete_distribution.rb,
lib/rackspace-fog/rackspace/requests/cdn/put_container.rb,
lib/rackspace-fog/rackspace/requests/cdn/get_containers.rb,
lib/rackspace-fog/rackspace/requests/cdn/head_container.rb,
lib/rackspace-fog/rackspace/requests/cdn/post_container.rb,
lib/rackspace-fog/aws/requests/cdn/get_distribution_list.rb,
lib/rackspace-fog/aws/requests/cdn/get_invalidation_list.rb,
lib/rackspace-fog/aws/requests/cdn/put_distribution_config.rb,
lib/rackspace-fog/aws/requests/cdn/get_streaming_distribution.rb,
lib/rackspace-fog/aws/requests/cdn/post_streaming_distribution.rb,
lib/rackspace-fog/aws/requests/cdn/delete_streaming_distribution.rb,
lib/rackspace-fog/aws/requests/cdn/get_streaming_distribution_list.rb,
lib/rackspace-fog/aws/requests/cdn/put_streaming_distribution_config.rb

Defined Under Namespace

Classes: AWS, HP, Rackspace

Class Method Summary collapse

Class Method Details

.[](provider) ⇒ Object



4
5
6
# File 'lib/rackspace-fog/cdn.rb', line 4

def self.[](provider)
  self.new(:provider => provider)
end

.new(attributes) ⇒ Object



8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# File 'lib/rackspace-fog/cdn.rb', line 8

def self.new(attributes)
  attributes = attributes.dup # prevent delete from having side effects
  case provider = attributes.delete(:provider).to_s.downcase.to_sym
  when :aws
    require 'rackspace-fog/aws/cdn'
    Fog::CDN::AWS.new(attributes)
  when :hp
    require 'rackspace-fog/hp/cdn'
    Fog::CDN::HP.new(attributes)
  when :rackspace
    require 'rackspace-fog/rackspace/cdn'
    Fog::CDN::Rackspace.new(attributes)
  else
    raise ArgumentError.new("#{provider} is not a recognized cdn provider")
  end
end

.providersObject



25
26
27
# File 'lib/rackspace-fog/cdn.rb', line 25

def self.providers
  Fog.services[:cdn]
end