Class: Fog::Vsphere::Compute::Cluster

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

Instance Method Summary collapse

Instance Method Details

#datastores(filters = {}) ⇒ Object



22
23
24
25
26
27
28
# File 'lib/fog/vsphere/models/compute/cluster.rb', line 22

def datastores(filters = {})
  attributes[:datastores] ||= id.nil? ? [] : service.datastores({
    service: service,
    cluster: full_path,
    datacenter: datacenter
  }.merge(filters))
end

#hostsObject



42
43
44
# File 'lib/fog/vsphere/models/compute/cluster.rb', line 42

def hosts
  service.hosts(datacenter: datacenter, cluster: full_path)
end

#networks(filters = {}) ⇒ Object



30
31
32
33
34
35
36
# File 'lib/fog/vsphere/models/compute/cluster.rb', line 30

def networks(filters = {})
  attributes[:networks] ||= id.nil? ? [] : service.networks({
    service: service,
    cluster: full_path,
    datacenter: datacenter
  }.merge(filters))
end

#resource_pools(filters = {}) ⇒ Object



14
15
16
17
18
19
20
# File 'lib/fog/vsphere/models/compute/cluster.rb', line 14

def resource_pools(filters = {})
  attributes[:resource_pools] ||= id.nil? ? [] : service.resource_pools({
    service: service,
    cluster: full_path,
    datacenter: datacenter
  }.merge(filters))
end

#rulesObject



38
39
40
# File 'lib/fog/vsphere/models/compute/cluster.rb', line 38

def rules
  service.rules(datacenter: datacenter, cluster: full_path)
end

#to_sObject



46
47
48
# File 'lib/fog/vsphere/models/compute/cluster.rb', line 46

def to_s
  name
end