Class: Fog::Compute::OpenStack::Image
- Inherits:
-
Model
- Object
- Model
- Fog::Compute::OpenStack::Image
show all
- Defined in:
- lib/fog/openstack/models/compute/image.rb
Instance Attribute Summary
Attributes inherited from Model
#collection, #connection
Instance Method Summary
collapse
Methods inherited from Model
#inspect, #reload, #symbolize_keys, #to_json, #wait_for
#_load, #aliases, #attribute, #attributes, #identity, #ignore_attributes, #ignored_attributes
#_dump, #attributes, #dup, #identity, #identity=, #merge_attributes, #new_record?, #requires, #requires_one
Constructor Details
#initialize(attributes) ⇒ Image
23
24
25
26
|
# File 'lib/fog/openstack/models/compute/image.rb', line 23
def initialize(attributes)
@connection = attributes[:connection]
super
end
|
Instance Method Details
#destroy ⇒ Object
43
44
45
46
47
|
# File 'lib/fog/openstack/models/compute/image.rb', line 43
def destroy
requires :id
connection.delete_image(id)
true
end
|
28
29
30
31
32
33
34
35
|
# File 'lib/fog/openstack/models/compute/image.rb', line 28
def metadata
@metadata ||= begin
Fog::Compute::OpenStack::Metadata.new({
:connection => connection,
:parent => self
})
end
end
|
37
38
39
40
41
|
# File 'lib/fog/openstack/models/compute/image.rb', line 37
def metadata=(new_metadata={})
metas = []
new_metadata.each_pair {|k,v| metas << {"key" => k, "value" => v} }
metadata.load(metas)
end
|
#ready? ⇒ Boolean
49
50
51
|
# File 'lib/fog/openstack/models/compute/image.rb', line 49
def ready?
status == 'ACTIVE'
end
|