Merge pull request #93 from travis-ci/jk_add_restart_to_build_and_job

Add 'restart' to the build and job endpoints
This commit is contained in:
Konstantin Haase 2013-11-05 22:56:26 -08:00
commit 30b17ad863
3 changed files with 11 additions and 0 deletions

View File

@ -43,6 +43,11 @@ class Travis::Api::App
status 204
end
end
post '/:id/restart' do
Metriks.meter("api.request.restart_build").mark
respond_with service(:reset_model, build_id: params[:id])
end
end
end
end

View File

@ -59,6 +59,11 @@ class Travis::Api::App
end
end
post '/:id/restart' do
Metriks.meter("api.request.restart_job").mark
respond_with service(:reset_model, job_id: params[:id])
end
def archive_url(path)
"https://s3.amazonaws.com/#{hostname('archive')}#{path}"
end

View File

@ -3,6 +3,7 @@ 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)