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

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

Instance Attribute Summary

Attributes inherited from Model

#collection, #connection

Instance Method Summary collapse

Methods inherited from Model

#initialize, #inspect, #reload, #symbolize_keys, #to_json, #wait_for

Methods included from Attributes::ClassMethods

#_load, #aliases, #attribute, #attributes, #identity, #ignore_attributes, #ignored_attributes

Methods included from Attributes::InstanceMethods

#_dump, #attributes, #dup, #identity, #identity=, #merge_attributes, #new_record?, #requires, #requires_one

Constructor Details

This class inherits a constructor from Fog::Model

Instance Method Details

#deregister(delete_snapshot = false) ⇒ Object



29
30
31
32
33
34
35
36
37
38
# File 'lib/rackspace-fog/aws/models/compute/image.rb', line 29

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

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

#ready?Boolean

Returns:

  • (Boolean)


40
41
42
# File 'lib/rackspace-fog/aws/models/compute/image.rb', line 40

def ready?
  state == 'available'
end