summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorMark Fletcher <mark@gitlab.com>2017-02-21 20:21:31 +0530
committerMark Fletcher <mark@gitlab.com>2017-02-22 17:40:20 +0530
commitd3425933dddf4e849199c06dd3ce00c212d0c6da (patch)
treee285f3bec6463b2c29ba446856438836975d924c /lib
parent459a97d46812fecc59c973bad356935422c7f60e (diff)
downloadgitlab-ce-d3425933dddf4e849199c06dd3ce00c212d0c6da.tar.gz
Add housekeeping endpoint for Projects API
Diffstat (limited to 'lib')
-rw-r--r--lib/api/projects.rb13
1 files changed, 13 insertions, 0 deletions
diff --git a/lib/api/projects.rb b/lib/api/projects.rb
index 366e5679edd..f1cb1b22143 100644
--- a/lib/api/projects.rb
+++ b/lib/api/projects.rb
@@ -374,6 +374,19 @@ module API
present paginate(users), with: Entities::UserBasic
end
+
+ desc 'Start the housekeeping task for a project' do
+ detail 'This feature was introduced in GitLab 9.0.'
+ end
+ post ':id/housekeeping' do
+ authorize_admin_project
+
+ begin
+ ::Projects::HousekeepingService.new(user_project).execute
+ rescue ::Projects::HousekeepingService::LeaseTaken => error
+ conflict!(error.message)
+ end
+ end
end
end
end