Class: Fog::OpenStack::Compute::Image

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

Instance Attribute Summary

Attributes inherited from Model

#project

Instance Method Summary collapse

Methods inherited from Model

#create, #initialize, #save, #update

Constructor Details

This class inherits a constructor from Fog::OpenStack::Model

Instance Method Details

#destroyObject



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

def destroy
  requires :id
  service.delete_image(id)
  true
end

#metadataObject



22
23
24
25
26
27
# File 'lib/fog/openstack/compute/models/image.rb', line 22

def 
  @metadata ||= begin
    Fog::OpenStack::Compute::Metadata.new(:service => service,
                                          :parent  => self)
  end
end

#metadata=(new_metadata = {}) ⇒ Object



29
30
31
32
33
# File 'lib/fog/openstack/compute/models/image.rb', line 29

def metadata=( = {})
  metas = []
  .to_hash.each_pair { |k, v| metas << {"key" => k, "value" => v} }
  .load(metas)
end

#ready?Boolean

Returns:

  • (Boolean)


41
42
43
# File 'lib/fog/openstack/compute/models/image.rb', line 41

def ready?
  status == 'ACTIVE'
end