mirror of
https://github.com/fog/fog.git
synced 2022-11-09 13:51:43 -05:00
25 lines
548 B
Ruby
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
|