Sha256: f144c84d5ecc9772ddfbec87d42988339fc8169a1a91028748e39af81c7698b3

Contents?: true

Size: 1.8 KB

Versions: 37

Compression:

Stored size: 1.8 KB

Contents

module Fog
  module AWS
    class Compute
      class Image < Fog::Model
        identity :id,                     :aliases => 'imageId'

        attribute :architecture
        attribute :block_device_mapping,  :aliases => 'blockDeviceMapping'
        attribute :description
        attribute :location,              :aliases => 'imageLocation'
        attribute :owner_id,              :aliases => 'imageOwnerId'
        attribute :owner_alias,           :aliases => 'imageOwnerAlias'
        attribute :state,                 :aliases => 'imageState'
        attribute :type,                  :aliases => 'imageType'
        attribute :is_public,             :aliases => 'isPublic'
        attribute :kernel_id,             :aliases => 'kernelId'
        attribute :platform
        attribute :product_codes,         :aliases => 'productCodes'
        attribute :ramdisk_id,            :aliases => 'ramdiskId'
        attribute :root_device_type,      :aliases => 'rootDeviceType'
        attribute :root_device_name,      :aliases => 'rootDeviceName'
        attribute :tags,                  :aliases => 'tagSet'
        attribute :name
        attribute :virtualization_type,   :aliases => 'virtualizationType'
        attribute :creation_date,         :aliases => 'creationDate'
        attribute :ena_support,           :aliases => 'enaSupport'

        def deregister(delete_snapshot = false)
          service.deregister_image(id)

          if(delete_snapshot && root_device_type == "ebs")
            block_device = block_device_mapping.find {|block_device| block_device['deviceName'] == root_device_name}
            service.snapshots.new(:id => block_device['snapshotId']).destroy
          else
            true
          end
        end

        def ready?
          state == 'available'
        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/image.rb
fog-aws-3.29.0 lib/fog/aws/models/compute/image.rb
fog-aws-3.28.0 lib/fog/aws/models/compute/image.rb
fog-aws-3.27.0 lib/fog/aws/models/compute/image.rb
fog-aws-3.26.0 lib/fog/aws/models/compute/image.rb
fog-aws-3.25.0 lib/fog/aws/models/compute/image.rb
fog-aws-3.24.0 lib/fog/aws/models/compute/image.rb
fog-aws-3.23.0 lib/fog/aws/models/compute/image.rb
fog-aws-3.22.0 lib/fog/aws/models/compute/image.rb
fog-aws-3.21.1 lib/fog/aws/models/compute/image.rb
fog-aws-3.21.0 lib/fog/aws/models/compute/image.rb
fog-aws-3.20.0 lib/fog/aws/models/compute/image.rb
fog-aws-3.19.0 lib/fog/aws/models/compute/image.rb
fog-aws-3.18.0 lib/fog/aws/models/compute/image.rb
fog-aws-3.17.0 lib/fog/aws/models/compute/image.rb
fog-aws-3.16.0 lib/fog/aws/models/compute/image.rb
fog-aws-3.15.0 lib/fog/aws/models/compute/image.rb
fog-aws-3.14.0 lib/fog/aws/models/compute/image.rb
fog-aws-3.13.0 lib/fog/aws/models/compute/image.rb
fog-aws-3.12.0 lib/fog/aws/models/compute/image.rb