Sha256: fd8752bdc2a0fd24080b9d505b6bbe4fed62b3080d17d1935c3dcc5cc974af7b

Contents?: true

Size: 1.36 KB

Versions: 37

Compression:

Stored size: 1.36 KB

Contents

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

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

        model Fog::AWS::Compute::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,
        #    creation_date=nil,
        #    ena_support=nil
        #  >
        #

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

        def all(filters_arg = filters)
          filters = filters_arg
          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

37 entries across 37 versions & 1 rubygems

Version Path
fog-aws-3.30.0 lib/fog/aws/models/compute/images.rb
fog-aws-3.29.0 lib/fog/aws/models/compute/images.rb
fog-aws-3.28.0 lib/fog/aws/models/compute/images.rb
fog-aws-3.27.0 lib/fog/aws/models/compute/images.rb
fog-aws-3.26.0 lib/fog/aws/models/compute/images.rb
fog-aws-3.25.0 lib/fog/aws/models/compute/images.rb
fog-aws-3.24.0 lib/fog/aws/models/compute/images.rb
fog-aws-3.23.0 lib/fog/aws/models/compute/images.rb
fog-aws-3.22.0 lib/fog/aws/models/compute/images.rb
fog-aws-3.21.1 lib/fog/aws/models/compute/images.rb
fog-aws-3.21.0 lib/fog/aws/models/compute/images.rb
fog-aws-3.20.0 lib/fog/aws/models/compute/images.rb
fog-aws-3.19.0 lib/fog/aws/models/compute/images.rb
fog-aws-3.18.0 lib/fog/aws/models/compute/images.rb
fog-aws-3.17.0 lib/fog/aws/models/compute/images.rb
fog-aws-3.16.0 lib/fog/aws/models/compute/images.rb
fog-aws-3.15.0 lib/fog/aws/models/compute/images.rb
fog-aws-3.14.0 lib/fog/aws/models/compute/images.rb
fog-aws-3.13.0 lib/fog/aws/models/compute/images.rb
fog-aws-3.12.0 lib/fog/aws/models/compute/images.rb