class CLISplash::CLIController

Thor inherited class for splashd daemon management

Public Instance Methods

getjobs(hostname=Socket.gethostname) click to toggle source
# File lib/splash/cli/daemon.rb, line 83
def getjobs(hostname=Socket.gethostname)
  log = get_logger
  log.info "ctrl+c for interrupt"
  begin
    transport = get_default_client
    if transport.class == Hash  and transport.include? :case then
      splash_exit transport
    else
      log.receive transport.execute({ :verb => :get_jobs,
                              :return_to => "splash.#{Socket.gethostname}.returncli",
                              :queue => "splash.#{hostname}.input" })
      splash_exit case: :quiet_exit
    end
  rescue Interrupt
    splash_exit status: :error, case: :interrupt, more: "getjobs Command"
  end
end
ping(hostname=Socket.gethostname) click to toggle source
# File lib/splash/cli/daemon.rb, line 62
def ping(hostname=Socket.gethostname)
  log = get_logger
  log.info "ctrl+c for interrupt"
  begin
    transport = get_default_client
    if transport.class == Hash  and transport.include? :case then
      splash_exit transport
    else
      log.receive transport.execute({ :verb => :ping,
                              :payload => {:hostname => Socket.gethostname},
                              :return_to => "splash.#{Socket.gethostname}.returncli",
                              :queue => "splash.#{hostname}.input" })
      splash_exit case: :quiet_exit
    end
  rescue Interrupt
    splash_exit status: :error, case: :interrupt, more: "ping Command"
  end
end
purge() click to toggle source
# File lib/splash/cli/daemon.rb, line 32
def purge
  log = get_logger
  log.level = :fatal if options[:quiet]
  transport = get_default_client
  if transport.class == Hash  and transport.include? :case then
    splash_exit transport
  else
    queue = "splash.#{Socket.gethostname}.input"
    transport.purge queue: queue
    log.ok "Queue : #{queue} purged"
    splash_exit case: :quiet_exit
  end
end
reset(hostname=Socket.gethostname) click to toggle source
# File lib/splash/cli/daemon.rb, line 103
def reset(hostname=Socket.gethostname)
  log = get_logger
  log.info "ctrl+c for interrupt"
  begin
    transport = get_default_client
    if transport.class == Hash  and transport.include? :case then
      splash_exit transport
    else
      log.receive transport.execute({ :verb => :reset,
                              :return_to => "splash.#{Socket.gethostname}.returncli",
                              :queue => "splash.#{hostname}.input" })
      splash_exit case: :quiet_exit
    end
  rescue Interrupt
    splash_exit status: :error, case: :interrupt, more: "reset Command"
  end
end
start() click to toggle source
# File lib/splash/cli/daemon.rb, line 25
def start
  acase = run_as_root :startdaemon, options
  splash_exit acase
end
status() click to toggle source
# File lib/splash/cli/daemon.rb, line 55
def status
  acase = run_as_root :statusdaemon
  splash_exit acase
end
stop() click to toggle source
# File lib/splash/cli/daemon.rb, line 48
def stop
  acase = run_as_root :stopdaemon
  splash_exit acase
end