Class: Shared::NodeInstance Abstract
- Inherits:
-
StateResource
- Object
- Resource
- StateResource
- Shared::NodeInstance
- Defined in:
- lib/vas/shared/node_instances.rb
Overview
A node instance, i.e. an instance on an individual node
Direct Known Subclasses
Gemfire::AgentNodeInstance, Gemfire::CacheServerNodeInstance, Gemfire::LocatorNodeInstance, RabbitMq::NodeInstance, Sqlfire::AgentNodeInstance, Sqlfire::LocatorNodeInstance, Sqlfire::ServerNodeInstance, TcServer::NodeInstance, WebServer::NodeInstance
Instance Attribute Summary collapse
-
#name ⇒ String
readonly
The instance’s name.
Attributes inherited from Resource
Instance Method Summary collapse
-
#group_instance ⇒ Instance
The node instance’s group instance.
-
#initialize(location, client, node_class, logs_class, group_instance_class, group_instance_type, node_live_configurations_class) ⇒ NodeInstance
constructor
A new instance of NodeInstance.
-
#live_configurations ⇒ Object
The node instance’s live configuration.
-
#logs ⇒ Logs
The instance’s logs.
-
#node ⇒ GroupableNode
The node that contains this instance.
-
#to_s ⇒ String
A string representation of the node instance.
Methods inherited from StateResource
Constructor Details
#initialize(location, client, node_class, logs_class, group_instance_class, group_instance_type, node_live_configurations_class) ⇒ NodeInstance
Returns a new instance of NodeInstance.
37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 |
# File 'lib/vas/shared/node_instances.rb', line 37 def initialize(location, client, node_class, logs_class, group_instance_class, group_instance_type, node_live_configurations_class) super(location, client) @name = details['name'] @node_class = node_class @logs_class = logs_class @group_instance_class = group_instance_class @live_configurations_class = node_live_configurations_class @node_location = Util::LinkUtils.get_link_href(details, 'node') @logs_location = Util::LinkUtils.get_link_href(details, 'logs') @group_instance_location = Util::LinkUtils.get_link_href(details, group_instance_type) @live_configurations_location = Util::LinkUtils.get_link_href(details, 'node-live-configurations') end |
Instance Attribute Details
#name ⇒ String (readonly)
Returns the instance’s name.
34 35 36 |
# File 'lib/vas/shared/node_instances.rb', line 34 def name @name end |
Instance Method Details
#group_instance ⇒ Instance
Returns the node instance’s group instance.
65 66 67 |
# File 'lib/vas/shared/node_instances.rb', line 65 def group_instance @group_instance ||= @group_instance_class.new(@group_instance_location, client) end |
#live_configurations ⇒ Object
Returns the node instance’s live configuration.
70 71 72 |
# File 'lib/vas/shared/node_instances.rb', line 70 def live_configurations @live_configurations ||= @live_configurations_class.new(@live_configurations_location, client) end |
#logs ⇒ Logs
Returns the instance’s logs.
60 61 62 |
# File 'lib/vas/shared/node_instances.rb', line 60 def logs @logs ||= @logs_class.new(@logs_location, client) end |
#node ⇒ GroupableNode
Returns the node that contains this instance.
55 56 57 |
# File 'lib/vas/shared/node_instances.rb', line 55 def node @node ||= @node_class.new(@node_location, client) end |
#to_s ⇒ String
Returns a string representation of the node instance.
75 76 77 |
# File 'lib/vas/shared/node_instances.rb', line 75 def to_s "#<#{self.class} name='#@name'>" end |