# File lib/fog/ibm/models/storage/volume.rb, line 47 def attach(instance_id) requires :id service.attach_volume(instance_id, id).body['success'] end
# File lib/fog/ibm/models/storage/volume.rb, line 43 def attached? state == "Attached" end
# File lib/fog/ibm/models/storage/volume.rb, line 57 def created_at Time.at(attributes[:created_at].to_f / 1000) end
# File lib/fog/ibm/models/storage/volume.rb, line 61 def destroy requires :id service.delete_volume(id) true end
# File lib/fog/ibm/models/storage/volume.rb, line 52 def detach(instance_id) requires :id service.detach_volume(instance_id, id).body['success'] end
# File lib/fog/ibm/models/storage/volume.rb, line 67 def instance return nil if instance_id.nil? || instance_id == "0" || instance_id == "" Fog::Compute[:ibm].servers.get(instance_id) end
# File lib/fog/ibm/models/storage/volume.rb, line 72 def location requires :location_id Fog::Compute[:ibm].locations.get(location_id) end
Are we ready to be attached to an instance?
# File lib/fog/ibm/models/storage/volume.rb, line 78 def ready? # TODO: Not sure if this is the only state we should be matching. state == "Detached" end
# File lib/fog/ibm/models/storage/volume.rb, line 83 def save raise Fog::Errors::Error.new('Resaving an existing object may create a duplicate') if persisted? requires :name, :offering_id, :format, :location_id, :size data = service.create_volume(name, offering_id, format, location_id, size) merge_attributes(data.body) true end
Generated with the Darkfish Rdoc Generator 2.