Module: Fog::Image

Defined in:
lib/fog/image.rb,
lib/fog/openstack/image.rb,
lib/fog/openstack/models/image/image.rb,
lib/fog/openstack/models/image/images.rb,
lib/fog/openstack/requests/image/get_image.rb,
lib/fog/openstack/requests/image/set_tenant.rb,
lib/fog/openstack/requests/image/create_image.rb,
lib/fog/openstack/requests/image/delete_image.rb,
lib/fog/openstack/requests/image/update_image.rb,
lib/fog/openstack/requests/image/get_image_by_id.rb,
lib/fog/openstack/requests/image/get_image_members.rb,
lib/fog/openstack/requests/image/get_shared_images.rb,
lib/fog/openstack/requests/image/list_public_images.rb,
lib/fog/openstack/requests/image/add_member_to_image.rb,
lib/fog/openstack/requests/image/update_image_members.rb,
lib/fog/openstack/requests/image/remove_member_from_image.rb,
lib/fog/openstack/requests/image/list_public_images_detailed.rb

Defined Under Namespace

Classes: OpenStack

Class Method Summary collapse

Class Method Details

.[](provider) ⇒ Object



4
5
6
# File 'lib/fog/image.rb', line 4

def self.[](provider)
  self.new(:provider => provider)
end

.new(attributes) ⇒ Object

Raises:

  • (ArgumentError)


8
9
10
11
12
13
14
15
16
# File 'lib/fog/image.rb', line 8

def self.new(attributes)
  attributes = attributes.dup # Prevent delete from having side effects
  provider = attributes.delete(:provider).to_s.downcase.to_sym
  if self.providers.include?(provider)
    require "fog/#{provider}/image"
    return Fog::Image.const_get(Fog.providers[provider]).new(attributes)
  end
  raise ArgumentError.new("#{provider} has no identity service")
end

.providersObject



18
19
20
# File 'lib/fog/image.rb', line 18

def self.providers
  Fog.services[:image]
end