Class: Fog::Hyperv::Compute::Cluster
- Defined in:
- lib/fog/hyperv/compute/models/cluster.rb
Overview
A cluster known to Hyper-V
This model is read-only and strictly informative
Instance Attribute Summary collapse
-
#description ⇒ String
readonly
The description of the cluster.
-
#domain ⇒ String
readonly
The domain of the cluster.
- #hosts ⇒ Object readonly
-
#id ⇒ String
readonly
The GUID of the cluster.
-
#name ⇒ String
readonly
The name of the cluster.
Instance Method Summary collapse
-
#reload ⇒ Object
Reload the cluster information from Hyper-V.
Methods inherited from Model
#initialize, #merge_attributes
Methods included from ModelExtends
Methods included from ModelIncludes
#cluster, #computer, #dirty, #dirty?, #vm
Constructor Details
This class inherits a constructor from Fog::Hyperv::Model
Instance Attribute Details
#description ⇒ String (readonly)
Returns the description of the cluster.
14 |
# File 'lib/fog/hyperv/compute/models/cluster.rb', line 14 attribute :description, type: :string |
#domain ⇒ String (readonly)
Returns the domain of the cluster.
17 |
# File 'lib/fog/hyperv/compute/models/cluster.rb', line 17 attribute :domain, type: :string |
#hosts ⇒ Object (readonly)
24 25 26 27 28 |
# File 'lib/fog/hyperv/compute/models/cluster.rb', line 24 def hosts return [] unless persisted? cluster_nodes.map { |n| service.hosts.get(n[:name]) } end |
#id ⇒ String (readonly)
Returns the GUID of the cluster.
10 |
# File 'lib/fog/hyperv/compute/models/cluster.rb', line 10 identity :id, type: :string |
#name ⇒ String (readonly)
Returns the name of the cluster.
20 |
# File 'lib/fog/hyperv/compute/models/cluster.rb', line 20 attribute :name, type: :string |
Instance Method Details
#reload ⇒ Object
Reload the cluster information from Hyper-V
31 32 33 34 35 36 37 38 39 40 41 42 |
# File 'lib/fog/hyperv/compute/models/cluster.rb', line 31 def reload requires :id data = service.get_cluster( id:, _return_fields: self.class.attributes ) return unless data merge_attributes(data.attributes) end |