1
0
Fork 0
mirror of https://github.com/fog/fog.git synced 2022-11-09 13:51:43 -05:00
fog--fog/lib/fog/fogdocker/models/compute/image.rb

38 lines
720 B
Ruby
Raw Normal View History

2014-02-16 01:06:49 +02:00
module Fog
module Compute
class Fogdocker
class Image < Fog::Model
identity :id
attr_accessor :info
2014-02-27 12:40:39 +02:00
attribute :repo_tags
2014-02-16 01:06:49 +02:00
attribute :created
attribute :size
attribute :virtual_size
2014-02-27 12:40:39 +02:00
def name
repo_tags.empty? ? id : repo_tags.first
end
2014-02-16 01:06:49 +02:00
def ready?
!(status =~ /down/i)
end
def destroy(options = {})
service.image_delete(id)
end
def save
raise Fog::Errors::Error.new('Resaving an existing object may create a duplicate') if persisted?
service.image_create(attributes)
end
def to_s
name
end
end
end
end
end