1
0
Fork 0
mirror of https://github.com/fog/fog.git synced 2022-11-09 13:51:43 -05:00
fog--fog/lib/fog/rackspace/models/block_storage/volumes.rb
2013-01-07 21:01:20 +00:00

25 lines
548 B
Ruby

require 'fog/core/collection'
require 'fog/rackspace/models/block_storage/volume'
module Fog
module Rackspace
class BlockStorage
class Volumes < Fog::Collection
model Fog::Rackspace::BlockStorage::Volume
def all
data = service.list_volumes.body['volumes']
load(data)
end
def get(volume_id)
data = service.get_volume(volume_id).body['volume']
new(data)
rescue Fog::Rackspace::BlockStorage::NotFound
nil
end
end
end
end
end