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

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

Instance Attribute Summary

Attributes inherited from OpenStack::Model

#project

Instance Method Summary collapse

Methods inherited from OpenStack::Model

#create, #initialize, #save, #update

Constructor Details

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

Instance Method Details

#destroyObject


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

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

#metadataObject


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

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

#metadata=(new_metadata = {}) ⇒ Object


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

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

#ready?Boolean


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

def ready?
  status == 'ACTIVE'
end