2010-10-04 17:02:08 -04:00
|
|
|
require 'fog/core/model'
|
2010-09-07 19:26:01 -04:00
|
|
|
|
|
|
|
module Fog
|
2011-06-16 19:28:54 -04:00
|
|
|
module Compute
|
|
|
|
class Bluebox
|
2010-09-07 19:26:01 -04:00
|
|
|
|
|
|
|
class Image < Fog::Model
|
|
|
|
|
|
|
|
identity :id
|
2011-09-07 15:43:12 -04:00
|
|
|
|
|
|
|
attribute :block_id
|
2010-09-07 19:26:01 -04:00
|
|
|
attribute :description
|
|
|
|
attribute :public
|
|
|
|
attribute :created_at, :aliases => 'created'
|
2011-09-07 15:43:12 -04:00
|
|
|
|
|
|
|
def save
|
|
|
|
requires :block_id
|
|
|
|
|
|
|
|
data = connection.create_template(block_id, attributes)
|
|
|
|
true
|
|
|
|
end
|
|
|
|
|
|
|
|
def destroy
|
|
|
|
requires :id
|
|
|
|
|
|
|
|
data = connection.destroy_template(id)
|
|
|
|
true
|
|
|
|
end
|
|
|
|
|
2010-09-07 19:26:01 -04:00
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|