Class: Fog::Compute::Brightbox::Image
Instance Method Summary
collapse
#lock!, #locked?, #unlock!
#collection_name, #resource_name
Instance Method Details
#destroy ⇒ Object
57
58
59
60
61
|
# File 'lib/fog/brightbox/models/compute/image.rb', line 57
def destroy
requires :identity
service.destroy_image(identity)
true
end
|
#ready? ⇒ Boolean
38
39
40
|
# File 'lib/fog/brightbox/models/compute/image.rb', line 38
def ready?
status == "available"
end
|
#save ⇒ Object
42
43
44
45
46
47
48
49
50
51
52
53
54
55
|
# File 'lib/fog/brightbox/models/compute/image.rb', line 42
def save
raise Fog::Errors::Error.new("Resaving an existing object may create a duplicate") if persisted?
requires :source, :arch
options = {
:source => source,
:arch => arch,
:name => name,
:username => username,
:description => description
}.delete_if { |_k, v| v.nil? || v == "" }
data = service.create_image(options)
merge_attributes(data)
true
end
|