def initialize(options = {})
require 'fog/core/parser'
@connections = {}
@connection_options = options[:connection_options] || {}
@host = options[:ecloud_host] || API_URL
@persistent = options[:persistent] || false
@version = options[:ecloud_version] || "2012-03-01"
@authentication_method = options[:ecloud_authentication_method] || :cloud_api_auth
@access_key = options[:ecloud_access_key]
@private_key = options[:ecloud_private_key]
if @private_key.nil? || @authentication_method == :basic_auth
@authentication_method = :basic_auth
@username = options[:ecloud_username]
@password = options[:ecloud_password]
if @username.nil? || @password.nil?
raise ArgumentError, "No credentials (cloud auth, or basic auth) passed!"
end
else
@hmac = Fog::HMAC.new("sha256", @private_key)
end
end