Class: Fog::Compute::Hyperv::Cluster
- Inherits:
-
Hyperv::Model
- Object
- Model
- Hyperv::Model
- Fog::Compute::Hyperv::Cluster
- Defined in:
- lib/fog/hyperv/models/compute/cluster.rb
Instance Method Summary collapse
Methods inherited from Hyperv::Model
Methods included from Hyperv::ModelExtends
Methods included from Hyperv::ModelIncludes
#cluster, #computer, #dirty?, #lazy_attributes, #parent, #vm
Constructor Details
This class inherits a constructor from Fog::Hyperv::Model
Instance Method Details
#hosts ⇒ Object
22 23 24 |
# File 'lib/fog/hyperv/models/compute/cluster.rb', line 22 def hosts attributes[:hosts] ||= id.nil? ? [] : nodes.map { |n| service.hosts.get(n[:name]) } end |
#nodes ⇒ Object
end
18 19 20 |
# File 'lib/fog/hyperv/models/compute/cluster.rb', line 18 def nodes attributes[:nodes] ||= id.nil? ? [] : [service.get_cluster_node(cluster: name, _return_fields: [:description, :name, :node_name])].flatten end |
#reload ⇒ Object
26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 |
# File 'lib/fog/hyperv/models/compute/cluster.rb', line 26 def reload requires_one :domain, :name data = service.get_cluster( domain: domain, name: name, _return_fields: self.class.attributes, _json_depth: 1 ) attributes[:nodes] = nil attributes[:hosts] = nil merge_attributes(data.attributes) self end |