def initialize(username, auth_key)
http = Net::HTTP.new(@@AUTH_API.host,@@AUTH_API.port)
http.use_ssl = true
authed = http.get(@@AUTH_API.path, {'X-Auth-User' => username, 'X-Auth-Key' => auth_key})
if authed.is_a?(Net::HTTPUnauthorized)
raise Deltacloud::AuthException, "Failed to authenticate to Rackspace"
elsif !authed.is_a?(Net::HTTPSuccess)
backend_error!(resp)
end
@auth_token = authed.header['X-Auth-Token']
@service_uri = URI.parse(authed.header['X-Server-Management-Url'])
@service = Net::HTTP.new(@service_uri.host, @service_uri.port)
@service.use_ssl = true
end