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

Version Path
gapinc-fog-1.12.1.2.1 lib/fog/openstack/models/compute/images.rb
fog-maestrodev-1.15.0.20130829165835 lib/fog/openstack/models/compute/images.rb
fog-1.15.0 lib/fog/openstack/models/compute/images.rb
gapinc-fog-1.14.0 lib/fog/openstack/models/compute/images.rb
fog-maestrodev-1.14.0.20130806165225 lib/fog/openstack/models/compute/images.rb
fog-1.14.0 lib/fog/openstack/models/compute/images.rb
fog-1.13.0 lib/fog/openstack/models/compute/images.rb
gapinc-fog-1.12.1.2 lib/fog/openstack/models/compute/images.rb
gapinc-fog-1.12.1.1 lib/fog/openstack/models/compute/images.rb
gapinc-fog-1.12.1a lib/fog/openstack/models/compute/images.rb
gapinc-fog-1.12.1 lib/fog/openstack/models/compute/images.rb
fog-1.12.1 lib/fog/openstack/models/compute/images.rb
fog-1.12.0 lib/fog/openstack/models/compute/images.rb
hpfog-0.0.20 lib/fog/openstack/models/compute/images.rb
vagrant-shell-0.2.6 vendor/bundle/gems/fog-1.10.1/lib/fog/openstack/models/compute/images.rb
vagrant-shell-0.2.5 vendor/bundle/gems/fog-1.10.1/lib/fog/openstack/models/compute/images.rb
fog-1.11.1 lib/fog/openstack/models/compute/images.rb
fog-1.11.0 lib/fog/openstack/models/compute/images.rb
fog-1.10.1 lib/fog/openstack/models/compute/images.rb
fog-test-me-1.10.0 lib/fog/openstack/models/compute/images.rb