Sha256: 6e5b19adefcf2a79b95b6c00ababc86a9c8387133a0864525db809be55004fc9

Contents?: true

Size: 985 Bytes

Versions: 14

Compression:

Stored size: 985 Bytes

Contents

module Fog
  module Rackspace

    extend Fog::Provider

    service_path 'fog/rackspace'
    service 'cdn'
    service 'compute'
    service 'files'
    service 'servers'
    service 'storage'

    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

14 entries across 14 versions & 2 rubygems

Version Path
fog-0.3.26 lib/fog/rackspace.rb
fog-0.3.25 lib/fog/rackspace.rb
fog-0.3.24 lib/fog/rackspace.rb
bbcloud-0.8.1 lib/bbcloud/vendor/fog-0.3.23/lib/fog/rackspace.rb
fog-0.3.23 lib/fog/rackspace.rb
fog-0.3.22 lib/fog/rackspace.rb
fog-0.3.21 lib/fog/rackspace.rb
fog-0.3.20 lib/fog/rackspace.rb
fog-0.3.19 lib/fog/rackspace.rb
fog-0.3.18 lib/fog/rackspace.rb
fog-0.3.17 lib/fog/rackspace.rb
fog-0.3.16 lib/fog/rackspace.rb
fog-0.3.15 lib/fog/rackspace.rb
fog-0.3.14 lib/fog/rackspace.rb