Class: TcServer::NodeInstance

Inherits:
Shared::NodeInstance show all
Defined in:
lib/vas/tc_server/node_instances.rb

Overview

A tc Server node instance

Instance Attribute Summary collapse

Attributes inherited from Shared::NodeInstance

#name

Attributes inherited from Shared::Resource

#location, #security

Instance Method Summary collapse

Methods inherited from Shared::NodeInstance

#group_instance, #live_configurations, #logs, #node

Methods inherited from Shared::StateResource

#start, #state, #stop

Constructor Details

#initialize(location, client) ⇒ NodeInstance

Returns a new instance of NodeInstance.



42
43
44
45
46
47
48
# File 'lib/vas/tc_server/node_instances.rb', line 42

def initialize(location, client)
  super(location, client, Node, Logs, Instance, 'group-instance', NodeLiveConfigurations)

  @layout = details['layout']

  @applications_location = Util::LinkUtils.get_link_href(details, 'node-applications')
end

Instance Attribute Details

#layoutString (readonly)

Returns the instance’s layout.

Returns:

  • (String)

    the instance’s layout



33
34
35
# File 'lib/vas/tc_server/node_instances.rb', line 33

def layout
  @layout
end

#runtime_versionString (readonly)

Returns the version of runtime used by the instance.

Returns:

  • (String)

    the version of runtime used by the instance



36
37
38
# File 'lib/vas/tc_server/node_instances.rb', line 36

def runtime_version
  @runtime_version
end

#servicesHash (readonly)

Returns the instance’s services.

Returns:

  • (Hash)

    the instance’s services



39
40
41
# File 'lib/vas/tc_server/node_instances.rb', line 39

def services
  @services
end

Instance Method Details

#applicationsNodeApplications

Returns the instance’s applications.

Returns:



59
60
61
# File 'lib/vas/tc_server/node_instances.rb', line 59

def applications
  @applications ||= NodeApplications.new(@applications_location, client)
end

#reloadvoid

This method returns an undefined value.

Reloads the instance’s details from the server



52
53
54
55
56
# File 'lib/vas/tc_server/node_instances.rb', line 52

def reload
  super
  @runtime_version = details['runtime-version']
  @services = details['services']
end

#to_sString

Returns a string representation of the instance.

Returns:

  • (String)

    a string representation of the instance



64
65
66
# File 'lib/vas/tc_server/node_instances.rb', line 64

def to_s
  "#<#{self.class} name='#{name}' layout='#@layout' runtime_version='#@runtime_version' services='#@services'>"
end