Class: Exec::ServiceComponentAdd
- Inherits:
-
ExecutableCommand
- Object
- ExecutableCommand
- Exec::ServiceComponentAdd
- Defined in:
- lib/exec/service_component_add.rb
Overview
Allows the user to add a service component.
Instance Attribute Summary
Attributes inherited from ExecutableCommand
#argv, #command_name, #logger, #options, #stderr, #stdin, #stdout, #values
Instance Method Summary collapse
-
#exec ⇒ Object
private
Execution of the command.
-
#set_options ⇒ Object
private
Parse and check the parameters of the function.
Methods inherited from ExecutableCommand
#check_parameters, #create_logger, #initialize, #run
Constructor Details
This class inherits a constructor from Exec::ExecutableCommand
Instance Method Details
#exec ⇒ Object (private)
Execution of the command
27 28 29 30 31 32 33 34 35 36 |
# File 'lib/exec/service_component_add.rb', line 27 def exec # @todo traiter les exceptions Color::print_log("NONE", "adding service on cluser...", @stdout) @values["host"].split(" ").each do |host| cmd = Command::.new(@values["cluster"], @values["component"], host) cmd.exec() Color::echo_ok(@stdout) @stdout.puts("Component #{@values["component"]} has been successfully added on host #{@values["host"]} in cluster #{@values["cluster"]}.") end end |
#set_options ⇒ Object (private)
Parse and check the parameters of the function.
17 18 19 20 21 22 23 |
# File 'lib/exec/service_component_add.rb', line 17 def @logger.info("setting options") .add_option("C", "cluster", "The virtual cluster name.", true, true, method(:check_cluster_name)) .add_option("H", "host", "Limit request to this host.", true, true, method(:check_ambari_host_name)) .add_option("c", "component", "Limit request to this component type.", false, true, method(:check_hadoop_component_name)) .add_option("f", "follow", "Follow completion of the request.", false) end |