2014-12-09 18:01:43 -05:00
|
|
|
require 'fog/core/credentials'
|
|
|
|
|
|
|
|
module Fog
|
|
|
|
class << self
|
|
|
|
def available_providers
|
2022-10-25 11:29:50 -04:00
|
|
|
available_providers ||= Fog.providers.values.select do |provider|
|
|
|
|
Kernel.const_defined?(provider) && Kernel.const_get(provider).try(:available?)
|
|
|
|
end.sort
|
2014-12-09 18:01:43 -05:00
|
|
|
end
|
|
|
|
|
|
|
|
def registered_providers
|
|
|
|
@registered_providers ||= Fog.providers.values.sort
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
class Bin
|
|
|
|
class << self
|
|
|
|
def available?
|
|
|
|
availability = true
|
|
|
|
for service in services
|
|
|
|
begin
|
|
|
|
service = self.class_for(service)
|
|
|
|
availability &&= service.requirements.all? { |requirement| Fog.credentials.include?(requirement) }
|
|
|
|
rescue ArgumentError => e
|
|
|
|
Fog::Logger.warning(e.message)
|
|
|
|
availability = false
|
|
|
|
rescue => e
|
|
|
|
availability = false
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
if availability
|
|
|
|
for service in services
|
|
|
|
for collection in self.class_for(service).collections
|
|
|
|
unless self.respond_to?(collection)
|
|
|
|
self.class_eval <<-EOS, __FILE__, __LINE__
|
|
|
|
def self.#{collection}
|
|
|
|
self[:#{service}].#{collection}
|
|
|
|
end
|
|
|
|
EOS
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
availability
|
|
|
|
end
|
|
|
|
|
|
|
|
def collections
|
|
|
|
services.map {|service| self[service].collections}.flatten.sort_by {|service| service.to_s}
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
require 'fog/bin/atmos'
|
|
|
|
require 'fog/bin/aws'
|
|
|
|
require 'fog/bin/brightbox'
|
|
|
|
require 'fog/bin/clodo'
|
2019-06-17 16:52:44 -04:00
|
|
|
require 'fog/bin/cloudstack'
|
2016-09-23 18:04:25 -04:00
|
|
|
require 'fog/bin/digitalocean'
|
2014-12-09 18:01:43 -05:00
|
|
|
require 'fog/bin/dnsimple'
|
|
|
|
require 'fog/bin/dnsmadeeasy'
|
|
|
|
require 'fog/bin/fogdocker'
|
|
|
|
require 'fog/bin/dreamhost'
|
|
|
|
require 'fog/bin/dynect'
|
|
|
|
require 'fog/bin/ecloud'
|
|
|
|
require 'fog/bin/glesys'
|
|
|
|
require 'fog/bin/go_grid'
|
|
|
|
require 'fog/bin/google'
|
|
|
|
require 'fog/bin/ibm'
|
|
|
|
require 'fog/bin/internet_archive'
|
|
|
|
require 'fog/bin/linode'
|
|
|
|
require 'fog/bin/local'
|
|
|
|
require 'fog/bin/bare_metal_cloud'
|
2014-12-10 11:30:34 -05:00
|
|
|
require 'fog/bin/rackspace'
|
2014-12-09 18:01:43 -05:00
|
|
|
require 'fog/bin/rage4'
|
|
|
|
require 'fog/bin/riakcs'
|
|
|
|
require 'fog/bin/openstack'
|
|
|
|
require 'fog/bin/ovirt'
|
2015-03-17 10:20:11 -04:00
|
|
|
require 'fog/bin/powerdns'
|
2014-12-09 18:01:43 -05:00
|
|
|
require 'fog/bin/profitbricks'
|
|
|
|
require 'fog/bin/sakuracloud'
|
|
|
|
require 'fog/bin/serverlove'
|
|
|
|
require 'fog/bin/softlayer'
|
|
|
|
require 'fog/bin/storm_on_demand'
|
|
|
|
require 'fog/bin/terremark'
|
|
|
|
require 'fog/bin/vcloud'
|
|
|
|
require 'fog/bin/vcloud_director'
|
|
|
|
require 'fog/bin/vmfusion'
|
|
|
|
require 'fog/bin/vsphere'
|
|
|
|
require 'fog/bin/voxel'
|
|
|
|
require 'fog/bin/xenserver'
|
|
|
|
require 'fog/bin/cloudsigma'
|
|
|
|
require 'fog/bin/openvz'
|
|
|
|
require 'fog/bin/opennebula'
|