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-agent-0.4.4 lib/onering/plugins/automation.rb
onering-agent-0.4.3 lib/onering/plugins/automation.rb
onering-client-0.4.3 lib/onering/plugins/automation.rb
onering-client-0.4.2 lib/onering/plugins/automation.rb
onering-client-0.4.1 lib/onering/plugins/automation.rb
onering-client-0.4.0 lib/onering/plugins/automation.rb
onering-client-0.3.4 lib/onering/plugins/automation.rb
onering-client-0.3.3 lib/onering/plugins/automation.rb
onering-client-0.3.2 lib/onering/plugins/automation.rb
onering-client-0.3.1 lib/onering/plugins/automation.rb
onering-client-0.3.0 lib/onering/plugins/automation.rb
onering-client-0.2.4 lib/onering/plugins/automation.rb
onering-client-0.2.3 lib/onering/plugins/automation.rb
onering-client-0.2.1 lib/onering/plugins/automation.rb
onering-client-0.2.0 lib/onering/plugins/automation.rb
onering-client-0.1.7 lib/onering/plugins/automation.rb
onering-client-0.1.6 lib/onering/plugins/automation.rb
onering-client-0.1.5 lib/onering/plugins/automation.rb
onering-client-0.1.4 lib/onering/plugins/automation.rb
onering-client-0.1.3 lib/onering/plugins/automation.rb