# File lib/fog/openstack/models/compute/volume.rb, line 23 def initialize(attributes) @connection = attributes[:connection] super end
# File lib/fog/openstack/models/compute/volume.rb, line 41 def attach(server_id, name) requires :id data = connection.attach_volume(id, server_id, name) merge_attributes(:attachments => attachments << data.body['volumeAttachment']) true end
# File lib/fog/openstack/models/compute/volume.rb, line 35 def destroy requires :id connection.delete_volume(id) true end
# File lib/fog/openstack/models/compute/volume.rb, line 48 def detach(server_id, attachment_id) requires :id connection.detach_volume(server_id, attachment_id) true end
# File lib/fog/openstack/models/compute/volume.rb, line 28 def save requires :name, :description, :size data = connection.create_volume(name, description, size, attributes) merge_attributes(data.body['volume']) true end