mirror of
https://github.com/fog/fog.git
synced 2022-11-09 13:51:43 -05:00
258275929b
cleaned up clone function from server model Added better use of resource pool, dest_folder Added new datastore selection, simplified vm_clone.rb Added Customization specs for linux machines Added a new call from datacenters method to grab virtual_servers in datacenter
39 lines
853 B
Ruby
39 lines
853 B
Ruby
module Fog
|
|
module Compute
|
|
class Vsphere
|
|
|
|
class Datacenter < Fog::Model
|
|
|
|
identity :id
|
|
attribute :name
|
|
attribute :status
|
|
|
|
def clusters filters = { }
|
|
connection.clusters({ :datacenter => name }.merge(filters))
|
|
end
|
|
|
|
def networks filters = { }
|
|
connection.networks({ :datacenter => name }.merge(filters))
|
|
end
|
|
|
|
def datastores filters = { }
|
|
connection.datastores({ :datacenter => name }.merge(filters))
|
|
end
|
|
|
|
def vm_folders filters = { }
|
|
connection.folders({ :datacenter => name, :type => :vm }.merge(filters))
|
|
end
|
|
|
|
def virtual_machines filters = {}
|
|
connection.servers({ :datacenter => name }.merge(filters))
|
|
end
|
|
|
|
def to_s
|
|
name
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
end
|
|
end
|