lib/splash/daemon/orchestrator/grammar.rb in prometheus-splash-0.7.0 vs lib/splash/daemon/orchestrator/grammar.rb in prometheus-splash-0.8.0

- old
+ new

@@ -14,11 +14,11 @@ include Splash::Config include Splash::Loggers # list of known verbs for Splash orchestrator - VERBS=[:ping,:list_commands,:execute_command,:ack_command, :shutdown] + VERBS=[:ping,:list_commands,:execute_command,:ack_command, :shutdown, :get_jobs, :reset] # shutdown verb : stop the Splash daemon gracefully # @param [Hash] content message content Hash Structure, ignored # @return [Hash] Exiter Case :quiet_exit def shutdown(content) @@ -42,9 +42,24 @@ # ack_command verb : send ack to Prometheus, for command specified in payload # @param [Hash] content message content Hash Structure, include mandatory payload[:name] # @return [Hash] Exiter case def ack_command(content) return execute command: content[:payload][:name], ack: true + end + + + # get_jobs verb : return list of scheduled jobs for internal scheduler + # @param [Hash] content message content Hash Structure, ignored + # @return [String] YAML dataset + def get_jobs(content) + return @server.jobs.to_yaml + end + + # reset verb : reset the internal scheduler + # @param [Hash] content message content Hash Structure, ignored + # @return [String] "Scheduler reset" static + def reset(content) + return "Scheduler reset" if reset_orchestrator end # execute_command verb : execute command specified in payload # @param [Hash] content message content Hash Structure, include mandatory payload[:name] # @return [Hash] Exiter case