Module: Fog::Rackspace

Extended by:
Provider
Defined in:
lib/fog/cdn/rackspace.rb,
lib/fog/compute/rackspace.rb,
lib/fog/compute/rackspace.rb,
lib/fog/storage/rackspace.rb,
lib/fog/storage/rackspace.rb,
lib/fog/providers/rackspace.rb,
lib/fog/storage/models/rackspace/file.rb,
lib/fog/compute/models/rackspace/image.rb,
lib/fog/storage/models/rackspace/files.rb,
lib/fog/compute/models/rackspace/flavor.rb,
lib/fog/compute/models/rackspace/images.rb,
lib/fog/compute/models/rackspace/server.rb,
lib/fog/compute/models/rackspace/flavors.rb,
lib/fog/compute/models/rackspace/servers.rb,
lib/fog/storage/models/rackspace/directory.rb,
lib/fog/cdn/requests/rackspace/put_container.rb,
lib/fog/storage/models/rackspace/directories.rb,
lib/fog/cdn/requests/rackspace/get_containers.rb,
lib/fog/cdn/requests/rackspace/head_container.rb,
lib/fog/storage/requests/rackspace/get_object.rb,
lib/fog/storage/requests/rackspace/put_object.rb,
lib/fog/compute/requests/rackspace/list_images.rb,
lib/fog/storage/requests/rackspace/head_object.rb,
lib/fog/compute/requests/rackspace/create_image.rb,
lib/fog/compute/requests/rackspace/delete_image.rb,
lib/fog/compute/requests/rackspace/list_flavors.rb,
lib/fog/compute/requests/rackspace/list_servers.rb,
lib/fog/compute/requests/rackspace/create_server.rb,
lib/fog/compute/requests/rackspace/delete_server.rb,
lib/fog/compute/requests/rackspace/reboot_server.rb,
lib/fog/compute/requests/rackspace/resize_server.rb,
lib/fog/compute/requests/rackspace/server_action.rb,
lib/fog/compute/requests/rackspace/update_server.rb,
lib/fog/storage/requests/rackspace/delete_object.rb,
lib/fog/storage/requests/rackspace/get_container.rb,
lib/fog/storage/requests/rackspace/put_container.rb,
lib/fog/compute/requests/rackspace/list_addresses.rb,
lib/fog/storage/requests/rackspace/get_containers.rb,
lib/fog/storage/requests/rackspace/head_container.rb,
lib/fog/storage/requests/rackspace/head_containers.rb,
lib/fog/storage/requests/rackspace/delete_container.rb,
lib/fog/compute/requests/rackspace/get_image_details.rb,
lib/fog/compute/requests/rackspace/get_flavor_details.rb,
lib/fog/compute/requests/rackspace/get_server_details.rb,
lib/fog/compute/requests/rackspace/list_images_detail.rb,
lib/fog/compute/requests/rackspace/list_flavors_detail.rb,
lib/fog/compute/requests/rackspace/list_servers_detail.rb,
lib/fog/compute/requests/rackspace/list_public_addresses.rb,
lib/fog/compute/requests/rackspace/revert_resized_server.rb,
lib/fog/compute/requests/rackspace/confirm_resized_server.rb,
lib/fog/compute/requests/rackspace/list_private_addresses.rb

Defined Under Namespace

Classes: CDN, Compute, Files, Servers, Storage

Class Method Summary collapse

Methods included from Provider

service, services

Class Method Details

.authenticate(options) ⇒ Object



14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# File 'lib/fog/providers/rackspace.rb', line 14

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