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.0.81 lib/onering/plugins/automation.rb
onering-client-0.0.80 lib/onering/plugins/automation.rb
onering-client-0.0.79 lib/onering/plugins/automation.rb
onering-client-0.0.78 lib/onering/plugins/automation.rb
onering-client-0.0.77 lib/onering/plugins/automation.rb
onering-client-0.0.76 lib/onering/plugins/automation.rb
onering-client-0.0.75 lib/onering/plugins/automation.rb
onering-client-0.0.74 lib/onering/plugins/automation.rb
onering-client-0.0.73 lib/onering/plugins/automation.rb
onering-client-0.0.72 lib/onering/plugins/automation.rb
onering-client-0.0.71 lib/onering/plugins/automation.rb
onering-client-0.0.70 lib/onering/plugins/automation.rb
onering-client-0.0.69 lib/onering/plugins/automation.rb
onering-client-0.0.68 lib/onering/plugins/automation.rb
onering-client-0.0.67 lib/onering/plugins/automation.rb
onering-client-0.0.66 lib/onering/plugins/automation.rb
onering-client-0.0.65 lib/onering/plugins/automation.rb
onering-client-0.0.64 lib/onering/plugins/automation.rb