2010-04-03 03:29:42 -04:00
|
|
|
require File.join(File.dirname(__FILE__), 'credentials')
|
|
|
|
|
2010-02-12 00:41:37 -05:00
|
|
|
module Fog
|
|
|
|
class << self
|
|
|
|
|
|
|
|
def services
|
|
|
|
services = []
|
2010-05-24 14:03:52 -04:00
|
|
|
[::AWS, ::Local, ::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
|