Sha256: 964dfaf588187ebc3102d1aa43c718cfc33965b48f62e2e72cac30eadf35c5a5

Contents?: true

Size: 726 Bytes

Versions: 12

Compression:

Stored size: 726 Bytes

Contents

module MotherBrain::API
  class V1
    class JobsEndpoint < MB::API::Endpoint
      helpers MB::API::Helpers

      rescue_from MB::JobNotFound do |ex|
        rack_response(ex.to_json, 404, "Content-type" => "application/json")
      end

      namespace 'jobs' do
        desc "list all jobs (completed and active)"
        get do
          job_manager.list.to_a
        end

        desc "list all active jobs"
        get 'active' do
          job_manager.active
        end

        desc "find and return the Job with the given ID"
        params do
          requires :job_id, type: String, desc: "job id"
        end
        get ':job_id' do
          find_job!(params[:job_id])
        end
      end
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
motherbrain-1.5.0 lib/mb/api/v1/jobs_endpoint.rb
motherbrain-1.4.0 lib/mb/api/v1/jobs_endpoint.rb
motherbrain-1.3.0 lib/mb/api/v1/jobs_endpoint.rb
motherbrain-1.2.1 lib/mb/api/v1/jobs_endpoint.rb
motherbrain-1.2.0 lib/mb/api/v1/jobs_endpoint.rb
motherbrain-1.1.3 lib/mb/api/v1/jobs_endpoint.rb
motherbrain-1.1.2 lib/mb/api/v1/jobs_endpoint.rb
motherbrain-1.1.1 lib/mb/api/v1/jobs_endpoint.rb
motherbrain-1.1.0 lib/mb/api/v1/jobs_endpoint.rb
motherbrain-1.0.0 lib/mb/api/v1/jobs_endpoint.rb
motherbrain-0.14.5 lib/mb/api/v1/jobs_endpoint.rb
motherbrain-0.14.4 lib/mb/api/v1/jobs_endpoint.rb