Sha256: 45e6a1a4848ed7ff574f99f3c6f73574ce810d63e1a8fc529c8f08484cac796e

Contents?: true

Size: 1.33 KB

Versions: 16

Compression:

Stored size: 1.33 KB

Contents

require 'fog/core/collection'
require 'fog/aws/models/compute/image'

module Fog
  module Compute
    class AWS
      class Images < Fog::Collection
        attribute :filters

        model Fog::Compute::AWS::Image

        # Creates a new Amazon machine image
        #
        # AWS.images.new
        #
        # ==== Returns
        #
        # Returns the details of the new image
        #
        #>> AWS.images.new
        #  <Fog::AWS::Compute::Image
        #    id=nil,
        #    architecture=nil,
        #    block_device_mapping=nil,
        #    location=nil,
        #    owner_id=nil,
        #    state=nil,
        #    type=nil,
        #    is_public=nil,
        #    kernel_id=nil,
        #    platform=nil,
        #    product_codes=nil,
        #    ramdisk_id=nil,
        #    root_device_type=nil,
        #    root_device_name=nil,
        #    tags=nil
        #  >
        #

        def initialize(attributes)
          self.filters ||= {}
          super
        end

        def all(filters = filters)
          self.filters = filters
          data = service.describe_images(filters).body
          load(data['imagesSet'])
        end

        def get(image_id)
          if image_id
            self.class.new(:service => service).all('image-id' => image_id).first
          end
        end
      end
    end
  end
end

Version data entries

16 entries across 16 versions & 4 rubygems

Version Path
vagrant-cloudstack-1.1.0 vendor/bundle/gems/fog-1.22.1/lib/fog/aws/models/compute/images.rb
fog-1.26.0 lib/fog/aws/models/compute/images.rb
fog-1.25.0 lib/fog/aws/models/compute/images.rb
nsidc-fog-1.24.1 lib/fog/aws/models/compute/images.rb
fog-1.24.0 lib/fog/aws/models/compute/images.rb
ns-fog-1.22.11 lib/fog/aws/models/compute/images.rb
ns-fog-1.22.10 lib/fog/aws/models/compute/images.rb
ns-fog-1.22.9 lib/fog/aws/models/compute/images.rb
ns-fog-1.22.8 lib/fog/aws/models/compute/images.rb
ns-fog-1.22.7 lib/fog/aws/models/compute/images.rb
ns-fog-1.22.6 lib/fog/aws/models/compute/images.rb
fog-1.23.0 lib/fog/aws/models/compute/images.rb
ns-fog-1.22.4 lib/fog/aws/models/compute/images.rb
ns-fog-1.22.3 lib/fog/aws/models/compute/images.rb
ns-fog-1.22.2 lib/fog/aws/models/compute/images.rb
fog-1.22.1 lib/fog/aws/models/compute/images.rb