2012-07-11 16:59:54 -04:00
|
|
|
require 'fog/core/collection'
|
|
|
|
require 'fog/hp/models/block_storage/volume'
|
|
|
|
|
|
|
|
module Fog
|
|
|
|
module BlockStorage
|
|
|
|
class HP
|
|
|
|
|
|
|
|
class Volumes < Fog::Collection
|
|
|
|
|
|
|
|
model Fog::BlockStorage::HP::Volume
|
|
|
|
|
2012-12-04 02:21:16 -05:00
|
|
|
def all
|
|
|
|
data = connection.list_volumes.body['volumes']
|
2012-07-11 16:59:54 -04:00
|
|
|
load(data)
|
|
|
|
end
|
|
|
|
|
|
|
|
def get(volume_id)
|
2012-12-04 02:21:16 -05:00
|
|
|
volume = connection.get_volume_details(volume_id).body['volume']
|
2012-11-14 15:09:48 -05:00
|
|
|
new(volume)
|
2012-07-11 16:59:54 -04:00
|
|
|
rescue Fog::BlockStorage::HP::NotFound
|
|
|
|
nil
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|