Class: Exec::ServiceComponentDelete
- Inherits:
-
ExecutableCommand
- Object
- ExecutableCommand
- Exec::ServiceComponentDelete
- Defined in:
- lib/exec/service_component_delete.rb
Overview
Allows the user to delete 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 |
# File 'lib/exec/service_component_delete.rb', line 27 def exec # @todo traiter les exceptions Color::print_log("NONE", "deleting service component...", @stdout) cmd = Command::.new(@values["cluster"], @values["component"], @values["host"]) cmd.exec() Color::echo_ok(@stdout) @stdout.puts("Component #{@values["component"]} has been successfully removed from host #{@values["host"]} in cluster #{@values["cluster"]}.") 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_delete.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 |