2012-11-14 08:31:02 -05:00
|
|
|
require 'fog/core/collection'
|
|
|
|
require 'fog/vsphere/models/compute/folder'
|
|
|
|
|
|
|
|
module Fog
|
|
|
|
module Compute
|
|
|
|
class Vsphere
|
|
|
|
|
|
|
|
class Folders < Fog::Collection
|
|
|
|
|
|
|
|
model Fog::Compute::Vsphere::Folder
|
|
|
|
attr_accessor :datacenter, :type, :path
|
|
|
|
|
|
|
|
def all(filters = { })
|
|
|
|
requires :datacenter
|
|
|
|
requires :type
|
2012-12-22 18:21:53 -05:00
|
|
|
load service.list_folders(filters.merge(:datacenter => datacenter, :type => type, :path => path))
|
2012-11-14 08:31:02 -05:00
|
|
|
end
|
|
|
|
|
|
|
|
def get(id)
|
|
|
|
requires :datacenter
|
2012-12-22 18:21:53 -05:00
|
|
|
new service.get_folder(id, datacenter, type)
|
2012-11-14 08:31:02 -05:00
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|