Sha256: bb8541acf4bcb7c0404b48a7afb3e4d6ec7c2fe4b6283458d786ee2ef9da186e

Contents?: true

Size: 1.05 KB

Versions: 9

Compression:

Stored size: 1.05 KB

Contents

require 'fog/core'

module Fog
  module Rackspace

    extend Fog::Provider

    service(:cdn,     'cdn/rackspace')
    service(:compute, 'compute/rackspace')
    service(:files,   'storage/rackspace')
    service(:servers, 'compute/rackspace')
    service(:storage, 'storage/rackspace')

    def self.authenticate(options)
      rackspace_auth_url = options[:rackspace_auth_url] || "auth.api.rackspacecloud.com"
      connection = Fog::Connection.new("https://" + rackspace_auth_url)
      @rackspace_api_key  = options[:rackspace_api_key]
      @rackspace_username = options[:rackspace_username]
      response = connection.request({
        :expects  => 204,
        :headers  => {
          'X-Auth-Key'  => @rackspace_api_key,
          'X-Auth-User' => @rackspace_username
        },
        :host     => rackspace_auth_url,
        :method   => 'GET',
        :path     => 'v1.0'
      })
      response.headers.reject do |key, value|
        !['X-Server-Management-Url', 'X-Storage-Url', 'X-CDN-Management-Url', 'X-Auth-Token'].include?(key)
      end
    end

  end
end

Version data entries

9 entries across 9 versions & 2 rubygems

Version Path
fog-0.5.3 lib/fog/providers/rackspace.rb
fog-0.5.2 lib/fog/providers/rackspace.rb
fog-0.5.1 lib/fog/providers/rackspace.rb
fog-0.5.0 lib/fog/providers/rackspace.rb
phpfog-fog-0.4.1.3 lib/fog/providers/rackspace.rb
phpfog-fog-0.4.1.2 lib/fog/providers/rackspace.rb
phpfog-fog-0.4.1.1 lib/fog/providers/rackspace.rb
phpfog-fog-0.4.1 lib/fog/providers/rackspace.rb
fog-0.4.1 lib/fog/providers/rackspace.rb