class Fog::Volume::OpenStack::V2::Volume

Public Instance Methods

save() click to toggle source
# File lib/fog/openstack/models/volume_v2/volume.rb, line 15
def save
  requires :name, :size
  data = if id.nil?
           service.create_volume(name, description, size, attributes)
         else
           service.update_volume(id, attributes.reject { |k, _v| k == :id })
         end
  merge_attributes(data.body['volume'])
  true
end
update(attr = nil) click to toggle source
# File lib/fog/openstack/models/volume_v2/volume.rb, line 26
def update(attr = nil)
  requires :id
  merge_attributes(
    service.update_volume(id, attr || attributes).body['volume'])
  self
end