Class: Fog::Compute::Vsphere::Datacenter

Inherits:
Model
  • Object
show all
Defined in:
lib/fog/vsphere/models/compute/datacenter.rb

Instance Attribute Summary

Attributes inherited from Model

#collection, #service

Instance Method Summary collapse

Methods inherited from Model

#initialize, #inspect, #reload, #symbolize_keys, #to_json, #wait_for

Methods included from Attributes::ClassMethods

#_load, #aliases, #attribute, #attributes, #identity, #ignore_attributes, #ignored_attributes

Methods included from Fog::Core::DeprecatedConnectionAccessors

#connection, #connection=, #prepare_service_value

Methods included from Attributes::InstanceMethods

#_dump, #attributes, #dup, #identity, #identity=, #merge_attributes, #new_record?, #persisted?, #requires, #requires_one

Constructor Details

This class inherits a constructor from Fog::Model

Instance Method Details

#clusters(filters = { }) ⇒ Object



11
12
13
# File 'lib/fog/vsphere/models/compute/datacenter.rb', line 11

def clusters filters = { }
  service.clusters({ :datacenter => name }.merge(filters))
end

#customfields(filters = {}) ⇒ Object



31
32
33
# File 'lib/fog/vsphere/models/compute/datacenter.rb', line 31

def customfields filters = {}
  service.customfields({ :datacenter => name}.merge(filters))
end

#datastores(filters = { }) ⇒ Object



19
20
21
# File 'lib/fog/vsphere/models/compute/datacenter.rb', line 19

def datastores filters = { }
  service.datastores({ :datacenter => name }.merge(filters))
end

#networks(filters = { }) ⇒ Object



15
16
17
# File 'lib/fog/vsphere/models/compute/datacenter.rb', line 15

def networks filters = { }
  service.networks({ :datacenter => name }.merge(filters))
end

#servertypes(filters = {}) ⇒ Object



35
36
37
# File 'lib/fog/vsphere/models/compute/datacenter.rb', line 35

def servertypes filters={}
  service.servertypes({:datacenter => name }.merge(filters))
end

#to_sObject



39
40
41
# File 'lib/fog/vsphere/models/compute/datacenter.rb', line 39

def to_s
  name
end

#virtual_machines(filters = {}) ⇒ Object



27
28
29
# File 'lib/fog/vsphere/models/compute/datacenter.rb', line 27

def virtual_machines filters = {}
  service.servers({ :datacenter => name }.merge(filters))
end

#vm_folders(filters = { }) ⇒ Object



23
24
25
# File 'lib/fog/vsphere/models/compute/datacenter.rb', line 23

def vm_folders filters = { }
  service.folders({ :datacenter => name, :type => :vm }.merge(filters))
end