Sha256: 40b8c25e0d7383fca42029fdd07d4545a97f9ed4ed41a5c7d6bf211cde952ae8
Contents?: true
Size: 1.51 KB
Versions: 2
Compression:
Stored size: 1.51 KB
Contents
require "fog/brightbox/model" module Fog module Compute class Brightbox class Image < Fog::Brightbox::Model identity :id attribute :url attribute :resource_type attribute :name attribute :username attribute :status attribute :description attribute :source attribute :source_type attribute :arch attribute :virtual_size attribute :disk_size attribute :licence_name # Boolean flags attribute :public attribute :official attribute :compatibility_mode # Times attribute :created_at, :type => :time # Links - to be replaced attribute :ancestor_id, :aliases => "ancestor", :squash => "id" attribute :owner_id, :aliases => "owner", :squash => "id" def ready? status == "available" end def save raise Fog::Errors::Error.new('Resaving an existing object may create a duplicate') if persisted? requires :source, :arch options = { :source => source, :arch => arch, :name => name, :username => username, :description => description }.delete_if { |k, v| v.nil? || v == "" } data = service.create_image(options) merge_attributes(data) true end def destroy requires :identity service.destroy_image(identity) true end end end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
fog-brightbox-0.1.1 | lib/fog/brightbox/models/compute/image.rb |
fog-brightbox-0.1.0 | lib/fog/brightbox/models/compute/image.rb |