Sha256: 89c45d95b9be4218f5127e0d383e4fc6d9dcc2bd95faba00fbc7a1f622fd655d
Contents?: true
Size: 700 Bytes
Versions: 21
Compression:
Stored size: 700 Bytes
Contents
require 'fog/core/collection' require 'fog/openstack/models/compute/image' module Fog module Compute class OpenStack class Images < Fog::Collection model Fog::Compute::OpenStack::Image attribute :server def all data = service.list_images_detail.body['images'] images = load(data) if server self.replace(self.select {|image| image.server_id == server.id}) end images end def get(image_id) data = service.get_image_details(image_id).body['image'] new(data) rescue Fog::Compute::OpenStack::NotFound nil end end end end end
Version data entries
21 entries across 21 versions & 6 rubygems