Class: Fog::OpenStack::Image

Inherits:
Service
  • Object
show all
Defined in:
lib/fog/openstack/image.rb,
lib/fog/openstack/image/v1.rb,
lib/fog/openstack/image/v2.rb,
lib/fog/openstack/image/v1/models/image.rb,
lib/fog/openstack/image/v2/models/image.rb,
lib/fog/openstack/image/v1/models/images.rb,
lib/fog/openstack/image/v2/models/images.rb,
lib/fog/openstack/image/v1/requests/get_image.rb,
lib/fog/openstack/image/v2/requests/get_image.rb,
lib/fog/openstack/image/v1/requests/set_tenant.rb,
lib/fog/openstack/image/v2/requests/set_tenant.rb,
lib/fog/openstack/image/v2/requests/list_images.rb,
lib/fog/openstack/image/v1/requests/create_image.rb,
lib/fog/openstack/image/v1/requests/delete_image.rb,
lib/fog/openstack/image/v1/requests/update_image.rb,
lib/fog/openstack/image/v2/requests/create_image.rb,
lib/fog/openstack/image/v2/requests/delete_image.rb,
lib/fog/openstack/image/v2/requests/update_image.rb,
lib/fog/openstack/image/v2/requests/upload_image.rb,
lib/fog/openstack/image/v2/requests/download_image.rb,
lib/fog/openstack/image/v1/requests/get_image_by_id.rb,
lib/fog/openstack/image/v2/requests/get_image_by_id.rb,
lib/fog/openstack/image/v2/requests/add_tag_to_image.rb,
lib/fog/openstack/image/v2/requests/deactivate_image.rb,
lib/fog/openstack/image/v2/requests/reactivate_image.rb,
lib/fog/openstack/image/v1/requests/get_image_members.rb,
lib/fog/openstack/image/v1/requests/get_shared_images.rb,
lib/fog/openstack/image/v2/requests/get_image_members.rb,
lib/fog/openstack/image/v2/requests/get_shared_images.rb,
lib/fog/openstack/image/v1/requests/list_public_images.rb,
lib/fog/openstack/image/v2/requests/get_member_details.rb,
lib/fog/openstack/image/v1/requests/add_member_to_image.rb,
lib/fog/openstack/image/v2/requests/add_member_to_image.rb,
lib/fog/openstack/image/v2/requests/update_image_member.rb,
lib/fog/openstack/image/v1/requests/update_image_members.rb,
lib/fog/openstack/image/v2/requests/remove_tag_from_image.rb,
lib/fog/openstack/image/v1/requests/remove_member_from_image.rb,
lib/fog/openstack/image/v2/requests/remove_member_from_image.rb,
lib/fog/openstack/image/v1/requests/list_public_images_detailed.rb

Defined Under Namespace

Classes: V1, V2

Class Method Summary collapse

Class Method Details

.new(args = {}) ⇒ Object

Fog::OpenStack::Image.new() will return a Fog::OpenStack::Image::V2 or a Fog::OpenStack::Image::V1,

choosing the latest available


11
12
13
14
15
16
17
18
19
20
# File 'lib/fog/openstack/image.rb', line 11

def self.new(args = {})
  @openstack_auth_uri = URI.parse(args[:openstack_auth_url]) if args[:openstack_auth_url]
  if inspect == 'Fog::OpenStack::Image'
    service = Fog::OpenStack::Image::V2.new(args) unless args.empty?
    service ||= Fog::OpenStack::Image::V1.new(args)
  else
    service = Fog::Service.new(args)
  end
  service
end