2011-06-28 17:30:31 -04:00
|
|
|
require 'fog/core/model'
|
|
|
|
|
|
|
|
module Fog
|
2011-10-17 15:25:07 -04:00
|
|
|
module Compute
|
|
|
|
class HP
|
2011-06-28 17:30:31 -04:00
|
|
|
|
|
|
|
class Image < Fog::Model
|
|
|
|
|
|
|
|
identity :id
|
|
|
|
|
|
|
|
attribute :name
|
|
|
|
attribute :created_at, :aliases => 'created'
|
|
|
|
attribute :updated_at, :aliases => 'updated'
|
|
|
|
attribute :progress
|
|
|
|
attribute :status
|
2011-11-02 15:13:18 -04:00
|
|
|
attribute :minDisk, :aliases => 'min_disk'
|
|
|
|
attribute :minRam, :aliases => 'min_ram'
|
|
|
|
attribute :server, :aliases => 'server'
|
|
|
|
#attribute :metadata #TODO: Need to add it back when Metadata API is done
|
|
|
|
attribute :links
|
2011-06-28 17:30:31 -04:00
|
|
|
|
|
|
|
def destroy
|
|
|
|
requires :id
|
|
|
|
|
|
|
|
connection.delete_image(id)
|
|
|
|
true
|
|
|
|
end
|
|
|
|
|
|
|
|
def ready?
|
|
|
|
status == 'ACTIVE'
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|