2011-06-15 02:10:54 -04:00
|
|
|
require 'fog/core/model'
|
|
|
|
|
|
|
|
module Fog
|
|
|
|
module Compute
|
|
|
|
class HP
|
|
|
|
|
|
|
|
class Image < Fog::Model
|
|
|
|
|
|
|
|
identity :id
|
|
|
|
|
|
|
|
attribute :name
|
|
|
|
attribute :created_at, :aliases => 'created'
|
|
|
|
attribute :updated_at, :aliases => 'updated'
|
|
|
|
attribute :progress
|
|
|
|
attribute :status
|
|
|
|
attribute :minDisk, :aliases => 'min_disk'
|
|
|
|
attribute :minRam, :aliases => 'min_ram'
|
|
|
|
attribute :server, :aliases => 'server'
|
2012-09-04 06:29:45 -04:00
|
|
|
attribute :metadata
|
2011-06-15 02:10:54 -04:00
|
|
|
attribute :links
|
|
|
|
|
|
|
|
def destroy
|
|
|
|
requires :id
|
|
|
|
|
|
|
|
connection.delete_image(id)
|
|
|
|
true
|
|
|
|
end
|
|
|
|
|
|
|
|
def ready?
|
|
|
|
status == 'ACTIVE'
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|