2011-03-09 20:03:15 -05:00
|
|
|
require 'fog/core/collection'
|
2011-08-24 21:07:28 -04:00
|
|
|
require 'fog/virtual_box/models/compute/medium'
|
2011-03-09 20:03:15 -05:00
|
|
|
|
|
|
|
module Fog
|
2011-06-16 19:28:54 -04:00
|
|
|
module Compute
|
|
|
|
class VirtualBox
|
2011-03-09 20:03:15 -05:00
|
|
|
|
|
|
|
class Mediums < Fog::Collection
|
|
|
|
|
2011-06-16 19:28:54 -04:00
|
|
|
model Fog::Compute::VirtualBox::Medium
|
2011-03-09 20:03:15 -05:00
|
|
|
|
|
|
|
def all
|
|
|
|
data = []
|
|
|
|
data.concat(connection.dvd_images)
|
|
|
|
data.concat(connection.floppy_images)
|
|
|
|
data.concat(connection.hard_disks)
|
|
|
|
data = data.map do |medium|
|
|
|
|
{:raw => medium}
|
|
|
|
end
|
|
|
|
load(data)
|
|
|
|
end
|
|
|
|
|
|
|
|
def get(medium_identity)
|
|
|
|
data = connection.find_medium(medium_identity)
|
|
|
|
new(:raw => data)
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|