1
0
Fork 0
mirror of https://github.com/fog/fog.git synced 2022-11-09 13:51:43 -05:00

[stormondemand|compute] cleanup

This commit is contained in:
geemus 2011-05-10 13:58:22 -07:00
parent 3669f48b50
commit daed8de253
34 changed files with 20 additions and 39 deletions

View file

@ -32,7 +32,7 @@ module Fog
require 'fog/compute/slicehost'
Fog::Slicehost::Compute.new(attributes)
when 'StormOnDemand'
require 'fog/compute/stormondemand'
require 'fog/compute/storm_on_demand'
Fog::StormOnDemand::Compute.new(attributes)
when 'VirtualBox'
require 'fog/compute/virtual_box'

View file

@ -1,5 +1,5 @@
require 'fog/core/collection'
require 'fog/compute/models/stormondemand/balancer'
require 'fog/compute/models/storm_on_demand/balancer'
module Fog
module StormOnDemand

View file

@ -1,5 +1,5 @@
require 'fog/core/collection'
require 'fog/compute/models/stormondemand/config'
require 'fog/compute/models/storm_on_demand/config'
module Fog
module StormOnDemand

View file

@ -1,5 +1,5 @@
require 'fog/core/collection'
require 'fog/compute/models/stormondemand/image'
require 'fog/compute/models/storm_on_demand/image'
module Fog
module StormOnDemand

View file

@ -1,5 +1,5 @@
require 'fog/core/collection'
require 'fog/compute/models/stormondemand/private_ip'
require 'fog/compute/models/storm_on_demand/private_ip'
module Fog
module StormOnDemand

View file

@ -1,5 +1,5 @@
require 'fog/core/collection'
require 'fog/compute/models/stormondemand/server'
require 'fog/compute/models/storm_on_demand/server'
module Fog
module StormOnDemand

View file

@ -1,5 +1,5 @@
require 'fog/core/collection'
require 'fog/compute/models/stormondemand/stat'
require 'fog/compute/models/storm_on_demand/stat'
module Fog
module StormOnDemand

View file

@ -1,5 +1,5 @@
require 'fog/core/collection'
require 'fog/compute/models/stormondemand/template'
require 'fog/compute/models/storm_on_demand/template'
module Fog
module StormOnDemand

View file

@ -1,19 +0,0 @@
module Fog
module StormOnDemand
class Compute
class Real
def create_server(options = {})
request(
:expects => [200],
:method => 'GET',
:path => "/storm/server/create",
:headers => {"Content-Type" => "application/json"},
:body => {:params => options}.to_json
)
end
end
end
end
end

View file

@ -4,11 +4,11 @@ module Fog
API_URL = 'https://api.stormondemand.com'
requires :stormondemand_username, :stormondemand_password
recognizes :stormondemand_auth_url
requires :storm_on_demand_username, :storm_on_demand_password
recognizes :storm_on_demand_auth_url
recognizes :provider # remove post deprecation
model_path 'fog/compute/models/stormondemand'
model_path 'fog/compute/models/storm_on_demand'
model :config
collection :configs
model :image
@ -24,7 +24,7 @@ module Fog
model :template
collection :templates
request_path 'fog/compute/requests/stormondemand'
request_path 'fog/compute/requests/storm_on_demand'
request :clone_server
request :delete_server
request :reboot_server
@ -63,8 +63,8 @@ module Fog
end
def initialize(options={})
@stormondemand_username = options[:stormondemand_username]
@data = self.class.data[@stormondemand_username]
@storm_on_demand_username = options[:storm_on_demand_username]
@data = self.class.data[@storm_on_demand_username]
end
end
@ -73,13 +73,13 @@ module Fog
def initialize(options={})
require 'json'
uri = URI.parse(options[:stormondemand_auth_url] ||= API_URL)
uri = URI.parse(options[:storm_on_demand_auth_url] ||= API_URL)
@host = uri.host
@path = uri.path
@port = uri.port
@scheme = uri.scheme
@stormondemand_username = options[:stormondemand_username]
@stormondemand_password = options[:stormondemand_password]
@storm_on_demand_username = options[:storm_on_demand_username]
@storm_on_demand_password = options[:storm_on_demand_password]
@connection = Fog::Connection.new("#{@scheme}://#{@host}:#{@port}")
end
@ -92,7 +92,7 @@ module Fog
response = @connection.request(params.merge!({
:headers => {
'Content-Type' => 'application/json',
'Authorization' => "Basic " + Base64.encode64("#{@stormondemand_username}:#{@stormondemand_password}").chomp
'Authorization' => 'Basic ' << Base64.encode64("#{@storm_on_demand_username}:#{@storm_on_demand_password}").chomp
}.merge!(params[:headers] || {}),
:host => @host,
:path => "#{@path}/#{params[:path]}",

View file

@ -18,7 +18,7 @@ require 'fog/providers/local'
require 'fog/providers/new_servers'
require 'fog/providers/rackspace'
require 'fog/providers/slicehost'
require 'fog/providers/stormondemand'
require 'fog/providers/storm_on_demand'
require 'fog/providers/virtual_box'
require 'fog/providers/voxel'
require 'fog/providers/zerigo'

View file

@ -5,7 +5,7 @@ module Fog
extend Fog::Provider
service(:compute, 'compute/stormondemand')
service(:compute, 'compute/storm_on_demand')
end
end