diff options
author | Matija Čupić <matteeyah@gmail.com> | 2018-11-12 16:27:28 +0100 |
---|---|---|
committer | Matija Čupić <matteeyah@gmail.com> | 2018-11-12 16:27:28 +0100 |
commit | 5b45cd246373f18bf678dbdecad589733cfec8b0 (patch) | |
tree | 8f8320f4c7251790b2eb352d9df20e10e1df0dcf /lib | |
parent | d15c9ae37b29c561a68309e8d81558016ffdb261 (diff) | |
download | gitlab-ce-5b45cd246373f18bf678dbdecad589733cfec8b0.tar.gz |
Implement MVC for Pipeline deletion API
Diffstat (limited to 'lib')
-rw-r--r-- | lib/api/pipelines.rb | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/lib/api/pipelines.rb b/lib/api/pipelines.rb index 1cfb982c04b..d4bd4e71343 100644 --- a/lib/api/pipelines.rb +++ b/lib/api/pipelines.rb @@ -81,6 +81,21 @@ module API present pipeline, with: Entities::Pipeline end + desc 'Deletes a pipeline' do + detail 'This feature was introduced in GitLab 11.6' + http_codes [[204, 'Pipeline was deleted'], [403, 'Forbidden']] + end + params do + requires :pipeline_id, type: Integer, desc: 'The pipeline ID' + end + delete ':id/pipelines/:pipeline_id' do + authorize! :admin_pipeline, user_project + + AuditEventService.new(current_user, user_project).security_event + + destroy_conditionally!(pipeline) + end + desc 'Retry builds in the pipeline' do detail 'This feature was introduced in GitLab 8.11.' success Entities::Pipeline |