
Requests API allows to get the requests from the DB and thus enable users to have more insight into what's going on in their repositories.
24 lines
548 B
Ruby
24 lines
548 B
Ruby
require 'travis/api/app'
|
|
|
|
class Travis::Api::App
|
|
class Endpoint
|
|
class Requests < Endpoint
|
|
# DEPRECATED: this will be removed by 1st of December
|
|
post '/' do
|
|
Metriks.meter("api.request.restart").mark
|
|
respond_with service(:reset_model, params)
|
|
end
|
|
|
|
get '/' do
|
|
begin
|
|
respond_with(service(:find_requests, params).run)
|
|
rescue Travis::RepositoryNotFoundError => e
|
|
status 404
|
|
{ "error" => "Repository could not be found" }
|
|
end
|
|
end
|
|
end
|
|
end
|
|
end
|
|
|