2012-12-04 02:18:10 -05:00
|
|
|
require 'fog/core/collection'
|
|
|
|
require 'fog/hp/models/block_storage/volume'
|
|
|
|
|
|
|
|
module Fog
|
2013-01-14 17:51:41 -05:00
|
|
|
module HP
|
|
|
|
class BlockStorage
|
2012-12-04 02:18:10 -05:00
|
|
|
class BootableVolumes < Fog::Collection
|
2013-01-14 17:51:41 -05:00
|
|
|
model Fog::HP::BlockStorage::Volume
|
2012-12-04 02:18:10 -05:00
|
|
|
|
|
|
|
def all
|
2013-01-18 15:08:27 -05:00
|
|
|
data = service.list_bootable_volumes.body['volumes']
|
2012-12-04 02:18:10 -05:00
|
|
|
load(data)
|
|
|
|
end
|
|
|
|
|
|
|
|
def get(volume_id)
|
2013-01-18 15:08:27 -05:00
|
|
|
volume = service.get_bootable_volume_details(volume_id).body['volume']
|
2012-12-04 02:18:10 -05:00
|
|
|
new(volume)
|
2013-01-14 17:51:41 -05:00
|
|
|
rescue Fog::HP::BlockStorage::NotFound
|
2012-12-04 02:18:10 -05:00
|
|
|
nil
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|