attribute :metadata
# File lib/fog/hp/models/block_storage/snapshot.rb, line 19 def initialize(attributes = {}) # assign these attributes first to prevent race condition with persisted? self.force = attributes.delete(:force) # force snapshotting of attached volumes super end
# File lib/fog/hp/models/block_storage/snapshot.rb, line 25 def destroy requires :id service.delete_snapshot(id) true end
# File lib/fog/hp/models/block_storage/snapshot.rb, line 31 def force=(new_force) @force = new_force end
# File lib/fog/hp/models/block_storage/snapshot.rb, line 35 def ready? self.status == 'available' end
# File lib/fog/hp/models/block_storage/snapshot.rb, line 39 def save raise Fog::Errors::Error.new('Resaving an existing object may create a duplicate') if persisted? requires :name, :volume_id options = { #'metadata' => metadata, # TODO: Add metadata when snapshots support it 'force' => @force } options = options.reject {|key, value| value.nil?} data = service.create_snapshot(name, description, volume_id, options) merge_attributes(data.body['snapshot']) true end
Generated with the Darkfish Rdoc Generator 2.