Sha256: 54426ff7e41606e511bce5fba781bb07f4e13f56db5a9a8a5c08cf8504e81080

Contents?: true

Size: 814 Bytes

Versions: 8

Compression:

Stored size: 814 Bytes

Contents

require 'rubygems'
require 'json'

module Fog
  module Rackspace

    def self.reload
      load 'fog/rackspace/files.rb'
      load 'fog/rackspace/servers.rb'
    end

    def self.authenticate(options)
      connection = Fog::Connection.new("https://auth.api.rackspacecloud.com")
      response = connection.request({
        :expects  => 204,
        :headers  => {
          'X-Auth-Key'  => options[:rackspace_api_key],
          'X-Auth-User' => options[:rackspace_username]
        },
        :host     => 'auth.api.rackspacecloud.com',
        :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
Fog::Rackspace.reload

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
fog-0.0.22 lib/fog/rackspace.rb
fog-0.0.21 lib/fog/rackspace.rb
fog-0.0.20 lib/fog/rackspace.rb
fog-0.0.19 lib/fog/rackspace.rb
fog-0.0.18 lib/fog/rackspace.rb
fog-0.0.17 lib/fog/rackspace.rb
fog-0.0.16 lib/fog/rackspace.rb
fog-0.0.15 lib/fog/rackspace.rb