Sha256: d682220583fe640fbf71e553acebf10607eef914a9c3bbe10cb945819217dde4

Contents?: true

Size: 1.72 KB

Versions: 58

Compression:

Stored size: 1.72 KB

Contents

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

Version data entries

58 entries across 58 versions & 2 rubygems

Version Path
onering-client-0.1.2 lib/onering/plugins/automation.rb
onering-client-0.1.1 lib/onering/plugins/automation.rb
onering-client-0.0.99 lib/onering/plugins/automation.rb
onering-client-0.0.98 lib/onering/plugins/automation.rb
onering-client-0.0.97 lib/onering/plugins/automation.rb
onering-client-0.0.96 lib/onering/plugins/automation.rb
onering-client-0.0.95 lib/onering/plugins/automation.rb
onering-client-0.0.94 lib/onering/plugins/automation.rb
onering-client-0.0.93 lib/onering/plugins/automation.rb
onering-client-0.0.92 lib/onering/plugins/automation.rb
onering-client-0.0.91 lib/onering/plugins/automation.rb
onering-client-0.0.90 lib/onering/plugins/automation.rb
onering-client-0.0.89 lib/onering/plugins/automation.rb
onering-client-0.0.88 lib/onering/plugins/automation.rb
onering-client-0.0.87 lib/onering/plugins/automation.rb
onering-client-0.0.86 lib/onering/plugins/automation.rb
onering-client-0.0.85 lib/onering/plugins/automation.rb
onering-client-0.0.84 lib/onering/plugins/automation.rb
onering-client-0.0.83 lib/onering/plugins/automation.rb
onering-client-0.0.82 lib/onering/plugins/automation.rb