Fog::Model
volume can be attached to only one server at a time
# File lib/fog/hp/models/block_storage_v2/volume.rb, line 71 def attach(new_server_id, device) requires :id unless in_use? data = service.compute.attach_volume(new_server_id, id, device) merge_attributes(:attachments => attachments << data.body['volumeAttachment']) true else false end end
# File lib/fog/hp/models/block_storage_v2/volume.rb, line 58 def backing_up? self.status == 'backing-up' end
# File lib/fog/hp/models/block_storage_v2/volume.rb, line 90 def destroy requires :id service.delete_volume(id) true end
# File lib/fog/hp/models/block_storage_v2/volume.rb, line 82 def detach requires :id if has_attachments? service.compute.detach_volume(self.server_id, id) end true end
a volume can be attached to only one server at a time
# File lib/fog/hp/models/block_storage_v2/volume.rb, line 30 def device attachments[0]['device'] if has_attachments? end
a volume can be attached to only one server at a time
# File lib/fog/hp/models/block_storage_v2/volume.rb, line 49 def has_attachments? !(attachments.nil? || attachments.empty? || attachments[0].empty?) end
# File lib/fog/hp/models/block_storage_v2/volume.rb, line 44 def image_id @image_id = image_metadata['image_id'] if image_metadata end
used for creating bootable volumes
# File lib/fog/hp/models/block_storage_v2/volume.rb, line 40 def image_id=(new_image_id) @image_id = new_image_id end
# File lib/fog/hp/models/block_storage_v2/volume.rb, line 53 def in_use? self.status == 'in-use' end
# File lib/fog/hp/models/block_storage_v2/volume.rb, line 66 def ready? self.status == 'available' end
# File lib/fog/hp/models/block_storage_v2/volume.rb, line 62 def restoring? self.status == 'restoring-backup' end
Generated with the Darkfish Rdoc Generator 2.