class Fog::Image::OpenStack::V1::Images

Public Instance Methods

all(options = {}) click to toggle source
# File lib/fog/image/openstack/v1/models/images.rb, line 11
def all(options = {})
  load_response(service.list_public_images_detailed(options), 'images')
end
destroy(id) click to toggle source
# File lib/fog/image/openstack/v1/models/images.rb, line 40
def destroy(id)
  image = find_by_id(id)
  image.destroy
end
details(options = {}, deprecated_query = nil) click to toggle source
# File lib/fog/image/openstack/v1/models/images.rb, line 19
def details(options = {}, deprecated_query = nil)
  Fog::Logger.deprecation("Calling OpenStack[:glance].images.details will be removed, "                                     " call .images.all for detailed list.")
  load_response(service.list_public_images_detailed(options, deprecated_query), 'images')
end
find_attribute(attribute, value) click to toggle source
# File lib/fog/image/openstack/v1/models/images.rb, line 61
def find_attribute(attribute, value)
  attribute = attribute.to_s.gsub("find_by_", "")
  load(service.list_public_images_detailed(attribute, value).body['images'])
end
find_by_id(id) click to toggle source
# File lib/fog/image/openstack/v1/models/images.rb, line 25
def find_by_id(id)
  all.find { |image| image.id == id }
end
Also aliased as: get
find_by_size_max(size) click to toggle source
# File lib/fog/image/openstack/v1/models/images.rb, line 57
def find_by_size_max(size)
  find_attribute(__method__, size)
end
find_by_size_min(size) click to toggle source
# File lib/fog/image/openstack/v1/models/images.rb, line 53
def find_by_size_min(size)
  find_attribute(__method__, size)
end
get(id)
Alias for: find_by_id
method_missing(method_sym, *arguments, &block) click to toggle source
Calls superclass method
# File lib/fog/image/openstack/v1/models/images.rb, line 45
def method_missing(method_sym, *arguments, &block)
  if method_sym.to_s =~ /^find_by_(.*)$/
    load(service.list_public_images_detailed($1, arguments.first).body['images'])
  else
    super
  end
end
private() click to toggle source
# File lib/fog/image/openstack/v1/models/images.rb, line 35
def private
  images = load(service.list_public_images_detailed.body['images'])
  images.delete_if(&:is_public)
end
public() click to toggle source
# File lib/fog/image/openstack/v1/models/images.rb, line 30
def public
  images = load(service.list_public_images_detailed.body['images'])
  images.delete_if { |image| image.is_public == false }
end
summary(options = {}) click to toggle source
# File lib/fog/image/openstack/v1/models/images.rb, line 15
def summary(options = {})
  load_response(service.list_public_images(options), 'images')
end