Class: Shared::NodeInstance

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

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

:nodoc:



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

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_instanceObject (readonly)

The node instance’s group instance



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

def group_instance
  @group_instance
end

#logsObject (readonly)

The instance’s Logs



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

def logs
  @logs
end

#nameObject (readonly)

The instance’s name



31
32
33
# File 'lib/vas/shared/node_instances.rb', line 31

def name
  @name
end

#nodeObject (readonly)

The node that contains this instance



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

def node
  @node
end

Instance Method Details

#to_sObject

:nodoc:



52
53
54
# File 'lib/vas/shared/node_instances.rb', line 52

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