Class: Shared::Node Abstract

Inherits:
Resource show all
Defined in:
lib/vas/shared/nodes.rb

Overview

This class is abstract.

A node, i.e. a machine with the vFabric Administration agent installed on it

Direct Known Subclasses

GroupableNode, VFabric::Node

Instance Attribute Summary collapse

Attributes inherited from Resource

#location, #security

Instance Method Summary collapse

Constructor Details

#initialize(location, client) ⇒ Node

Returns a new instance of Node.



47
48
49
# File 'lib/vas/shared/nodes.rb', line 47

def initialize(location, client)
  super(location, client)
end

Instance Attribute Details

#agent_homeString (readonly)

Returns the location of the vFabric Administration agent.

Returns:

  • (String)

    the location of the vFabric Administration agent



23
24
25
# File 'lib/vas/shared/nodes.rb', line 23

def agent_home
  @agent_home
end

#architectureString (readonly)

Returns the architecture of the node’s operating system.

Returns:

  • (String)

    the architecture of the node’s operating system



26
27
28
# File 'lib/vas/shared/nodes.rb', line 26

def architecture
  @architecture
end

#host_namesString (readonly)

Returns the node’s host names.

Returns:

  • (String)

    the node’s host names



29
30
31
# File 'lib/vas/shared/nodes.rb', line 29

def host_names
  @host_names
end

#ip_addressesString[] (readonly)

Returns the node’s IP addresses.

Returns:

  • (String[])

    the node’s IP addresses



32
33
34
# File 'lib/vas/shared/nodes.rb', line 32

def ip_addresses
  @ip_addresses
end

#ipv4_addressesString[]? (readonly)

Returns the node’s IPv4 addresses. nil if the server is not version 1.1.0 or later.

Returns:

  • (String[], nil)

    the node’s IPv4 addresses. nil if the server is not version 1.1.0 or later



35
36
37
# File 'lib/vas/shared/nodes.rb', line 35

def ipv4_addresses
  @ipv4_addresses
end

#ipv6_addressesString[]? (readonly)

Returns the node’s IPv6 addresses. nil if the server is not version 1.1.0 or later.

Returns:

  • (String[], nil)

    the node’s IPv6 addresses. nil if the server is not version 1.1.0 or later



38
39
40
# File 'lib/vas/shared/nodes.rb', line 38

def ipv6_addresses
  @ipv6_addresses
end

#metadataHash (readonly)

Returns the node’s metadata.

Returns:

  • (Hash)

    the node’s metadata



44
45
46
# File 'lib/vas/shared/nodes.rb', line 44

def 
  @metadata
end

#operating_systemString (readonly)

Returns the node’s operating system.

Returns:

  • (String)

    the node’s operating system



41
42
43
# File 'lib/vas/shared/nodes.rb', line 41

def operating_system
  @operating_system
end

Instance Method Details

#reloadvoid

This method returns an undefined value.

Reloads the node’s details from the server



54
55
56
57
58
59
60
61
62
63
64
# File 'lib/vas/shared/nodes.rb', line 54

def reload
  super
  @agent_home = details['agent-home']
  @architecture = details['architecture']
  @host_names = details['host-names']
  @ip_addresses = details['ip-addresses']
  @ipv4_addresses = details['ipv4-addresses']
  @ipv6_addresses = details['ipv6-addresses']
  @metadata = details['metadata']
  @operating_system = details['operating-system']
end

#update(metadata) ⇒ void

This method returns an undefined value.

Updates the node’s metadata



68
69
70
71
# File 'lib/vas/shared/nodes.rb', line 68

def update()
  client.post(location, {:metadata => })
  reload
end