module Onering class API class AutomationRequests < API def summary(fields) get("/automation/requests/summary/#{[*fields].join('/')}").parsed_response end def find_by_status(status) get("/automation/requests/status/#{status}").parsed_response end def show(id) get("/automation/requests/#{id}").parsed_response end def requeue(id) get("/automation/requests/#{id}/requeue").parsed_response end def flush_queue() get("/automation/requests/flush").parsed_response end def purge() get("/automation/requests/purge").parsed_response end def requeue_all_failed() get("/automation/requests/requeue").parsed_response end end # ----------------------------------------------------------------------------- class AutomationJobs < API def list() get("/automation/jobs/list").parsed_response end def show(name) get("/automation/jobs/#{name}").parsed_response end def requests_waiting(name) get("/automation/jobs/#{name}/waiting").parsed_response end def run(name, options={}, &block) if block_given? post("/automation/jobs/#{name}/run", { :query => options }, &block).parsed_response else get("/automation/jobs/#{name}/run", { :query => options }).parsed_response end end end # ----------------------------------------------------------------------------- class AutomationTasks < API def run(name, options={}) get("/automation/tasks/#{name}/run", { :query => options }).parsed_response end end end end