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