2012-07-30 16:50:16 -04:00
|
|
|
require 'fog/core/model'
|
|
|
|
|
|
|
|
module Fog
|
|
|
|
module Compute
|
|
|
|
class RackspaceV2
|
|
|
|
class Image < Fog::Model
|
|
|
|
UNKNOWN = 'UNKNOWN'
|
|
|
|
ACTIVE = 'ACTIVE'
|
|
|
|
SAVING = 'SAVING'
|
|
|
|
ERROR = 'ERROR'
|
|
|
|
DELETED = 'DELETED'
|
|
|
|
|
|
|
|
identity :id
|
|
|
|
|
|
|
|
attribute :name
|
|
|
|
attribute :created
|
|
|
|
attribute :updated
|
|
|
|
attribute :state, :aliases => 'status'
|
|
|
|
attribute :user_id
|
|
|
|
attribute :tenant_id
|
|
|
|
attribute :progress
|
|
|
|
attribute :minDisk
|
|
|
|
attribute :minRam
|
|
|
|
attribute :metadata
|
|
|
|
attribute :disk_config, :aliases => 'OS-DCF:diskConfig'
|
|
|
|
attribute :links
|
2012-12-11 08:35:06 -06:00
|
|
|
|
|
|
|
def ready?
|
|
|
|
state == ACTIVE
|
|
|
|
end
|
|
|
|
|
|
|
|
def destroy
|
|
|
|
requires :identity
|
|
|
|
connection.delete_image(identity)
|
|
|
|
end
|
2012-07-30 16:50:16 -04:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|