2012-11-14 08:31:02 -05:00
|
|
|
require 'fog/core/collection'
|
|
|
|
require 'fog/vsphere/models/compute/cluster'
|
|
|
|
|
|
|
|
module Fog
|
|
|
|
module Compute
|
|
|
|
class Vsphere
|
|
|
|
class Clusters < Fog::Collection
|
|
|
|
model Fog::Compute::Vsphere::Cluster
|
|
|
|
attr_accessor :datacenter
|
|
|
|
|
|
|
|
def all(filters = {})
|
|
|
|
requires :datacenter
|
2012-12-22 18:21:53 -05:00
|
|
|
load service.list_clusters(filters.merge(:datacenter => datacenter))
|
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_cluster(id, datacenter)
|
2012-11-14 08:31:02 -05:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|