Permalink
Browse files

We want JSON.

  • Loading branch information...
1 parent 1a5e396 commit 86ac91ac22b01d388dc1c547933643aad42a99a3 James Rose committed Apr 27, 2012
Showing with 6 additions and 3 deletions.
  1. +6 −3 lib/fog/serverlove/compute.rb
@@ -1,7 +1,9 @@
module Fog
module Compute
class Serverlove < Fog::Service
-
+
+ API_HOST = "api.z1-man.serverlove.com"
+
requires :serverlove_uuid, :serverlove_api_key
recognizes :serverlove_api_url
@@ -27,14 +29,15 @@ class Real
def initialize(options)
@api_uuid = options[:serverlove_uuid] || Fog.credentials[:serverlove_uuid]
@api_key = options[:serverlove_api_key] || Fog.credentials[:serverlove_api_key]
+ @api_host = options[:serverlove_api_url] || Fog.credentials[:serverlove_api_url] || API_HOST
- @connection = Fog::Connection.new("https://#{@api_uuid}:#{@api_key}@api.z1-man.serverlove.com/")
+ @connection = Fog::Connection.new("https://#{@api_uuid}:#{@api_key}@#{@api_host}")
end
def request(params)
params = params.merge!(
:headers => {
- "Content-Type" => "application/json"
+ "Accept" => "application/json"
}
)
response = @connection.request(params)

0 comments on commit 86ac91a

Please sign in to comment.