Class: Shared::Node Abstract
Overview
A node, i.e. a machine with the vFabric Administration agent installed on it
Direct Known Subclasses
Instance Attribute Summary collapse
-
#agent_home ⇒ String
readonly
The location of the vFabric Administration agent.
-
#architecture ⇒ String
readonly
The architecture of the node’s operating system.
-
#host_names ⇒ String
readonly
The node’s host names.
-
#ip_addresses ⇒ String[]
readonly
The node’s IP addresses.
-
#ipv4_addresses ⇒ String[]?
readonly
The node’s IPv4 addresses.
-
#ipv6_addresses ⇒ String[]?
readonly
The node’s IPv6 addresses.
-
#metadata ⇒ Hash
readonly
The node’s metadata.
-
#operating_system ⇒ String
readonly
The node’s operating system.
Attributes inherited from Resource
Instance Method Summary collapse
-
#initialize(location, client) ⇒ Node
constructor
A new instance of Node.
-
#reload ⇒ void
Reloads the node’s details from the server.
-
#update(metadata) ⇒ void
Updates the node’s metadata.
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_home ⇒ String (readonly)
Returns the location of the vFabric Administration agent.
23 24 25 |
# File 'lib/vas/shared/nodes.rb', line 23 def agent_home @agent_home end |
#architecture ⇒ String (readonly)
Returns the architecture of the node’s operating system.
26 27 28 |
# File 'lib/vas/shared/nodes.rb', line 26 def architecture @architecture end |
#host_names ⇒ String (readonly)
Returns the node’s host names.
29 30 31 |
# File 'lib/vas/shared/nodes.rb', line 29 def host_names @host_names end |
#ip_addresses ⇒ String[] (readonly)
Returns the node’s IP addresses.
32 33 34 |
# File 'lib/vas/shared/nodes.rb', line 32 def ip_addresses @ip_addresses end |
#ipv4_addresses ⇒ String[]? (readonly)
Returns 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_addresses ⇒ String[]? (readonly)
Returns 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 |
#metadata ⇒ Hash (readonly)
Returns the node’s metadata.
44 45 46 |
# File 'lib/vas/shared/nodes.rb', line 44 def @metadata end |
#operating_system ⇒ String (readonly)
Returns the node’s operating system.
41 42 43 |
# File 'lib/vas/shared/nodes.rb', line 41 def @operating_system end |
Instance Method Details
#reload ⇒ void
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 |