lib/splash/cli/commands.rb in prometheus-splash-0.5.3 vs lib/splash/cli/commands.rb in prometheus-splash-0.6.0
- old
+ new
@@ -1,18 +1,22 @@
# coding: utf-8
+
+# module for all Thor subcommands
module CLISplash
-
+ # Thor inherited class for commands management
class Commands < Thor
include Splash::Config
include Splash::Backends
include Splash::Exiter
include Splash::Transports
include Splash::Templates
include Splash::Loggers
include Splash::Commands
+
+ # Thor method : execution of command
desc "execute NAME", "run for command/sequence or ack result"
long_desc <<-LONGDESC
execute command or sequence or ack result\n
with --no-trace prevent storing execution trace in configured backend (see config file)\n
with --ack, notify errorcode=0 to Prometheus PushGateway\n
@@ -72,10 +76,11 @@
splash_exit case: :not_root, :more => "Command execution"
end
end
+ # Thor method : scheduling commands
desc "schedule NAME", "Schedule excution of command on Splash daemon"
long_desc <<-LONGDESC
Schedule excution of command on Splash daemon\n
with --hostname, Schedule on an other Splash daemon via transport\n
with --at TIME/DATE, Schedule at specified date/time, like 2030/12/12 23:30:00 or 12:00 \n
@@ -114,11 +119,11 @@
res[:more] = "Remote command : :execute_command with schedule"
splash_exit res
end
-
+ # Thor method : getting a treeview of sequence of commands
desc "treeview", "Show commands sequence tree"
long_desc <<-LONGDESC
Show commands sequence tree\n
with --hostname, ask other Splash daemon via transport\n
LONGDESC
@@ -162,10 +167,11 @@
end
aproc.call(command,depht)
end
+ # Thor method : getting the list of avaible commands in splash config
desc "list", "Show configured commands"
long_desc <<-LONGDESC
Show configured commands\n
with --detail, show command details\n
with --hostname, ask other Splash daemon via transport\n
@@ -211,11 +217,11 @@
end
end
splash_exit case: :quiet_exit
end
-
+ # Thor method: getting informations about a specific splash configuration defined command
desc "show COMMAND", "Show specific configured command COMMAND"
long_desc <<-LONGDESC
Show specific configured command COMMAND\n
with --hostname <HOSTNAME>, an other Splash monitored server (only with Redis backend configured)
LONGDESC
@@ -257,11 +263,11 @@
else
splash_exit case: :not_found, :more => 'Command not configured'
end
end
-
+ # Thor method : getting information on the last execution of a command
desc "lastrun COMMAND", "Show last running result for specific configured command COMMAND"
long_desc <<-LONGDESC
Show last running result for specific configured command COMMAND\n
with --hostname <HOSTNAME>, an other Splash monitored server (only with Redis backend configured)
LONGDESC
@@ -297,9 +303,10 @@
else
splash_exit case: :not_found, :more => "Command report never runned remotly" if options[:hostname]
end
end
+ # Thor method : getting the list of avaibles executions reports
desc "getreportlist", "list all executions report results "
long_desc <<-LONGDESC
list all executions report results\n
with --pattern <SEARCH>, search type string, wilcard * (group) ? (char)\n
with --hostname <HOSTNAME>, an other Splash monitored server (only with Redis backend configured)\n