class Fog::Image::OpenStack::V2::Images
Public Instance Methods
all(options = {})
click to toggle source
# File lib/fog/image/openstack/v2/models/images.rb, line 11 def all(options = {}) load_response(service.list_images(options), 'images') end
destroy(id)
click to toggle source
# File lib/fog/image/openstack/v2/models/images.rb, line 38 def destroy(id) image = find_by_id(id) image.destroy end
find_attribute(attribute, value)
click to toggle source
# File lib/fog/image/openstack/v2/models/images.rb, line 59 def find_attribute(attribute, value) attribute = attribute.to_s.gsub("find_by_", "") load(service.list_images(attribute.to_sym => value).body['images']) end
find_by_id(id)
click to toggle source
# File lib/fog/image/openstack/v2/models/images.rb, line 19 def find_by_id(id) image_hash = service.get_image_by_id(id).body Fog::Image::OpenStack::V2::Image.new( image_hash.merge(:service => service) ) end
Also aliased as: get
find_by_size_max(size)
click to toggle source
# File lib/fog/image/openstack/v2/models/images.rb, line 55 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/v2/models/images.rb, line 51 def find_by_size_min(size) find_attribute(__method__, size) end
method_missing(method_sym, *arguments, &block)
click to toggle source
Calls superclass method
# File lib/fog/image/openstack/v2/models/images.rb, line 43 def method_missing(method_sym, *arguments, &block) if method_sym.to_s =~ /^find_by_(.*)$/ load(service.list_images($1.to_sym => arguments.first).body['images']) else super end end
private()
click to toggle source
# File lib/fog/image/openstack/v2/models/images.rb, line 33 def private images = load(service.list_images.body['images']) images.delete_if(&:is_public) end
public()
click to toggle source
# File lib/fog/image/openstack/v2/models/images.rb, line 28 def public images = load(service.list_images.body['images']) images.delete_if { |image| image.is_public == false } end
summary(options = {})
click to toggle source
# File lib/fog/image/openstack/v2/models/images.rb, line 15 def summary(options = {}) load_response(service.list_images(options), 'images') end