Class: Command::CrowbarClusterAllocate

Inherits:
CrowbarCommand show all
Defined in:
lib/command/crowbar_cluster_allocate.rb

Overview

CrowbarCommand implementation for list Crowbar nodes.

Author:

  • aboudot

Instance Attribute Summary collapse

Attributes inherited from BasicCommand

#logger, #receiver

Instance Method Summary collapse

Constructor Details

#initialize(logger, cluster_name, all_nodes, list_node = nil) ⇒ CrowbarClusterAllocate

Default constructor



23
24
25
26
27
28
29
# File 'lib/command/crowbar_cluster_allocate.rb', line 23

def initialize(logger, cluster_name, all_nodes, list_node = nil)
  super(logger)
  @logger.info("Command::CrowbarClusterAllocate   initialize the parameters...")
  @list_node = list_node
  @all_nodes = all_nodes
  @cluster_name = cluster_name
end

Instance Attribute Details

#cluster_nameObject (readonly)

Returns the value of attribute cluster_name.



18
19
20
# File 'lib/command/crowbar_cluster_allocate.rb', line 18

def cluster_name
  @cluster_name
end

#list_nodesObject (readonly)

Returns the value of attribute list_nodes.



17
18
19
# File 'lib/command/crowbar_cluster_allocate.rb', line 17

def list_nodes
  @list_nodes
end

Instance Method Details

#execObject

Run the command on receiver.

Returns:

  • output The output standard



34
35
36
37
38
39
40
# File 'lib/command/crowbar_cluster_allocate.rb', line 34

def exec()
  output = ""

  output += @receiver.crowbar_allocate_cluster(@cluster_name, @all_nodes, @list_node)

  return output
end