Class: Fog::Compute::AWS::Image

Inherits:
Model
  • Object
show all
Defined in:
lib/fog/aws/models/compute/image.rb

Instance Method Summary collapse

Instance Method Details

#deregister(delete_snapshot = false) ⇒ Object



26
27
28
29
30
31
32
33
34
35
# File 'lib/fog/aws/models/compute/image.rb', line 26

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

#ready?Boolean

Returns:

  • (Boolean)


37
38
39
# File 'lib/fog/aws/models/compute/image.rb', line 37

def ready?
  state == 'available'
end