Sha256: 7c6833f9e2ba19f28eec9da5ba9d6429e8cdcf156ddec58754a34d98cb9faa38
Contents?: true
Size: 809 Bytes
Versions: 20
Compression:
Stored size: 809 Bytes
Contents
class AttachmentsController < MVCLI::Controller requires :compute requires :volumes def index #Maybe it would be best to give better information about the #attachments? #Maybe list the volume information rather than attachment info server.attachments.all end def attach server.attach_volume volume end def detach id = volume.id attachment(id).detach end def show id = volume.id attachment id end private def volume volumes.all.find {|v| v.display_name == params[:id]} or fail Fog::Errors::NotFound end def server compute.servers.all.find {|s| s.name == params[:server_id]} or fail Fog::Errors::NotFound end def attachment vol_id server.attachments.find {|a| a.volume_id == vol_id} or fail Fog::Errors::NotFound end end
Version data entries
20 entries across 20 versions & 1 rubygems