class Fog::Compute::Linode::Images

Public Instance Methods

all() click to toggle source
# File lib/fog/linode/models/compute/images.rb, line 10
def all
  load images
end
get(id) click to toggle source
# File lib/fog/linode/models/compute/images.rb, line 14
def get(id)
  new images(id).first
rescue Fog::Compute::Linode::NotFound
  nil
end

Private Instance Methods

images(id=nil) click to toggle source
# File lib/fog/linode/models/compute/images.rb, line 21
def images(id=nil)
  service.avail_distributions(id).body['DATA'].map { |image| map_image image }
end
map_image(image) click to toggle source
# File lib/fog/linode/models/compute/images.rb, line 25
def map_image(image)
  image = image.each_with_object({}) { |(k, v), h| h[k.downcase.to_sym] = v  }
  image.merge!(:id => image[:distributionid], :name => image[:label], :image_size => image[:minimagesize],
               :requires_pvops_kernel => image[:requirespvopskernel], :bits => ((image[:is64bit] == 1) ? 64 : 32 ),
               :created_at => image[:create_dt])
end