2010-06-23 20:22:44 -04:00
|
|
|
require 'fog/credentials'
|
|
|
|
|
2010-06-23 16:22:20 -04:00
|
|
|
require 'fog/aws/bin'
|
2010-07-03 11:48:13 -04:00
|
|
|
require 'fog/linode/bin'
|
2010-06-23 16:22:20 -04:00
|
|
|
require 'fog/local/bin'
|
|
|
|
require 'fog/new_servers/bin'
|
|
|
|
require 'fog/rackspace/bin'
|
|
|
|
require 'fog/slicehost/bin'
|
|
|
|
require 'fog/terremark/bin'
|
|
|
|
require 'fog/vcloud/bin'
|
|
|
|
require 'fog/bluebox/bin'
|
2010-04-03 03:29:42 -04:00
|
|
|
|
2010-02-12 00:41:37 -05:00
|
|
|
module Fog
|
|
|
|
class << self
|
|
|
|
|
|
|
|
def services
|
|
|
|
services = []
|
2010-07-03 11:48:13 -04:00
|
|
|
[::AWS, ::Linode, ::Local, ::NewServers, ::Rackspace, ::Slicehost, ::Terremark, ::Vcloud, ::Bluebox].each do |service|
|
2010-02-12 00:41:37 -05:00
|
|
|
if service.initialized?
|
|
|
|
services << service
|
|
|
|
end
|
|
|
|
end
|
|
|
|
services
|
|
|
|
end
|
|
|
|
|
2010-05-02 01:10:11 -04:00
|
|
|
def directories
|
|
|
|
directories = {}
|
|
|
|
services.each do |service|
|
|
|
|
if service.respond_to?(:directories)
|
|
|
|
directories[service] = service.directories
|
|
|
|
end
|
|
|
|
end
|
|
|
|
directories
|
|
|
|
end
|
|
|
|
|
2010-02-12 00:41:37 -05:00
|
|
|
def flavors
|
|
|
|
flavors = {}
|
|
|
|
services.each do |service|
|
2010-04-05 18:26:59 -04:00
|
|
|
if service.respond_to?(:flavors)
|
|
|
|
flavors[service] = service.flavors
|
|
|
|
end
|
2010-02-12 00:41:37 -05:00
|
|
|
end
|
|
|
|
flavors
|
|
|
|
end
|
|
|
|
|
|
|
|
def images
|
|
|
|
images = {}
|
|
|
|
services.each do |service|
|
2010-04-05 18:26:59 -04:00
|
|
|
if service.respond_to?(:images)
|
|
|
|
images[service] = service.images
|
|
|
|
end
|
2010-02-12 00:41:37 -05:00
|
|
|
end
|
|
|
|
images
|
|
|
|
end
|
|
|
|
|
|
|
|
def servers
|
|
|
|
servers = {}
|
|
|
|
services.each do |service|
|
2010-04-05 18:26:59 -04:00
|
|
|
if service.respond_to?(:servers)
|
|
|
|
servers[service] = service.servers
|
|
|
|
end
|
2010-02-12 00:41:37 -05:00
|
|
|
end
|
|
|
|
servers
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|
2010-04-03 03:29:42 -04:00
|
|
|
end
|