Class: Shared::NodeInstance Abstract

Inherits:
StateResource show all
Defined in:
lib/vas/shared/node_instances.rb

Overview

This class is abstract.

A node instance, i.e. an instance on an individual node

Instance Attribute Summary collapse

Attributes inherited from Resource

#location, #security

Instance Method Summary collapse

Methods inherited from StateResource

#start, #state, #stop

Constructor Details

#initialize(location, client, node_class, logs_class, group_instance_class, group_instance_type) ⇒ NodeInstance

Returns a new instance of NodeInstance.



46
47
48
49
50
51
52
53
54
# File 'lib/vas/shared/node_instances.rb', line 46

def initialize(location, client, node_class, logs_class, group_instance_class, group_instance_type) #:nodoc:
  super(location, client)

  @name = details["name"]

  @node = node_class.new(Util::LinkUtils.get_link_href(details, "node"), client)
  @logs = logs_class.new(Util::LinkUtils.get_link_href(details, "logs"), client)
  @group_instance = group_instance_class.new(Util::LinkUtils.get_link_href(details, group_instance_type), client)
end

Instance Attribute Details

#group_instanceInstance (readonly)

Returns the node instance’s group instance.

Returns:

  • (Instance)

    the node instance’s group instance



43
44
45
# File 'lib/vas/shared/node_instances.rb', line 43

def group_instance
  @group_instance
end

#logsLogs (readonly)

Returns the instance’s Logs.

Returns:

  • (Logs)

    the instance’s Logs



40
41
42
# File 'lib/vas/shared/node_instances.rb', line 40

def logs
  @logs
end

#nameString (readonly)

Returns the instance’s name.

Returns:

  • (String)

    the instance’s name



34
35
36
# File 'lib/vas/shared/node_instances.rb', line 34

def name
  @name
end

#nodeGroupableNode (readonly)

Returns the node that contains this instance.

Returns:



37
38
39
# File 'lib/vas/shared/node_instances.rb', line 37

def node
  @node
end

Instance Method Details

#to_sString

Returns a string representation of the node instance.

Returns:

  • (String)

    a string representation of the node instance



57
58
59
# File 'lib/vas/shared/node_instances.rb', line 57

def to_s #:nodoc:
  "#<#{self.class} name='#@name'>"
end