Sha256: 89b14a75d078f3712ec29c7e0e556ca647d63599b2a66fc54f956f0e1ec4a1e3

Contents?: true

Size: 1.36 KB

Versions: 15

Compression:

Stored size: 1.36 KB

Contents

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,
        #    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

15 entries across 13 versions & 2 rubygems

Version Path
fog-aws-3.1.0 lib/fog/aws/models/compute/images.rb
vagrant-packet-0.1.1 vendor/bundle/ruby/2.5.0/gems/fog-aws-2.0.1/lib/fog/aws/models/compute/images.rb
vagrant-packet-0.1.1 vendor/bundle/ruby/2.4.0/gems/fog-aws-2.0.1/lib/fog/aws/models/compute/images.rb
vagrant-packet-0.1.1 vendor/bundle/ruby/2.3.0/gems/fog-aws-2.0.1/lib/fog/aws/models/compute/images.rb
fog-aws-3.0.0 lib/fog/aws/models/compute/images.rb
fog-aws-2.0.1 lib/fog/aws/models/compute/images.rb
fog-aws-2.0.0 lib/fog/aws/models/compute/images.rb
fog-aws-1.4.1 lib/fog/aws/models/compute/images.rb
fog-aws-1.4.0 lib/fog/aws/models/compute/images.rb
fog-aws-1.3.0 lib/fog/aws/models/compute/images.rb
fog-aws-1.2.1 lib/fog/aws/models/compute/images.rb
fog-aws-1.2.0 lib/fog/aws/models/compute/images.rb
fog-aws-1.1.0 lib/fog/aws/models/compute/images.rb
fog-aws-1.0.0 lib/fog/aws/models/compute/images.rb
fog-aws-0.13.0 lib/fog/aws/models/compute/images.rb